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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 supported_codecs_.push_back(cricket::VideoCodec(kUlpfecCodecName)); | 44 supported_codecs_.push_back(cricket::VideoCodec(kUlpfecCodecName)); |
45 } | 45 } |
46 | 46 |
47 InternalEncoderFactory::~InternalEncoderFactory() {} | 47 InternalEncoderFactory::~InternalEncoderFactory() {} |
48 | 48 |
49 // WebRtcVideoEncoderFactory implementation. | 49 // WebRtcVideoEncoderFactory implementation. |
50 webrtc::VideoEncoder* InternalEncoderFactory::CreateVideoEncoder( | 50 webrtc::VideoEncoder* InternalEncoderFactory::CreateVideoEncoder( |
51 const cricket::VideoCodec& codec) { | 51 const cricket::VideoCodec& codec) { |
52 switch (CodecTypeFromName(codec.name)) { | 52 switch (CodecTypeFromName(codec.name)) { |
53 case webrtc::kVideoCodecH264: | 53 case webrtc::kVideoCodecH264: |
54 return webrtc::H264Encoder::Create(); | 54 return webrtc::H264Encoder::Create(codec); |
55 case webrtc::kVideoCodecVP8: | 55 case webrtc::kVideoCodecVP8: |
56 return webrtc::VP8Encoder::Create(); | 56 return webrtc::VP8Encoder::Create(); |
57 case webrtc::kVideoCodecVP9: | 57 case webrtc::kVideoCodecVP9: |
58 return webrtc::VP9Encoder::Create(); | 58 return webrtc::VP9Encoder::Create(); |
59 default: | 59 default: |
60 return nullptr; | 60 return nullptr; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 const std::vector<cricket::VideoCodec>& | 64 const std::vector<cricket::VideoCodec>& |
65 InternalEncoderFactory::supported_codecs() const { | 65 InternalEncoderFactory::supported_codecs() const { |
66 return supported_codecs_; | 66 return supported_codecs_; |
67 } | 67 } |
68 | 68 |
69 void InternalEncoderFactory::DestroyVideoEncoder( | 69 void InternalEncoderFactory::DestroyVideoEncoder( |
70 webrtc::VideoEncoder* encoder) { | 70 webrtc::VideoEncoder* encoder) { |
71 delete encoder; | 71 delete encoder; |
72 } | 72 } |
73 | 73 |
74 } // namespace cricket | 74 } // namespace cricket |
OLD | NEW |