aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtp.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:58:15 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/rtp.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/rtp.c')
-rw-r--r--libavformat/rtp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 4d41350f3c..4745e54bb0 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -68,19 +68,19 @@ static const struct {
{-1, "", AVMEDIA_TYPE_UNKNOWN, AV_CODEC_ID_NONE, -1, -1}
};
-int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
+int ff_rtp_get_codec_info(AVCodecParameters *par, int payload_type)
{
int i = 0;
for (i = 0; rtp_payload_types[i].pt >= 0; i++)
if (rtp_payload_types[i].pt == payload_type) {
if (rtp_payload_types[i].codec_id != AV_CODEC_ID_NONE) {
- codec->codec_type = rtp_payload_types[i].codec_type;
- codec->codec_id = rtp_payload_types[i].codec_id;
+ par->codec_type = rtp_payload_types[i].codec_type;
+ par->codec_id = rtp_payload_types[i].codec_id;
if (rtp_payload_types[i].audio_channels > 0)
- codec->channels = rtp_payload_types[i].audio_channels;
+ par->channels = rtp_payload_types[i].audio_channels;
if (rtp_payload_types[i].clock_rate > 0)
- codec->sample_rate = rtp_payload_types[i].clock_rate;
+ par->sample_rate = rtp_payload_types[i].clock_rate;
return 0;
}
}
@@ -88,7 +88,7 @@ int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type)
}
int ff_rtp_get_payload_type(AVFormatContext *fmt,
- AVCodecContext *codec, int idx)
+ AVCodecParameters *par, int idx)
{
int i;
AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
@@ -103,27 +103,27 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
/* static payload type */
for (i = 0; rtp_payload_types[i].pt >= 0; ++i)
- if (rtp_payload_types[i].codec_id == codec->codec_id) {
- if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || !fmt->oformat ||
+ if (rtp_payload_types[i].codec_id == par->codec_id) {
+ if (par->codec_id == AV_CODEC_ID_H263 && (!fmt || !fmt->oformat ||
!fmt->oformat->priv_class || !fmt->priv_data ||
!av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
continue;
/* G722 has 8000 as nominal rate even if the sample rate is 16000,
* see section 4.5.2 in RFC 3551. */
- if (codec->codec_id == AV_CODEC_ID_ADPCM_G722 &&
- codec->sample_rate == 16000 && codec->channels == 1)
+ if (par->codec_id == AV_CODEC_ID_ADPCM_G722 &&
+ par->sample_rate == 16000 && par->channels == 1)
return rtp_payload_types[i].pt;
- if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&
+ if (par->codec_type == AVMEDIA_TYPE_AUDIO &&
((rtp_payload_types[i].clock_rate > 0 &&
- codec->sample_rate != rtp_payload_types[i].clock_rate) ||
+ par->sample_rate != rtp_payload_types[i].clock_rate) ||
(rtp_payload_types[i].audio_channels > 0 &&
- codec->channels != rtp_payload_types[i].audio_channels)))
+ par->channels != rtp_payload_types[i].audio_channels)))
continue;
return rtp_payload_types[i].pt;
}
if (idx < 0)
- idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;
+ idx = par->codec_type == AVMEDIA_TYPE_AUDIO;
/* dynamic payload type */
return RTP_PT_PRIVATE + idx;