[vlc-commits] commit: Remove unused factory pattern for SDP announces ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Wed Jan 12 22:41:25 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan 12 23:40:57 2011 +0200| [677f45decd33a0af72bd9eb94a3faba6f7924d70] | committer: Rémi Denis-Courmont 

Remove unused factory pattern for SDP announces

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=677f45decd33a0af72bd9eb94a3faba6f7924d70
---

 include/vlc_sout.h            |    9 +++------
 modules/stream_out/rtp.c      |    7 +------
 modules/stream_out/standard.c |    5 +----
 src/libvlccore.sym            |    2 --
 src/stream_output/announce.c  |   23 +----------------------
 5 files changed, 6 insertions(+), 40 deletions(-)

diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 1374856..304e2d1 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -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;
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index e0b3dd2..7583447 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -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;
 }
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index c793069..c518b98 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -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);
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 23c41bc..30c1107 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -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
diff --git a/src/stream_output/announce.c b/src/stream_output/announce.c
index 37e3300..c97338a 100644
--- a/src/stream_output/announce.c
+++ b/src/stream_output/announce.c
@@ -35,10 +35,6 @@
 
 #include <assert.h>
 
-struct announce_method_t
-{
-} sap_method;
-
 /****************************************************************************
  * Sout-side functions
  ****************************************************************************/
@@ -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;
@@ -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);
-}



More information about the vlc-commits mailing list