OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/media/rtc_video_encoder.h" | 5 #include "content/renderer/media/rtc_video_encoder.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 base::Bind(&RTCVideoEncoder::NotifyError, weak_encoder_, retval)); | 470 base::Bind(&RTCVideoEncoder::NotifyError, weak_encoder_, retval)); |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 RTCVideoEncoder::Impl::~Impl() { DCHECK(!video_encoder_); } | 474 RTCVideoEncoder::Impl::~Impl() { DCHECK(!video_encoder_); } |
475 | 475 |
476 void RTCVideoEncoder::Impl::LogAndNotifyError( | 476 void RTCVideoEncoder::Impl::LogAndNotifyError( |
477 const tracked_objects::Location& location, | 477 const tracked_objects::Location& location, |
478 const std::string& str, | 478 const std::string& str, |
479 media::VideoEncodeAccelerator::Error error) { | 479 media::VideoEncodeAccelerator::Error error) { |
480 static const char* kErrorNames[] = { | 480 static const char* const kErrorNames[] = { |
481 "kIllegalStateError", "kInvalidArgumentError", "kPlatformFailureError"}; | 481 "kIllegalStateError", "kInvalidArgumentError", "kPlatformFailureError"}; |
482 static_assert( | 482 static_assert( |
483 arraysize(kErrorNames) == media::VideoEncodeAccelerator::kErrorMax + 1, | 483 arraysize(kErrorNames) == media::VideoEncodeAccelerator::kErrorMax + 1, |
484 "Different number of errors and textual descriptions"); | 484 "Different number of errors and textual descriptions"); |
485 DLOG(ERROR) << location.ToString() << kErrorNames[error] << " - " << str; | 485 DLOG(ERROR) << location.ToString() << kErrorNames[error] << " - " << str; |
486 NotifyError(error); | 486 NotifyError(error); |
487 } | 487 } |
488 | 488 |
489 void RTCVideoEncoder::Impl::EncodeOneFrame() { | 489 void RTCVideoEncoder::Impl::EncodeOneFrame() { |
490 DVLOG(3) << "Impl::EncodeOneFrame()"; | 490 DVLOG(3) << "Impl::EncodeOneFrame()"; |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", | 806 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", |
807 init_retval == WEBRTC_VIDEO_CODEC_OK); | 807 init_retval == WEBRTC_VIDEO_CODEC_OK); |
808 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { | 808 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { |
809 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", | 809 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", |
810 profile, | 810 profile, |
811 media::VIDEO_CODEC_PROFILE_MAX + 1); | 811 media::VIDEO_CODEC_PROFILE_MAX + 1); |
812 } | 812 } |
813 } | 813 } |
814 | 814 |
815 } // namespace content | 815 } // namespace content |
OLD | NEW |