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

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

Issue 1910063005: Store AVDACodecImage list in shared state, cleanup callers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: It lives! 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_shared_state.h
diff --git a/content/common/gpu/media/avda_shared_state.h b/content/common/gpu/media/avda_shared_state.h
index 5f80c44d72933c3e8be76898694f852e21a9aa71..f431d49987798a7200cb851155b5263c0eb5630b 100644
--- a/content/common/gpu/media/avda_shared_state.h
+++ b/content/common/gpu/media/avda_shared_state.h
@@ -17,7 +17,12 @@ namespace gfx {
class SurfaceTexture;
}
+namespace media {
+class MediaCodecBridge;
+}
+
namespace content {
+class AVDACodecImage;
// Shared state to allow communication between the AVDA and the
// GLImages that configure GL for drawing the frames.
@@ -50,6 +55,16 @@ class AVDASharedState : public base::RefCounted<AVDASharedState> {
return surface_texture_is_attached_;
}
+ // Iterates over all known codec images and updates the MediaCodec attached to
+ // each one.
+ void CodecChanged(media::MediaCodecBridge* codec);
+
+ // Methods for finding and updating the AVDACodecImage associated with a given
+ // picture buffer id. GetImageForPicture() will return null for unknown ids.
+ void SetImageForPicture(int picture_buffer_id, AVDACodecImage* image);
+ AVDACodecImage* GetImageForPicture(int picture_buffer_id) const;
+ void EraseImage(const AVDACodecImage* image);
+
// TODO(liberato): move the surface texture here and make these calls
// attach / detach it also. There are several changes going on in avda
// concurrently, so I don't want to change that until the dust settles.
@@ -64,7 +79,12 @@ class AVDASharedState : public base::RefCounted<AVDASharedState> {
// will cause us to forget the last binding.
void DidDetachSurfaceTexture();
+ protected:
+ virtual ~AVDASharedState();
+
private:
+ friend class base::RefCounted<AVDASharedState>;
+
// Platform gl texture Id for |surface_texture_|. This will be zero if
// and only if |texture_owner_| is null.
// TODO(liberato): This should be GLuint, but we don't seem to have the type.
@@ -81,11 +101,10 @@ class AVDASharedState : public base::RefCounted<AVDASharedState> {
scoped_refptr<gfx::GLContext> context_;
scoped_refptr<gfx::GLSurface> surface_;
- protected:
- virtual ~AVDASharedState();
+ // Maps a picture buffer id to a AVDACodecImage.
+ std::map<int, AVDACodecImage*> codec_images_;
- private:
- friend class base::RefCounted<AVDASharedState>;
+ DISALLOW_COPY_AND_ASSIGN(AVDASharedState);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698