OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <set> | 16 #include <set> |
17 | 17 |
| 18 #include "webrtc/api/audio_codecs/audio_format.h" |
| 19 #include "webrtc/base/annotations.h" |
18 #include "webrtc/base/criticalsection.h" | 20 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/deprecation.h" | 21 #include "webrtc/base/deprecation.h" |
20 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
21 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
22 | 24 |
23 namespace webrtc { | 25 namespace webrtc { |
24 | 26 |
25 struct CodecInst; | 27 struct CodecInst; |
26 class VideoCodec; | 28 class VideoCodec; |
27 | 29 |
28 // TODO(magjed): Remove once external code is updated. | 30 // TODO(magjed): Remove once external code is updated. |
29 class RTPPayloadStrategy { | 31 class RTPPayloadStrategy { |
30 public: | 32 public: |
31 static RTPPayloadStrategy* CreateStrategy(bool handling_audio) { | 33 static RTPPayloadStrategy* CreateStrategy(bool handling_audio) { |
32 return nullptr; | 34 return nullptr; |
33 } | 35 } |
34 }; | 36 }; |
35 | 37 |
36 class RTPPayloadRegistry { | 38 class RTPPayloadRegistry { |
37 public: | 39 public: |
38 RTPPayloadRegistry(); | 40 RTPPayloadRegistry(); |
39 ~RTPPayloadRegistry(); | 41 ~RTPPayloadRegistry(); |
40 // TODO(magjed): Remove once external code is updated. | 42 // TODO(magjed): Remove once external code is updated. |
41 explicit RTPPayloadRegistry(RTPPayloadStrategy* rtp_payload_strategy) | 43 explicit RTPPayloadRegistry(RTPPayloadStrategy* rtp_payload_strategy) |
42 : RTPPayloadRegistry() {} | 44 : RTPPayloadRegistry() {} |
43 | 45 |
44 // TODO(magjed): Split RTPPayloadRegistry into separate Audio and Video class | 46 // TODO(magjed): Split RTPPayloadRegistry into separate Audio and Video class |
45 // and simplify the code. http://crbug/webrtc/6743. | 47 // and simplify the code. http://crbug/webrtc/6743. |
| 48 |
| 49 // Replace all audio receive payload types with the given map. Returns true |
| 50 // on success. |
| 51 RTC_WARN_UNUSED_RESULT(bool) |
| 52 SetAudioReceivePayloads(std::map<int, SdpAudioFormat> codecs); |
| 53 |
46 int32_t RegisterReceivePayload(const CodecInst& audio_codec, | 54 int32_t RegisterReceivePayload(const CodecInst& audio_codec, |
47 bool* created_new_payload_type); | 55 bool* created_new_payload_type); |
48 int32_t RegisterReceivePayload(const VideoCodec& video_codec); | 56 int32_t RegisterReceivePayload(const VideoCodec& video_codec); |
49 | 57 |
50 int32_t DeRegisterReceivePayload(int8_t payload_type); | 58 int32_t DeRegisterReceivePayload(int8_t payload_type); |
51 | 59 |
52 int32_t ReceivePayloadType(const CodecInst& audio_codec, | 60 int32_t ReceivePayloadType(const CodecInst& audio_codec, |
53 int8_t* payload_type) const; | 61 int8_t* payload_type) const; |
54 int32_t ReceivePayloadType(const VideoCodec& video_codec, | 62 int32_t ReceivePayloadType(const VideoCodec& video_codec, |
55 int8_t* payload_type) const; | 63 int8_t* payload_type) const; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 std::map<int, int> rtx_payload_type_map_; | 144 std::map<int, int> rtx_payload_type_map_; |
137 uint32_t ssrc_rtx_; | 145 uint32_t ssrc_rtx_; |
138 // Only warn once per payload type, if an RTX packet is received but | 146 // Only warn once per payload type, if an RTX packet is received but |
139 // no associated payload type found in |rtx_payload_type_map_|. | 147 // no associated payload type found in |rtx_payload_type_map_|. |
140 std::set<int> payload_types_with_suppressed_warnings_ GUARDED_BY(crit_sect_); | 148 std::set<int> payload_types_with_suppressed_warnings_ GUARDED_BY(crit_sect_); |
141 }; | 149 }; |
142 | 150 |
143 } // namespace webrtc | 151 } // namespace webrtc |
144 | 152 |
145 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 153 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
OLD | NEW |