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

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

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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/gpu_video_service_host.cc
diff --git a/content/renderer/gpu/gpu_video_service_host.cc b/content/renderer/gpu/gpu_video_service_host.cc
index 9b3fe2238dfa67c78fad784d6a963a84e50c5593..e2ba13e92b89425742284b4c3c9f8d1505079a8b 100644
--- a/content/renderer/gpu/gpu_video_service_host.cc
+++ b/content/renderer/gpu/gpu_video_service_host.cc
@@ -12,32 +12,24 @@
GpuVideoServiceHost::GpuVideoServiceHost()
scherkus (not reviewing) 2011/06/28 22:02:07 nit: if the object is created/destroyed on same th
Ami GONE FROM CHROMIUM 2011/06/28 22:25:06 Done.
: channel_(NULL),
next_decoder_host_id_(0) {
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
scherkus (not reviewing) 2011/06/28 22:02:07 ditto
Ami GONE FROM CHROMIUM 2011/06/28 22:25:06 Done.
}
GpuVideoServiceHost::~GpuVideoServiceHost() {
}
-void GpuVideoServiceHost::OnFilterAdded(IPC::Channel* channel) {
- base::Closure on_initialized;
- {
- base::AutoLock auto_lock(lock_);
- DCHECK(!channel_);
- channel_ = channel;
- on_initialized = on_initialized_;
- }
- if (!on_initialized.is_null())
- on_initialized.Run();
-}
-
-void GpuVideoServiceHost::OnFilterRemoved() {
- // TODO(hclam): Implement.
-}
-
-void GpuVideoServiceHost::OnChannelClosing() {
- // TODO(hclam): Implement.
+void GpuVideoServiceHost::set_channel(IPC::SyncChannel* channel) {
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
+ DCHECK(!channel_);
+ channel_ = channel;
+ if (!on_initialized_.is_null())
+ on_initialized_.Run();
}
bool GpuVideoServiceHost::OnMessageReceived(const IPC::Message& msg) {
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
+ if (!channel_)
+ return false;
switch (msg.type()) {
case AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed::ID:
case AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers::ID:
@@ -57,25 +49,27 @@ bool GpuVideoServiceHost::OnMessageReceived(const IPC::Message& msg) {
}
}
+void GpuVideoServiceHost::OnChannelError() {
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
+ channel_ = NULL;
+}
+
void GpuVideoServiceHost::SetOnInitialized(
const base::Closure& on_initialized) {
- IPC::Channel* channel;
- {
- base::AutoLock auto_lock(lock_);
- DCHECK(on_initialized_.is_null());
- on_initialized_ = on_initialized;
- channel = channel_;
- }
- if (channel)
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
+ DCHECK(on_initialized_.is_null());
+ on_initialized_ = on_initialized;
+ if (channel_)
on_initialized.Run();
}
GpuVideoDecodeAcceleratorHost* GpuVideoServiceHost::CreateVideoAccelerator(
media::VideoDecodeAccelerator::Client* client,
- int command_buffer_route_id) {
- base::AutoLock auto_lock(lock_);
+ int32 command_buffer_route_id,
+ gpu::CommandBufferHelper* cmd_buffer_helper) {
+ DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current());
DCHECK(channel_);
return new GpuVideoDecodeAcceleratorHost(
&router_, channel_, next_decoder_host_id_++,
- command_buffer_route_id, client);
+ command_buffer_route_id, cmd_buffer_helper, client);
}

Powered by Google App Engine
This is Rietveld 408576698