Index: media/gpu/avda_picture_buffer_manager.h |
diff --git a/media/gpu/avda_picture_buffer_manager.h b/media/gpu/avda_picture_buffer_manager.h |
index 3c156fd30df4a219fd72eb9cc56ddb3918ac20cc..b10b6bd61fdb7544c0c48b117b4fbd407b67f014 100644 |
--- a/media/gpu/avda_picture_buffer_manager.h |
+++ b/media/gpu/avda_picture_buffer_manager.h |
@@ -24,6 +24,7 @@ class SurfaceTexture; |
} |
namespace media { |
+class AVDACodecImage; |
class AVDASharedState; |
class VideoCodecBridge; |
@@ -38,14 +39,13 @@ class MEDIA_GPU_EXPORT AVDAPictureBufferManager { |
public: |
using PictureBufferMap = std::map<int32_t, PictureBuffer>; |
- AVDAPictureBufferManager(); |
+ AVDAPictureBufferManager(AVDAStateProvider* state_provider); |
virtual ~AVDAPictureBufferManager(); |
- // Must be called before anything else. If |surface_view_id| is |kNoSurfaceID| |
+ // Must be called before anything else. If |surface_id| is |kNoSurfaceID| |
// then a new SurfaceTexture will be returned. Otherwise, the corresponding |
// SurfaceView will be returned. |
- gl::ScopedJavaSurface Initialize(AVDAStateProvider* state_provider, |
- int surface_view_id); |
+ gl::ScopedJavaSurface Initialize(int surface_id); |
void Destroy(const PictureBufferMap& buffers); |
@@ -81,6 +81,9 @@ class MEDIA_GPU_EXPORT AVDAPictureBufferManager { |
// Whether the pictures buffers are overlayable. |
bool ArePicturesOverlayable(); |
+ // Are there any unrendered picture buffers oustanding? |
+ bool ArePicturesOutstanding() const; |
+ |
private: |
// Release any codec buffer that is associated with the given picture buffer |
// back to the codec. It is okay if there is no such buffer. |
@@ -92,27 +95,28 @@ class MEDIA_GPU_EXPORT AVDAPictureBufferManager { |
// Sets up the texture references (as found by |picture_buffer|), for the |
// specified |image|. If |image| is null, clears any ref on the texture |
// associated with |picture_buffer|. |
- void SetImageForPicture( |
- const PictureBuffer& picture_buffer, |
- const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image); |
+ void SetImageForPicture(const PictureBuffer& picture_buffer, |
+ gpu::gles2::GLStreamTextureImage* image); |
+ |
+ AVDACodecImage* GetImageForPicture(int picture_buffer_id) const; |
scoped_refptr<AVDASharedState> shared_state_; |
- AVDAStateProvider* state_provider_; |
+ AVDAStateProvider* const state_provider_; |
// The SurfaceTexture to render to. Non-null after Initialize() if |
// we're not rendering to a SurfaceView. |
scoped_refptr<gl::SurfaceTexture> surface_texture_; |
- class OnFrameAvailableHandler; |
- scoped_refptr<OnFrameAvailableHandler> on_frame_available_handler_; |
- |
VideoCodecBridge* media_codec_; |
// Picture buffer IDs that are out for display. Stored in order of frames as |
// they are returned from the decoder. |
std::vector<int32_t> pictures_out_for_display_; |
+ // Maps a picture buffer id to a AVDACodecImage. |
+ std::map<int, AVDACodecImage*> codec_images_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AVDAPictureBufferManager); |
}; |