freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Mon Dec 23, 2024 12:55 am
Board index » MXF Categories » freeMXF.org Tools



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

Offline
Board User

Joined: Wed Aug 22, 2007 3:03 pm
Posts: 7

Post Posted: Wed Aug 29, 2007 9:13 am 
Top  
Hi,

I am trying to add new identification into header metadata and update the LastModifiedDate. But it doesn't work, please help me. Thanks!
Code:
int main(int argc, char *argv[])
{
   ...
   MasterPartition->ReadMetadata();
   MetadataPtr HMeta = MasterPartition->ParseMetadata();
   
                MDObjectPtr Idens=HMeta[Identifications_UL];
   if(Idens) cout<<"Idens size: "<< Idens->size()<<endl;

   MDObjectPtr LMD=HMeta[LastModifiedDate_UL];
   printf("%s = %s\n", LMD->Name().c_str(), LMD->GetString().c_str());

   HMeta->SetTime();
   //Not changed!!??Why?
                LMD=HMeta[LastModifiedDate_UL];
   printf("%s = %s\n", LMD->Name().c_str(), LMD->GetString().c_str());

   UInt8 ProductGUID_Data[16] = { 0x84, 0x55, 0x23, 0xe2, 0x16, 0x8c, 0xc2, 0x30, 0x85, 0xcb, 0xef, 0x78, 0x9c, 0xde, 0xef, 0x42 };
   ...
   MDObjectPtr Ident = new MDObject(Identification_UL);
   Ident->SetString(CompanyName_UL, CompanyName);
    ...
   Ident->SetValue(ProductUID_UL, DataChunk(16,ProductUID->GetValue()));
   HMeta->UpdateGenerations(Ident);
   Idens=HMeta[Identifications_UL];
   //Not changed!!??Why?
   if(Idens) cout<<"Idens size: "<< Idens->size()<<endl;
                ...

}

 Profile  

Offline
Insider

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

Post Posted: Wed Aug 29, 2007 4:07 pm 
Top  
What you need to to is build an Identification set, call SetTime() then call UpdateGenerations() - this final call will do all the work of adding the identification set and linking it by GenerationUID to any metadata sets whose values have been modified since the data was last read from file, or since the last call to UpdateGenerations(). All SetTime() does is sets the time that will be used when the next recorded modification happens (such as a call to UpdateGenerations() or adding a new package to the file)

 Profile WWW  

Offline
Board User

Joined: Wed Aug 22, 2007 3:03 pm
Posts: 7

Post Posted: Thu Aug 30, 2007 7:24 am 
Top  
Thank you Matt.

I have tried it (Create a new identification set, call SetTime(), then call UpDateGenerations()), but it didn't work.
Insteed SetTime() I've tried:

Code:
...
LMD=HMeta[LastModifiedDate_UL];
LMD->SetString(Now2String());
HMeta->UpdateGenerations(Ident)
...


It worked!

 Profile  

Offline
Insider

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

Post Posted: Tue Sep 11, 2007 9:43 am 
Top  
This seems to be because you have not actually modified any properties.

UpdateGenerations contains the following note: "The preface does not get modified simply to add the new identification set"

What this is supposed to show is that nothing will get added if you have not changed the file.

I will add a tracker request to allow a new Ident set to be forced into an otherwise unchanged file (there may be a reason to allow this).

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

Jump to:  


Who is online

Users browsing this forum: No registered users and 8 guests

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