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

Side by Side Diff: content/browser/renderer_host/gpu_jpeg_decoder.cc

Issue 1125263005: MJPEG acceleration for V4L2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kcwu's comments Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
wuchengli 2015/06/11 11:08:54 Update the performance number in the change descri
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/gpu_jpeg_decoder.h" 5 #include "content/browser/renderer_host/gpu_jpeg_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
11 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 11 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
12 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h" 12 #include "content/common/gpu/client/gpu_jpeg_decode_accelerator_host.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 #include "media/base/video_frame.h" 14 #include "media/base/video_frame.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 // static 18 // static
19 bool GpuJpegDecoder::Supported() { 19 bool GpuJpegDecoder::Supported() {
20 // A lightweight check for caller to avoid IPC latency for known unsupported 20 // A lightweight check for caller to avoid IPC latency for known unsupported
21 // platform. Initialize() can do the real platform supporting check but it 21 // platform. Initialize() can do the real platform supporting check but it
22 // requires an IPC even for platforms that do not support HW decoder. 22 // requires an IPC even for platforms that do not support HW decoder.
23 // TODO(kcwu): move this information to GpuInfo. 23 // TODO(kcwu): move this information to GpuInfo.
24 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 24 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
25 return true; 25 return true;
26 #elif defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
27 return true;
wuchengli 2015/06/11 11:08:54 Make this a separate CL. Do not enable it directly
henryhsu 2015/06/12 05:47:59 Done.
26 #endif 28 #endif
27 return false; 29 return false;
28 } 30 }
29 31
30 GpuJpegDecoder::GpuJpegDecoder(const DecodeDoneCB& decode_done_cb, 32 GpuJpegDecoder::GpuJpegDecoder(const DecodeDoneCB& decode_done_cb,
31 const ErrorCB& error_cb) 33 const ErrorCB& error_cb)
32 : gpu_channel_event_(false /* manual reset */, 34 : gpu_channel_event_(false /* manual reset */,
33 false /* initially_signaled */), 35 false /* initially_signaled */),
34 decode_done_cb_(decode_done_cb), 36 decode_done_cb_(decode_done_cb),
35 error_cb_(error_cb), 37 error_cb_(error_cb),
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 193
192 { 194 {
193 base::AutoLock lock(lock_); 195 base::AutoLock lock(lock_);
194 decode_done_closure_ = base::Bind( 196 decode_done_closure_ = base::Bind(
195 decode_done_cb_, base::Passed(&out_buffer), out_frame, timestamp); 197 decode_done_cb_, base::Passed(&out_buffer), out_frame, timestamp);
196 } 198 }
197 decoder_->Decode(in_buffer_, out_frame); 199 decoder_->Decode(in_buffer_, out_frame);
198 } 200 }
199 201
200 } // namespace content 202 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/BUILD.gn » ('j') | content/common/gpu/media/jpeg_decode_accelerator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698