[FFmpeg-soc] MXF muxer version 0.0.4

Michael Niedermayer michaelni at gmx.at
Thu Aug 21 19:09:53 CEST 2008


On Fri, Aug 22, 2008 at 12:00:02AM +0800, zhentan feng wrote:
> hi
> 
> 2008/8/21 Michael Niedermayer <michaelni at gmx.at>
> 
> > On Thu, Aug 21, 2008 at 12:28:02AM +0800, zhentan feng wrote:
[...]
> > > +static void mxf_write_package(AVFormatContext *s, enum
> > MXFMetadataSetType type)
> > > +{
> > > +    ByteIOContext *pb = s->pb;
> > > +    int i;
> > > +
> > > +    if (type == MaterialPackage) {
> > > +        mxf_write_metadata_key(pb, 0x013600);
> > > +        PRINT_KEY(s, "Material Package key", pb->buf_ptr - 16);
> > > +        klv_encode_ber_length(pb, 92 + 16 * s->nb_streams);
> > > +    }
> > > +    else {
> > > +        mxf_write_metadata_key(pb, 0x013700);
> > > +        PRINT_KEY(s, "Source Package key", pb->buf_ptr - 16);
> > > +        klv_encode_ber_length(pb, 112 + 16 * s->nb_streams); // 20 bytes
> > length for descriptor reference
> > > +    }
> > > +
> > > +    // write uid
> > > +    mxf_write_local_tag(pb, 16, 0x3C0A);
> > > +    mxf_write_uuid(pb, type, 0);
> > > +    av_log(s,AV_LOG_DEBUG, "package type:%d\n", type);
> > > +    PRINT_KEY(s, "package uid", pb->buf_ptr - 16);
> > > +
> > > +    // write package umid
> > > +    mxf_write_local_tag(pb, 32, 0x4401);
> > > +    mxf_write_umid(pb, type, 0);
> > > +    PRINT_KEY(s, "package umid second part", pb->buf_ptr - 16);
> > > +    // write create date
> > > +    mxf_write_local_tag(pb, 8, 0x4405);
> > > +    put_be64(pb, 0);
> > > +
> > > +    // write modified date
> > > +    mxf_write_local_tag(pb, 8, 0x4404);
> > > +    put_be64(pb, 0);
> > > +
> > > +    // write track refs
> > > +    mxf_write_local_tag(pb, s->nb_streams * 16 + 8, 0x4403);
> > > +    mxf_write_refs_count(pb, s->nb_streams);
> >
> > > +    for (i = 0; i < s->nb_streams; i++)
> > > +        mxf_write_uuid(pb, type == MaterialPackage ? Track : Track +
> > 0xf0, i);
> >
> > a Track2 or any other name would be cleaner than Track + 0xf0
> >
> 
> do you mean add a new enum type for the other track?
> if there many tracks, it will add Track2, Track3...
> 
> so,
> mxf_write_uuid(pb, type == MaterialPackage ? Track : Track + 0xf0 + i, i);
> is this ok?

no


> 0xf0 just like a offset.

0xf0 is the problem
It should be an enum like

mxf_write_uuid(pb, type == MaterialPackage ? Track : SomethingElse, i);

Track + 0xf0 can be equal to another enum, its not likely but its just not
correct to add random integers to an enum to create a new one.


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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- 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-soc/attachments/20080821/ac303818/attachment.pgp>


More information about the FFmpeg-soc mailing list