RTCP is handled elsewhere, not in the depacketizer for an
individual format.
Signed-off-by: Martin Storsjö <martin@martin.st>
| ... | ... |
@@ -30,10 +30,6 @@ |
| 30 | 30 |
* Single Nal Unit Mode (0), or |
| 31 | 31 |
* Non-Interleaved Mode (1). It currently does not support |
| 32 | 32 |
* Interleaved Mode (2). (This requires implementing STAP-B, MTAP16, MTAP24, FU-B packet types) |
| 33 |
- * |
|
| 34 |
- * @note TODO: |
|
| 35 |
- * 1) RTCP sender reports for udp streams are required.. |
|
| 36 |
- * |
|
| 37 | 33 |
*/ |
| 38 | 34 |
|
| 39 | 35 |
#include "libavutil/base64.h" |
| ... | ... |
@@ -49,21 +45,17 @@ |
| 49 | 49 |
#include "rtpdec.h" |
| 50 | 50 |
#include "rtpdec_formats.h" |
| 51 | 51 |
|
| 52 |
-/** |
|
| 53 |
- RTP/H264 specific private data. |
|
| 54 |
-*/ |
|
| 55 | 52 |
struct PayloadContext {
|
| 56 | 53 |
//sdp setup parameters |
| 57 |
- uint8_t profile_idc; ///< from the sdp setup parameters. |
|
| 58 |
- uint8_t profile_iop; ///< from the sdp setup parameters. |
|
| 59 |
- uint8_t level_idc; ///< from the sdp setup parameters. |
|
| 60 |
- int packetization_mode; ///< from the sdp setup parameters. |
|
| 54 |
+ uint8_t profile_idc; |
|
| 55 |
+ uint8_t profile_iop; |
|
| 56 |
+ uint8_t level_idc; |
|
| 57 |
+ int packetization_mode; |
|
| 61 | 58 |
#ifdef DEBUG |
| 62 | 59 |
int packet_types_received[32]; |
| 63 | 60 |
#endif |
| 64 | 61 |
}; |
| 65 | 62 |
|
| 66 |
-/* ---------------- private code */ |
|
| 67 | 63 |
static int sdp_parse_fmtp_config_h264(AVStream * stream, |
| 68 | 64 |
PayloadContext * h264_data, |
| 69 | 65 |
char *attr, char *value) |
| ... | ... |
@@ -99,7 +91,6 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, |
| 99 | 99 |
buffer[0] = value[4]; buffer[1] = value[5]; |
| 100 | 100 |
level_idc = strtol(buffer, NULL, 16); |
| 101 | 101 |
|
| 102 |
- // set the parameters... |
|
| 103 | 102 |
av_log(codec, AV_LOG_DEBUG, |
| 104 | 103 |
"RTP Profile IDC: %x Profile IOP: %x Level: %x\n", |
| 105 | 104 |
profile_idc, profile_iop, level_idc); |
| ... | ... |
@@ -136,7 +127,6 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, |
| 136 | 136 |
{
|
| 137 | 137 |
if(codec->extradata_size) |
| 138 | 138 |
{
|
| 139 |
- // av_realloc? |
|
| 140 | 139 |
memcpy(dest, codec->extradata, codec->extradata_size); |
| 141 | 140 |
av_free(codec->extradata); |
| 142 | 141 |
} |
| ... | ... |
@@ -213,7 +203,7 @@ static int h264_handle_packet(AVFormatContext *ctx, |
| 213 | 213 |
int src_len= len; |
| 214 | 214 |
|
| 215 | 215 |
while (src_len > 2) {
|
| 216 |
- uint16_t nal_size = AV_RB16(src); // this going to be a problem if unaligned (can it be?) |
|
| 216 |
+ uint16_t nal_size = AV_RB16(src); |
|
| 217 | 217 |
|
| 218 | 218 |
// consume the length of the aggregate... |
| 219 | 219 |
src += 2; |
| ... | ... |
@@ -275,7 +265,7 @@ static int h264_handle_packet(AVFormatContext *ctx, |
| 275 | 275 |
if (len > 1) {
|
| 276 | 276 |
// these are the same as above, we just redo them here for clarity... |
| 277 | 277 |
uint8_t fu_indicator = nal; |
| 278 |
- uint8_t fu_header = *buf; // read the fu_header. |
|
| 278 |
+ uint8_t fu_header = *buf; |
|
| 279 | 279 |
uint8_t start_bit = fu_header >> 7; |
| 280 | 280 |
// uint8_t end_bit = (fu_header & 0x40) >> 6; |
| 281 | 281 |
uint8_t nal_type = (fu_header & 0x1f); |
| ... | ... |
@@ -322,7 +312,6 @@ static int h264_handle_packet(AVFormatContext *ctx, |
| 322 | 322 |
return result; |
| 323 | 323 |
} |
| 324 | 324 |
|
| 325 |
-/* ---------------- public code */ |
|
| 326 | 325 |
static PayloadContext *h264_new_context(void) |
| 327 | 326 |
{
|
| 328 | 327 |
return av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE); |
| ... | ... |
@@ -380,12 +369,9 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index, |
| 380 | 380 |
// could use this if we wanted. |
| 381 | 381 |
} |
| 382 | 382 |
|
| 383 |
- return 0; // keep processing it the normal way... |
|
| 383 |
+ return 0; |
|
| 384 | 384 |
} |
| 385 | 385 |
|
| 386 |
-/** |
|
| 387 |
-This is the structure for expanding on the dynamic rtp protocols (makes everything static. yay!) |
|
| 388 |
-*/ |
|
| 389 | 386 |
RTPDynamicProtocolHandler ff_h264_dynamic_handler = {
|
| 390 | 387 |
.enc_name = "H264", |
| 391 | 388 |
.codec_type = AVMEDIA_TYPE_VIDEO, |