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

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: . 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
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 b37e787e6716f2132dcf54e6f0a5b3eab147f79e..f10be513d8aa1320ef6b11222522b4626e534cd4 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -104,11 +104,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;
}
@@ -554,14 +549,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)

Powered by Google App Engine
This is Rietveld 408576698