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

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

Issue 1963773003: Merge to M51: Various fixes to prevent playback hang on MotoX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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/android_deferred_rendering_backing_strategy.h
diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.h b/content/common/gpu/media/android_deferred_rendering_backing_strategy.h
index 733b25b0a45a7685449bdb4cb00e2b4b3a45267e..def6edb70c0bb71565c842770531bbed76ffdb05 100644
--- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.h
+++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.h
@@ -6,6 +6,7 @@
#define CONTENT_COMMON_GPU_MEDIA_ANDROID_DEFERRED_RENDERING_BACKING_STRATEGY_H_
#include <stdint.h>
+#include <vector>
#include "base/macros.h"
#include "content/common/content_export.h"
@@ -40,18 +41,22 @@ class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy
// AndroidVideoDecodeAccelerator::BackingStrategy
gfx::ScopedJavaSurface Initialize(int surface_view_id) override;
- void Cleanup(bool have_context,
- const AndroidVideoDecodeAccelerator::OutputBufferMap&) override;
+ void Cleanup(
+ bool have_context,
+ const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override;
scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture() const override;
uint32_t GetTextureTarget() const override;
gfx::Size GetPictureBufferSize() const override;
- void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index,
- const media::PictureBuffer&) override;
+ void UseCodecBufferForPictureBuffer(
+ int32_t codec_buffer_index,
+ const media::PictureBuffer& picture_buffer) override;
void AssignOnePictureBuffer(const media::PictureBuffer&, bool) override;
- void ReuseOnePictureBuffer(const media::PictureBuffer&) override;
- void CodecChanged(
- media::VideoCodecBridge*,
- const AndroidVideoDecodeAccelerator::OutputBufferMap&) override;
+ void ReuseOnePictureBuffer(
+ const media::PictureBuffer& picture_buffer) override;
+ void MaybeRenderEarly() override;
+ void CodecChanged(media::VideoCodecBridge* codec) override;
+ void ReleaseCodecBuffers(
+ const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) override;
void OnFrameAvailable() override;
bool ArePicturesOverlayable() override;
void UpdatePictureBufferSize(media::PictureBuffer* picture_buffer,
@@ -62,8 +67,9 @@ class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy
// back to the codec. It is okay if there is no such buffer.
void ReleaseCodecBufferForPicture(const media::PictureBuffer& picture_buffer);
- // Return the AVDACodecImage for a given PictureBuffer's texture.
- AVDACodecImage* GetImageForPicture(const media::PictureBuffer&);
+ // 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 media::PictureBuffer& picture_buffer,
const scoped_refptr<gpu::gles2::GLStreamTextureImage>& image);
@@ -93,6 +99,10 @@ class CONTENT_EXPORT AndroidDeferredRenderingBackingStrategy
media::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_;
+
DISALLOW_COPY_AND_ASSIGN(AndroidDeferredRenderingBackingStrategy);
};

Powered by Google App Engine
This is Rietveld 408576698