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

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

Issue 2529153002: Reland of Add H264 profile to webrtc::VideoCodecH264 and webrtc::VideoPayload (Closed)
Patch Set: Set profile information in CreatePayloadType for video. 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h ('k') | webrtc/modules/video_coding/codec_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7d4afc6e36199f77baa394779aa026be203bb9c1..d99e22110a31f4129af4a869cd619e3a3550772f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry.cc
@@ -37,7 +37,14 @@ bool PayloadIsCompatible(const RtpUtility::Payload& payload,
bool PayloadIsCompatible(const RtpUtility::Payload& payload,
const VideoCodec& video_codec) {
- return !payload.audio && _stricmp(payload.name, video_codec.plName) == 0;
+ if (payload.audio || _stricmp(payload.name, video_codec.plName) != 0)
+ return false;
+ // For H264, profiles must match as well.
+ if (video_codec.codecType == kVideoCodecH264) {
+ return video_codec.H264().profile ==
+ payload.typeSpecific.Video.h264_profile;
+ }
+ return true;
}
RtpUtility::Payload CreatePayloadType(const CodecInst& audio_codec) {
@@ -74,6 +81,8 @@ RtpUtility::Payload CreatePayloadType(const VideoCodec& video_codec) {
strncpy(payload.name, video_codec.plName, RTP_PAYLOAD_NAME_SIZE - 1);
payload.typeSpecific.Video.videoCodecType =
ConvertToRtpVideoCodecType(video_codec.codecType);
+ if (video_codec.codecType == kVideoCodecH264)
+ payload.typeSpecific.Video.h264_profile = video_codec.H264().profile;
payload.audio = false;
return payload;
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h ('k') | webrtc/modules/video_coding/codec_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698