OLD | NEW |
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 Loading... |
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 |
OLD | NEW |