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

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: Uses drain with EOS instead of abitrary delay 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 6be34608aae10845336654f356ccd74a1797acf3..3a1608b6b48821e2e87c967d683f13769d56fc04 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.
@@ -224,6 +226,9 @@ void AndroidDeferredRenderingBackingStrategy::ReleaseCodecBufferForPicture(
const media::PictureBuffer& picture_buffer) {
AVDACodecImage* avda_image = GetImageForPicture(picture_buffer);
+ 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();
@@ -243,6 +248,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,
const AndroidVideoDecodeAccelerator::OutputBufferMap& buffers) {

Powered by Google App Engine
This is Rietveld 408576698