freeMXF.org
http://freemxf.org/forum/

Reading a package name
http://freemxf.org/forum/viewtopic.php?f=2&t=131
Page 1 of 1

Author:  MarcoBiagi [ Fri Jan 11, 2008 11:49 am ]
Post subject:  Reading a package name

Why there isn't an UL for reading the package name property?
The only way that i found is this, but this isn't the same thing :

std::string packName=package->Name();

where package is the smart pointer to the package metadata.
This function return only the name of the MDObjectPtr, in this case sourcePackage or MaterialPackage.
SO this isn't the same thing because the property can have different value like:
"File Package: SMPTE 382M clip wrapping of wave audio"
why there isn't an UL that permit me to read the Package name value in this why:
std::string packName=package->GetString(mxflib::PackageName_UL);
how i can do this?
thx

Author:  Matt Beard [ Sun Jan 13, 2008 10:54 am ]
Post subject: 

The UL you are looking for is GenericPackage_Name_UL - this is because the name specified in 377M is "Name" and this is not unique, so it gets the name of the set prepended (added to the beginning).

If you ever can't figure out the name of a UL for a property or set, look in 377M or dict.xml for the UL and then search for that value in ulmap.h (you will need to convert it to "0xnn, " format)

For example dict.xml shows the Name property of GenericPackage to be:
Code:
06 0e 2b 34 01 01 01 01  01 03 03 02 01 00 00 00


If you search in ulmap.h for:
Code:
0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00


You will find:
Code:
const UInt8 GenericPackage_Name_UL_Data[16] = { 0x06, 0x0e, 0x2b, 0x34, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00 };
const UL GenericPackage_Name_UL(GenericPackage_Name_UL_Data);


In fact only the Item Designator part is required in the search (the last 8 bytes, excluding any zero bytes). This is what is listed in 377M:
Code:
| Name | UTF-16 string | var | 44.02 | 01.03.03.02.01 | Opt | Human readable package name |


So, you only need to search for:
Code:
0x01, 0x03, 0x03, 0x02, 0x01


This is somewhat less than ideal, and a future release should include a handy list of ULs to use for each set, pack or property.

Author:  MarcoBiagi [ Sun Jan 13, 2008 12:24 pm ]
Post subject: 

Thx for the reply!!! your answear is very clear and complete. thx

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/