summaryrefslogtreecommitdiffstats
path: root/content/renderer/pepper/pepper_video_destination_host.cc
diff options
context:
space:
mode:
authorperkj <perkj@chromium.org>2014-10-09 09:07:13 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-09 16:08:47 +0000
commit49069e124dc1d57b19ffe87c8d324c16f0a2c861 (patch)
tree531c8926875679d65bbca1234d01fb30111ff5ec /content/renderer/pepper/pepper_video_destination_host.cc
parent8fb48317ec49417cf3257af945c6f3ada5c47311 (diff)
downloadchromium_src-49069e124dc1d57b19ffe87c8d324c16f0a2c861.zip
chromium_src-49069e124dc1d57b19ffe87c8d324c16f0a2c861.tar.gz
chromium_src-49069e124dc1d57b19ffe87c8d324c16f0a2c861.tar.bz2
Move VideoDestinationHandler processing to the IO-thread.
This moves reading video frames from shared memory memory received from the pepper effects plugin to the IO thread. Also RGBA color conversion is now done on the IO thread. The purpose of this is to free up processing time on the main render thread. Note that, before this change, the frames from the plugin was posted to the IO thread after the color conversion was done. BUG= 421554 Review URL: https://codereview.chromium.org/631903003 Cr-Commit-Position: refs/heads/master@{#298885}
Diffstat (limited to 'content/renderer/pepper/pepper_video_destination_host.cc')
-rw-r--r--content/renderer/pepper/pepper_video_destination_host.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/content/renderer/pepper/pepper_video_destination_host.cc b/content/renderer/pepper/pepper_video_destination_host.cc
index 5254374..3c2ee23 100644
--- a/content/renderer/pepper/pepper_video_destination_host.cc
+++ b/content/renderer/pepper/pepper_video_destination_host.cc
@@ -50,11 +50,9 @@ int32_t PepperVideoDestinationHost::OnHostMsgOpen(
if (!gurl.is_valid())
return PP_ERROR_BADARGUMENT;
- FrameWriterInterface* frame_writer = NULL;
if (!VideoDestinationHandler::Open(
- NULL /* registry */, gurl.spec(), &frame_writer))
+ NULL /* registry */, gurl.spec(), &frame_writer_))
return PP_ERROR_FAILED;
- frame_writer_.reset(frame_writer);
ReplyMessageContext reply_context = context->MakeReplyMessageContext();
reply_context.params.set_result(PP_OK);
@@ -66,6 +64,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame(
HostMessageContext* context,
const ppapi::HostResource& image_data_resource,
PP_TimeTicks timestamp) {
+ TRACE_EVENT0("video", "PepperVideoDestinationHost::OnHostMsgPutFrame");
ppapi::thunk::EnterResourceNoLock<ppapi::thunk::PPB_ImageData_API> enter(
image_data_resource.host_resource(), true);
if (enter.failed())
@@ -77,7 +76,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame(
image_data_impl->format()))
return PP_ERROR_BADARGUMENT;
- if (!frame_writer_.get())
+ if (frame_writer_.is_null())
return PP_ERROR_FAILED;
// Convert PP_TimeTicks (a double, in seconds) to a TimeDelta (int64,
@@ -87,14 +86,14 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame(
base::Time::FromDoubleT(timestamp) - base::Time();
int64_t timestamp_ns =
time_delta.InMicroseconds() * base::Time::kNanosecondsPerMicrosecond;
- frame_writer_->PutFrame(image_data_impl, timestamp_ns);
+ frame_writer_.Run(image_data_impl, timestamp_ns);
return PP_OK;
}
int32_t PepperVideoDestinationHost::OnHostMsgClose(
HostMessageContext* context) {
- frame_writer_.reset(NULL);
+ frame_writer_.Reset();
return PP_OK;
}