History

avformat/avformat: Constify AVFormatContext.*_codec pointers

This also allows to exclusively use pointers to const AVCodec in fftools/ffmpeg_opt.c.

Andreas Rheinhardt committed 5 years ago

Commit 14fa0a41 parent 420cedd3 files · +9 −6Browse files

Unified · Split

3 files
  1. doc/APIchanges +3 −0
  2. fftools/ffmpeg_opt.c +2 −2
  3. libavformat/avformat.h +4 −4
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2017-10-21 · 13 unmodified lines
14 14
15API changes, most recent first:15API changes, most recent first:
16 16
172021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
18 Constified AVFormatContext.*_codec.
19
172021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h202021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
18 Constified the pointers to AVInputFormats and AVOutputFormats21 Constified the pointers to AVInputFormats and AVOutputFormats
19 in AVFormatContext, avformat_alloc_output_context2(),22 in AVFormatContext, avformat_alloc_output_context2(),
fftools/ffmpeg_opt.c+2−2
@@ -737,11 +737,11 @@ static int opt_recording_timestamp(void *optctx, const char *opt, const char *ar · 736 unmodified lines
737 return 0;737 return 0;
738}738}
739 739
740static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)740static const AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
741{741{
742 const AVCodecDescriptor *desc;742 const AVCodecDescriptor *desc;
743 const char *codec_string = encoder ? "encoder" : "decoder";743 const char *codec_string = encoder ? "encoder" : "decoder";
744 AVCodec *codec;744 const AVCodec *codec;
745 745
746 codec = encoder ?746 codec = encoder ?
747 avcodec_find_encoder_by_name(name) :747 avcodec_find_encoder_by_name(name) :
libavformat/avformat.h+4−4
@@ -1598,7 +1598,7 @@ typedef struct AVFormatContext { · 1597 unmodified lines
1598 * the same codec_id.1598 * the same codec_id.
1599 * Demuxing: Set by user1599 * Demuxing: Set by user
1600 */1600 */
1601 AVCodec *video_codec;1601 const AVCodec *video_codec;
1602 1602
1603 /**1603 /**
1604 * Forced audio codec.1604 * Forced audio codec.
@@ -1606,7 +1606,7 @@ typedef struct AVFormatContext { · 1 unmodified line
1606 * the same codec_id.1606 * the same codec_id.
1607 * Demuxing: Set by user1607 * Demuxing: Set by user
1608 */1608 */
1609 AVCodec *audio_codec;1609 const AVCodec *audio_codec;
1610 1610
1611 /**1611 /**
1612 * Forced subtitle codec.1612 * Forced subtitle codec.
@@ -1614,7 +1614,7 @@ typedef struct AVFormatContext { · 1 unmodified line
1614 * the same codec_id.1614 * the same codec_id.
1615 * Demuxing: Set by user1615 * Demuxing: Set by user
1616 */1616 */
1617 AVCodec *subtitle_codec;1617 const AVCodec *subtitle_codec;
1618 1618
1619 /**1619 /**
1620 * Forced data codec.1620 * Forced data codec.
@@ -1622,7 +1622,7 @@ typedef struct AVFormatContext { · 1 unmodified line
1622 * the same codec_id.1622 * the same codec_id.
1623 * Demuxing: Set by user1623 * Demuxing: Set by user
1624 */1624 */
1625 AVCodec *data_codec;1625 const AVCodec *data_codec;
1626 1626
1627 /**1627 /**
1628 * Number of bytes to be written as padding in a metadata header.1628 * Number of bytes to be written as padding in a metadata header.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t