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

Unified Diff: content/browser/media/android/media_player_renderer.h

Issue 2282633002: Integrate Surface requests with MediaPlayerRenderer (Closed)
Patch Set: Addressed last comments Created 4 years, 2 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 | « no previous file | content/browser/media/android/media_player_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/media_player_renderer.h
diff --git a/content/browser/media/android/media_player_renderer.h b/content/browser/media/android/media_player_renderer.h
index 4a95c36935da3112dbc00c41e486ee6a7d816a71..bd27299df1bd9afe748365769f8f336b04af4e8b 100644
--- a/content/browser/media/android/media_player_renderer.h
+++ b/content/browser/media/android/media_player_renderer.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/unguessable_token.h"
#include "content/common/content_export.h"
#include "content/public/browser/render_frame_host.h"
#include "media/base/android/media_player_bridge.h"
@@ -84,10 +85,24 @@ class CONTENT_EXPORT MediaPlayerRenderer : public media::Renderer,
base::TimeDelta duration,
bool has_audio) override;
+ // Registers a request in the content::ScopedSurfaceRequestManager, and
+ // returns the token associated to the request. The token can then be used to
+ // complete the request via the gpu::ScopedSurfaceRequestConduit.
+ // A completed request will call back to OnScopedSurfaceRequestCompleted().
+ //
+ // NOTE: If a request is already pending, calling this method again will
+ // safely cancel the pending request before registering a new one.
+ base::UnguessableToken InitiateScopedSurfaceRequest();
+ void OnScopedSurfaceRequestCompleted(gl::ScopedJavaSurface surface);
+
private:
// Used when creating |media_player_|.
void OnDecoderResourcesReleased(int player_id);
+ // Cancels the pending request started by InitiateScopedSurfaceRequest(), if
+ // it exists. No-ops otherwise.
+ void CancelScopedSurfaceRequest();
+
RenderFrameHost* render_frame_host_;
media::RendererClient* renderer_client_;
@@ -101,6 +116,8 @@ class CONTENT_EXPORT MediaPlayerRenderer : public media::Renderer,
gfx::Size video_size_;
+ base::UnguessableToken surface_request_token_;
+
std::unique_ptr<media::MediaResourceGetter> media_resource_getter_;
// NOTE: Weak pointers must be invalidated before all other member variables.
« no previous file with comments | « no previous file | content/browser/media/android/media_player_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698