| 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" |
| 18 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
| 19 #include "webrtc/base/deprecation.h" | 20 #include "webrtc/base/deprecation.h" |
| 20 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
| 21 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 22 | 23 |
| 23 namespace webrtc { | 24 namespace webrtc { |
| 24 | 25 |
| 25 struct CodecInst; | 26 struct CodecInst; |
| 26 class VideoCodec; | 27 class VideoCodec; |
| 27 | 28 |
| 28 // TODO(magjed): Remove once external code is updated. | 29 // TODO(magjed): Remove once external code is updated. |
| 29 class RTPPayloadStrategy { | 30 class RTPPayloadStrategy { |
| 30 public: | 31 public: |
| 31 static RTPPayloadStrategy* CreateStrategy(bool handling_audio) { | 32 static RTPPayloadStrategy* CreateStrategy(bool handling_audio) { |
| 32 return nullptr; | 33 return nullptr; |
| 33 } | 34 } |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 class RTPPayloadRegistry { | 37 class RTPPayloadRegistry { |
| 37 public: | 38 public: |
| 38 RTPPayloadRegistry(); | 39 RTPPayloadRegistry(); |
| 39 ~RTPPayloadRegistry(); | 40 ~RTPPayloadRegistry(); |
| 40 // TODO(magjed): Remove once external code is updated. | 41 // TODO(magjed): Remove once external code is updated. |
| 41 explicit RTPPayloadRegistry(RTPPayloadStrategy* rtp_payload_strategy) | 42 explicit RTPPayloadRegistry(RTPPayloadStrategy* rtp_payload_strategy) |
| 42 : RTPPayloadRegistry() {} | 43 : RTPPayloadRegistry() {} |
| 43 | 44 |
| 44 // TODO(magjed): Split RTPPayloadRegistry into separate Audio and Video class | 45 // TODO(magjed): Split RTPPayloadRegistry into separate Audio and Video class |
| 45 // and simplify the code. http://crbug/webrtc/6743. | 46 // and simplify the code. http://crbug/webrtc/6743. |
| 47 |
| 48 // Replace all audio receive payload types with the given map. |
| 49 void SetAudioReceivePayloads(std::map<int, SdpAudioFormat> codecs); |
| 50 |
| 46 int32_t RegisterReceivePayload(const CodecInst& audio_codec, | 51 int32_t RegisterReceivePayload(const CodecInst& audio_codec, |
| 47 bool* created_new_payload_type); | 52 bool* created_new_payload_type); |
| 48 int32_t RegisterReceivePayload(const VideoCodec& video_codec); | 53 int32_t RegisterReceivePayload(const VideoCodec& video_codec); |
| 49 | 54 |
| 50 int32_t DeRegisterReceivePayload(int8_t payload_type); | 55 int32_t DeRegisterReceivePayload(int8_t payload_type); |
| 51 | 56 |
| 52 int32_t ReceivePayloadType(const CodecInst& audio_codec, | 57 int32_t ReceivePayloadType(const CodecInst& audio_codec, |
| 53 int8_t* payload_type) const; | 58 int8_t* payload_type) const; |
| 54 int32_t ReceivePayloadType(const VideoCodec& video_codec, | 59 int32_t ReceivePayloadType(const VideoCodec& video_codec, |
| 55 int8_t* payload_type) const; | 60 int8_t* payload_type) const; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // video, DCHECK that no instance is used for both audio and video. | 148 // video, DCHECK that no instance is used for both audio and video. |
| 144 #if RTC_DCHECK_IS_ON | 149 #if RTC_DCHECK_IS_ON |
| 145 bool used_for_audio_ GUARDED_BY(crit_sect_) = false; | 150 bool used_for_audio_ GUARDED_BY(crit_sect_) = false; |
| 146 bool used_for_video_ GUARDED_BY(crit_sect_) = false; | 151 bool used_for_video_ GUARDED_BY(crit_sect_) = false; |
| 147 #endif | 152 #endif |
| 148 }; | 153 }; |
| 149 | 154 |
| 150 } // namespace webrtc | 155 } // namespace webrtc |
| 151 | 156 |
| 152 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ | 157 #endif // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_ |
| OLD | NEW |