freeMXF.org http://freemxf.org/forum/ |
|
Codec UL http://freemxf.org/forum/viewtopic.php?f=2&t=62 |
Page 1 of 1 |
Author: | Abheeshta [ Mon Aug 07, 2006 5:06 pm ] |
Post subject: | Codec UL |
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. |
Author: | Matt Beard [ Thu Aug 10, 2006 11:12 am ] |
Post subject: | |
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. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |