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

Side by Side Diff: webrtc/media/engine/internalencoderfactory.cc

Issue 2474993002: Pass selected cricket::VideoCodec down to internal H264 encoder (Closed)
Patch Set: Fix includes. Created 4 years 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
« no previous file with comments | « no previous file | webrtc/modules/BUILD.gn » ('j') | webrtc/video/video_quality_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 InternalEncoderFactory::~InternalEncoderFactory() {} 62 InternalEncoderFactory::~InternalEncoderFactory() {}
63 63
64 // WebRtcVideoEncoderFactory implementation. 64 // WebRtcVideoEncoderFactory implementation.
65 webrtc::VideoEncoder* InternalEncoderFactory::CreateVideoEncoder( 65 webrtc::VideoEncoder* InternalEncoderFactory::CreateVideoEncoder(
66 const cricket::VideoCodec& codec) { 66 const cricket::VideoCodec& codec) {
67 const webrtc::VideoCodecType codec_type = 67 const webrtc::VideoCodecType codec_type =
68 webrtc::PayloadNameToCodecType(codec.name) 68 webrtc::PayloadNameToCodecType(codec.name)
69 .value_or(webrtc::kVideoCodecUnknown); 69 .value_or(webrtc::kVideoCodecUnknown);
70 switch (codec_type) { 70 switch (codec_type) {
71 case webrtc::kVideoCodecH264: 71 case webrtc::kVideoCodecH264:
72 return webrtc::H264Encoder::Create(); 72 return webrtc::H264Encoder::Create(codec);
73 case webrtc::kVideoCodecVP8: 73 case webrtc::kVideoCodecVP8:
74 return webrtc::VP8Encoder::Create(); 74 return webrtc::VP8Encoder::Create();
75 case webrtc::kVideoCodecVP9: 75 case webrtc::kVideoCodecVP9:
76 return webrtc::VP9Encoder::Create(); 76 return webrtc::VP9Encoder::Create();
77 default: 77 default:
78 return nullptr; 78 return nullptr;
79 } 79 }
80 } 80 }
81 81
82 const std::vector<cricket::VideoCodec>& 82 const std::vector<cricket::VideoCodec>&
83 InternalEncoderFactory::supported_codecs() const { 83 InternalEncoderFactory::supported_codecs() const {
84 return supported_codecs_; 84 return supported_codecs_;
85 } 85 }
86 86
87 void InternalEncoderFactory::DestroyVideoEncoder( 87 void InternalEncoderFactory::DestroyVideoEncoder(
88 webrtc::VideoEncoder* encoder) { 88 webrtc::VideoEncoder* encoder) {
89 delete encoder; 89 delete encoder;
90 } 90 }
91 91
92 } // namespace cricket 92 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/BUILD.gn » ('j') | webrtc/video/video_quality_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698