Re: [FFmpeg-devel] [PATCH v3 1/3] avformat/mxfenc: use track count to generate component instance uuid

2017-12-07 Thread Michael Niedermayer
On Thu, Dec 07, 2017 at 10:50:37PM +0100, Tomas Härdin wrote:
> On Thu, 2017-12-07 at 22:40 +0100, Michael Niedermayer wrote:
> > On Thu, Dec 07, 2017 at 04:41:09PM +0100, Tomas Härdin wrote:
> > > On 2017-12-05 05:46, Mark Reid wrote:
> > > > @@ -1398,16 +1397,26 @@ static void
> > > > mxf_write_package(AVFormatContext *s, MXFPackage *package)
> > > >  mxf_write_uuid(pb, SubDescriptor, 0);
> > > >  }
> > > > +/*
> > > > + * for every 1 track in a package there is 1 sequence and 1
> > > > component.
> > > > + * all 3 of these elements share the same instance number
> > > > for generating
> > > > + * there instance uuids. mxf->track_instance_count stores
> > > > this value.
> > > > + * mxf->track_instance_count is incremented after a group of
> > > > all 3 of
> > > > + * these elements are written.
> > > > + */
> > > > +
> > > 
> > > Excellent.
> > > 
> > > Patch looks good to me :)
> > 
> > any reason why you didnt apply it ?
> 
> No access. Plus waiting for feedback on my other comment

ok, if theres anythig i should apply then clearly say so.

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/3] avformat/mxfenc: use track count to generate component instance uuid

2017-12-07 Thread Tomas Härdin
On Thu, 2017-12-07 at 22:40 +0100, Michael Niedermayer wrote:
> On Thu, Dec 07, 2017 at 04:41:09PM +0100, Tomas Härdin wrote:
> > On 2017-12-05 05:46, Mark Reid wrote:
> > > @@ -1398,16 +1397,26 @@ static void
> > > mxf_write_package(AVFormatContext *s, MXFPackage *package)
> > >  mxf_write_uuid(pb, SubDescriptor, 0);
> > >  }
> > > +/*
> > > + * for every 1 track in a package there is 1 sequence and 1
> > > component.
> > > + * all 3 of these elements share the same instance number
> > > for generating
> > > + * there instance uuids. mxf->track_instance_count stores
> > > this value.
> > > + * mxf->track_instance_count is incremented after a group of
> > > all 3 of
> > > + * these elements are written.
> > > + */
> > > +
> > 
> > Excellent.
> > 
> > Patch looks good to me :)
> 
> any reason why you didnt apply it ?

No access. Plus waiting for feedback on my other comment

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/3] avformat/mxfenc: use track count to generate component instance uuid

2017-12-07 Thread Michael Niedermayer
On Thu, Dec 07, 2017 at 04:41:09PM +0100, Tomas Härdin wrote:
> On 2017-12-05 05:46, Mark Reid wrote:
> >@@ -1398,16 +1397,26 @@ static void mxf_write_package(AVFormatContext *s, 
> >MXFPackage *package)
> >  mxf_write_uuid(pb, SubDescriptor, 0);
> >  }
> >+/*
> >+ * for every 1 track in a package there is 1 sequence and 1 component.
> >+ * all 3 of these elements share the same instance number for generating
> >+ * there instance uuids. mxf->track_instance_count stores this value.
> >+ * mxf->track_instance_count is incremented after a group of all 3 of
> >+ * these elements are written.
> >+ */
> >+
> 
> Excellent.
> 
> Patch looks good to me :)

any reason why you didnt apply it ?


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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/3] avformat/mxfenc: use track count to generate component instance uuid

2017-12-07 Thread Tomas Härdin

On 2017-12-05 05:46, Mark Reid wrote:

@@ -1398,16 +1397,26 @@ static void mxf_write_package(AVFormatContext *s, 
MXFPackage *package)
  mxf_write_uuid(pb, SubDescriptor, 0);
  }
  
+/*

+ * for every 1 track in a package there is 1 sequence and 1 component.
+ * all 3 of these elements share the same instance number for generating
+ * there instance uuids. mxf->track_instance_count stores this value.
+ * mxf->track_instance_count is incremented after a group of all 3 of
+ * these elements are written.
+ */
+


Excellent.

Patch looks good to me :)

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 1/3] avformat/mxfenc: use track count to generate component instance uuid

2017-12-04 Thread Mark Reid
---
 libavformat/mxf.h   |  1 -
 libavformat/mxfenc.c| 42 ++---
 tests/ref/fate/copy-trac4914|  2 +-
 tests/ref/fate/time_base|  2 +-
 tests/ref/lavf/mxf  |  6 +++---
 tests/ref/lavf/mxf_d10  |  2 +-
 tests/ref/lavf/mxf_dv25 |  2 +-
 tests/ref/lavf/mxf_dvcpro50 |  2 +-
 tests/ref/lavf/mxf_opatom   |  2 +-
 tests/ref/lavf/mxf_opatom_audio |  2 +-
 10 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/libavformat/mxf.h b/libavformat/mxf.h
