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

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

Issue 22875014: Merge 217276 "Add media::VideoEncodeAccelerator with WebRTC inte..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1599/src/
Patch Set: Created 7 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_channel.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_channel.cc
===================================================================
--- content/common/gpu/gpu_channel.cc (revision 217687)
+++ content/common/gpu/gpu_channel.cc (working copy)
@@ -20,6 +20,7 @@
#include "base/timer/timer.h"
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
#include "content/common/gpu/sync_point_manager.h"
#include "content/public/common/content_switches.h"
#include "crypto/hmac.h"
@@ -754,9 +755,12 @@
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg)
IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer,
- OnCreateOffscreenCommandBuffer)
+ OnCreateOffscreenCommandBuffer)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
- OnDestroyCommandBuffer)
+ OnDestroyCommandBuffer)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateVideoEncoder, OnCreateVideoEncoder)
+ IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoEncoder,
+ OnDestroyVideoEncoder)
#if defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(GpuChannelMsg_RegisterStreamTextureProxy,
OnRegisterStreamTextureProxy)
@@ -899,6 +903,26 @@
}
}
+void GpuChannel::OnCreateVideoEncoder(int32* route_id) {
+ TRACE_EVENT0("gpu", "GpuChannel::OnCreateVideoEncoder");
+
+ *route_id = GenerateRouteID();
+ GpuVideoEncodeAccelerator* encoder =
+ new GpuVideoEncodeAccelerator(this, *route_id);
+ router_.AddRoute(*route_id, encoder);
+ video_encoders_.AddWithID(encoder, *route_id);
+}
+
+void GpuChannel::OnDestroyVideoEncoder(int32 route_id) {
+ TRACE_EVENT1(
+ "gpu", "GpuChannel::OnDestroyVideoEncoder", "route_id", route_id);
+ GpuVideoEncodeAccelerator* encoder = video_encoders_.Lookup(route_id);
+ if (!encoder)
+ return;
+ router_.RemoveRoute(route_id);
+ video_encoders_.Remove(route_id);
+}
+
#if defined(OS_ANDROID)
void GpuChannel::OnRegisterStreamTextureProxy(
int32 stream_id, int32* route_id) {
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698