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

Side by Side Diff: content/common/gpu/media/vaapi_video_encode_accelerator.cc

Issue 597473002: Change log level to show real errors in release mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Pawel's review comments Created 6 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/common/gpu/media/vaapi_video_encode_accelerator.h" 5 #include "content/common/gpu/media/vaapi_video_encode_accelerator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/numerics/safe_conversions.h" 12 #include "base/numerics/safe_conversions.h"
13 #include "content/common/gpu/media/h264_dpb.h" 13 #include "content/common/gpu/media/h264_dpb.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "media/base/bind_to_current_loop.h" 15 #include "media/base/bind_to_current_loop.h"
16 #include "third_party/libva/va/va_enc_h264.h" 16 #include "third_party/libva/va/va_enc_h264.h"
17 17
18 #define DVLOGF(level) DVLOG(level) << __FUNCTION__ << "(): " 18 #define DVLOGF(level) DVLOG(level) << __FUNCTION__ << "(): "
19 19
20 #define NOTIFY_ERROR(error, msg) \ 20 #define NOTIFY_ERROR(error, msg) \
21 do { \ 21 do { \
22 SetState(kError); \ 22 SetState(kError); \
23 DVLOGF(1) << msg; \ 23 LOG(ERROR) << msg; \
24 DVLOGF(1) << "Calling NotifyError(" << error << ")"; \ 24 LOG(ERROR) << "Calling NotifyError(" << error << ")";\
25 NotifyError(error); \ 25 NotifyError(error); \
26 } while (0) 26 } while (0)
27 27
28 namespace content { 28 namespace content {
29 29
30 namespace { 30 namespace {
31 // Need 2 surfaces for each frame: one for input data and one for 31 // Need 2 surfaces for each frame: one for input data and one for
32 // reconstructed picture, which is later used for reference. 32 // reconstructed picture, which is later used for reference.
33 const size_t kMinSurfacesToEncode = 2; 33 const size_t kMinSurfacesToEncode = 2;
34 34
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 mb_height_ = coded_size_.height() / 16; 215 mb_height_ = coded_size_.height() / 16;
216 output_buffer_byte_size_ = coded_size_.GetArea(); 216 output_buffer_byte_size_ = coded_size_.GetArea();
217 217
218 UpdateRates(initial_bitrate, kDefaultFramerate); 218 UpdateRates(initial_bitrate, kDefaultFramerate);
219 219
220 vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kEncode, 220 vaapi_wrapper_ = VaapiWrapper::Create(VaapiWrapper::kEncode,
221 output_profile, 221 output_profile,
222 x_display_, 222 x_display_,
223 base::Bind(&ReportToUMA, VAAPI_ERROR)); 223 base::Bind(&ReportToUMA, VAAPI_ERROR));
224 if (!vaapi_wrapper_) { 224 if (!vaapi_wrapper_) {
225 DVLOGF(1) << "Failed initializing VAAPI"; 225 LOG(ERROR) << "Failed initializing VAAPI";
226 return false; 226 return false;
227 } 227 }
228 228
229 if (!encoder_thread_.Start()) { 229 if (!encoder_thread_.Start()) {
230 DVLOGF(1) << "Failed to start encoder thread"; 230 LOG(ERROR) << "Failed to start encoder thread";
231 return false; 231 return false;
232 } 232 }
233 encoder_thread_proxy_ = encoder_thread_.message_loop_proxy(); 233 encoder_thread_proxy_ = encoder_thread_.message_loop_proxy();
234 234
235 // Finish the remaining initialization on the encoder thread. 235 // Finish the remaining initialization on the encoder thread.
236 encoder_thread_proxy_->PostTask( 236 encoder_thread_proxy_->PostTask(
237 FROM_HERE, 237 FROM_HERE,
238 base::Bind(&VaapiVideoEncodeAccelerator::InitializeTask, 238 base::Bind(&VaapiVideoEncodeAccelerator::InitializeTask,
239 base::Unretained(this))); 239 base::Unretained(this)));
240 240
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1061 }
1062 1062
1063 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob() 1063 VaapiVideoEncodeAccelerator::EncodeJob::EncodeJob()
1064 : coded_buffer(VA_INVALID_ID), keyframe(false) { 1064 : coded_buffer(VA_INVALID_ID), keyframe(false) {
1065 } 1065 }
1066 1066
1067 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() { 1067 VaapiVideoEncodeAccelerator::EncodeJob::~EncodeJob() {
1068 } 1068 }
1069 1069
1070 } // namespace content 1070 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698