[FFmpeg-devel] [PATCH 1/2] Adding support for parsing BlockAdditional

Michael Niedermayer michaelni at gmx.at
Wed Feb 6 22:24:48 CET 2013


On Tue, Feb 05, 2013 at 12:09:54PM -0800, Vignesh Venkatasubramanian wrote:
> On Mon, Feb 4, 2013 at 4:53 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Mon, Feb 04, 2013 at 03:17:51PM -0800, Vignesh Venkatasubramanian wrote:
> >> Matroska specification lists support for BlockAdditional element
> >> which is not supported by ffmpeg's matroska parser. This patch
> >> adds grammar definitions for parsing that element (and few other
> >> related elements) and then puts the data in AVPacket.side_data
> >> with new AVPacketSideDataType AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL.
> >> It also updates the fate test crc generator to generate frame crc
> >> based on both data and side_data instead of just data.
> >>
> >> Signed-off-by: Vignesh Venkatasubramanian <vigneshv at google.com>
> >> ---
> >>  libavcodec/avcodec.h      |   8 +
> >>  libavformat/framecrcenc.c |   7 +-
> >>  libavformat/matroska.h    |   4 +
> >>  libavformat/matroskadec.c |  41 ++-
> >>  tests/fate/vpx.mak        |   3 +
> >>  tests/ref/fate/vp8-alpha  | 755 ++++++++++++++++++++++++++++++++++++++++++++++
> >>  6 files changed, 813 insertions(+), 5 deletions(-)
> >>  create mode 100644 tests/ref/fate/vp8-alpha
> >>
> >> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> >> index ca7764a..2ed63e2 100644
> >> --- a/libavcodec/avcodec.h
> >> +++ b/libavcodec/avcodec.h
> >> @@ -983,6 +983,14 @@ enum AVPacketSideDataType {
> >>       * @endcode
> >>       */
> >>      AV_PKT_DATA_SUBTITLE_POSITION,
> >> +
> >> +    /**
> >> +     * Data found in BlockAdditional element of matroska container. There is
> >> +     * no end marker for the data, so it is required to rely on the side data
> >> +     * size to recognize the end. 8 byte id (as found in BlockAddId) followed
> >> +     * by data.
> >> +     */
> >> +    AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
> >>  };
> >>
> >>  /**
> >
> >> diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
> >> index 8a69748..7a53f64 100644
> >> --- a/libavformat/framecrcenc.c
> >> +++ b/libavformat/framecrcenc.c
> >> @@ -23,12 +23,17 @@
> >>  #include "libavutil/avstring.h"
> >>  #include "avformat.h"
> >>  #include "internal.h"
> >> +#include "libavcodec/avcodec.h"
> >>
> >>  static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
> >>  {
> >> -    uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
> >> +    uint32_t crc;
> >>      char buf[256];
> >>
> >> +    av_packet_merge_side_data(pkt);
> >> +    crc = av_adler32_update(0, pkt->data, pkt->size);
> >> +    av_packet_split_side_data(pkt);
> >> +
> >>      snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x",
> >>               pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
> >>      if (pkt->flags != AV_PKT_FLAG_KEY)
> >
> > I think its better to print a list of CRCs, one for each side data
> > element.
> > It could be quite helpfull when debuging, when one but not the other
> > changes. Also the framecrcenc change belongs into a seperate patch.
> 
> Ok. I will do this and send it in as a different patch.
> 
> >
> > Ive also uploaded the new file, though would prefer a smaller file to
> > keep the whole fate suite as small and fast as possible
> > no big issue though, its ok as is if you think such a bigger file
> > provides more complete testing
> 
> Not an issue. Please replace it with the file attached in this email.
> It is much smaller. Sorry about the consecutive test file changes.

uploaded

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130206/b9a8b180/attachment.asc>


More information about the ffmpeg-devel mailing list