本文整理汇总了C++中FrameBuffer::MIMEType方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameBuffer::MIMEType方法的具体用法?C++ FrameBuffer::MIMEType怎么用?C++ FrameBuffer::MIMEType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameBuffer
的用法示例。
在下文中一共展示了FrameBuffer::MIMEType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TmpID
Result_t
ASDCP::TimedText::DCSubtitleParser::h__SubtitleParser::ReadAncillaryResource(const byte_t* uuid, FrameBuffer& FrameBuf,
const IResourceResolver& Resolver) const
{
FrameBuf.AssetID(uuid);
UUID TmpID(uuid);
char buf[64];
ResourceTypeMap_t::const_iterator rmi = m_ResourceTypes.find(TmpID);
if ( rmi == m_ResourceTypes.end() )
{
DefaultLogSink().Error("Unknown ancillary resource id: %s\n", TmpID.EncodeHex(buf, 64));
return RESULT_RANGE;
}
Result_t result = Resolver.ResolveRID(uuid, FrameBuf);
if ( KM_SUCCESS(result) )
{
if ( (*rmi).second == MT_PNG )
FrameBuf.MIMEType("image/png");
else if ( (*rmi).second == MT_OPENTYPE )
FrameBuf.MIMEType("application/x-font-opentype");
else
FrameBuf.MIMEType("application/octet-stream");
}
return result;
}
示例2: RID
ASDCP::Result_t
ASDCP::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const byte_t* uuid, FrameBuffer& frame_buf,
AESDecContext* Ctx, HMACContext* HMAC)
{
KM_TEST_NULL_L(uuid);
UUID RID(uuid);
ResourceMap_t::const_iterator ri = m_ResourceMap.find(RID);
if ( ri == m_ResourceMap.end() )
{
char buf[64];
DefaultLogSink().Error("No such resource: %s\n", RID.EncodeHex(buf, 64));
return RESULT_RANGE;
}
// get the subdescriptor
InterchangeObject* tmp_iobj = 0;
Result_t result = m_HeaderPart.GetMDObjectByID((*ri).second, &tmp_iobj);
TimedTextResourceSubDescriptor* desc_object = dynamic_cast<TimedTextResourceSubDescriptor*>(tmp_iobj);
if ( KM_SUCCESS(result) )
{
assert(desc_object);
result = ReadGenericStreamPartitionPayload(desc_object->EssenceStreamID, frame_buf, Ctx, HMAC);
}
if ( KM_SUCCESS(result) )
{
frame_buf.AssetID(uuid);
frame_buf.MIMEType(desc_object->MIMEMediaType);
}
return result;
}
示例3: assert
ASDCP::Result_t
ASDCP::TimedText::MXFReader::h__Reader::ReadTimedTextResource(FrameBuffer& FrameBuf,
AESDecContext* Ctx, HMACContext* HMAC)
{
if ( ! m_File.IsOpen() )
return RESULT_INIT;
assert(m_Dict);
Result_t result = ReadEKLVFrame(0, FrameBuf, m_Dict->ul(MDD_TimedTextEssence), Ctx, HMAC);
if( ASDCP_SUCCESS(result) )
{
FrameBuf.AssetID(m_TDesc.AssetID);
FrameBuf.MIMEType("text/xml");
}
return result;
}
示例4: RID
ASDCP::Result_t
ASDCP::TimedText::MXFReader::h__Reader::ReadAncillaryResource(const byte_t* uuid, FrameBuffer& FrameBuf,
AESDecContext* Ctx, HMACContext* HMAC)
{
KM_TEST_NULL_L(uuid);
UUID RID(uuid);
ResourceMap_t::const_iterator ri = m_ResourceMap.find(RID);
if ( ri == m_ResourceMap.end() )
{
char buf[64];
DefaultLogSink().Error("No such resource: %s\n", RID.EncodeHex(buf, 64));
return RESULT_RANGE;
}
TimedTextResourceSubDescriptor* DescObject = 0;
// get the subdescriptor
InterchangeObject* tmp_iobj = 0;
Result_t result = m_HeaderPart.GetMDObjectByID((*ri).second, &tmp_iobj);
DescObject = static_cast<TimedTextResourceSubDescriptor*>(tmp_iobj);
if ( KM_SUCCESS(result) )
{
Array<RIP::Pair>::const_iterator pi;
RIP::Pair TmpPair;
ui32_t sequence = 0;
// Look up the partition start in the RIP using the SID.
// Count the sequence length in because this is the sequence
// value needed to complete the HMAC.
for ( pi = m_HeaderPart.m_RIP.PairArray.begin(); pi != m_HeaderPart.m_RIP.PairArray.end(); ++pi, ++sequence )
{
if ( (*pi).BodySID == DescObject->EssenceStreamID )
{
TmpPair = *pi;
break;
}
}
if ( TmpPair.ByteOffset == 0 )
{
DefaultLogSink().Error("Body SID not found in RIP set: %d\n", DescObject->EssenceStreamID);
return RESULT_FORMAT;
}
if ( KM_SUCCESS(result) )
{
FrameBuf.AssetID(uuid);
FrameBuf.MIMEType(DescObject->MIMEMediaType);
// seek tp the start of the partition
if ( (Kumu::fpos_t)TmpPair.ByteOffset != m_LastPosition )
{
m_LastPosition = TmpPair.ByteOffset;
result = m_File.Seek(TmpPair.ByteOffset);
}
// read the partition header
MXF::Partition GSPart(m_Dict);
result = GSPart.InitFromFile(m_File);
if( ASDCP_SUCCESS(result) )
{
// check the SID
if ( DescObject->EssenceStreamID != GSPart.BodySID )
{
char buf[64];
DefaultLogSink().Error("Generic stream partition body differs: %s\n", RID.EncodeHex(buf, 64));
return RESULT_FORMAT;
}
// read the essence packet
assert(m_Dict);
if( ASDCP_SUCCESS(result) )
result = ReadEKLVPacket(0, sequence, FrameBuf, m_Dict->ul(MDD_GenericStream_DataElement), Ctx, HMAC);
}
}
}
return result;
}