OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 #ifndef MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ | 11 #ifndef MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |
12 #define MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ | 12 #define MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "call/call.h" | 17 #include "call/call.h" |
18 #include "media/base/mediaengine.h" | 18 #include "media/base/mediaengine.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 class AudioDecoderFactory; | 21 class AudioDecoderFactory; |
22 class AudioDeviceModule; | 22 class AudioDeviceModule; |
23 class AudioMixer; | 23 class AudioMixer; |
24 class AudioProcessing; | 24 class AudioProcessing; |
| 25 class VideoDecoderFactory; |
| 26 class VideoEncoderFactory; |
25 } | 27 } |
26 namespace cricket { | 28 namespace cricket { |
27 class WebRtcVideoDecoderFactory; | 29 class WebRtcVideoDecoderFactory; |
28 class WebRtcVideoEncoderFactory; | 30 class WebRtcVideoEncoderFactory; |
29 } | 31 } |
30 | 32 |
31 namespace cricket { | 33 namespace cricket { |
32 | 34 |
33 class WebRtcMediaEngineFactory { | 35 class WebRtcMediaEngineFactory { |
34 public: | 36 public: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 static MediaEngineInterface* Create( | 76 static MediaEngineInterface* Create( |
75 webrtc::AudioDeviceModule* adm, | 77 webrtc::AudioDeviceModule* adm, |
76 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& | 78 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>& |
77 audio_encoder_factory, | 79 audio_encoder_factory, |
78 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& | 80 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
79 audio_decoder_factory, | 81 audio_decoder_factory, |
80 WebRtcVideoEncoderFactory* video_encoder_factory, | 82 WebRtcVideoEncoderFactory* video_encoder_factory, |
81 WebRtcVideoDecoderFactory* video_decoder_factory, | 83 WebRtcVideoDecoderFactory* video_decoder_factory, |
82 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 84 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
83 rtc::scoped_refptr<webrtc::AudioProcessing> apm); | 85 rtc::scoped_refptr<webrtc::AudioProcessing> apm); |
| 86 |
| 87 // Create a MediaEngineInterface with optional video codec factories. These |
| 88 // video factories represents all video codecs, i.e. no extra internal video |
| 89 // codecs will be added. |
| 90 static std::unique_ptr<MediaEngineInterface> Create( |
| 91 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm, |
| 92 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, |
| 93 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, |
| 94 std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory, |
| 95 std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory, |
| 96 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
| 97 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing); |
84 }; | 98 }; |
85 | 99 |
86 // Verify that extension IDs are within 1-byte extension range and are not | 100 // Verify that extension IDs are within 1-byte extension range and are not |
87 // overlapping. | 101 // overlapping. |
88 bool ValidateRtpExtensions(const std::vector<webrtc::RtpExtension>& extensions); | 102 bool ValidateRtpExtensions(const std::vector<webrtc::RtpExtension>& extensions); |
89 | 103 |
90 // Discard any extensions not validated by the 'supported' predicate. Duplicate | 104 // Discard any extensions not validated by the 'supported' predicate. Duplicate |
91 // extensions are removed if 'filter_redundant_extensions' is set, and also any | 105 // extensions are removed if 'filter_redundant_extensions' is set, and also any |
92 // mutually exclusive extensions (see implementation for details) are removed. | 106 // mutually exclusive extensions (see implementation for details) are removed. |
93 std::vector<webrtc::RtpExtension> FilterRtpExtensions( | 107 std::vector<webrtc::RtpExtension> FilterRtpExtensions( |
94 const std::vector<webrtc::RtpExtension>& extensions, | 108 const std::vector<webrtc::RtpExtension>& extensions, |
95 bool (*supported)(const std::string&), | 109 bool (*supported)(const std::string&), |
96 bool filter_redundant_extensions); | 110 bool filter_redundant_extensions); |
97 | 111 |
98 webrtc::Call::Config::BitrateConfig GetBitrateConfigForCodec( | 112 webrtc::Call::Config::BitrateConfig GetBitrateConfigForCodec( |
99 const Codec& codec); | 113 const Codec& codec); |
100 | 114 |
101 } // namespace cricket | 115 } // namespace cricket |
102 | 116 |
103 #endif // MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ | 117 #endif // MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |
OLD | NEW |