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

Unified Diff: content/renderer/gpu/stream_texture_host_android.cc

Issue 2390783003: Make stream_id internal to StreamTextureHost. (Closed)
Patch Set: Handle failure conditions of route_id. 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/gpu/stream_texture_host_android.cc
diff --git a/content/renderer/gpu/stream_texture_host_android.cc b/content/renderer/gpu/stream_texture_host_android.cc
index 208385d4e6f65fcbc3c031691c5658fbc2302510..e03a16dee84a20222268155158f35d56ae766ac0 100644
--- a/content/renderer/gpu/stream_texture_host_android.cc
+++ b/content/renderer/gpu/stream_texture_host_android.cc
@@ -4,6 +4,7 @@
#include "content/renderer/gpu/stream_texture_host_android.h"
+#include "base/unguessable_token.h"
#include "content/renderer/render_thread_impl.h"
#include "gpu/ipc/client/gpu_channel_host.h"
#include "gpu/ipc/common/gpu_messages.h"
@@ -11,8 +12,9 @@
namespace content {
-StreamTextureHost::StreamTextureHost(scoped_refptr<gpu::GpuChannelHost> channel)
- : stream_id_(0),
+StreamTextureHost::StreamTextureHost(scoped_refptr<gpu::GpuChannelHost> channel,
+ int32_t route_id)
+ : route_id_(route_id),
listener_(NULL),
channel_(std::move(channel)),
weak_ptr_factory_(this) {
@@ -20,17 +22,15 @@ StreamTextureHost::StreamTextureHost(scoped_refptr<gpu::GpuChannelHost> channel)
}
StreamTextureHost::~StreamTextureHost() {
- if (channel_.get() && stream_id_)
- channel_->RemoveRoute(stream_id_);
+ if (channel_.get() && route_id_)
+ channel_->RemoveRoute(route_id_);
}
-bool StreamTextureHost::BindToCurrentThread(int32_t stream_id,
- Listener* listener) {
+bool StreamTextureHost::BindToCurrentThread(Listener* listener) {
listener_ = listener;
- if (channel_.get() && stream_id && !stream_id_) {
- stream_id_ = stream_id;
- channel_->AddRoute(stream_id, weak_ptr_factory_.GetWeakPtr());
- channel_->Send(new GpuStreamTextureMsg_StartListening(stream_id));
+ if (channel_.get() && route_id_) {
+ channel_->AddRoute(route_id_, weak_ptr_factory_.GetWeakPtr());
+ channel_->Send(new GpuStreamTextureMsg_StartListening(route_id_));
return true;
}
@@ -56,4 +56,24 @@ void StreamTextureHost::OnFrameAvailable() {
listener_->OnFrameAvailable();
}
+void StreamTextureHost::EstablishPeer(int player_id, int frame_id) {
+ if (route_id_) {
+ channel_->Send(
+ new GpuStreamTextureMsg_EstablishPeer(route_id_, frame_id, player_id));
+ }
+}
+
+void StreamTextureHost::SetStreamTextureSize(const gfx::Size& size) {
+ if (route_id_)
+ channel_->Send(new GpuStreamTextureMsg_SetSize(route_id_, size));
+}
+
+void StreamTextureHost::ForwardStreamTextureForSurfaceRequest(
+ const base::UnguessableToken& request_token) {
+ if (route_id_) {
+ channel_->Send(new GpuStreamTextureMsg_ForwardForSurfaceRequest(
+ route_id_, request_token));
+ }
+}
+
} // namespace content
« no previous file with comments | « content/renderer/gpu/stream_texture_host_android.h ('k') | content/renderer/media/android/stream_texture_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698