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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 7659001: Support multiple HW video decoders per context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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 | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 73d16c6088847bfcfcb848761cba18f083cac5bd..047cfa730535db10a6ae42677eb63d0398075069 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -107,11 +107,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
- // If this message isn't intended for the stub, try to route it to the video
- // decoder.
- if (!handled && video_decoder_.get())
- handled = video_decoder_->OnMessageReceived(message);
-
DCHECK(handled);
return handled;
}
@@ -557,14 +552,19 @@ void GpuCommandBufferStub::ReportState() {
void GpuCommandBufferStub::OnCreateVideoDecoder(
const std::vector<int32>& configs,
IPC::Message* reply_message) {
- video_decoder_.reset(
- new GpuVideoDecodeAccelerator(this, route_id_, this));
- video_decoder_->Initialize(configs, reply_message);
+ int decoder_route_id = channel_->GenerateRouteID();
+ GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(
+ reply_message, decoder_route_id);
+ GpuVideoDecodeAccelerator* decoder =
+ new GpuVideoDecodeAccelerator(this, decoder_route_id, this);
+ video_decoders_.AddWithID(decoder, decoder_route_id);
+ channel_->AddRoute(decoder_route_id, decoder);
+ decoder->Initialize(configs, reply_message);
}
-void GpuCommandBufferStub::OnDestroyVideoDecoder() {
- LOG(ERROR) << "GpuCommandBufferStub::OnDestroyVideoDecoder";
- video_decoder_.reset();
+void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) {
+ channel_->RemoveRoute(decoder_route_id);
+ video_decoders_.Remove(decoder_route_id);
}
#endif // defined(ENABLE_GPU)
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698