| 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/gpu/rtc_video_encoder.h" | 5 #include "content/renderer/media/gpu/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 24 matching lines...) Expand all Loading... |
| 35 // Translate from webrtc::VideoCodecType and webrtc::VideoCodec to | 35 // Translate from webrtc::VideoCodecType and webrtc::VideoCodec to |
| 36 // media::VideoCodecProfile. | 36 // media::VideoCodecProfile. |
| 37 media::VideoCodecProfile WebRTCVideoCodecToVideoCodecProfile( | 37 media::VideoCodecProfile WebRTCVideoCodecToVideoCodecProfile( |
| 38 webrtc::VideoCodecType type, | 38 webrtc::VideoCodecType type, |
| 39 const webrtc::VideoCodec* codec_settings) { | 39 const webrtc::VideoCodec* codec_settings) { |
| 40 DCHECK_EQ(type, codec_settings->codecType); | 40 DCHECK_EQ(type, codec_settings->codecType); |
| 41 switch (type) { | 41 switch (type) { |
| 42 case webrtc::kVideoCodecVP8: | 42 case webrtc::kVideoCodecVP8: |
| 43 return media::VP8PROFILE_ANY; | 43 return media::VP8PROFILE_ANY; |
| 44 case webrtc::kVideoCodecH264: { | 44 case webrtc::kVideoCodecH264: { |
| 45 switch (codec_settings->codecSpecific.H264.profile) { | 45 switch (codec_settings->H264().profile) { |
| 46 case webrtc::kProfileBase: | 46 case webrtc::kProfileBase: |
| 47 return media::H264PROFILE_BASELINE; | 47 return media::H264PROFILE_BASELINE; |
| 48 case webrtc::kProfileMain: | 48 case webrtc::kProfileMain: |
| 49 return media::H264PROFILE_MAIN; | 49 return media::H264PROFILE_MAIN; |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 default: | 52 default: |
| 53 NOTREACHED() << "Unrecognized video codec type"; | 53 NOTREACHED() << "Unrecognized video codec type"; |
| 54 return media::VIDEO_CODEC_PROFILE_UNKNOWN; | 54 return media::VIDEO_CODEC_PROFILE_UNKNOWN; |
| 55 } | 55 } |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", | 884 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", |
| 885 init_retval == WEBRTC_VIDEO_CODEC_OK); | 885 init_retval == WEBRTC_VIDEO_CODEC_OK); |
| 886 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { | 886 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { |
| 887 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", | 887 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", |
| 888 profile, | 888 profile, |
| 889 media::VIDEO_CODEC_PROFILE_MAX + 1); | 889 media::VIDEO_CODEC_PROFILE_MAX + 1); |
| 890 } | 890 } |
| 891 } | 891 } |
| 892 | 892 |
| 893 } // namespace content | 893 } // namespace content |
| OLD | NEW |