summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_h264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-07-05 07:01:07 +0000
committerAnton Khirnov <anton@khirnov.net>2014-07-09 13:40:54 +0000
commit0307cc2253e76772b1c645ac6117d08da87a147c (patch)
treea888e60dee2ceb9b4abbe48ec4f13a70303d4015 /libavformat/rtpdec_h264.c
parent650d384048ed42579cc6d67bf32a94b468c0b6cb (diff)
rtpdec: pass an AVFormatContext to ff_parse_fmtp()
Use it for logging, instead of NULL or the stream codec context.
Diffstat (limited to 'libavformat/rtpdec_h264.c')
-rw-r--r--libavformat/rtpdec_h264.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 982eb72160..abf1f39279 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -64,7 +64,8 @@ struct PayloadContext {
static const uint8_t start_sequence[] = { 0, 0, 0, 1 };
-static int sdp_parse_fmtp_config_h264(AVStream *stream,
+static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
+ AVStream *stream,
PayloadContext *h264_data,
char *attr, char *value)
{
@@ -73,7 +74,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
assert(h264_data != NULL);
if (!strcmp(attr, "packetization-mode")) {
- av_log(codec, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));
+ av_log(s, AV_LOG_DEBUG, "RTP Packetization Mode: %d\n", atoi(value));
h264_data->packetization_mode = atoi(value);
/*
* Packetization Mode:
@@ -83,7 +84,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
* and 29 (FU-B) are allowed.
*/
if (h264_data->packetization_mode > 1)
- av_log(codec, AV_LOG_ERROR,
+ av_log(s, AV_LOG_ERROR,
"Interleaved RTP mode is not supported yet.\n");
} else if (!strcmp(attr, "profile-level-id")) {
if (strlen(value) == 6) {
@@ -104,7 +105,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
buffer[1] = value[5];
level_idc = strtol(buffer, NULL, 16);
- av_log(codec, AV_LOG_DEBUG,
+ av_log(s, AV_LOG_DEBUG,
"RTP Profile IDC: %x Profile IOP: %x Level: %x\n",
profile_idc, profile_iop, level_idc);
h264_data->profile_idc = profile_idc;
@@ -137,7 +138,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
codec->extradata_size +
FF_INPUT_BUFFER_PADDING_SIZE);
if (!dest) {
- av_log(codec, AV_LOG_ERROR,
+ av_log(s, AV_LOG_ERROR,
"Unable to allocate memory for extradata!\n");
return AVERROR(ENOMEM);
}
@@ -157,7 +158,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
codec->extradata_size += sizeof(start_sequence) + packet_size;
}
}
- av_log(codec, AV_LOG_DEBUG, "Extradata set to %p (size: %d)!\n",
+ av_log(s, AV_LOG_DEBUG, "Extradata set to %p (size: %d)!\n",
codec->extradata, codec->extradata_size);
}
return 0;
@@ -385,7 +386,7 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index,
codec->width = atoi(buf1);
codec->height = atoi(p + 1); // skip the -
} else if (av_strstart(p, "fmtp:", &p)) {
- return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264);
+ return ff_parse_fmtp(s, stream, h264_data, p, sdp_parse_fmtp_config_h264);
} else if (av_strstart(p, "cliprect:", &p)) {
// could use this if we wanted.
}