本文整理汇总了C++中Encoder::SetChunkWriter方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::SetChunkWriter方法的具体用法?C++ Encoder::SetChunkWriter怎么用?C++ Encoder::SetChunkWriter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::SetChunkWriter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
status_t
MediaWriter::CreateEncoder(Encoder** _encoder,
const media_codec_info* codecInfo, media_format* format, uint32 flags)
{
CALLED();
if (fWriter == NULL)
return B_NO_INIT;
// TODO: Here we should work out a way so that if there is a setup
// failure we can try the next encoder.
Encoder* encoder;
status_t ret = gPluginManager.CreateEncoder(&encoder, codecInfo, flags);
if (ret != B_OK) {
ERROR("MediaWriter::CreateEncoder gPluginManager.CreateEncoder "
"failed, codec: %s\n", codecInfo->pretty_name);
return ret;
}
StreamInfo info;
ret = fWriter->AllocateCookie(&info.cookie, format, codecInfo);
if (ret != B_OK) {
gPluginManager.DestroyEncoder(encoder);
return ret;
}
int32 streamIndex = fStreamInfos.CountItems();
if (!fStreamInfos.Insert(info)) {
gPluginManager.DestroyEncoder(encoder);
ERROR("MediaWriter::CreateEncoder can't create StreamInfo "
"for stream %ld\n", streamIndex);
return B_NO_MEMORY;
}
ChunkWriter* chunkWriter = new(std::nothrow) MediaExtractorChunkWriter(
this, streamIndex);
if (chunkWriter == NULL) {
gPluginManager.DestroyEncoder(encoder);
ERROR("MediaWriter::CreateEncoder can't create ChunkWriter "
"for stream %ld\n", streamIndex);
return B_NO_MEMORY;
}
encoder->SetChunkWriter(chunkWriter);
*_encoder = encoder;
return B_OK;
}