[vlc-commits] commit: decode an RTP/H264 elementary stream without using SDP ( Tony Vankrunkelsven )

git at videolan.org git at videolan.org
Wed Nov 3 17:51:51 CET 2010


vlc/vlc-1.1 | branch: master | Tony Vankrunkelsven <Tony.Vankrunkelsven at otnsystems.com> | Thu Sep 30 13:13:06 2010 +0200| [187394137e9e05d09c0b3cad8520426ec58305b7] | committer: Rémi Denis-Courmont 

decode an RTP/H264 elementary stream without using SDP

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit 39349f5c16dbf4d7dc7e474e7b596bd34c380730)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=187394137e9e05d09c0b3cad8520426ec58305b7
---

 modules/access/rtp/rtp.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
old mode 100644
new mode 100755
index 19ed269..faf21be
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -435,7 +435,6 @@ static void codec_decode (demux_t *demux, void *data, block_t *block)
         block_Release (block);
 }
 
-
 static void *stream_init (demux_t *demux, const char *name)
 {
     return stream_DemuxNew (demux, name, demux->out);
@@ -458,6 +457,11 @@ static void stream_decode (demux_t *demux, void *data, block_t *block)
     (void)demux;
 }
 
+static void *demux_init (demux_t *demux)
+{
+    return stream_init (demux, demux->psz_demux);
+}
+
 /*
  * Static payload types handler
  */
@@ -683,7 +687,22 @@ int rtp_autodetect (demux_t *demux, rtp_session_t *session,
         break;
 
       default:
-        return -1;
+        /*
+         * If the rtp payload type is unknown then check demux if it is specified
+         */
+        if ((strcmp(demux->psz_demux, "h264") == 0) || (strcmp(demux->psz_demux, "ts") == 0))
+        {
+          msg_Dbg (demux, "rtp autodetect specified demux=%s", demux->psz_demux);
+          pt.init = demux_init;
+          pt.destroy = stream_destroy;
+          pt.decode = stream_decode;
+          pt.frequency = 90000;
+          break;
+        }
+        else
+        {
+          return -1;
+        }
     }
     rtp_add_type (demux, session, &pt);
     return 0;



More information about the vlc-commits mailing list