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

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

Issue 1767673002: Revert of Decouple Media Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 25380102fdbd0b73e97ca16ecbb02522afb80e84..07d2a1f992999a8fd0768e8d3f37a0db3d2c4fa0 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -23,6 +23,9 @@
#include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/gpu_watchdog.h"
#include "content/common/gpu/image_transport_surface.h"
+#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
+#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
+#include "content/common/gpu/media_messages.h"
#include "content/public/common/content_client.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/mailbox.h"
@@ -39,8 +42,6 @@
#include "gpu/command_buffer/service/transfer_buffer_manager.h"
#include "gpu/command_buffer/service/valuebuffer_manager.h"
#include "ui/gl/gl_bindings.h"
-#include "ui/gl/gl_image.h"
-#include "ui/gl/gl_switches.h"
#if defined(OS_WIN)
#include "base/win/win_util.h"
@@ -307,6 +308,10 @@
OnRegisterTransferBuffer);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyTransferBuffer,
OnDestroyTransferBuffer);
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateVideoDecoder,
+ OnCreateVideoDecoder)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateVideoEncoder,
+ OnCreateVideoEncoder)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncToken,
OnSignalSyncToken)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery,
@@ -328,6 +333,7 @@
base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs));
}
+ DCHECK(handled);
return handled;
}
@@ -867,6 +873,41 @@
scheduler_->PutChanged();
}
+void GpuCommandBufferStub::OnCreateVideoDecoder(
+ const media::VideoDecodeAccelerator::Config& config,
+ int32_t decoder_route_id,
+ IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateVideoDecoder");
+ GpuVideoDecodeAccelerator* decoder = new GpuVideoDecodeAccelerator(
+ decoder_route_id, this, channel_->io_task_runner());
+ bool succeeded = decoder->Initialize(config);
+ GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(reply_message,
+ succeeded);
+ Send(reply_message);
+ // decoder is registered as a DestructionObserver of this stub and will
+ // self-delete during destruction of this stub.
+}
+
+void GpuCommandBufferStub::OnCreateVideoEncoder(
+ media::VideoPixelFormat input_format,
+ const gfx::Size& input_visible_size,
+ media::VideoCodecProfile output_profile,
+ uint32_t initial_bitrate,
+ int32_t encoder_route_id,
+ IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateVideoEncoder");
+ GpuVideoEncodeAccelerator* encoder =
+ new GpuVideoEncodeAccelerator(encoder_route_id, this);
+ bool succeeded = encoder->Initialize(input_format, input_visible_size,
+ output_profile, initial_bitrate);
+ GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(reply_message,
+ succeeded);
+ Send(reply_message);
+
+ // encoder is registered as a DestructionObserver of this stub and will
+ // self-delete during destruction of this stub.
+}
+
void GpuCommandBufferStub::PullTextureUpdates(
gpu::CommandBufferNamespace namespace_id,
gpu::CommandBufferId command_buffer_id,
« 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