本文整理汇总了C++中FramePtr::getTemporalOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::getTemporalOffset方法的具体用法?C++ FramePtr::getTemporalOffset怎么用?C++ FramePtr::getTemporalOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::getTemporalOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
if(argc == 3)
{
try
{
StdIOStream infile(argv[1], StdIOStream::ReadOnly);
try
{
InputFile input(infile);
const InputFile::TrackMap &tracks = input.getTracks();
Position startTimeCode = 0;
Rational editRate(24, 1);
OutputFile::EssenceList essence;
SID bodySID = 0;
SID indexSID = 0;
for(InputFile::TrackMap::const_iterator t = tracks.begin(); t != tracks.end(); ++t)
{
if(const TimecodeTrack *timecode = dynamic_cast<const TimecodeTrack *>(t->second))
{
startTimeCode = timecode->getStartTimecode();
editRate = timecode->getEditRate();
}
else if(const SourceTrack *source = dynamic_cast<const SourceTrack *>(t->second))
{
essence[source->getNumber()] = source->getDescriptor();
if(bodySID == 0)
{
bodySID = source->getBodySID();
indexSID = source->getIndexSID();
}
else
{
assert(bodySID == source->getBodySID());
assert(indexSID == source->getIndexSID());
}
}
}
if(bodySID == 0)
throw InputExc("No bodySID");
assert(indexSID != 0);
StdIOStream outfile(argv[2], StdIOStream::ReadWrite);
OutputFile output(outfile, essence, editRate, startTimeCode);
const Length duration = input.getDuration();
for(int i=0; i < duration; i++)
{
FramePtr frame = input.getFrame(i, bodySID, indexSID);
if(frame)
{
std::cout << "frame " << i << " : ";
const Frame::FrameParts &parts = frame->getFrameParts();
bool first_part = true;
for(Frame::FrameParts::const_iterator prt = parts.begin(); prt != parts.end(); ++prt)
{
const TrackNum track_number = prt->first;
FramePartPtr part = prt->second;
mxflib::DataChunkPtr data = new mxflib::DataChunk( part->getData() );
assert(data->Size > 0);
assert(data->Data != NULL);
if(first_part)
{
output.PushEssence(track_number, data, frame->getKeyOffset(), frame->getTemporalOffset(), frame->getFlags());
first_part = false;
}
else
output.PushEssence(track_number, data);
std::cout << data->Size << " ";
}
std::cout << std::endl;
}
else
assert(false);
}
}
//.........这里部分代码省略.........