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

Side by Side Diff: content/renderer/media/gpu/rtc_video_encoder.cc

Issue 2449353003: Stop using webrtc::VideoCodec.codecSpecific (Closed)
Patch Set: Created 4 years, 1 month 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698