[FFmpeg-soc] MXF muxer version 0.0.4

Baptiste Coudurier baptiste.coudurier at smartjog.com
Fri Aug 29 18:47:24 CEST 2008


Hi,

zhentan feng wrote:
> Hi
> 
> 2008/8/27 Baptiste Coudurier <baptiste.coudurier at smartjog.com>
> 
>> Hi,
>>
>> zhentan feng wrote:
>>> [...]
>>>
>>> +
>>> +    if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
>>> +        mxf_write_local_tag(pb, version_string_len, 0x3C04);
>>> +        put_buffer(pb, LIBAVFORMAT_IDENT, version_string_len);
>>> +    }
>> According to 377M, Version String is "req", so you have to put something
>> here when bitexact is enabled. IMHO "0.0.0" should be fine.
>>
> 
> here is the new patch version 0.0.9.
> 1) fix this bug
> 2) write company name, product name, version string as utf 16
> 3) modify version string and track number uls.
> 
> please review.
> thanks
> 
> 
> ------------------------------------------------------------------------
> 
> Index: libavformat/mxfenc.c
> ===================================================================
> --- libavformat/mxfenc.c	(revision 15018)
> +++ libavformat/mxfenc.c	(working copy)
> @@ -32,7 +32,10 @@
>  //#define DEBUG
>  
>  #include "mxf.h"
> +#include <wchar.h>
>  
> +typedef wchar_t MXFUTF16String;
> +

You don't need that, you need to transform char * to utf-16.

>  typedef struct {
>      int local_tag;
>      UID uid;
> @@ -96,7 +99,7 @@
>      { 0x3C09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x01,0x00,0x00,0x00}}, /* This Generation UID */
>      { 0x3C01, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x02,0x01,0x00,0x00}}, /* Company Name */
>      { 0x3C02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x03,0x01,0x00,0x00}}, /* Product Name */
> -    { 0x3C04, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x04,0x00,0x00,0x00}}, /* Version String */
> +    { 0x3C04, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x05,0x01,0x00,0x00}}, /* Version String */
>      { 0x3C05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x05,0x20,0x07,0x01,0x07,0x00,0x00,0x00}}, /* Product ID */
>      { 0x3C06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x03,0x00,0x00}}, /* Modification Date */
>      // Content Storage

ok.

> @@ -112,7 +115,7 @@
>      { 0x4701, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x03,0x00,0x00}}, /* Descriptor */
>      // Track
>      { 0x4801, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x07,0x01,0x01,0x00,0x00,0x00,0x00}}, /* Track ID */
> -    { 0x4804, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x01,0x03,0x00,0x00}}, /* Track Numberr */
> +    { 0x4804, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x01,0x04,0x01,0x03,0x00,0x00,0x00,0x00}}, /* Track Numberr */

One 'r' too much.

> [...]
>
> @@ -331,14 +344,16 @@
>  
>      mxf_write_metadata_key(pb, 0x013000);
>      PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
> -    company_name_len = sizeof("FFmpeg");
> -    product_name_len = sizeof("OP1a Muxer");
> +    company_name_len = (wcslen(L"FFmpeg") + 1) * 2;
> +    product_name_len = (wcslen(L"OP1a Muxer") + 1) * 2;
>  
>      length = 80 + company_name_len + product_name_len;
> -    if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
> -        version_string_len = sizeof(LIBAVFORMAT_IDENT);
> -        length += 4 + version_string_len;
> -    }
> +    if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
> +        version_string_len = (wcslen(WCS_LIBAVFORMAT_IDENT) + 1) * 2;
> +    else
> +        version_string_len = (wcslen(L"0.0.0") + 1) * 2;
> +
> +    length += 4 + version_string_len;
>      klv_encode_ber_length(pb, length);

Something like:
If (bitexact) version_string = LIBAVFORMAT_VERSION
else          version_string = "0.0.0"

This is version btw, not ident.

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA



More information about the FFmpeg-soc mailing list