Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc

Issue 2523843002: Send audio and video codecs to RTPPayloadRegistry (Closed)
Patch Set: Change strcpy to strncpy Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698