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 |
11 #include "webrtc/media/engine/internalencoderfactory.h" | 11 #include "webrtc/media/engine/internalencoderfactory.h" |
12 | 12 |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | 15 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
17 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" | 17 #include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h" |
18 #include "webrtc/system_wrappers/include/field_trial.h" | 18 #include "webrtc/system_wrappers/include/field_trial.h" |
19 | 19 |
20 namespace cricket { | 20 namespace cricket { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // If this field trial is enabled, the "flexfec-03" codec will be advertised | 24 // If this field trial is enabled, the "flexfec-03" codec will be advertised |
25 // as being supported by the InternalEncoderFactory. This means that | 25 // as being supported by the InternalEncoderFactory. This means that |
26 // "flexfec-03" will appear in the default local SDP, and we therefore need to | 26 // "flexfec-03" will appear in the default SDP offer, and we therefore need to |
27 // be ready to receive FlexFEC packets from the remote. | 27 // be ready to receive FlexFEC packets from the remote. It also means that |
| 28 // FlexFEC SSRCs will be generated by MediaSession and added as "a=ssrc:" and |
| 29 // "a=ssrc-group:" lines in the local SDP. |
28 bool IsFlexfecAdvertisedFieldTrialEnabled() { | 30 bool IsFlexfecAdvertisedFieldTrialEnabled() { |
29 return webrtc::field_trial::FindFullName("WebRTC-FlexFEC-03-Advertised") == | 31 return webrtc::field_trial::IsEnabled("WebRTC-FlexFEC-03-Advertised"); |
30 "Enabled"; | |
31 } | 32 } |
32 | 33 |
33 } // namespace | 34 } // namespace |
34 | 35 |
35 InternalEncoderFactory::InternalEncoderFactory() { | 36 InternalEncoderFactory::InternalEncoderFactory() { |
36 supported_codecs_.push_back(cricket::VideoCodec(kVp8CodecName)); | 37 supported_codecs_.push_back(cricket::VideoCodec(kVp8CodecName)); |
37 if (webrtc::VP9Encoder::IsSupported()) | 38 if (webrtc::VP9Encoder::IsSupported()) |
38 supported_codecs_.push_back(cricket::VideoCodec(kVp9CodecName)); | 39 supported_codecs_.push_back(cricket::VideoCodec(kVp9CodecName)); |
39 if (webrtc::H264Encoder::IsSupported()) { | 40 if (webrtc::H264Encoder::IsSupported()) { |
40 cricket::VideoCodec codec(kH264CodecName); | 41 cricket::VideoCodec codec(kH264CodecName); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 InternalEncoderFactory::supported_codecs() const { | 89 InternalEncoderFactory::supported_codecs() const { |
89 return supported_codecs_; | 90 return supported_codecs_; |
90 } | 91 } |
91 | 92 |
92 void InternalEncoderFactory::DestroyVideoEncoder( | 93 void InternalEncoderFactory::DestroyVideoEncoder( |
93 webrtc::VideoEncoder* encoder) { | 94 webrtc::VideoEncoder* encoder) { |
94 delete encoder; | 95 delete encoder; |
95 } | 96 } |
96 | 97 |
97 } // namespace cricket | 98 } // namespace cricket |
OLD | NEW |