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

Unified Diff: content/common/gpu/media/avda_shared_state.cc

Issue 1910063005: Store AVDACodecImage list in shared state, cleanup callers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 4 years, 8 months 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 | « content/common/gpu/media/avda_shared_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/avda_shared_state.cc
diff --git a/content/common/gpu/media/avda_shared_state.cc b/content/common/gpu/media/avda_shared_state.cc
index 7746254fee94c3ecdc1f3bc7d787998d097850f3..f55a3b0278e698e6a2bfba0921b1a159affd2582 100644
--- a/content/common/gpu/media/avda_shared_state.cc
+++ b/content/common/gpu/media/avda_shared_state.cc
@@ -5,6 +5,7 @@
#include "content/common/gpu/media/avda_shared_state.h"
#include "base/time/time.h"
+#include "content/common/gpu/media/avda_codec_image.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/scoped_make_current.h"
@@ -43,4 +44,27 @@ void AVDASharedState::DidDetachSurfaceTexture() {
surface_texture_is_attached_ = false;
}
+void AVDASharedState::CodecChanged(media::MediaCodecBridge* codec) {
+ for (auto& image_kv : codec_images_)
+ image_kv.second->CodecChanged(codec);
+}
+
+void AVDASharedState::SetImageForPicture(int picture_buffer_id,
+ AVDACodecImage* image) {
+ if (!image) {
+ DCHECK(codec_images_.find(picture_buffer_id) != codec_images_.end());
+ codec_images_.erase(picture_buffer_id);
+ return;
+ }
+
+ DCHECK(codec_images_.find(picture_buffer_id) == codec_images_.end());
+ codec_images_[picture_buffer_id] = image;
+}
+
+AVDACodecImage* AVDASharedState::GetImageForPicture(
+ int picture_buffer_id) const {
+ auto it = codec_images_.find(picture_buffer_id);
+ return it == codec_images_.end() ? nullptr : it->second;
+}
+
} // namespace content
« no previous file with comments | « content/common/gpu/media/avda_shared_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698