freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Wed Apr 08, 2020 2:05 am
Board index » MXF Categories » freeMXF.org Tools



Post new topic Reply to topic  [ 2 posts ] 
Author
Search for:
Message

Offline
Rookie

Joined: Tue Aug 01, 2006 11:22 pm
Posts: 4

Post Posted: Mon Aug 07, 2006 5:06 pm 
Top  
Hi,

I have been trying to get the Codec UL from the descriptor.

This is what I have been doing unsuccessfully:

if(Track && (Descriptor->IsA(FileDescriptor_UL)))
{
MDObjectPtr Codec_ul=Descriptor->Child("Codec");
if(Codec_ul)
ULPtr codec_ul_ptr=Codec_ul->GetUL();
//const UInt8 *this_ptr=Codec_ul->GetUL()->GetValue();
}

The MDObjectPtr never gets initialized. Help Please.

 Profile  

Offline
Insider

Joined: Thu Apr 15, 2004 10:39 am
Posts: 198
Location: Scotland

Post Posted: Thu Aug 10, 2006 11:12 am 
Top  
I don't see why the MDObjectPtr Codec_ul is not getting initialized (but I would change its name as there is already a Codec_UL which is the UL of this property). Are you sure that this file descriptor has a codec property?

GetUL() will return the property UL (the same as the value of the global constant Codec_UL mentioned above) not the value of property as a UL.

I would use the following:
Code:
if(Track && (Descriptor->IsA(FileDescriptor_UL)))
{
    ULPtr CodecLabel;
    MDObjectPtr Codec = Descriptor->Child(Codec_UL);

    if(Codec)
    {
        DataChunkPtr Data = Codec->PutData();
        if(Data->Size == 16) CodecLabel = new UL(Data->Data);
    }
}

What happens here is that once the codec property is located its value is written into a buffer. This should be 16 bytes (but I always check as you never know what rubbish there may be in the file!). This can then be used to build a new UL.

 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Jump to:  


Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by phpBBservice.nl :: All times are UTC