本文整理汇总了C++中MediaDecoder::GetResource方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaDecoder::GetResource方法的具体用法?C++ MediaDecoder::GetResource怎么用?C++ MediaDecoder::GetResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaDecoder
的用法示例。
在下文中一共展示了MediaDecoder::GetResource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Decoders
NS_IMETHODIMP
MediaMemoryTracker::CollectReports(nsIHandleReportCallback* aHandleReport,
nsISupports* aData, bool aAnonymize)
{
int64_t video = 0, audio = 0;
size_t resources = 0;
DecodersArray& decoders = Decoders();
for (size_t i = 0; i < decoders.Length(); ++i) {
MediaDecoder* decoder = decoders[i];
video += decoder->SizeOfVideoQueue();
audio += decoder->SizeOfAudioQueue();
if (decoder->GetResource()) {
resources += decoder->GetResource()->SizeOfIncludingThis(MallocSizeOf);
}
}
#define REPORT(_path, _amount, _desc) \
do { \
nsresult rv; \
rv = aHandleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
KIND_HEAP, UNITS_BYTES, _amount, \
NS_LITERAL_CSTRING(_desc), aData); \
NS_ENSURE_SUCCESS(rv, rv); \
} while (0)
REPORT("explicit/media/decoded/video", video,
"Memory used by decoded video frames.");
REPORT("explicit/media/decoded/audio", audio,
"Memory used by decoded audio chunks.");
REPORT("explicit/media/resources", resources,
"Memory used by media resources including streaming buffers, caches, "
"etc.");
#undef REPORT
return NS_OK;
}