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

Unified Diff: content/common/gpu/media/avda_codec_image.h

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
Index: content/common/gpu/media/avda_codec_image.h
diff --git a/content/common/gpu/media/avda_codec_image.h b/content/common/gpu/media/avda_codec_image.h
index 9c8c7f638307c6cff36d6a24a40614b40e4991bc..4fb47f02eba1d6cf2446e6942b7f5056b94b771a 100644
--- a/content/common/gpu/media/avda_codec_image.h
+++ b/content/common/gpu/media/avda_codec_image.h
@@ -23,15 +23,12 @@ namespace content {
// needed in order to draw them.
class AVDACodecImage : public gpu::gles2::GLStreamTextureImage {
public:
- AVDACodecImage(const scoped_refptr<AVDASharedState>&,
+ AVDACodecImage(int picture_buffer_id,
+ const scoped_refptr<AVDASharedState>& shared_state,
media::VideoCodecBridge* codec,
const base::WeakPtr<gpu::gles2::GLES2Decoder>& decoder,
const scoped_refptr<gfx::SurfaceTexture>& surface_texture);
- protected:
- ~AVDACodecImage() override;
-
- public:
// gl::GLImage implementation
void Destroy(bool have_context) override;
gfx::Size GetSize() override;
@@ -53,7 +50,6 @@ class AVDACodecImage : public gpu::gles2::GLStreamTextureImage {
// gpu::gles2::GLStreamTextureMatrix implementation
void GetTextureMatrix(float xform[16]) override;
- public:
// Decoded buffer index that has the image for us to display.
void SetMediaCodecBufferIndex(int buffer_index);
@@ -64,10 +60,14 @@ class AVDACodecImage : public gpu::gles2::GLStreamTextureImage {
// Set the size of the current image.
void SetSize(const gfx::Size& size);
- void SetMediaCodec(media::MediaCodecBridge* codec);
+ // Updates the MediaCodec for this image; clears |codec_buffer_index_|.
+ void CodecChanged(media::MediaCodecBridge* codec);
void SetTexture(gpu::gles2::Texture* texture);
+ protected:
+ ~AVDACodecImage() override;
+
private:
enum { kInvalidCodecBufferIndex = -1 };
@@ -126,6 +126,9 @@ class AVDACodecImage : public gpu::gles2::GLStreamTextureImage {
// Texture matrix of the front buffer of the surface texture.
float gl_matrix_[16];
+ // The picture buffer id attached to this image.
+ int picture_buffer_id_;
+
DISALLOW_COPY_AND_ASSIGN(AVDACodecImage);
};
« no previous file with comments | « content/common/gpu/media/android_video_decode_accelerator.cc ('k') | content/common/gpu/media/avda_codec_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698