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
1414
1515 API changes, most recent first:
1616
17+2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
18+ Constified AVFormatContext.*_codec.
19+
1720 2021-04-27 - xxxxxxxxxx - lavf yyyyyyyyy - avformat.h
1821 Constified the pointers to AVInputFormats and AVOutputFormats
1922 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
737737 return 0;
738738 }
739739
740−static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
740+static const AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
741741 {
742742 const AVCodecDescriptor *desc;
743743 const char *codec_string = encoder ? "encoder" : "decoder";
744− AVCodec *codec;
744+ const AVCodec *codec;
745745
746746 codec = encoder ?
747747 avcodec_find_encoder_by_name(name) :
libavformat/avformat.h+4−4
@@ -1598,7 +1598,7 @@ typedef struct AVFormatContext { · 1597 unmodified lines
15981598 * the same codec_id.
15991599 * Demuxing: Set by user
16001600 */
1601− AVCodec *video_codec;
1601+ const AVCodec *video_codec;
16021602
16031603 /**
16041604 * Forced audio codec.
@@ -1606,7 +1606,7 @@ typedef struct AVFormatContext { · 1 unmodified line
16061606 * the same codec_id.
16071607 * Demuxing: Set by user
16081608 */
1609− AVCodec *audio_codec;
1609+ const AVCodec *audio_codec;
16101610
16111611 /**
16121612 * Forced subtitle codec.
@@ -1614,7 +1614,7 @@ typedef struct AVFormatContext { · 1 unmodified line
16141614 * the same codec_id.
16151615 * Demuxing: Set by user
16161616 */
1617− AVCodec *subtitle_codec;
1617+ const AVCodec *subtitle_codec;
16181618
16191619 /**
16201620 * Forced data codec.
@@ -1622,7 +1622,7 @@ typedef struct AVFormatContext { · 1 unmodified line
16221622 * the same codec_id.
16231623 * Demuxing: Set by user
16241624 */
1625− AVCodec *data_codec;
1625+ const AVCodec *data_codec;
16261626
16271627 /**
16281628 * 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