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

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

Issue 1892013002: ReleaseOutputBuffer to surface back and front buffers where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanerer. 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/android_video_decode_accelerator.h
diff --git a/content/common/gpu/media/android_video_decode_accelerator.h b/content/common/gpu/media/android_video_decode_accelerator.h
index 9e0d8ab9546e02b2818074abe01c6e3af95fb9c9..5c0af106c9b99a66509abece354069046bca1413 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.h
+++ b/content/common/gpu/media/android_video_decode_accelerator.h
@@ -76,7 +76,8 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
// the decoded output buffer at codec_buffer_index.
virtual void UseCodecBufferForPictureBuffer(
int32_t codec_buffer_index,
- const media::PictureBuffer& picture_buffer) = 0;
+ const media::PictureBuffer& picture_buffer,
+ const std::vector<int32_t>& pictures_out_for_display) = 0;
liberato (no reviews please) 2016/04/22 00:51:05 couldn't pictures_out_for_display be an implementa
DaleCurtis 2016/04/22 01:33:58 Great suggestion. Done.
// Notify strategy that a picture buffer has been assigned.
virtual void AssignOnePictureBuffer(
@@ -85,7 +86,12 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
// Notify strategy that a picture buffer has been reused.
virtual void ReuseOnePictureBuffer(
- const media::PictureBuffer& picture_buffer) {}
+ const media::PictureBuffer& picture_buffer,
+ const std::vector<int32_t>& pictures_out_for_display) {}
+
+ // Attempts to free up codec output buffers by rendering early.
+ virtual void MaybeRenderEarly(
+ const std::vector<int32_t>& pictures_out_for_display) {}
// Notify strategy that we have a new android MediaCodec instance. This
// happens when we're starting up or re-configuring mid-stream. Any
@@ -317,6 +323,10 @@ class CONTENT_EXPORT AndroidVideoDecodeAccelerator
// decoded frames to the client.
std::queue<int32_t> free_picture_ids_;
+ // 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_;
+
// The low-level decoder which Android SDK provides.
std::unique_ptr<media::VideoCodecBridge> media_codec_;

Powered by Google App Engine
This is Rietveld 408576698