Skip to content

Commit

Permalink
Update to FFmpeg 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Jan 22, 2022
1 parent d0ed5c9 commit 5ef8a66
Show file tree
Hide file tree
Showing 211 changed files with 4,284 additions and 7,452 deletions.
1,115 changes: 43 additions & 1,072 deletions mac/include/libavcodec/avcodec.h

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions mac/include/libavcodec/bsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* @{
*/

typedef struct AVBSFInternal AVBSFInternal;

/**
* The bitstream filter state.
*
Expand All @@ -57,12 +55,6 @@ typedef struct AVBSFContext {
*/
const struct AVBitStreamFilter *filter;

/**
* Opaque libavcodec internal data. Must not be touched by the caller in any
* way.
*/
AVBSFInternal *internal;

/**
* Opaque filter-specific private data. If filter->priv_class is non-NULL,
* this is an AVOptions-enabled struct.
Expand Down
43 changes: 30 additions & 13 deletions mac/include/libavcodec/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
*/
#define AV_CODEC_CAP_DR1 (1 << 1)
#if FF_API_FLAG_TRUNCATED
/**
* @deprecated Use parsers to always send proper frames.
*/
#define AV_CODEC_CAP_TRUNCATED (1 << 3)
#endif
/**
* Encoder or decoder requires flushing with NULL input at the end in order to
* give the complete and correct output.
Expand Down Expand Up @@ -214,12 +219,12 @@ typedef struct AVCodec {
* see AV_CODEC_CAP_*
*/
int capabilities;
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}

Expand All @@ -242,10 +247,13 @@ typedef struct AVCodec {
* New public fields should be added right above.
*****************************************************************
*/
/**
* Internal codec capabilities.
* See FF_CODEC_CAP_* in internal.h
*/
int caps_internal;

int priv_data_size;
#if FF_API_NEXT
struct AVCodec *next;
#endif
/**
* @name Frame-level threading support functions
* @{
Expand All @@ -258,6 +266,11 @@ typedef struct AVCodec {
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
*/
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);

/**
* Copy variables back to the user-facing context
*/
int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/** @} */

/**
Expand Down Expand Up @@ -321,11 +334,6 @@ typedef struct AVCodec {
* Will be called when seeking
*/
void (*flush)(struct AVCodecContext *);
/**
* Internal codec capabilities.
* See FF_CODEC_CAP_* in internal.h
*/
int caps_internal;

/**
* Decoding only, a comma-separated list of bitstream filters to apply to
Expand Down Expand Up @@ -365,31 +373,31 @@ const AVCodec *av_codec_iterate(void **opaque);
* @param id AVCodecID of the requested decoder
* @return A decoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_decoder(enum AVCodecID id);
const AVCodec *avcodec_find_decoder(enum AVCodecID id);

/**
* Find a registered decoder with the specified name.
*
* @param name name of the requested decoder
* @return A decoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_decoder_by_name(const char *name);
const AVCodec *avcodec_find_decoder_by_name(const char *name);

/**
* Find a registered encoder with a matching codec ID.
*
* @param id AVCodecID of the requested encoder
* @return An encoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_encoder(enum AVCodecID id);
const AVCodec *avcodec_find_encoder(enum AVCodecID id);

/**
* Find a registered encoder with the specified name.
*
* @param name name of the requested encoder
* @return An encoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_encoder_by_name(const char *name);
const AVCodec *avcodec_find_encoder_by_name(const char *name);
/**
* @return a non-zero number if codec is an encoder, zero otherwise
*/
Expand All @@ -400,6 +408,15 @@ int av_codec_is_encoder(const AVCodec *codec);
*/
int av_codec_is_decoder(const AVCodec *codec);

/**
* Return a name for the specified profile, if available.
*
* @param codec the codec that is searched for the given profile
* @param profile the profile value for which a name is requested
* @return A name for the profile if found, NULL otherwise.
*/
const char *av_get_profile_name(const AVCodec *codec, int profile);

