Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1321)

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 2580223002: media: Move VPX mem dump provider reg/unreg to same thread. (Closed)
Patch Set: Move unregister to CloseDecoder. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 541478a14cf511b7f4e55dda40b3037ba36d1d5b..af5d01c8bbb1d8f3bfc0c96b72b58d660d4a005f 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -230,13 +230,9 @@ class VpxVideoDecoder::MemoryPool
};
VpxVideoDecoder::MemoryPool::MemoryPool() {
- base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
- this, "VpxVideoDecoder", base::ThreadTaskRunnerHandle::Get());
}
VpxVideoDecoder::MemoryPool::~MemoryPool() {
- base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
- this);
}
VpxVideoDecoder::MemoryPool::VP9FrameBuffer*
@@ -482,7 +478,12 @@ bool VpxVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config) {
g_vpx_offload_thread.Pointer()->RequestOffloadThread();
}
+ DCHECK(!memory_pool_);
memory_pool_ = new MemoryPool();
+ base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
+ memory_pool_.get(), "VpxVideoDecoder",
+ base::ThreadTaskRunnerHandle::Get());
+
if (vpx_codec_set_frame_buffer_functions(vpx_codec_,
&MemoryPool::GetVP9FrameBuffer,
&MemoryPool::ReleaseVP9FrameBuffer,
@@ -511,6 +512,8 @@ void VpxVideoDecoder::CloseDecoder() {
vpx_codec_destroy(vpx_codec_);
delete vpx_codec_;
vpx_codec_ = nullptr;
+ base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
+ memory_pool_.get());
memory_pool_ = nullptr;
}
if (vpx_codec_alpha_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698