本文整理汇总了C++中Sequence::appendStructuralComponents方法的典型用法代码示例。如果您正苦于以下问题:C++ Sequence::appendStructuralComponents方法的具体用法?C++ Sequence::appendStructuralComponents怎么用?C++ Sequence::appendStructuralComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequence
的用法示例。
在下文中一共展示了Sequence::appendStructuralComponents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InsertFramework
void InsertFramework(HeaderMetadata *header_metadata, uint32_t track_id, std::string track_name, DMFramework *framework, ObjectModifier *mod)
{
BMX_ASSERT(header_metadata);
MaterialPackage *material_package = header_metadata->getPreface()->findMaterialPackage();
BMX_ASSERT(material_package);
// Preface - ContentStorage - Package - DM Track
StaticTrack *dm_track = new StaticTrack(header_metadata);
if (mod!=NULL) mod->Modify(dm_track);
material_package->appendTracks(dm_track);
dm_track->setTrackName(track_name);
dm_track->setTrackID(track_id);
dm_track->setTrackNumber(0);
// Preface - ContentStorage - Package - DM Track - Sequence
Sequence *sequence = new Sequence(header_metadata);
if (mod!=NULL) mod->Modify(sequence);
dm_track->setSequence(sequence);
sequence->setDataDefinition(MXF_DDEF_L(DescriptiveMetadata));
// Preface - ContentStorage - Package - DM Track - Sequence - DMSegment
DMSegment *dm_segment = new DMSegment(header_metadata);
if (mod!=NULL) mod->Modify(dm_segment);
sequence->appendStructuralComponents(dm_segment);
dm_segment->setDataDefinition(MXF_DDEF_L(DescriptiveMetadata));
// move the framework set after the dm degment set
mxf_remove_set(header_metadata->getCHeaderMetadata(), framework->getCMetadataSet());
BMX_CHECK(mxf_add_set(header_metadata->getCHeaderMetadata(), framework->getCMetadataSet()));
// Preface - ContentStorage - Package - DM Track - Sequence - DMSegment - DMFramework
dm_segment->setDMFramework(framework);
}
示例2: InsertEventFrameworks
void InsertEventFrameworks(HeaderMetadata *header_metadata, uint32_t track_id, std::string track_name, std::vector<EventInput> &frameworks, ObjectModifier *mod)
{
BMX_ASSERT(header_metadata);
MaterialPackage *material_package = header_metadata->getPreface()->findMaterialPackage();
BMX_ASSERT(material_package);
// Preface - ContentStorage - Package - DM Track
EventTrack *dm_track = new EventTrack(header_metadata);
if (mod!=NULL) mod->Modify(dm_track);
material_package->appendTracks(dm_track);
dm_track->setTrackName(track_name);
dm_track->setTrackID(track_id);
dm_track->setTrackNumber(0);
// Preface - ContentStorage - Package - DM Track - Sequence
Sequence *sequence = new Sequence(header_metadata);
if (mod!=NULL) mod->Modify(sequence);
dm_track->setSequence(sequence);
sequence->setDataDefinition(MXF_DDEF_L(DescriptiveMetadata));
for (std::vector<EventInput>::iterator it = frameworks.begin(); it != frameworks.end(); it++) {
EventInput& ev = *it;
// Preface - ContentStorage - Package - DM Track - Sequence - DMSegment
DMSegment *dm_segment = new DMSegment(header_metadata);
if (mod!=NULL) mod->Modify(dm_segment);
sequence->appendStructuralComponents(dm_segment);
dm_segment->setDataDefinition(MXF_DDEF_L(DescriptiveMetadata));
dm_segment->setEventStartPosition(ev.start);
dm_segment->setDuration(ev.duration);
// move the framework set after the dm degment set
mxf_remove_set(header_metadata->getCHeaderMetadata(), ev.framework->getCMetadataSet());
BMX_CHECK(mxf_add_set(header_metadata->getCHeaderMetadata(), ev.framework->getCMetadataSet()));
// Preface - ContentStorage - Package - DM Track - Sequence - DMSegment - DMFramework
dm_segment->setDMFramework(ev.framework);
}
}
示例3: Track
void RDD9Track::AddHeaderMetadata(HeaderMetadata *header_metadata, MaterialPackage *material_package,
SourcePackage *file_source_package)
{
mxfUL data_def = (mIsPicture ? MXF_DDEF_L(Picture) : MXF_DDEF_L(Sound));
int64_t material_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_origin = 0; // could be updated if not writing in a single pass
// Preface - ContentStorage - MaterialPackage - Timeline Track
Track *track = new Track(header_metadata);
material_package->appendTracks(track);
track->setTrackName(get_track_name((mIsPicture ? MXF_PICTURE_DDEF : MXF_SOUND_DDEF), mOutputTrackNumber));
track->setTrackID(mTrackId);
// TODO: not sure whether setting TrackNumber in the MaterialPackage is a good idea for this MXF flavour
// track->setTrackNumber(mOutputTrackNumber);
track->setTrackNumber(0);
track->setEditRate(mEditRate);
track->setOrigin(0);
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence
Sequence *sequence = new Sequence(header_metadata);
track->setSequence(sequence);
sequence->setDataDefinition(data_def);
sequence->setDuration(material_track_duration);
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence - SourceClip
SourceClip *source_clip = new SourceClip(header_metadata);
sequence->appendStructuralComponents(source_clip);
source_clip->setDataDefinition(data_def);
source_clip->setDuration(material_track_duration);
source_clip->setStartPosition(0);
source_clip->setSourcePackageID(file_source_package->getPackageUID());
source_clip->setSourceTrackID(mTrackId);
// Preface - ContentStorage - SourcePackage - Timeline Track
track = new Track(header_metadata);
file_source_package->appendTracks(track);
track->setTrackName(get_track_name((mIsPicture ? MXF_PICTURE_DDEF : MXF_SOUND_DDEF), mOutputTrackNumber));
track->setTrackID(mTrackId);
track->setTrackNumber(mTrackNumber);
track->setEditRate(mEditRate);
track->setOrigin(source_track_origin);
// Preface - ContentStorage - SourcePackage - Timeline Track - Sequence
sequence = new Sequence(header_metadata);
track->setSequence(sequence);
sequence->setDataDefinition(data_def);
sequence->setDuration(source_track_duration);
// Preface - ContentStorage - SourcePackage - Timeline Track - Sequence - SourceClip
source_clip = new SourceClip(header_metadata);
sequence->appendStructuralComponents(source_clip);
source_clip->setDataDefinition(data_def);
source_clip->setDuration(source_track_duration);
source_clip->setStartPosition(0);
source_clip->setSourceTrackID(0);
source_clip->setSourcePackageID(g_Null_UMID);
// Preface - ContentStorage - SourcePackage - FileDescriptor
FileDescriptor *descriptor = mDescriptorHelper->CreateFileDescriptor(header_metadata);
BMX_ASSERT(file_source_package->haveDescriptor());
MultipleDescriptor *mult_descriptor = dynamic_cast<MultipleDescriptor*>(file_source_package->getDescriptor());
BMX_ASSERT(mult_descriptor);
mult_descriptor->appendSubDescriptorUIDs(descriptor);
descriptor->setLinkedTrackID(mTrackId);
}
示例4: Preface
void AS02Track::CreateHeaderMetadata()
{
// Preface
Preface *preface = new Preface(mHeaderMetadata);
preface->setLastModifiedDate(mClip->mCreationDate);
preface->setVersion(MXF_PREFACE_VER(1, 3));
preface->setOperationalPattern(MXF_OP_L(1a, UniTrack_Stream_Internal));
preface->appendEssenceContainers(GetEssenceContainerUL());
preface->setDMSchemes(vector<mxfUL>());
// Preface - Identification
Identification *ident = new Identification(mHeaderMetadata);
preface->appendIdentifications(ident);
ident->initialise(mClip->mCompanyName, mClip->mProductName, mClip->mVersionString, mClip->mProductUID);
if (mClip->mProductVersion.major != 0 || mClip->mProductVersion.minor != 0 || mClip->mProductVersion.patch != 0 ||
mClip->mProductVersion.build != 0 || mClip->mProductVersion.release != 0)
{
ident->setProductVersion(mClip->mProductVersion);
}
ident->setModificationDate(mClip->mCreationDate);
ident->setThisGenerationUID(mClip->mGenerationUID);
// Preface - ContentStorage
ContentStorage* content_storage = new ContentStorage(mHeaderMetadata);
preface->setContentStorage(content_storage);
// Preface - ContentStorage - EssenceContainerData
EssenceContainerData *ess_container_data = new EssenceContainerData(mHeaderMetadata);
content_storage->appendEssenceContainerData(ess_container_data);
ess_container_data->setLinkedPackageUID(mFileSourcePackageUID);
ess_container_data->setIndexSID(mIndexSID);
ess_container_data->setBodySID(mBodySID);
// Preface - ContentStorage - MaterialPackage
mMaterialPackage = new MaterialPackage(mHeaderMetadata);
content_storage->appendPackages(mMaterialPackage);
mMaterialPackage->setPackageUID(mMaterialPackageUID);
mMaterialPackage->setPackageCreationDate(mClip->mCreationDate);
mMaterialPackage->setPackageModifiedDate(mClip->mCreationDate);
if (!mClip->mClipName.empty())
mMaterialPackage->setName(get_track_clip_name(mClip->mClipName, mIsPicture, mOutputTrackNumber));
// Preface - ContentStorage - MaterialPackage - Timecode Track
Track *timecode_track = new Track(mHeaderMetadata);
mMaterialPackage->appendTracks(timecode_track);
timecode_track->setTrackName(TIMECODE_TRACK_NAME);
timecode_track->setTrackID(TIMECODE_TRACK_ID);
timecode_track->setTrackNumber(0);
timecode_track->setEditRate(GetSampleRate());
timecode_track->setOrigin(0);
// Preface - ContentStorage - MaterialPackage - Timecode Track - Sequence
Sequence *sequence = new Sequence(mHeaderMetadata);
timecode_track->setSequence(sequence);
sequence->setDataDefinition(MXF_DDEF_L(Timecode));
sequence->setDuration(-1); // updated when writing completed
// Preface - ContentStorage - MaterialPackage - Timecode Track - TimecodeComponent
TimecodeComponent *timecode_component = new TimecodeComponent(mHeaderMetadata);
sequence->appendStructuralComponents(timecode_component);
timecode_component->setDataDefinition(MXF_DDEF_L(Timecode));
timecode_component->setDuration(-1); // updated when writing completed
timecode_component->setRoundedTimecodeBase(mClip->mStartTimecode.GetRoundedTCBase());
timecode_component->setDropFrame(mClip->mStartTimecode.IsDropFrame());
timecode_component->setStartTimecode(mClip->mStartTimecode.GetOffset());
// Preface - ContentStorage - MaterialPackage - Timeline Track
Track *track = new Track(mHeaderMetadata);
mMaterialPackage->appendTracks(track);
track->setTrackName(mIsPicture ? VIDEO_TRACK_NAME : AUDIO_TRACK_NAME);
track->setTrackID(mIsPicture ? VIDEO_TRACK_ID : AUDIO_TRACK_ID);
track->setTrackNumber(0);
track->setEditRate(GetSampleRate());
track->setOrigin(0);
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence
sequence = new Sequence(mHeaderMetadata);
track->setSequence(sequence);
sequence->setDataDefinition(mIsPicture ? MXF_DDEF_L(Picture) : MXF_DDEF_L(Sound));
sequence->setDuration(-1); // updated when writing completed
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence - SourceClip
SourceClip *source_clip = new SourceClip(mHeaderMetadata);
sequence->appendStructuralComponents(source_clip);
source_clip->setDataDefinition(mIsPicture ? MXF_DDEF_L(Picture) : MXF_DDEF_L(Sound));
source_clip->setDuration(-1); // updated when writing completed
source_clip->setStartPosition(0);
source_clip->setSourceTrackID(mIsPicture ? VIDEO_TRACK_ID : AUDIO_TRACK_ID);
source_clip->setSourcePackageID(mFileSourcePackageUID);
// Preface - ContentStorage - SourcePackage
mFileSourcePackage = new SourcePackage(mHeaderMetadata);
content_storage->appendPackages(mFileSourcePackage);
mFileSourcePackage->setPackageUID(mFileSourcePackageUID);
mFileSourcePackage->setPackageCreationDate(mClip->mCreationDate);
mFileSourcePackage->setPackageModifiedDate(mClip->mCreationDate);
preface->setPrimaryPackage(mFileSourcePackage);
// Preface - ContentStorage - SourcePackage - Timecode Track
timecode_track = new Track(mHeaderMetadata);
//.........这里部分代码省略.........
示例5: Track
void OP1ATrack::AddHeaderMetadata(HeaderMetadata *header_metadata, MaterialPackage *material_package,
SourcePackage *file_source_package)
{
mxfUL data_def_ul;
BMX_CHECK(mxf_get_ddef_label(mDataDef, &data_def_ul));
int64_t material_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_origin = 0; // could be updated if not writing in a single pass
if (mOP1AFile->mSupportCompleteSinglePass) {
material_track_duration = mOP1AFile->mInputDuration - mOP1AFile->mOutputStartOffset +
mOP1AFile->mOutputEndOffset;
if (material_track_duration < 0)
material_track_duration = 0;
source_track_duration = mOP1AFile->mInputDuration + mOP1AFile->mOutputEndOffset;
source_track_origin = mOP1AFile->mOutputStartOffset;
}
// Preface - ContentStorage - MaterialPackage - Timeline Track
Track *track = new Track(header_metadata);
material_package->appendTracks(track);
track->setTrackName(get_track_name(mDataDef, mOutputTrackNumber));
track->setTrackID(mTrackId);
track->setTrackNumber(mOutputTrackNumber);
track->setEditRate(mEditRate);
track->setOrigin(0);
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence
Sequence *sequence = new Sequence(header_metadata);
track->setSequence(sequence);
sequence->setDataDefinition(data_def_ul);
sequence->setDuration(material_track_duration);
// Preface - ContentStorage - MaterialPackage - Timeline Track - Sequence - SourceClip
SourceClip *source_clip = new SourceClip(header_metadata);
sequence->appendStructuralComponents(source_clip);
source_clip->setDataDefinition(data_def_ul);
source_clip->setDuration(material_track_duration);
source_clip->setStartPosition(0);
source_clip->setSourcePackageID(file_source_package->getPackageUID());
source_clip->setSourceTrackID(mTrackId);
// Preface - ContentStorage - SourcePackage - Timeline Track
track = new Track(header_metadata);
file_source_package->appendTracks(track);
track->setTrackName(get_track_name(mDataDef, mOutputTrackNumber));
track->setTrackID(mTrackId);
track->setTrackNumber(mTrackNumber);
track->setEditRate(mEditRate);
track->setOrigin(source_track_origin);
// Preface - ContentStorage - SourcePackage - Timeline Track - Sequence
sequence = new Sequence(header_metadata);
track->setSequence(sequence);
sequence->setDataDefinition(data_def_ul);
sequence->setDuration(source_track_duration);
// Preface - ContentStorage - SourcePackage - Timeline Track - Sequence - SourceClip
source_clip = new SourceClip(header_metadata);
sequence->appendStructuralComponents(source_clip);
source_clip->setDataDefinition(data_def_ul);
source_clip->setDuration(source_track_duration);
source_clip->setStartPosition(0);
if (mHaveLowerLevelSourcePackage) {
source_clip->setSourcePackageID(mLowerLevelSourcePackageUID);
source_clip->setSourceTrackID(mLowerLevelTrackId);
} else {
source_clip->setSourceTrackID(0);
source_clip->setSourcePackageID(g_Null_UMID);
}
// Preface - ContentStorage - SourcePackage - FileDescriptor
FileDescriptor *descriptor = mDescriptorHelper->CreateFileDescriptor(header_metadata);
if (file_source_package->haveDescriptor()) {
MultipleDescriptor *mult_descriptor = dynamic_cast<MultipleDescriptor*>(file_source_package->getDescriptor());
BMX_ASSERT(mult_descriptor);
mult_descriptor->appendSubDescriptorUIDs(descriptor);
} else {
file_source_package->setDescriptor(descriptor);
}
descriptor->setLinkedTrackID(mTrackId);
if (mOP1AFile->mSupportCompleteSinglePass)
descriptor->setContainerDuration(mOP1AFile->mInputDuration);
// Preface - ContentStorage - (lower-level) SourcePackage
if (mLowerLevelSourcePackage) {
header_metadata->getPreface()->getContentStorage()->appendPackages(mLowerLevelSourcePackage);
if (!mLowerLevelURI.empty()) {
NetworkLocator *network_locator = new NetworkLocator(header_metadata);
mLowerLevelSourcePackage->getDescriptor()->appendLocators(network_locator);
network_locator->setURLString(mLowerLevelURI);
}
}
}
示例6: DataModel
void OP1AFile::CreateHeaderMetadata()
{
BMX_ASSERT(!mHeaderMetadata);
int64_t material_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_duration = -1; // unknown - could be updated if not writing in a single pass
int64_t source_track_origin = 0; // could be updated if not writing in a single pass
if (mSupportCompleteSinglePass) {
// values are known and will not be updated
material_track_duration = mInputDuration - mOutputStartOffset + mOutputEndOffset;
if (material_track_duration < 0)
material_track_duration = 0;
source_track_duration = mInputDuration + mOutputEndOffset;
source_track_origin = mOutputStartOffset;
}
// create the header metadata
mDataModel = new DataModel();
mHeaderMetadata = new HeaderMetadata(mDataModel);
// Preface
Preface *preface = new Preface(mHeaderMetadata);
preface->setLastModifiedDate(mCreationDate);
preface->setVersion((mFlavour & OP1A_377_2004_FLAVOUR) ? MXF_PREFACE_VER(1, 2) : MXF_PREFACE_VER(1, 3));
if (mTracks.size() <= 1)
preface->setOperationalPattern(MXF_OP_L(1a, UniTrack_Stream_Internal));
else
preface->setOperationalPattern(MXF_OP_L(1a, MultiTrack_Stream_Internal));
set<mxfUL>::const_iterator iter;
for (iter = mEssenceContainerULs.begin(); iter != mEssenceContainerULs.end(); iter++)
preface->appendEssenceContainers(*iter);
preface->setDMSchemes(vector<mxfUL>());
if ((mFlavour & OP1A_ARD_ZDF_HDF_PROFILE_FLAVOUR))
preface->setIsRIPPresent(true);
// Preface - Identification
Identification *ident = new Identification(mHeaderMetadata);
preface->appendIdentifications(ident);
ident->initialise(mCompanyName, mProductName, mVersionString, mProductUID);
if (mProductVersion.major != 0 || mProductVersion.minor != 0 || mProductVersion.patch != 0 ||
mProductVersion.build != 0 || mProductVersion.release != 0)
{
ident->setProductVersion(mProductVersion);
}
ident->setModificationDate(mCreationDate);
ident->setThisGenerationUID(mGenerationUID);
// Preface - ContentStorage
ContentStorage* content_storage = new ContentStorage(mHeaderMetadata);
preface->setContentStorage(content_storage);
// Preface - ContentStorage - EssenceContainerData
EssenceContainerData *ess_container_data = new EssenceContainerData(mHeaderMetadata);
content_storage->appendEssenceContainerData(ess_container_data);
ess_container_data->setLinkedPackageUID(mFileSourcePackageUID);
ess_container_data->setIndexSID(INDEX_SID);
ess_container_data->setBodySID(BODY_SID);
// Preface - ContentStorage - MaterialPackage
mMaterialPackage = new MaterialPackage(mHeaderMetadata);
content_storage->appendPackages(mMaterialPackage);
mMaterialPackage->setPackageUID(mMaterialPackageUID);
mMaterialPackage->setPackageCreationDate(mCreationDate);
mMaterialPackage->setPackageModifiedDate(mCreationDate);
if (!mClipName.empty())
mMaterialPackage->setName(mClipName);
// Preface - ContentStorage - MaterialPackage - Timecode Track
Track *timecode_track = new Track(mHeaderMetadata);
mMaterialPackage->appendTracks(timecode_track);
timecode_track->setTrackName(TIMECODE_TRACK_NAME);
timecode_track->setTrackID(TIMECODE_TRACK_ID);
timecode_track->setTrackNumber(0);
timecode_track->setEditRate(mEditRate);
timecode_track->setOrigin(0);
// Preface - ContentStorage - MaterialPackage - Timecode Track - Sequence
Sequence *sequence = new Sequence(mHeaderMetadata);
timecode_track->setSequence(sequence);
sequence->setDataDefinition(MXF_DDEF_L(Timecode));
sequence->setDuration(material_track_duration);
// Preface - ContentStorage - MaterialPackage - Timecode Track - TimecodeComponent
TimecodeComponent *timecode_component = new TimecodeComponent(mHeaderMetadata);
sequence->appendStructuralComponents(timecode_component);
timecode_component->setDataDefinition(MXF_DDEF_L(Timecode));
timecode_component->setDuration(material_track_duration);
timecode_component->setRoundedTimecodeBase(mStartTimecode.GetRoundedTCBase());
timecode_component->setDropFrame(mStartTimecode.IsDropFrame());
timecode_component->setStartTimecode(mStartTimecode.GetOffset());
// Preface - ContentStorage - SourcePackage
mFileSourcePackage = new SourcePackage(mHeaderMetadata);
content_storage->appendPackages(mFileSourcePackage);
mFileSourcePackage->setPackageUID(mFileSourcePackageUID);
mFileSourcePackage->setPackageCreationDate(mCreationDate);
mFileSourcePackage->setPackageModifiedDate(mCreationDate);
// Preface - ContentStorage - SourcePackage - Timecode Track
//.........这里部分代码省略.........