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

Unified Diff: content/common/gpu/media/avda_codec_image.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_codec_image.h ('k') | content/common/gpu/media/avda_shared_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/avda_codec_image.cc
diff --git a/content/common/gpu/media/avda_codec_image.cc b/content/common/gpu/media/avda_codec_image.cc
index cd9ec57bcc4ec12ce5daf5dd291be6c914fbc684..7efc0c690bb45c20784fe60ad559271c27a8b162 100644
--- a/content/common/gpu/media/avda_codec_image.cc
+++ b/content/common/gpu/media/avda_codec_image.cc
@@ -21,6 +21,7 @@
namespace content {
AVDACodecImage::AVDACodecImage(
+ int picture_buffer_id,
const scoped_refptr<AVDASharedState>& shared_state,
media::VideoCodecBridge* codec,
const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder,
@@ -31,15 +32,19 @@ AVDACodecImage::AVDACodecImage(
decoder_(decoder),
surface_texture_(surface_texture),
detach_surface_texture_on_destruction_(false),
- texture_(0) {
+ texture_(0),
+ picture_buffer_id_(picture_buffer_id) {
// Default to a sane guess of "flip Y", just in case we can't get
// the matrix on the first call.
memset(gl_matrix_, 0, sizeof(gl_matrix_));
gl_matrix_[0] = gl_matrix_[10] = gl_matrix_[15] = 1.0f;
gl_matrix_[5] = -1.0f;
+ shared_state_->SetImageForPicture(picture_buffer_id_, this);
}
-AVDACodecImage::~AVDACodecImage() {}
+AVDACodecImage::~AVDACodecImage() {
+ shared_state_->SetImageForPicture(picture_buffer_id_, nullptr);
+}
void AVDACodecImage::Destroy(bool have_context) {}
@@ -172,8 +177,9 @@ void AVDACodecImage::SetSize(const gfx::Size& size) {
size_ = size;
}
-void AVDACodecImage::SetMediaCodec(media::MediaCodecBridge* codec) {
+void AVDACodecImage::CodecChanged(media::MediaCodecBridge* codec) {
media_codec_ = codec;
+ codec_buffer_index_ = kInvalidCodecBufferIndex;
}
void AVDACodecImage::SetTexture(gpu::gles2::Texture* texture) {
« no previous file with comments | « content/common/gpu/media/avda_codec_image.h ('k') | content/common/gpu/media/avda_shared_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698