diff mbox

[FFmpeg-devel,5/5] avformat/mxfdec: recognize SMPTE 436 VBI data

Message ID 20180527192154.25996-5-cus@passwd.hu
State Superseded
Headers show

Commit Message

Marton Balint May 27, 2018, 7:21 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mxfdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tomas Härdin May 27, 2018, 9:21 p.m. UTC | #1
sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
> > Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/mxfdec.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index a62021b0d7..df97d6438f 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1278,11 +1278,13 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = {
>  };
>  
>  static const MXFCodecUL mxf_data_essence_container_uls[] = {
> -    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
> +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
> +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
>      { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0, AV_CODEC_ID_NONE },
>  };
>  
>  static const char * const mxf_data_essence_descriptor[] = {
> +    "vbi_smpte_436M",
>      "vbi_vanc_smpte_436M",
>  };

Should this really be added at the top of the array?

Can't say much else since I never did poke too much with VBI

/Tomas
Marton Balint May 27, 2018, 10:27 p.m. UTC | #2
On Sun, 27 May 2018, Tomas Härdin wrote:

> sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
>>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/mxfdec.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
>> index a62021b0d7..df97d6438f 100644
>> --- a/libavformat/mxfdec.c
>> +++ b/libavformat/mxfdec.c
>> @@ -1278,11 +1278,13 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = {
>>  };
>>  
>>  static const MXFCodecUL mxf_data_essence_container_uls[] = {
>> -    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
>> +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
>> +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
>>      { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0, AV_CODEC_ID_NONE },
>>  };
>>  
>>  static const char * const mxf_data_essence_descriptor[] = {
>> +    "vbi_smpte_436M",
>>      "vbi_vanc_smpte_436M",
>>  };
>
> Should this really be added at the top of the array?

Yeah, following existing style, I tried to keep the container_uls in 
numeric order, and the descriptor names must be in the same order as the 
essence_container_uls:

... 0d is MXFGCGenericVBIDataMappingUndefinedPayload (this is the new)
... 0e is MXFGCGenericANCDataMappingUndefinedPayload

Regards,
Marton
Tomas Härdin May 30, 2018, 9:22 a.m. UTC | #3
mån 2018-05-28 klockan 00:27 +0200 skrev Marton Balint:
> 
> On Sun, 27 May 2018, Tomas Härdin wrote:
> 
> > sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
> > > > Signed-off-by: Marton Balint <cus@passwd.hu>
> > > 
> > > ---
> > >  libavformat/mxfdec.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > index a62021b0d7..df97d6438f 100644
> > > --- a/libavformat/mxfdec.c
> > > +++ b/libavformat/mxfdec.c
> > > @@ -1278,11 +1278,13 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = {
> > >  };
> > >  
> > >  static const MXFCodecUL mxf_data_essence_container_uls[] = {
> > > -    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
> > > +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
> > > +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
> > >      { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0, AV_CODEC_ID_NONE },
> > >  };
> > >  
> > >  static const char * const mxf_data_essence_descriptor[] = {
> > > +    "vbi_smpte_436M",
> > >      "vbi_vanc_smpte_436M",
> > >  };
> > 
> > Should this really be added at the top of the array?
> 
> Yeah, following existing style, I tried to keep the container_uls in 
> numeric order, and the descriptor names must be in the same order as the 
> essence_container_uls:
> 
> ... 0d is MXFGCGenericVBIDataMappingUndefinedPayload (this is the new)
> ... 0e is MXFGCGenericANCDataMappingUndefinedPayload

Feels like these two should be in the same struct if order is important
in that way. But maybe there's some MXF peculiarity I'm overlooking..

/Tomas
Marton Balint May 30, 2018, 9:16 p.m. UTC | #4
On Wed, 30 May 2018, Tomas Härdin wrote:

> mån 2018-05-28 klockan 00:27 +0200 skrev Marton Balint:
>> 
>> On Sun, 27 May 2018, Tomas Härdin wrote:
>> 
>> > sön 2018-05-27 klockan 21:21 +0200 skrev Marton Balint:
>> > > > Signed-off-by: Marton Balint <cus@passwd.hu>
>> > > 
>> > > ---
>> > >  libavformat/mxfdec.c | 5 ++++-
>> > >  1 file changed, 4 insertions(+), 1 deletion(-)
>> > > 
>> > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
>> > > index a62021b0d7..df97d6438f 100644
>> > > --- a/libavformat/mxfdec.c
>> > > +++ b/libavformat/mxfdec.c
>> > > @@ -1278,11 +1278,13 @@ static const MXFCodecUL mxf_sound_essence_container_uls[] = {
>> > >  };
>> > >  
>> > >  static const MXFCodecUL mxf_data_essence_container_uls[] = {
>> > > -    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
>> > > +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
>> > > +    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
>> > >      { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0, AV_CODEC_ID_NONE },
>> > >  };
>> > >  
>> > >  static const char * const mxf_data_essence_descriptor[] = {
>> > > +    "vbi_smpte_436M",
>> > >      "vbi_vanc_smpte_436M",
>> > >  };
>> > 
>> > Should this really be added at the top of the array?
>> 
>> Yeah, following existing style, I tried to keep the container_uls in 
>> numeric order, and the descriptor names must be in the same order as the 
>> essence_container_uls:
>> 
>> ... 0d is MXFGCGenericVBIDataMappingUndefinedPayload (this is the new)
>> ... 0e is MXFGCGenericANCDataMappingUndefinedPayload
>
> Feels like these two should be in the same struct if order is important
> in that way. But maybe there's some MXF peculiarity I'm overlooking..

Ok, I will change it. I pushed the first 3 patches in the series, I will 
re-send this one and the previous.

Thanks,
Marton
diff mbox

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index a62021b0d7..df97d6438f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1278,11 +1278,13 @@  static const MXFCodecUL mxf_sound_essence_container_uls[] = {
 };
 
 static const MXFCodecUL mxf_data_essence_container_uls[] = {
-    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, 0 },
+    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0d,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
+    { { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x09,0x0d,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 }, 16, AV_CODEC_ID_NONE },
     { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },  0, AV_CODEC_ID_NONE },
 };
 
 static const char * const mxf_data_essence_descriptor[] = {
+    "vbi_smpte_436M",
     "vbi_vanc_smpte_436M",
 };
 
@@ -2505,6 +2507,7 @@  static const MXFMetadataReadTableEntry mxf_metadata_read_table[] = {
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG2VideoDescriptor */
+    { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5b,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VBI - SMPTE 436M */
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5c,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VANC/VBI - SMPTE 436M */
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5e,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG2AudioDescriptor */
     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */