Open discussion about tools and MXF in general
It is currently Sat Dec 05, 2020 2:25 pm
Board index » MXF Categories » Tools

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


Joined: Thu May 31, 2007 10:10 am
Posts: 1

Post Posted: Thu May 31, 2007 11:24 am 
Hey Matt!

Thank you for the great MXFLib! :)

I have a short question: Is there a possibility to write small parts of the MXF-Body and all ending up in a single partition using the Bodywriter?

The reason for the question is that i would like to abort the writing upon user request. The code should look like (Writer is of class BodyWriter):

// End header partition

while (!Writer->BodyDone()) {
    // write a couple of edit units

    // check if user wants to abort

instead of just


which puts everything in one large partition but can take a while to finish. From the documentation and the code in essence.cpp I assume propably yes but I managed to do it only with changes to BodyWriter::WriteEssence and that doesn't seem right :)

Also: I probably overlook some special case, but shouldn't line 2597 in essence.cpp rather be:

if(ThisSize >= RemainingDuration)

Otherwise always one more edit unit is written than in the WritePartition-Call specified?

Thank you,
best regards,



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

Post Posted: Thu May 31, 2007 4:40 pm 
The +1 thing is (if my memory serves me correctly) because the last edit unit is stored for next time a body partition is started.

I do like the idea of being able to cancel a write part way through, but this would be quite difficult to make work from within the BodyWriter for clip-wrapping as it passes the entire clip (or details of it!) down to a lower level.

My recommendation would be to write a version of EssenceSource that works as a "filter", passing calls to all methods through to another essence source, but with a hook in GetEssenceDataSize, GetEssenceData and EndOfData to flag that the essence has ended if a test shows that the cancel button has been pressed.

Then rather than:
BodyStreamPtr MyStream = new BodyStream(OriginalSource);

... you do:
EssenceSourcePtr NewSource = new FilterSource(OriginalSource);
BodyStreamPtr MyStream = new BodyStream(NewSource);

 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 6 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
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by :: All times are UTC