Index: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc |
index 190449b3ddfe6bdde9561cc16a0ce6d1387ed767..5080e87b04da046ab6b0010fcc5b1a5685b4dd93 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc |
@@ -80,12 +80,7 @@ RtpReceiverImpl::~RtpReceiverImpl() { |
} |
} |
-int32_t RtpReceiverImpl::RegisterReceivePayload( |
- const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
- const int8_t payload_type, |
- const uint32_t frequency, |
- const size_t channels, |
- const uint32_t rate) { |
+int32_t RtpReceiverImpl::RegisterReceivePayload(const CodecInst& audio_codec) { |
rtc::CritScope lock(&critical_section_rtp_receiver_); |
// TODO(phoglund): Try to streamline handling of the RED codec and some other |
@@ -93,13 +88,33 @@ int32_t RtpReceiverImpl::RegisterReceivePayload( |
// payload or not. |
bool created_new_payload = false; |
int32_t result = rtp_payload_registry_->RegisterReceivePayload( |
- payload_name, payload_type, frequency, channels, rate, |
- &created_new_payload); |
+ audio_codec, &created_new_payload); |
if (created_new_payload) { |
- if (rtp_media_receiver_->OnNewPayloadTypeCreated(payload_name, payload_type, |
- frequency) != 0) { |
- LOG(LS_ERROR) << "Failed to register payload: " << payload_name << "/" |
- << static_cast<int>(payload_type); |
+ if (rtp_media_receiver_->OnNewPayloadTypeCreated( |
+ audio_codec.plname, audio_codec.pltype, audio_codec.plfreq) != 0) { |
+ LOG(LS_ERROR) << "Failed to register payload: " << audio_codec.plname |
+ << "/" << static_cast<int>(audio_codec.pltype); |
+ return -1; |
+ } |
+ } |
+ return result; |
+} |
+ |
+int32_t RtpReceiverImpl::RegisterReceivePayload(const VideoCodec& video_codec) { |
+ rtc::CritScope lock(&critical_section_rtp_receiver_); |
+ |
+ // TODO(phoglund): Try to streamline handling of the RED codec and some other |
+ // cases which makes it necessary to keep track of whether we created a |
+ // payload or not. |
+ bool created_new_payload = false; |
+ int32_t result = rtp_payload_registry_->RegisterReceivePayload( |
+ video_codec, &created_new_payload); |
+ if (created_new_payload) { |
+ if (rtp_media_receiver_->OnNewPayloadTypeCreated( |
danilchap
2016/11/23 15:19:23
look like noone interested in new Video payload ty
magjed_webrtc
2016/11/23 16:35:53
Thanks, you are right! I didn't notice when I wrot
|
+ video_codec.plName, video_codec.plType, |
+ kVideoPayloadTypeFrequency) != 0) { |
+ LOG(LS_ERROR) << "Failed to register payload: " << video_codec.plName |
+ << "/" << static_cast<int>(video_codec.plType); |
return -1; |
} |
} |