Skip to content

Commit

Permalink
avformat/rtpdec: Constify RTPDynamicProtocolHandlers
Browse files Browse the repository at this point in the history
Also constify the list of pointers to said RTPDynamicProtocolHandlers.

Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Jan 24, 2021
1 parent 3567fab commit a6d7419
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libavformat/rdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ rdt_close_context (PayloadContext *rdt)
}

#define RDT_HANDLER(n, s, t) \
RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
const RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \
.enc_name = s, \
.codec_type = t, \
.codec_id = AV_CODEC_ID_NONE, \
Expand Down
22 changes: 11 additions & 11 deletions libavformat/rtpdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,48 @@

#define MIN_FEEDBACK_INTERVAL 200000 /* 200 ms in us */

static RTPDynamicProtocolHandler l24_dynamic_handler = {
static const RTPDynamicProtocolHandler l24_dynamic_handler = {
.enc_name = "L24",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_PCM_S24BE,
};

static RTPDynamicProtocolHandler gsm_dynamic_handler = {
static const RTPDynamicProtocolHandler gsm_dynamic_handler = {
.enc_name = "GSM",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_GSM,
};

static RTPDynamicProtocolHandler realmedia_mp3_dynamic_handler = {
static const RTPDynamicProtocolHandler realmedia_mp3_dynamic_handler = {
.enc_name = "X-MP3-draft-00",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_MP3ADU,
};

static RTPDynamicProtocolHandler speex_dynamic_handler = {
static const RTPDynamicProtocolHandler speex_dynamic_handler = {
.enc_name = "speex",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_SPEEX,
};

static RTPDynamicProtocolHandler opus_dynamic_handler = {
static const RTPDynamicProtocolHandler opus_dynamic_handler = {
.enc_name = "opus",
.codec_type = AVMEDIA_TYPE_AUDIO,
.codec_id = AV_CODEC_ID_OPUS,
};

static RTPDynamicProtocolHandler t140_dynamic_handler = { /* RFC 4103 */
static const RTPDynamicProtocolHandler t140_dynamic_handler = { /* RFC 4103 */
.enc_name = "t140",
.codec_type = AVMEDIA_TYPE_SUBTITLE,
.codec_id = AV_CODEC_ID_TEXT,
};

extern RTPDynamicProtocolHandler ff_rdt_video_handler;
extern RTPDynamicProtocolHandler ff_rdt_audio_handler;
extern RTPDynamicProtocolHandler ff_rdt_live_video_handler;
extern RTPDynamicProtocolHandler ff_rdt_live_audio_handler;
extern const RTPDynamicProtocolHandler ff_rdt_video_handler;
extern const RTPDynamicProtocolHandler ff_rdt_audio_handler;
extern const RTPDynamicProtocolHandler ff_rdt_live_video_handler;
extern const RTPDynamicProtocolHandler ff_rdt_live_audio_handler;

static const RTPDynamicProtocolHandler *rtp_dynamic_protocol_handler_list[] = {
static const RTPDynamicProtocolHandler *const rtp_dynamic_protocol_handler_list[] = {
/* rtp */
&ff_ac3_dynamic_handler,
&ff_amr_nb_dynamic_handler,
Expand Down
2 changes: 1 addition & 1 deletion libavformat/rtpdec_qt.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static void qt_rtp_close(PayloadContext *qt)
}

#define RTP_QT_HANDLER(m, n, s, t) \
RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
const RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ## _handler = { \
.enc_name = s, \
.codec_type = t, \
.codec_id = AV_CODEC_ID_NONE, \
Expand Down

0 comments on commit a6d7419

Please sign in to comment.