webrtc_media_engine.h (1661B)
1 /* 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 3 * 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. 9 */ 10 11 #ifndef MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_H_ 12 #define MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_H_ 13 14 #include <vector> 15 16 #include "absl/strings/string_view.h" 17 #include "api/array_view.h" 18 #include "api/field_trials_view.h" 19 #include "api/rtp_parameters.h" 20 #include "api/transport/bitrate_settings.h" 21 #include "media/base/codec.h" 22 23 namespace webrtc { 24 25 // Verify that extension IDs are within 1-byte extension range and are not 26 // overlapping, and that they form a legal change from previously registerd 27 // extensions (if any). 28 bool ValidateRtpExtensions(ArrayView<const RtpExtension> extennsions, 29 ArrayView<const RtpExtension> old_extensions); 30 31 // Discard any extensions not validated by the 'supported' predicate. Duplicate 32 // extensions are removed if 'filter_redundant_extensions' is set, and also any 33 // mutually exclusive extensions (see implementation for details) are removed. 34 std::vector<RtpExtension> FilterRtpExtensions( 35 const std::vector<RtpExtension>& extensions, 36 bool (*supported)(absl::string_view), 37 bool filter_redundant_extensions, 38 const FieldTrialsView& trials); 39 40 BitrateConstraints GetBitrateConfigForCodec(const Codec& codec); 41 42 } // namespace webrtc 43 44 45 #endif // MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_H_