Index: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc |
index 4188f97b539d1bfa0347b485e0d722e2d9c6074a..a4354d393ea99cea9a6a0964a77c962fe8d6ab4b 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc |
@@ -11,6 +11,7 @@ |
#include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
#include "webrtc/base/logging.h" |
+#include "webrtc/common_types.h" |
#include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
namespace webrtc { |
@@ -33,6 +34,21 @@ RTPPayloadRegistry::~RTPPayloadRegistry() { |
} |
} |
+int32_t RTPPayloadRegistry::RegisterReceivePayload(const CodecInst& audio_codec, |
+ bool* created_new_payload) { |
+ return RegisterReceivePayload( |
+ audio_codec.plname, audio_codec.pltype, audio_codec.plfreq, |
+ audio_codec.channels, std::max(0, audio_codec.rate), created_new_payload); |
+} |
+ |
+int32_t RTPPayloadRegistry::RegisterReceivePayload( |
+ const VideoCodec& video_codec) { |
+ bool dummy_created_new_payload; |
+ return RegisterReceivePayload(video_codec.plName, video_codec.plType, |
+ kVideoPayloadTypeFrequency, 0 /* channels */, |
+ 0 /* rate */, &dummy_created_new_payload); |
+} |
+ |
int32_t RTPPayloadRegistry::RegisterReceivePayload( |
const char* const payload_name, |
const int8_t payload_type, |
@@ -165,6 +181,19 @@ void RTPPayloadRegistry::DeregisterAudioCodecOrRedTypeRegardlessOfPayloadType( |
} |
} |
+int32_t RTPPayloadRegistry::ReceivePayloadType(const CodecInst& audio_codec, |
+ int8_t* payload_type) const { |
+ return ReceivePayloadType(audio_codec.plname, audio_codec.plfreq, |
+ audio_codec.channels, std::max(0, audio_codec.rate), |
+ payload_type); |
+} |
+ |
+int32_t RTPPayloadRegistry::ReceivePayloadType(const VideoCodec& video_codec, |
+ int8_t* payload_type) const { |
+ return ReceivePayloadType(video_codec.plName, kVideoPayloadTypeFrequency, |
+ 0 /* channels */, 0 /* rate */, payload_type); |
+} |
+ |
int32_t RTPPayloadRegistry::ReceivePayloadType(const char* const payload_name, |
const uint32_t frequency, |
const size_t channels, |