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

Unified Diff: media/gpu/android_video_decode_accelerator.h

Issue 2461073002: Use MediaCodec.setOutputSurface() for fullscreen transitions on M. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/gpu/android_video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/android_video_decode_accelerator.h
diff --git a/media/gpu/android_video_decode_accelerator.h b/media/gpu/android_video_decode_accelerator.h
index c8199a2aae7d7fa670c0dfd6279e61e56b35aaea..2b4d4aefca925dfaab841985ac4adb6c5a3d0532 100644
--- a/media/gpu/android_video_decode_accelerator.h
+++ b/media/gpu/android_video_decode_accelerator.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/optional.h"
#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
@@ -57,6 +58,7 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
void ReusePictureBuffer(int32_t picture_buffer_id) override;
void Flush() override;
void Reset() override;
+ void SetSurface(int32_t surface_id) override;
void Destroy() override;
bool TryToSetupDecodeOnSeparateThread(
const base::WeakPtr<Client>& decode_client,
@@ -277,6 +279,12 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// have safer versions elsewhere.
bool IsMediaCodecSoftwareDecodingForbidden() const;
+ // On platforms which support seamless surface changes, this will reinitialize
+ // the picture buffer manager with the new surface. This function reads and
+ // clears the surface id from |pending_surface_id_|. It will issue a decode
+ // error if the surface change fails. Returns false on failure.
+ bool UpdateSurface();
+
// Used to DCHECK that we are called on the correct thread.
base::ThreadChecker thread_checker_;
@@ -383,6 +391,12 @@ class MEDIA_GPU_EXPORT AndroidVideoDecodeAccelerator
// been defered until the first Decode() call.
bool defer_surface_creation_;
+ // Has a value if a SetSurface() call has occurred and a new surface should be
+ // switched to when possible. Cleared during OnDestroyingSurface() and if all
+ // pictures have been rendered in DequeueOutput().
+ int32_t surface_id_;
+ base::Optional<int32_t> pending_surface_id_;
+
// Copy of the VDA::Config we were given.
Config config_;
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/gpu/android_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698