[FFmpeg-devel] [PATCH] RDT/Realmedia patches #2

Michael Niedermayer michaelni
Sat Nov 15 20:44:39 CET 2008


On Sat, Nov 15, 2008 at 11:09:55AM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Sat, Nov 15, 2008 at 4:36 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Nov 14, 2008 at 10:05:36PM -0500, Ronald S. Bultje wrote:
> >>      /**
> >>       * Layout of the header (in bits):
> >>       * 1:  len_included
> >
> > code to skip status packets
> 
> ?
> 
> You mean "I didn't document how to skip status packets"? I did, it

I mean that this is unrelated to the rest of the patch


[...]
> >>  /**< return 0 on packet, no more left, 1 on packet, 1 on partial packet... */
> >> @@ -289,7 +317,7 @@
> >>  ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt,
> >>                      const uint8_t *buf, int len)
> >>  {
> >> -    int seq_no, flags = 0, stream_id, set_id;
> >> +    int seq_no, flags = 0, stream_id, set_id, is_keyframe;
> >>      uint32_t timestamp;
> >>      int rv= 0;
> >>
> >> @@ -306,10 +334,10 @@
> >>
> >>      if (len < 12)
> >>          return -1;
> >> -    rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, &timestamp);
> >> +    rv = ff_rdt_parse_header(buf, len, &set_id, &seq_no, &stream_id, &is_keyframe, &timestamp);
> >>      if (rv < 0)
> >>          return rv;
> >> -    if (!(stream_id & 1) && (set_id != s->prev_set_id || timestamp != s->prev_timestamp)) {
> >> +    if (is_keyframe && (set_id != s->prev_set_id || timestamp != s->prev_timestamp)) {
> >>          flags |= PKT_FLAG_KEY;
> >>          s->prev_set_id    = set_id;
> >>          s->prev_timestamp = timestamp;
> >
> > Addition of is_keyframe, surely should be seperate as well
> 
> Attached (+ reindent).
[...]
> Index: ffmpeg-svn/libavformat/rdt.h
> ===================================================================
> --- ffmpeg-svn.orig/libavformat/rdt.h	2008-11-15 10:55:54.000000000 -0500
> +++ ffmpeg-svn/libavformat/rdt.h	2008-11-15 10:58:05.000000000 -0500
> @@ -73,13 +73,15 @@
>   * @param buf input buffer
>   * @param len length of input buffer
>   * @param set_id will be set to the set ID this packet belongs to
> - * @param seq_no will be set to the sequence number this packet belongs to
> + * @param seq_no will be set to the sequence number of the packet
>   * @param stream_id will be set to the stream ID this packet belongs to

?


> + * @param is_keyframe will be whether this packet belongs to a keyframe
>   * @param timestamp will be set to the timestamp of the packet
>   * @return the amount of bytes consumed, or <0 on error
>   */
>  int ff_rdt_parse_header(const uint8_t *buf, int len,
> -                        int *set_id, int *seq_no, int *stream_id, uint32_t *timestamp);
> +                        int *set_id, int *seq_no, int *stream_id,
> +                        int *is_keyframe, uint32_t *timestamp);
>  
>  /**
>   * Parse RDT-style packet data (header + media data).
[...]


> Index: ffmpeg-svn/libavformat/rdt.c
> ===================================================================
> --- ffmpeg-svn.orig/libavformat/rdt.c	2008-11-15 11:00:25.000000000 -0500
> +++ ffmpeg-svn/libavformat/rdt.c	2008-11-15 11:01:37.000000000 -0500
> @@ -238,10 +238,10 @@
>       * [2] http://www.wireshark.org/docs/dfref/r/rdt.html and
>       *     http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
>       */
> -    if (set_id)    *set_id    = (buf[0]>>1) & 0x1f;
> -    if (seq_no)    *seq_no    = AV_RB16(buf+1);
> -    if (timestamp) *timestamp = AV_RB32(buf+4);
> -    if (stream_id) *stream_id = (buf[3]>>1) & 0x1f;
> +    if (set_id)      *set_id      = (buf[0]>>1) & 0x1f;
> +    if (seq_no)      *seq_no      = AV_RB16(buf+1);
> +    if (timestamp)   *timestamp   = AV_RB32(buf+4);
> +    if (stream_id)   *stream_id   = (buf[3]>>1) & 0x1f;
>      if (is_keyframe) *is_keyframe = !(buf[3] & 0x1);
>  
>      return consumed;

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081115/a797f0ec/attachment.pgp>



More information about the ffmpeg-devel mailing list