Skip to content

Commit 9ccbdf2

Browse files
committed
F Code cleanup
1 parent 6cf92b0 commit 9ccbdf2

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/SharpRTSPServer/H264Track.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public int PayloadType
9393
/// Ctor.
9494
/// </summary>
9595
/// <param name="profileIdc">H264 Profile IDC. Default value is 77.</param>
96-
/// <param name="profileIop">H264 Profile IOP. Default value is 0.</param>
96+
/// <param name="profileIop">H264 Profile IOP. Default value is 0. See https://www.rfc-editor.org/rfc/rfc6184#page-41.</param>
9797
/// <param name="level">H264 Level. Default value is 42.</param>
9898
/// <param name="clock">H264 clock. Default value is 90000.</param>
9999
public H264Track(int profileIdc = 77, int profileIop = 0, int level = 42, int clock = DEFAULT_CLOCK)
@@ -110,7 +110,7 @@ public H264Track(int profileIdc = 77, int profileIop = 0, int level = 42, int cl
110110
/// <param name="sps">Sequence Parameter Set (SPS).</param>
111111
/// <param name="pps">Picture Parameter Set (PPS).</param>
112112
/// <param name="profileIdc">H264 Profile IDC. Default value is 77.</param>
113-
/// <param name="profileIop">H264 Profile IOP. Default value is 0.</param>
113+
/// <param name="profileIop">H264 Profile IOP. Default value is 0. See https://www.rfc-editor.org/rfc/rfc6184#page-41.</param>
114114
/// <param name="level">H264 Level. Default value is 42.</param>
115115
/// <param name="clock">H264 clock. Default value is 90000.</param>
116116
public H264Track(byte[] sps, byte[] pps, int profileIdc = 77, int profileIop = 0, int level = 42, int clock = DEFAULT_CLOCK) : this(profileIdc, profileIop, level, clock)
@@ -144,17 +144,13 @@ public StringBuilder BuildSDP(StringBuilder sdp)
144144
ProfileIop.ToString("X2") +
145145
Level.ToString("X2");
146146

147-
// Make the Base64 SPS and PPS
148-
// raw_sps has no 0x00 0x00 0x00 0x01 or 32 bit size header
149-
// raw_pps has no 0x00 0x00 0x00 0x01 or 32 bit size header
150147
string spsStr = Convert.ToBase64String(SPS);
151148
string ppsStr = Convert.ToBase64String(PPS);
152149

153150
sdp.Append($"m=video 0 RTP/AVP {PayloadType}\n");
154151
sdp.Append($"a=control:trackID={ID}\n");
155152
sdp.Append($"a=rtpmap:{PayloadType} {Codec}/{VideoClock}\n");
156-
sdp.Append($"a=fmtp:{PayloadType} profile-level-id=").Append(profileLevelIdStr)
157-
.Append("; sprop-parameter-sets=").Append(spsStr).Append(',').Append(ppsStr).Append("\n");
153+
sdp.Append($"a=fmtp:{PayloadType} profile-level-id={profileLevelIdStr}; sprop-parameter-sets={spsStr},{ppsStr}\n");
158154
return sdp;
159155
}
160156

src/SharpRTSPServer/H265Track.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public StringBuilder BuildSDP(StringBuilder sdp)
122122
sdp.Append($"m=video 0 RTP/AVP {PayloadType}\n");
123123
sdp.Append($"a=control:trackID={ID}\n");
124124
sdp.Append($"a=rtpmap:{PayloadType} {Codec}/{VideoClock}\n");
125-
sdp.Append($"a=fmtp:{PayloadType} sprop-vps=").Append(vps_str).Append("; sprop-sps=").Append(sps_str).Append("; sprop-pps=").Append(pps_str).Append("\n");
125+
sdp.Append($"a=fmtp:{PayloadType} sprop-vps={vps_str}; sprop-sps={sps_str}; sprop-pps={pps_str}\n");
126126
return sdp;
127127
}
128128

0 commit comments

Comments
 (0)