henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
kjellander@webrtc.org | 5ad1297 | 2016-02-12 06:39:40 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |
| 12 | #define WEBRTC_MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 13 | |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 14 | #include <string> |
| 15 | #include <vector> |
| 16 | |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 17 | #include "webrtc/config.h" |
kjellander | a96e2d7 | 2016-02-04 23:52:28 -0800 | [diff] [blame] | 18 | #include "webrtc/media/base/mediaengine.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | class AudioDeviceModule; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 22 | } |
| 23 | namespace cricket { |
| 24 | class WebRtcVideoDecoderFactory; |
| 25 | class WebRtcVideoEncoderFactory; |
| 26 | } |
| 27 | |
buildbot@webrtc.org | 58e7c86 | 2014-06-20 00:26:50 +0000 | [diff] [blame] | 28 | namespace cricket { |
| 29 | |
henrike@webrtc.org | 0481f15 | 2014-08-19 14:56:59 +0000 | [diff] [blame] | 30 | class WebRtcMediaEngineFactory { |
buildbot@webrtc.org | 58e7c86 | 2014-06-20 00:26:50 +0000 | [diff] [blame] | 31 | public: |
ossu | 111744e | 2016-06-15 02:22:32 -0700 | [diff] [blame^] | 32 | // TODO(ossu): Backwards-compatible interface. Will be deprecated once the |
| 33 | // audio decoder factory is fully plumbed and used throughout WebRTC. |
| 34 | // See: crbug.com/webrtc/6000 |
| 35 | static MediaEngineInterface* Create( |
| 36 | webrtc::AudioDeviceModule* adm, |
| 37 | WebRtcVideoEncoderFactory* video_encoder_factory, |
| 38 | WebRtcVideoDecoderFactory* video_decoder_factory); |
| 39 | |
henrike@webrtc.org | 0481f15 | 2014-08-19 14:56:59 +0000 | [diff] [blame] | 40 | static MediaEngineInterface* Create( |
buildbot@webrtc.org | 58e7c86 | 2014-06-20 00:26:50 +0000 | [diff] [blame] | 41 | webrtc::AudioDeviceModule* adm, |
ossu | 29b1a8d | 2016-06-13 07:34:51 -0700 | [diff] [blame] | 42 | const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& |
| 43 | audio_decoder_factory, |
| 44 | WebRtcVideoEncoderFactory* video_encoder_factory, |
| 45 | WebRtcVideoDecoderFactory* video_decoder_factory); |
buildbot@webrtc.org | bb2d658 | 2014-06-20 14:58:56 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 48 | // Verify that extension IDs are within 1-byte extension range and are not |
| 49 | // overlapping. |
isheriff | 6f8d686 | 2016-05-26 11:24:55 -0700 | [diff] [blame] | 50 | bool ValidateRtpExtensions(const std::vector<webrtc::RtpExtension>& extensions); |
Stefan Holmer | bbaf363 | 2015-10-29 18:53:23 +0100 | [diff] [blame] | 51 | |
isheriff | 6f8d686 | 2016-05-26 11:24:55 -0700 | [diff] [blame] | 52 | // Discard any extensions not validated by the 'supported' predicate. Duplicate |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 53 | // extensions are removed if 'filter_redundant_extensions' is set, and also any |
isheriff | 6f8d686 | 2016-05-26 11:24:55 -0700 | [diff] [blame] | 54 | // mutually exclusive extensions (see implementation for details) are removed. |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 55 | std::vector<webrtc::RtpExtension> FilterRtpExtensions( |
isheriff | 6f8d686 | 2016-05-26 11:24:55 -0700 | [diff] [blame] | 56 | const std::vector<webrtc::RtpExtension>& extensions, |
solenberg | 7e4e01a | 2015-12-02 08:05:01 -0800 | [diff] [blame] | 57 | bool (*supported)(const std::string&), |
| 58 | bool filter_redundant_extensions); |
Stefan Holmer | bbaf363 | 2015-10-29 18:53:23 +0100 | [diff] [blame] | 59 | |
buildbot@webrtc.org | bb2d658 | 2014-06-20 14:58:56 +0000 | [diff] [blame] | 60 | } // namespace cricket |
| 61 | |
kjellander@webrtc.org | 5ad1297 | 2016-02-12 06:39:40 +0100 | [diff] [blame] | 62 | #endif // WEBRTC_MEDIA_ENGINE_WEBRTCMEDIAENGINE_H_ |