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

Unified Diff: content/renderer/media/android/stream_texture_factory.h

Issue 2390783003: Make stream_id internal to StreamTextureHost. (Closed)
Patch Set: Addressed review 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
Index: content/renderer/media/android/stream_texture_factory.h
diff --git a/content/renderer/media/android/stream_texture_factory.h b/content/renderer/media/android/stream_texture_factory.h
index 7ba8cbd134974f2f98a42d2bf89d2db8e0e66159..22b826b4bda4ae3b3cfe7e997a1f21eba93a4dc2 100644
--- a/content/renderer/media/android/stream_texture_factory.h
+++ b/content/renderer/media/android/stream_texture_factory.h
@@ -41,13 +41,27 @@ class StreamTextureProxy : public StreamTextureHost::Listener {
// provided callback will be run on. This can be called on any thread, but
// must be called with the same |task_runner| every time.
void BindToTaskRunner(
- int32_t stream_id,
const base::Closure& received_frame_cb,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
// StreamTextureHost::Listener implementation:
void OnFrameAvailable() override;
+ // Set the streamTexture size.
+ void SetStreamTextureSize(const gfx::Size& size);
+
+ // Send an IPC message to the browser process to request a java surface
+ // object for the given route_id. After the the surface is created,
+ // it will be passed back to the WebMediaPlayerAndroid object identified by
+ // the player_id.
+ void EstablishPeer(int player_id, int frame_id);
+
+ // Sends an IPC to the GPU process.
+ // Asks the StreamTexture to forward its SurfaceTexture to the
+ // ScopedSurfaceRequestManager, using the gpu::ScopedSurfaceRequestConduit.
+ void ForwardStreamTextureForSurfaceRequest(
+ const base::UnguessableToken& request_token);
+
struct Deleter {
inline void operator()(StreamTextureProxy* ptr) const { ptr->Release(); }
};
@@ -55,7 +69,7 @@ class StreamTextureProxy : public StreamTextureHost::Listener {
friend class StreamTextureFactory;
explicit StreamTextureProxy(StreamTextureHost* host);
- void BindOnThread(int32_t stream_id);
+ void BindOnThread();
void Release();
const std::unique_ptr<StreamTextureHost> host_;
@@ -79,30 +93,9 @@ class CONTENT_EXPORT StreamTextureFactory
scoped_refptr<ContextProviderCommandBuffer> context_provider);
// Create the StreamTextureProxy object.
liberato (no reviews please) 2016/10/10 16:46:13 please comment the function args, now that the cal
sivag 2016/10/12 11:25:33 Done.
- StreamTextureProxy* CreateProxy();
-
- // Send an IPC message to the browser process to request a java surface
- // object for the given stream_id. After the the surface is created,
- // it will be passed back to the WebMediaPlayerAndroid object identified by
- // the player_id.
- void EstablishPeer(int32_t stream_id, int player_id, int frame_id);
-
- // Sends an IPC to the GPU process.
- // Asks the StreamTexture to forward its SurfaceTexture to the
- // ScopedSurfaceRequestManager, using the gpu::ScopedSurfaceRequestConduit.
- void ForwardStreamTextureForSurfaceRequest(
- int32_t stream_id,
- const base::UnguessableToken& request_token);
-
- // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the
- // client-side id of the gpu::StreamTexture. The texture is produced into
- // a mailbox so it can be shipped in a VideoFrame.
- unsigned CreateStreamTexture(unsigned texture_target,
- unsigned* texture_id,
- gpu::Mailbox* texture_mailbox);
-
- // Set the streamTexture size for the given stream Id.
- void SetStreamTextureSize(int32_t texture_id, const gfx::Size& size);
+ StreamTextureProxy* CreateProxy(unsigned texture_target,
+ unsigned* texture_id,
+ gpu::Mailbox* texture_mailbox);
gpu::gles2::GLES2Interface* ContextGL();
@@ -111,6 +104,12 @@ class CONTENT_EXPORT StreamTextureFactory
StreamTextureFactory(
scoped_refptr<ContextProviderCommandBuffer> context_provider);
~StreamTextureFactory();
+ // Creates a gpu::StreamTexture and returns its id. Sets |*texture_id| to the
+ // client-side id of the gpu::StreamTexture. The texture is produced into
+ // a mailbox so it can be shipped in a VideoFrame.
+ unsigned CreateStreamTexture(unsigned texture_target,
+ unsigned* texture_id,
+ gpu::Mailbox* texture_mailbox);
scoped_refptr<ContextProviderCommandBuffer> context_provider_;
scoped_refptr<gpu::GpuChannelHost> channel_;

Powered by Google App Engine
This is Rietveld 408576698