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

Side by Side Diff: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc

Issue 1872393002: Enable VAAPI accelerated decode on Linux Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing JPEG change Created 4 years, 8 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
« no previous file with comments | « no previous file | content/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
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/media/video_capture_gpu_jpeg_decoder.h" 5 #include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 29 matching lines...) Expand all
40 // |gpu_channel_host_| should outlive |decoder_|, so |gpu_channel_host_| 40 // |gpu_channel_host_| should outlive |decoder_|, so |gpu_channel_host_|
41 // must be released after |decoder_| has been destroyed. 41 // must be released after |decoder_| has been destroyed.
42 gpu_channel_host_ = nullptr; 42 gpu_channel_host_ = nullptr;
43 } 43 }
44 44
45 void VideoCaptureGpuJpegDecoder::Initialize() { 45 void VideoCaptureGpuJpegDecoder::Initialize() {
46 DCHECK(CalledOnValidThread()); 46 DCHECK(CalledOnValidThread());
47 47
48 base::AutoLock lock(lock_); 48 base::AutoLock lock(lock_);
49 bool is_platform_supported = false; 49 bool is_platform_supported = false;
50 #if defined(OS_CHROMEOS) 50 #if defined(OS_CHROMEOS) || defined(OS_LINUX)
51 // Non-ChromeOS platforms do not support HW JPEG decode now. Do not establish 51 // Non-Linux platforms do not support HW JPEG decode now. Do not establish
52 // gpu channel to avoid introducing overhead. 52 // gpu channel to avoid introducing overhead.
53 is_platform_supported = true; 53 is_platform_supported = true;
54 #endif 54 #endif
55 55
56 if (!is_platform_supported || 56 if (!is_platform_supported ||
57 base::CommandLine::ForCurrentProcess()->HasSwitch( 57 base::CommandLine::ForCurrentProcess()->HasSwitch(
58 switches::kDisableAcceleratedMjpegDecode)) { 58 switches::kDisableAcceleratedMjpegDecode)) {
59 decoder_status_ = FAILED; 59 decoder_status_ = FAILED;
60 RecordInitDecodeUMA_Locked(); 60 RecordInitDecodeUMA_Locked();
61 return; 61 return;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 lock_.AssertAcquired(); 248 lock_.AssertAcquired();
249 return !decode_done_closure_.is_null(); 249 return !decode_done_closure_.is_null();
250 } 250 }
251 251
252 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { 252 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() {
253 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", 253 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess",
254 decoder_status_ == INIT_PASSED); 254 decoder_status_ == INIT_PASSED);
255 } 255 }
256 256
257 } // namespace content 257 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698