summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2016-03-04 16:31:06 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-05 00:32:31 +0000
commit2ddf3b764c008dfe984af88c247a46815243ce16 (patch)
tree1050db56f2d9a04d7703db67cd510a64e6808372 /content/gpu
parent1f571c732fde129c7f9fdb366dbc7ed513541af1 (diff)
downloadchromium_src-2ddf3b764c008dfe984af88c247a46815243ce16.zip
chromium_src-2ddf3b764c008dfe984af88c247a46815243ce16.tar.gz
chromium_src-2ddf3b764c008dfe984af88c247a46815243ce16.tar.bz2
Decouple Media Service
This CL moves media object creation IPCs into a separate MediaChannel object that lives above GpuChannel. content/gpu (or mus in the future) becomes the layer that lives above both gpu and media and glues the two together. This may not reflect what a hypothetical future mojo interface might look like. If we want to preserve the ordering guarantees we have now, media interfaces should be associated interfaces that branch off a gpu channel and its gpu interfaces. This seems to suggest that gpu should know about media or else there should exist a factory interface that glues both media and gpu as we have here. I don't want to block this CL on long term mojo interface discussions as any direction we choose is just a refactor away. Until then, in the interest of making forward progress, I'd like to assume there exists a layer above both media and gpu. Thoughts? BUG=586384 Committed: https://crrev.com/028d76aa627788a7252fd6de39304f67e00837ab Cr-Commit-Position: refs/heads/master@{#379211} Review URL: https://codereview.chromium.org/1736643005 Cr-Commit-Position: refs/heads/master@{#379411}
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_child_thread.cc9
-rw-r--r--content/gpu/gpu_child_thread.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 74f041f..1bb3df0 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -18,6 +18,7 @@
#include "content/common/gpu/gpu_host_messages.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
+#include "content/common/gpu/media/media_service.h"
#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "content/public/common/content_client.h"
@@ -302,6 +303,7 @@ void GpuChildThread::DidCreateOffscreenContext(const GURL& active_url) {
}
void GpuChildThread::DidDestroyChannel(int client_id) {
+ media_service_->RemoveChannel(client_id);
Send(new GpuHostMsg_DestroyChannel(client_id));
}
@@ -377,6 +379,8 @@ void GpuChildThread::OnInitialize() {
ChildProcess::current()->GetShutDownEvent(),
sync_point_manager_, gpu_memory_buffer_factory_));
+ media_service_.reset(new MediaService(gpu_channel_manager_.get()));
+
#if defined(USE_OZONE)
ui::OzonePlatform::GetInstance()
->GetGpuPlatformSupport()
@@ -565,6 +569,7 @@ void GpuChildThread::OnEstablishChannel(const EstablishChannelParams& params) {
IPC::ChannelHandle channel_handle =
gpu_channel_manager_->EstablishChannel(params);
+ media_service_->AddChannel(params.client_id);
Send(new GpuHostMsg_ChannelEstablished(channel_handle));
}
@@ -601,8 +606,10 @@ void GpuChildThread::OnWakeUpGpu() {
#endif
void GpuChildThread::OnLoseAllContexts() {
- if (gpu_channel_manager_)
+ if (gpu_channel_manager_) {
gpu_channel_manager_->DestroyAllChannels();
+ media_service_->DestroyAllChannels();
+ }
}
void GpuChildThread::BindProcessControlRequest(
diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
index b9aa2b2..ec7d19e 100644
--- a/content/gpu/gpu_child_thread.h
+++ b/content/gpu/gpu_child_thread.h
@@ -41,6 +41,7 @@ namespace content {
class GpuMemoryBufferFactory;
class GpuProcessControlImpl;
class GpuWatchdogThread;
+class MediaService;
// The main thread of the GPU child process. There will only ever be one of
// these per process. It does process initialization and shutdown. It forwards
@@ -152,6 +153,8 @@ class GpuChildThread : public ChildThreadImpl,
scoped_ptr<GpuChannelManager> gpu_channel_manager_;
+ scoped_ptr<MediaService> media_service_;
+
// Information about the GPU, such as device and vendor ID.
gpu::GPUInfo gpu_info_;