| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 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::kVideoCodecVP9: |
| 45 return media::VP9PROFILE_MIN; |
| 44 case webrtc::kVideoCodecH264: | 46 case webrtc::kVideoCodecH264: |
| 45 // TODO(magjed): WebRTC is only using Baseline profile for now. Update | 47 // TODO(magjed): WebRTC is only using Baseline profile for now. Update |
| 46 // once http://crbug/webrtc/6337 is fixed. | 48 // once http://crbug/webrtc/6337 is fixed. |
| 47 return media::H264PROFILE_BASELINE; | 49 return media::H264PROFILE_BASELINE; |
| 48 default: | 50 default: |
| 49 NOTREACHED() << "Unrecognized video codec type"; | 51 NOTREACHED() << "Unrecognized video codec type"; |
| 50 return media::VIDEO_CODEC_PROFILE_UNKNOWN; | 52 return media::VIDEO_CODEC_PROFILE_UNKNOWN; |
| 51 } | 53 } |
| 52 } | 54 } |
| 53 | 55 |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", | 882 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoEncoderInitEncodeSuccess", |
| 881 init_retval == WEBRTC_VIDEO_CODEC_OK); | 883 init_retval == WEBRTC_VIDEO_CODEC_OK); |
| 882 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { | 884 if (init_retval == WEBRTC_VIDEO_CODEC_OK) { |
| 883 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", | 885 UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoEncoderProfile", |
| 884 profile, | 886 profile, |
| 885 media::VIDEO_CODEC_PROFILE_MAX + 1); | 887 media::VIDEO_CODEC_PROFILE_MAX + 1); |
| 886 } | 888 } |
| 887 } | 889 } |
| 888 | 890 |
| 889 } // namespace content | 891 } // namespace content |
| OLD | NEW |