[libav-commits] rtpenc_vp8: Update the packetizer to the latest spec version

Martin Storsjö git at libav.org
Mon Oct 8 23:05:20 CEST 2012


Module: libav
Branch: master
Commit: c9b10cc4dbb67a94c29359fde79fb882d71fef6f

Author:    Martin Storsjö <martin at martin.st>
Committer: Martin Storsjö <martin at martin.st>
Date:      Mon Oct  8 23:18:38 2012 +0300

rtpenc_vp8: Update the packetizer to the latest spec version

Tested to work with the gstreamer depacketizer.

Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/rtpenc.c     |    4 ----
 libavformat/rtpenc_vp8.c |    6 ++++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index dc257f6..36064ed 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -181,10 +181,6 @@ static int rtp_write_header(AVFormatContext *s1)
         s->max_payload_size -= 6; // ident+frag+tdt/vdt+pkt_num+pkt_length
         s->num_frames = 0;
         goto defaultcase;
-    case AV_CODEC_ID_VP8:
-        av_log(s1, AV_LOG_ERROR, "RTP VP8 payload implementation is "
-                                 "incompatible with the latest spec drafts.\n");
-        break;
     case AV_CODEC_ID_ADPCM_G722:
         /* Due to a historical error, the clock rate for G722 in RTP is
          * 8000, even if the sample rate is 16000. See RFC 3551. */
diff --git a/libavformat/rtpenc_vp8.c b/libavformat/rtpenc_vp8.c
index afedbb4..1730379 100644
--- a/libavformat/rtpenc_vp8.c
+++ b/libavformat/rtpenc_vp8.c
@@ -22,7 +22,7 @@
 #include "rtpenc.h"
 
 /* Based on a draft spec for VP8 RTP.
- * ( http://www.webmproject.org/code/specs/rtp/ ) */
+ * ( http://tools.ietf.org/html/draft-ietf-payload-vp8-05 ) */
 void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buf, int size)
 {
     RTPMuxContext *s = s1->priv_data;
@@ -32,7 +32,9 @@ void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buf, int size)
     s->timestamp    = s->cur_timestamp;
     max_packet_size = s->max_payload_size - 1; // minus one for header byte
 
-    *s->buf_ptr++ = 1; // 0b1 indicates start of frame
+    // no extended control bits, reference frame, start of partition,
+    // partition id 0
+    *s->buf_ptr++ = 0x10;
     while (size > 0) {
         len = FFMIN(size, max_packet_size);
 



More information about the libav-commits mailing list