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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2849043002: Send AndroidOverlay routing token from WMPI to AVDA. (Closed)
Patch Set: rebased Created 3 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
« no previous file with comments | « media/base/routing_token_callback.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index c40b0b502fd2f6e9bc9f1df060fa24e18966a2f4..8a6c51b9c487bbc5eb0baaec8cdbe351055fe592 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -27,6 +27,7 @@
#include "build/build_config.h"
#include "media/base/media_observer.h"
#include "media/base/media_tracks.h"
+#include "media/base/overlay_info.h"
#include "media/base/pipeline_impl.h"
#include "media/base/renderer_factory_selector.h"
#include "media/base/surface_manager.h"
@@ -254,6 +255,14 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
void EnableOverlay();
void DisableOverlay();
+ // Do we have overlay information? For CVV, this is a surface id. For
+ // AndroidOverlay, this is the routing token.
+ bool HaveOverlayInfo();
+
+ // Send the overlay surface ID / routing token to the decoder if we have it
+ // and if it has been requested.
+ void MaybeSendOverlayInfoToDecoder();
+
void OnPipelineSuspended();
void OnBeforePipelineResume();
void OnPipelineResumed();
@@ -291,10 +300,14 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Called by SurfaceManager when a surface is created.
void OnSurfaceCreated(int surface_id);
+ // Called by RenderFrameImpl with the overlay routing token, if we request it.
+ void OnOverlayRoutingToken(const base::UnguessableToken& token);
+
// Called by GpuVideoDecoder on Android to request a surface to render to (if
// necessary).
- void OnSurfaceRequested(bool decoder_requires_restart_for_overlay,
- const SurfaceCreatedCB& surface_created_cb);
+ void OnOverlayInfoRequested(
+ bool decoder_requires_restart_for_overlay,
+ const ProvideOverlayInfoCB& provide_overlay_info_cb);
// Creates a Renderer via the |renderer_factory_selector_|.
std::unique_ptr<Renderer> CreateRenderer();
@@ -646,11 +659,15 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// request to the SurfaceManager.
base::Optional<int> overlay_surface_id_;
- // If a surface is requested before it's finished being created, the request
- // is saved and satisfied once the surface is available. If the decoder does
- // not require restart to change surfaces, this is callback is kept until
- // cleared by the decoder.
- SurfaceCreatedCB set_surface_cb_;
+ // For canceling AndroidOverlay routing token requests.
+ base::CancelableCallback<void(const base::UnguessableToken&)>
+ token_available_cb_;
+
+ // If overlay info is requested before we have it, then the request is saved
+ // and satisfied once the overlay info is available. If the decoder does not
+ // require restart to change surfaces, this is callback is kept until cleared
+ // by the decoder.
+ ProvideOverlayInfoCB provide_overlay_info_cb_;
// On Android an overlay surface means using
// SurfaceView instead of SurfaceTexture.
@@ -658,10 +675,6 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Use overlays for all video.
bool force_video_overlays_;
- // Use overlays for fullscreen video.
- // (Implied if |force_video_overlays_| is true.)
- bool enable_fullscreen_video_overlays_;
-
// Suppresses calls to OnPipelineError() after destruction / shutdown has been
// started; prevents us from spuriously logging errors that are transient or
// unimportant.
@@ -746,6 +759,28 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
bool initial_video_height_recorded_ = false;
+ enum class OverlayMode {
+ // All overlays are turned off.
+ kNoOverlays,
+
+ // Use ContentVideoView for overlays.
+ kUseContentVideoView,
+
+ // Use AndroidOverlay for overlays.
+ kUseAndroidOverlay,
+ };
+
+ OverlayMode overlay_mode_ = OverlayMode::kNoOverlays;
+
+ // Optional callback to request the routing token for AndroidOverlay.
+ RequestRoutingTokenCallback request_routing_token_cb_;
+
+ // Routing token, if we have one. No value if we have a request pending to
+ // get it via |request_routing_token_cb_|. A has_value() is_empty() token
+ // indicates that we requested and received an empty token. Note that we
+ // can't send an empty token via IPC, so we handle that specially.
+ base::Optional<base::UnguessableToken> overlay_routing_token_;
+
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
};
« no previous file with comments | « media/base/routing_token_callback.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698