History

avcodec, avutil, avformat: remove AVOption requirement for some fields

Allow all struct fields to be accessed directly, as long as they're public. Before this change, many fields were "public", but could be accessed via AVOption only. This meant they were effectively not public, but were present for documentation purposes, which was incredibly confusing at best.

wm4 committed 9 years ago

Commit 554bc4e1 parent 37330397 files · +42 −76Browse files

Showing the changes to libavcodec (2 of 7 files). Show all

Unified · Split

2 files
  1. libavcodec/avcodec.h +5 −20
  2. libavcodec/version.h +1 −1
libavcodec/avcodec.h+5−20
@@ -1680,7 +1680,7 @@ enum AVFieldOrder { · 1679 unmodified lines
1680 * New fields can be added to the end with minor version bumps.1680 * New fields can be added to the end with minor version bumps.
1681 * Removal, reordering and changes to existing fields require a major1681 * Removal, reordering and changes to existing fields require a major
1682 * version bump.1682 * version bump.
1683 * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user1683 * You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user
1684 * applications.1684 * applications.
1685 * The name string for AVOptions options matches the associated command line1685 * The name string for AVOptions options matches the associated command line
1686 * parameter name and can be found in libavcodec/options_table.h1686 * parameter name and can be found in libavcodec/options_table.h
@@ -2951,8 +2951,8 @@ typedef struct AVCodecContext { · 1264 unmodified lines
2951#define FF_DEBUG_MMCO 0x000008002951#define FF_DEBUG_MMCO 0x00000800
2952#define FF_DEBUG_BUGS 0x000010002952#define FF_DEBUG_BUGS 0x00001000
2953#if FF_API_DEBUG_MV2953#if FF_API_DEBUG_MV
2954#define FF_DEBUG_VIS_QP 0x00002000 ///< only access through AVOptions from outside libavcodec2954#define FF_DEBUG_VIS_QP 0x00002000
2955#define FF_DEBUG_VIS_MB_TYPE 0x00004000 ///< only access through AVOptions from outside libavcodec2955#define FF_DEBUG_VIS_MB_TYPE 0x00004000
2956#endif2956#endif
2957#define FF_DEBUG_BUFFERS 0x000080002957#define FF_DEBUG_BUFFERS 0x00008000
2958#define FF_DEBUG_THREADS 0x000100002958#define FF_DEBUG_THREADS 0x00010000
@@ -2962,7 +2962,6 @@ typedef struct AVCodecContext { · 3 unmodified lines
2962#if FF_API_DEBUG_MV2962#if FF_API_DEBUG_MV
2963 /**2963 /**
2964 * debug2964 * debug
2965 * Code outside libavcodec should access this field using AVOptions
2966 * - encoding: Set by user.2965 * - encoding: Set by user.
2967 * - decoding: Set by user.2966 * - decoding: Set by user.
2968 */2967 */
@@ -3097,8 +3096,6 @@ typedef struct AVCodecContext { · 128 unmodified lines
3097 * low resolution decoding, 1-> 1/2 size, 2->1/4 size3096 * low resolution decoding, 1-> 1/2 size, 2->1/4 size
3098 * - encoding: unused3097 * - encoding: unused
3099 * - decoding: Set by user.3098 * - decoding: Set by user.
3100 * Code outside libavcodec should access this field using:
3101 * av_codec_{get,set}_lowres(avctx)
3102 */3099 */
3103 int lowres;3100 int lowres;
3104#endif3101#endif
@@ -3399,8 +3396,6 @@ typedef struct AVCodecContext { · 294 unmodified lines
3399 3396
3400 /**3397 /**
3401 * Timebase in which pkt_dts/pts and AVPacket.dts/pts are.3398 * Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
3402 * Code outside libavcodec should access this field using:
3403 * av_codec_{get,set}_pkt_timebase(avctx)
3404 * - encoding unused.3399 * - encoding unused.
3405 * - decoding set by user.3400 * - decoding set by user.
3406 */3401 */
@@ -3408,8 +3403,6 @@ typedef struct AVCodecContext { · 1 unmodified line
3408 3403
3409 /**3404 /**
3410 * AVCodecDescriptor3405 * AVCodecDescriptor
3411 * Code outside libavcodec should access this field using:
3412 * av_codec_{get,set}_codec_descriptor(avctx)
3413 * - encoding: unused.3406 * - encoding: unused.
3414 * - decoding: set by libavcodec.3407 * - decoding: set by libavcodec.
3415 */3408 */
@@ -3420,8 +3413,6 @@ typedef struct AVCodecContext { · 4 unmodified lines
3420 * low resolution decoding, 1-> 1/2 size, 2->1/4 size3413 * low resolution decoding, 1-> 1/2 size, 2->1/4 size
3421 * - encoding: unused3414 * - encoding: unused
3422 * - decoding: Set by user.3415 * - decoding: Set by user.
3423 * Code outside libavcodec should access this field using:
3424 * av_codec_{get,set}_lowres(avctx)
3425 */3416 */
3426 int lowres;3417 int lowres;
3427#endif3418#endif
@@ -3462,7 +3453,6 @@ typedef struct AVCodecContext { · 34 unmodified lines
3462 * However for formats that do not use pre-multiplied alpha3453 * However for formats that do not use pre-multiplied alpha
3463 * there might be serious artefacts (though e.g. libswscale currently3454 * there might be serious artefacts (though e.g. libswscale currently
3464 * assumes pre-multiplied alpha anyway).3455 * assumes pre-multiplied alpha anyway).
3465 * Code outside libavcodec should access this field using AVOptions
3466 *3456 *
3467 * - decoding: set by user3457 * - decoding: set by user
3468 * - encoding: unused3458 * - encoding: unused
@@ -3479,7 +3469,6 @@ typedef struct AVCodecContext { · 10 unmodified lines
3479#if !FF_API_DEBUG_MV3469#if !FF_API_DEBUG_MV
3480 /**3470 /**
3481 * debug motion vectors3471 * debug motion vectors
3482 * Code outside libavcodec should access this field using AVOptions
3483 * - encoding: Set by user.3472 * - encoding: Set by user.
3484 * - decoding: Set by user.3473 * - decoding: Set by user.
3485 */3474 */
@@ -3491,7 +3480,6 @@ typedef struct AVCodecContext { · 5 unmodified lines
3491 3480
3492 /**3481 /**
3493 * custom intra quantization matrix3482 * custom intra quantization matrix
3494 * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix()
3495 * - encoding: Set by user, can be NULL.3483 * - encoding: Set by user, can be NULL.
3496 * - decoding: unused.3484 * - decoding: unused.
3497 */3485 */
@@ -3500,8 +3488,6 @@ typedef struct AVCodecContext { · 2 unmodified lines
3500 /**3488 /**
3501 * dump format separator.3489 * dump format separator.
3502 * can be ", " or "\n " or anything else3490 * can be ", " or "\n " or anything else
3503 * Code outside libavcodec should access this field using AVOptions
3504 * (NO direct access).
3505 * - encoding: Set by user.3491 * - encoding: Set by user.
3506 * - decoding: Set by user.3492 * - decoding: Set by user.
3507 */3493 */
@@ -3511,13 +3497,12 @@ typedef struct AVCodecContext { · 3 unmodified lines
3511 * ',' separated list of allowed decoders.3497 * ',' separated list of allowed decoders.
3512 * If NULL then all are allowed3498 * If NULL then all are allowed
3513 * - encoding: unused3499 * - encoding: unused
3514 * - decoding: set by user through AVOPtions (NO direct access)3500 * - decoding: set by user
3515 */3501 */
3516 char *codec_whitelist;3502 char *codec_whitelist;
3517 3503
3518 /*3504 /*
3519 * Properties of the stream that gets decoded3505 * Properties of the stream that gets decoded
3520 * To be accessed through av_codec_get_properties() (NO direct access)
3521 * - encoding: unused3506 * - encoding: unused
3522 * - decoding: set by libavcodec3507 * - decoding: set by libavcodec
3523 */3508 */
@@ -3668,7 +3653,7 @@ typedef struct AVCodec { · 144 unmodified lines
3668 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 03653 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
3669 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -13654 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
3670 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 03655 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
3671 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres()3656 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
3672 const AVClass *priv_class; ///< AVClass for the private context3657 const AVClass *priv_class; ///< AVClass for the private context
3673 const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}3658 const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
3674 3659
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30#define LIBAVCODEC_VERSION_MAJOR 5730#define LIBAVCODEC_VERSION_MAJOR 57
31#define LIBAVCODEC_VERSION_MINOR 8131#define LIBAVCODEC_VERSION_MINOR 81
32#define LIBAVCODEC_VERSION_MICRO 10132#define LIBAVCODEC_VERSION_MICRO 102
33 33
34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
35 LIBAVCODEC_VERSION_MINOR, \35 LIBAVCODEC_VERSION_MINOR, \

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