index f3db1f939b..2d5b44943b 100644
--- a/libavformat/mxf.h
+++ b/libavformat/mxf.h
@@ -45,7 +45,6 @@ enum MXFMetadataSetType {
 SubDescriptor,
 IndexTableSegment,
 EssenceContainerData,
-TypeBottom,// add metadata type before this
 EssenceGroup,
 TaggedValue,
 };
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index ed6ecbf541..c9694f2a4e 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -386,6 +386,7 @@ typedef struct MXFContext {
 uint32_t tagged_value_count;
 AVRational audio_edit_rate;
 int store_user_comments;
+int track_instance_count; // used to generate MXFTrack uuids
 } MXFContext;
 
 static const uint8_t uuid_base[]= { 
0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd };
@@ -853,7 +854,7 @@ static void mxf_write_track(AVFormatContext *s, AVStream 
*st, MXFPackage *packag
 
 // write track uid
 mxf_write_local_tag(pb, 16, 0x3C0A);
-mxf_write_uuid(pb, package->type == MaterialPackage ? Track : Track + 
TypeBottom, st->index);
+mxf_write_uuid(pb, Track, mxf->track_instance_count);
 PRINT_KEY(s, "track uid", pb->buf_ptr - 16);
 
 // write track id
@@ -884,7 +885,7 @@ static void mxf_write_track(AVFormatContext *s, AVStream 
*st, MXFPackage *packag
 
 // write sequence refs
 mxf_write_local_tag(pb, 16, 0x4803);
-mxf_write_uuid(pb, package->type == MaterialPackage ? Sequence: Sequence + 
TypeBottom, st->index);
+mxf_write_uuid(pb, Sequence, mxf->track_instance_count);
 }
 
 static const uint8_t smpte_12m_timecode_track_data_ul[] = { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x01,0x01,0x00,0x00,0x00 
};
@@ -924,7 +925,7 @@ static void mxf_write_sequence(AVFormatContext *s, AVStream 
*st, MXFPackage *pac
 klv_encode_ber_length(pb, 80);
 
 mxf_write_local_tag(pb, 16, 0x3C0A);
-mxf_write_uuid(pb, package->type == MaterialPackage ? Sequence: Sequence + 
TypeBottom, st->index);
+mxf_write_uuid(pb, Sequence, mxf->track_instance_count);
 
 PRINT_KEY(s, "sequence uid", pb->buf_ptr - 16);
 mxf_write_common_fields(s, st);
@@ -936,9 +937,8 @@ static void mxf_write_sequence(AVFormatContext *s, AVStream 
*st, MXFPackage *pac
 component = TimecodeComponent;
 else
 component = SourceClip;
-if (package->type == SourcePackage)
-component += TypeBottom;
-mxf_write_uuid(pb, component, st->index);
+
+mxf_write_uuid(pb, component, mxf->track_instance_count);
 }
 
 static void mxf_write_timecode_component(AVFormatContext *s, AVStream *st, 
MXFPackage *package)
@@ -951,8 +951,7 @@ static void mxf_write_timecode_component(AVFormatContext 
*s, AVStream *st, MXFPa
 
 // UID
 mxf_write_local_tag(pb, 16, 0x3C0A);
-mxf_write_uuid(pb, package->type == MaterialPackage ? TimecodeComponent :
-   TimecodeComponent + TypeBottom, st->index);
+mxf_write_uuid(pb, TimecodeComponent, mxf->track_instance_count);
 
 mxf_write_common_fields(s, st);
 
@@ -971,6 +970,7 @@ static void mxf_write_timecode_component(AVFormatContext 
*s, AVStream *st, MXFPa
 
 static void mxf_write_structural_component(AVFormatContext *s, AVStream *st, 
MXFPackage *package)
 {
+MXFContext *mxf = s->priv_data;
 AVIOContext *pb = s->pb;
 int i;
 
@@ -980,7 +980,7 @@ static void mxf_write_structural_component(AVFormatContext 
*s, AVStream *st, MXF
 
 // write uid
 mxf_write_local_tag(pb, 16, 0x3C0A);
-mxf_write_uuid(pb, package->type == MaterialPackage ? SourceClip: 
SourceClip + TypeBottom, st->index);
+mxf_write_uuid(pb, SourceClip, mxf->track_instance_count);
 
 PRINT_KEY(s, "structural component uid", pb->buf_ptr - 16);
 mxf_write_common_fields(s, st);
@@ -1357,7 +1357,7 @@ static void mxf_write_package(AVFormatContext *s, 
MXFPackage *package)
 
 // write package umid
 mxf_write_local_tag(pb, 32, 0x4401);
-mxf_write_umid(s, package->type == SourcePackage);
+mxf_write_umid(s, package->instance);
 PRINT_KEY(s, "package umid second part", pb->buf_ptr - 16);
 
 // package name
@@ -1375,10 +1375,9 @@ static void mxf_write_package(AVFormatContext *s, 
MXFPackage *package)
 // write track refs
 mxf_write_local_tag(pb, track_count*16 + 8, 0x4403);
 mxf_write_refs_count(pb, track_count);
-mxf_write_uuid(pb, package->type == MaterialPackage ? Track :
-   Track + TypeBottom, -1); // timecode track
-