Skip to content

Commit

Permalink
Remove unused factory pattern for SDP announces
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed Jan 12, 2011
1 parent 9168a4f commit 677f45d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 40 deletions.
9 changes: 3 additions & 6 deletions include/vlc_sout.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,13 @@ VLC_EXPORT( encoder_t *, sout_EncoderCreate, ( vlc_object_t *obj ) );
/****************************************************************************
* Announce handler
****************************************************************************/
VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, ( vlc_object_t *, const char *, const char *, announce_method_t* ) LIBVLC_USED );
VLC_EXPORT(session_descriptor_t*,sout_AnnounceRegisterSDP, ( vlc_object_t *, const char *, const char * ) LIBVLC_USED );
VLC_EXPORT( int, sout_AnnounceUnRegister, (vlc_object_t *,session_descriptor_t* ) );
#define sout_AnnounceRegisterSDP(o, sdp, addr, m) \
sout_AnnounceRegisterSDP(VLC_OBJECT (o), sdp, addr, m)
#define sout_AnnounceRegisterSDP(o, sdp, addr) \
sout_AnnounceRegisterSDP(VLC_OBJECT (o), sdp, addr)
#define sout_AnnounceUnRegister(o, a) \
sout_AnnounceUnRegister(VLC_OBJECT (o), a)

VLC_EXPORT(announce_method_t*, sout_SAPMethod, (void) LIBVLC_USED );
VLC_EXPORT(void, sout_MethodRelease, (announce_method_t *) );

/** SDP */

struct sockaddr;
Expand Down
7 changes: 1 addition & 6 deletions modules/stream_out/rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,14 +1270,9 @@ static int SapSetup( sout_stream_t *p_stream )
}

if( p_sys->i_es > 0 && p_sys->psz_sdp && *p_sys->psz_sdp )
{
announce_method_t *p_method = sout_SAPMethod();
p_sys->p_session = sout_AnnounceRegisterSDP( p_sout,
p_sys->psz_sdp,
p_sys->psz_destination,
p_method );
sout_MethodRelease( p_method );
}
p_sys->psz_destination );

return VLC_SUCCESS;
}
Expand Down
5 changes: 1 addition & 4 deletions modules/stream_out/standard.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,9 @@ static int Open( vlc_object_t *p_this )
/* Register the SDP with the SAP thread */
if (psz_sdp != NULL)
{
announce_method_t *p_method = sout_SAPMethod ();
msg_Dbg (p_stream, "Generated SDP:\n%s", psz_sdp);

p_sys->p_session =
sout_AnnounceRegisterSDP (p_sout, psz_sdp, dhost, p_method);
sout_MethodRelease (p_method);
sout_AnnounceRegisterSDP (p_sout, psz_sdp, dhost);
free( psz_sdp );
}
free (dhost);
Expand Down
2 changes: 0 additions & 2 deletions src/libvlccore.sym
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,12 @@ sout_AccessOutWrite
sout_AnnounceRegisterSDP
sout_AnnounceUnRegister
sout_EncoderCreate
sout_MethodRelease
sout_MuxAddStream
sout_MuxDelete
sout_MuxDeleteStream
sout_MuxGetStream
sout_MuxNew
sout_MuxSendBuffer
sout_SAPMethod
sout_StreamChainDelete
sout_StreamChainNew
sout_UpdateStatistic
Expand Down
23 changes: 1 addition & 22 deletions src/stream_output/announce.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@

#include <assert.h>

struct announce_method_t
{
} sap_method;

/****************************************************************************
* Sout-side functions
****************************************************************************/
Expand All @@ -58,16 +54,12 @@ static vlc_mutex_t sap_mutex = VLC_STATIC_MUTEX;
* \param obj a VLC object
* \param psz_sdp the SDP to register
* \param psz_dst session address (needed for SAP address auto detection)
* \param p_method an announce method descriptor
* \return the new session descriptor structure
*/
session_descriptor_t *
sout_AnnounceRegisterSDP( vlc_object_t *obj, const char *psz_sdp,
const char *psz_dst, announce_method_t *p_method )
const char *psz_dst )
{
assert (p_method == &sap_method);
(void) p_method;

session_descriptor_t *p_session = calloc( 1, sizeof (*p_session) );
if( !p_session )
return NULL;
Expand Down Expand Up @@ -134,16 +126,3 @@ int sout_AnnounceUnRegister( vlc_object_t *obj,

return 0;
}

/**
* \return the SAP announce method
*/
announce_method_t * sout_SAPMethod (void)
{
return &sap_method;
}

void sout_MethodRelease (announce_method_t *m)
{
assert (m == &sap_method);
}

0 comments on commit 677f45d

Please sign in to comment.