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

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

Issue 1862303002: Delay actual flush and reset in AVDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kept OUTPUT_FORMAT_CHANGED processing while draining, rebased 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_deferred_rendering_backing_strategy.cc
diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
index 77cdf7ee2bfef4e46a5aa874fb81b9a8729c02d9..14b0243acd2e79b89c75120a9e617e859a66dffd 100644
--- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
+++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
@@ -79,8 +79,10 @@ void AndroidDeferredRenderingBackingStrategy::Cleanup(
// Make sure that no PictureBuffer textures refer to the SurfaceTexture or to
// the service_id that we created for it.
- for (const std::pair<int, media::PictureBuffer>& entry : buffers)
+ for (const std::pair<int, media::PictureBuffer>& entry : buffers) {
+ ReleaseCodecBufferForPicture(entry.second);
SetImageForPicture(entry.second, nullptr);
+ }
// If we're rendering to a SurfaceTexture we can make a copy of the current
// front buffer so that the PictureBuffer textures are still valid.
@@ -217,6 +219,9 @@ void AndroidDeferredRenderingBackingStrategy::ReleaseCodecBufferForPicture(
shared_state_->GetImageForPicture(picture_buffer.id());
RETURN_IF_NULL(avda_image);
+ if (!avda_image)
+ return;
+
// See if there is a media codec buffer still attached to this image.
const int32_t codec_buffer = avda_image->GetMediaCodecBufferIndex();
@@ -236,6 +241,12 @@ void AndroidDeferredRenderingBackingStrategy::ReuseOnePictureBuffer(
ReleaseCodecBufferForPicture(picture_buffer);
}
+void AndroidDeferredRenderingBackingStrategy::ReleaseCodecBuffers(
+ const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) {
+ for (const std::pair<int, media::PictureBuffer>& entry : buffers)
+ ReleaseCodecBufferForPicture(entry.second);
+}
+
void AndroidDeferredRenderingBackingStrategy::CodecChanged(
media::VideoCodecBridge* codec) {
media_codec_ = codec;

Powered by Google App Engine
This is Rietveld 408576698