本文整理汇总了C++中Stream::Context方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::Context方法的具体用法?C++ Stream::Context怎么用?C++ Stream::Context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::Context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
status_t
AVFormatReader::Sniff(int32* _streamCount)
{
TRACE("AVFormatReader::Sniff\n");
BPositionIO* source = dynamic_cast<BPositionIO*>(Source());
if (source == NULL) {
TRACE(" not a BPositionIO, but we need it to be one.\n");
return B_NOT_SUPPORTED;
}
Stream* stream = new(std::nothrow) Stream(source,
&fSourceLock);
if (stream == NULL) {
ERROR("AVFormatReader::Sniff() - failed to allocate Stream\n");
return B_NO_MEMORY;
}
ObjectDeleter<Stream> streamDeleter(stream);
status_t ret = stream->Open();
if (ret != B_OK) {
TRACE(" failed to detect stream: %s\n", strerror(ret));
return ret;
}
delete[] fStreams;
fStreams = NULL;
int32 streamCount = stream->CountStreams();
if (streamCount == 0) {
TRACE(" failed to detect any streams: %s\n", strerror(ret));
return B_ERROR;
}
fStreams = new(std::nothrow) Stream*[streamCount];
if (fStreams == NULL) {
ERROR("AVFormatReader::Sniff() - failed to allocate streams\n");
return B_NO_MEMORY;
}
memset(fStreams, 0, sizeof(Stream*) * streamCount);
fStreams[0] = stream;
streamDeleter.Detach();
#ifdef TRACE_AVFORMAT_READER
dump_format(const_cast<AVFormatContext*>(stream->Context()), 0, "", 0);
#endif
if (_streamCount != NULL)
*_streamCount = streamCount;
return B_OK;
}