enum {
/**
* The codec supports this format via the hw_device_ctx interface.
Expand Down
63 changes: 50 additions & 13 deletions mac/include/libavcodec/codec_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define AVCODEC_CODEC_ID_H

#include "libavutil/avutil.h"
#include "libavutil/samplefmt.h"

/**
* @addtogroup lavc_core
Expand Down Expand Up @@ -246,8 +247,7 @@ enum AVCodecID {
AV_CODEC_ID_MSP2,
AV_CODEC_ID_VVC,
#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC

AV_CODEC_ID_Y41P = 0x8000,
AV_CODEC_ID_Y41P,
AV_CODEC_ID_AVRP,
AV_CODEC_ID_012V,
AV_CODEC_ID_AVUI,
Expand Down Expand Up @@ -307,6 +307,7 @@ enum AVCodecID {
AV_CODEC_ID_CRI,
AV_CODEC_ID_SIMBIOSIS_IMX,
AV_CODEC_ID_SGA_VIDEO,
AV_CODEC_ID_GEM,

/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
Expand Down Expand Up @@ -341,8 +342,7 @@ enum AVCodecID {
AV_CODEC_ID_PCM_S24LE_PLANAR,
AV_CODEC_ID_PCM_S32LE_PLANAR,
AV_CODEC_ID_PCM_S16BE_PLANAR,

AV_CODEC_ID_PCM_S64LE = 0x10800,
AV_CODEC_ID_PCM_S64LE,
AV_CODEC_ID_PCM_S64BE,
AV_CODEC_ID_PCM_F16LE,
AV_CODEC_ID_PCM_F24LE,
Expand Down Expand Up @@ -381,8 +381,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_G722,
AV_CODEC_ID_ADPCM_IMA_APC,
AV_CODEC_ID_ADPCM_VIMA,

AV_CODEC_ID_ADPCM_AFC = 0x11800,
AV_CODEC_ID_ADPCM_AFC,
AV_CODEC_ID_ADPCM_IMA_OKI,
AV_CODEC_ID_ADPCM_DTK,
AV_CODEC_ID_ADPCM_IMA_RAD,
Expand All @@ -401,6 +400,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_IMA_MTF,
AV_CODEC_ID_ADPCM_IMA_CUNNING,
AV_CODEC_ID_ADPCM_IMA_MOFLEX,
AV_CODEC_ID_ADPCM_IMA_ACORN,

/* AMR */
AV_CODEC_ID_AMR_NB = 0x12000,
Expand All @@ -415,8 +415,7 @@ enum AVCodecID {
AV_CODEC_ID_INTERPLAY_DPCM,
AV_CODEC_ID_XAN_DPCM,
AV_CODEC_ID_SOL_DPCM,

AV_CODEC_ID_SDX2_DPCM = 0x14800,
AV_CODEC_ID_SDX2_DPCM,
AV_CODEC_ID_GREMLIN_DPCM,
AV_CODEC_ID_DERF_DPCM,

Expand Down Expand Up @@ -489,8 +488,7 @@ enum AVCodecID {
AV_CODEC_ID_ON2AVC,
AV_CODEC_ID_DSS_SP,
AV_CODEC_ID_CODEC2,

AV_CODEC_ID_FFWAVESYNTH = 0x15800,
AV_CODEC_ID_FFWAVESYNTH,
AV_CODEC_ID_SONIC,
AV_CODEC_ID_SONIC_LS,
AV_CODEC_ID_EVRC,
Expand All @@ -517,6 +515,7 @@ enum AVCodecID {
AV_CODEC_ID_SIREN,
AV_CODEC_ID_HCA,
AV_CODEC_ID_FASTAUDIO,
AV_CODEC_ID_MSNSIREN,

/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
Expand All @@ -529,8 +528,7 @@ enum AVCodecID {
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
AV_CODEC_ID_DVB_TELETEXT,
AV_CODEC_ID_SRT,

AV_CODEC_ID_MICRODVD = 0x17800,
AV_CODEC_ID_MICRODVD,
AV_CODEC_ID_EIA_608,
AV_CODEC_ID_JACOSUB,
AV_CODEC_ID_SAMI,
Expand All @@ -554,7 +552,7 @@ enum AVCodecID {

AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
AV_CODEC_ID_EPG,
AV_CODEC_ID_BINTEXT = 0x18800,
AV_CODEC_ID_BINTEXT,
AV_CODEC_ID_XBIN,
AV_CODEC_ID_IDF,
AV_CODEC_ID_OTF,
Expand Down Expand Up @@ -585,6 +583,45 @@ enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
*/
const char *avcodec_get_name(enum AVCodecID id);

/**
* Return codec bits per sample.
*
* @param[in] codec_id the codec
* @return Number of bits per sample or zero if unknown for the given codec.
*/
int av_get_bits_per_sample(enum AVCodecID codec_id);

/**
* Return codec bits per sample.
* Only return non-zero if the bits per sample is exactly correct, not an
* approximation.
*
* @param[in] codec_id the codec
* @return Number of bits per sample or zero if unknown for the given codec.
*/
int av_get_exact_bits_per_sample(enum AVCodecID codec_id);

/**
* Return a name for the specified profile, if available.
*
* @param codec_id the ID of the codec to which the requested profile belongs
* @param profile the profile value for which a name is requested
* @return A name for the profile if found, NULL otherwise.
*
* @note unlike av_get_profile_name(), which searches a list of profiles
* supported by a specific decoder or encoder implementation, this
* function searches the list of profiles from the AVCodecDescriptor
*/
const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);

/**
* Return the PCM codec associated with a sample format.
* @param be endianness, 0 for little, 1 for big,
* -1 (or anything else) for native
* @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
*/
enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);

/**
* @}
*/
Expand Down
5 changes: 5 additions & 0 deletions mac/include/libavcodec/codec_par.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ void avcodec_parameters_free(AVCodecParameters **par);
*/
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src);

/**
* This function is the same as av_get_audio_frame_duration(), except it works
* with AVCodecParameters instead of an AVCodecContext.
*/
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);

/**
* @}
Expand Down
Loading

0 comments on commit 5ef8a66

Please sign in to comment.