Update FFmpeg to version 4.
This commit is contained in:
61 files changed
+2100
-1634
No files matched your search
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* AC-3 parser prototypes
|
||||
* Copyright (c) 2003 Fabrice Bellard
|
||||
* Copyright (c) 2003 Michael Niedermayer
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AC3_PARSER_H
|
||||
#define AVCODEC_AC3_PARSER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Extract the bitstream ID and the frame size from AC-3 data.
|
||||
*/
|
||||
int av_ac3_parse_header(const uint8_t *buf, size_t size,
|
||||
uint8_t *bitstream_id, uint16_t *frame_size);
|
||||
|
||||
|
||||
#endif /* AVCODEC_AC3_PARSER_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_ADTS_PARSER_H
|
||||
#define AVCODEC_ADTS_PARSER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define AV_AAC_ADTS_HEADER_SIZE 7
|
||||
|
||||
/**
|
||||
* Extract the number of samples and frames from AAC data.
|
||||
* @param[in] buf pointer to AAC data buffer
|
||||
* @param[out] samples Pointer to where number of samples is written
|
||||
* @param[out] frames Pointer to where number of frames is written
|
||||
* @return Returns 0 on success, error code on failure.
|
||||
*/
|
||||
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
|
||||
uint8_t *frames);
|
||||
|
||||
#endif /* AVCODEC_ADTS_PARSER_H */
|
||||
+491
-694
File diff suppressed because it is too large.
Load diff
@@ -77,115 +77,6 @@ struct attribute_deprecated vaapi_context {
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
uint32_t context_id;
|
||||
|
||||
#if FF_API_VAAPI_CONTEXT
|
||||
/**
|
||||
* VAPictureParameterBuffer ID
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint32_t pic_param_buf_id;
|
||||
|
||||
/**
|
||||
* VAIQMatrixBuffer ID
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint32_t iq_matrix_buf_id;
|
||||
|
||||
/**
|
||||
* VABitPlaneBuffer ID (for VC-1 decoding)
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint32_t bitplane_buf_id;
|
||||
|
||||
/**
|
||||
* Slice parameter/data buffer IDs
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint32_t *slice_buf_ids;
|
||||
|
||||
/**
|
||||
* Number of effective slice buffer IDs to send to the HW
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned int n_slice_buf_ids;
|
||||
|
||||
/**
|
||||
* Size of pre-allocated slice_buf_ids
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned int slice_buf_ids_alloc;
|
||||
|
||||
/**
|
||||
* Pointer to VASliceParameterBuffers
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
void *slice_params;
|
||||
|
||||
/**
|
||||
* Size of a VASliceParameterBuffer element
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned int slice_param_size;
|
||||
|
||||
/**
|
||||
* Size of pre-allocated slice_params
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned int slice_params_alloc;
|
||||
|
||||
/**
|
||||
* Number of slices currently filled in
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned int slice_count;
|
||||
|
||||
/**
|
||||
* Pointer to slice data buffer base
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
const uint8_t *slice_data;
|
||||
|
||||
/**
|
||||
* Current size of slice data
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint32_t slice_data_size;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* @} */
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
/*
|
||||
* VDA HW acceleration
|
||||
*
|
||||
* copyright (c) 2011 Sebastien Zwickert
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VDA_H
|
||||
#define AVCODEC_VDA_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_vda
|
||||
* Public libavcodec VDA header.
|
||||
*/
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
|
||||
// http://openradar.appspot.com/8026390
|
||||
#undef __GNUC_STDC_INLINE__
|
||||
|
||||
#define Picture QuickdrawPicture
|
||||
#include <VideoDecodeAcceleration/VDADecoder.h>
|
||||
#undef Picture
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
|
||||
// extra flags not defined in VDADecoder.h
|
||||
enum {
|
||||
kVDADecodeInfo_Asynchronous = 1UL << 0,
|
||||
kVDADecodeInfo_FrameDropped = 1UL << 1
|
||||
};
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vda VDA
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This structure is used to provide the necessary configurations and data
|
||||
* to the VDA FFmpeg HWAccel implementation.
|
||||
*
|
||||
* The application must make it available as AVCodecContext.hwaccel_context.
|
||||
*/
|
||||
struct vda_context {
|
||||
/**
|
||||
* VDA decoder object.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
VDADecoder decoder;
|
||||
|
||||
/**
|
||||
* The Core Video pixel buffer that contains the current image data.
|
||||
*
|
||||
* encoding: unused
|
||||
* decoding: Set by libavcodec. Unset by user.
|
||||
*/
|
||||
CVPixelBufferRef cv_buffer;
|
||||
|
||||
/**
|
||||
* Use the hardware decoder in synchronous mode.
|
||||
*
|
||||
* encoding: unused
|
||||
* decoding: Set by user.
|
||||
*/
|
||||
int use_sync_decoding;
|
||||
|
||||
/**
|
||||
* The frame width.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int width;
|
||||
|
||||
/**
|
||||
* The frame height.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int height;
|
||||
|
||||
/**
|
||||
* The frame format.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int format;
|
||||
|
||||
/**
|
||||
* The pixel format for output image buffers.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
OSType cv_pix_fmt_type;
|
||||
|
||||
/**
|
||||
* unused
|
||||
*/
|
||||
uint8_t *priv_bitstream;
|
||||
|
||||
/**
|
||||
* unused
|
||||
*/
|
||||
int priv_bitstream_size;
|
||||
|
||||
/**
|
||||
* unused
|
||||
*/
|
||||
int priv_allocated_size;
|
||||
|
||||
/**
|
||||
* Use av_buffer to manage buffer.
|
||||
* When the flag is set, the CVPixelBuffers returned by the decoder will
|
||||
* be released automatically, so you have to retain them if necessary.
|
||||
* Not setting this flag may cause memory leak.
|
||||
*
|
||||
* encoding: unused
|
||||
* decoding: Set by user.
|
||||
*/
|
||||
int use_ref_buffer;
|
||||
};
|
||||
|
||||
/** Create the video decoder. */
|
||||
int ff_vda_create_decoder(struct vda_context *vda_ctx,
|
||||
uint8_t *extradata,
|
||||
int extradata_size);
|
||||
|
||||
/** Destroy the video decoder. */
|
||||
int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
|
||||
|
||||
/**
|
||||
* This struct holds all the information that needs to be passed
|
||||
* between the caller and libavcodec for initializing VDA decoding.
|
||||
* Its size is not a part of the public ABI, it must be allocated with
|
||||
* av_vda_alloc_context() and freed with av_free().
|
||||
*/
|
||||
typedef struct AVVDAContext {
|
||||
/**
|
||||
* VDA decoder object. Created and freed by the caller.
|
||||
*/
|
||||
VDADecoder decoder;
|
||||
|
||||
/**
|
||||
* The output callback that must be passed to VDADecoderCreate.
|
||||
* Set by av_vda_alloc_context().
|
||||
*/
|
||||
VDADecoderOutputCallback output_callback;
|
||||
|
||||
/**
|
||||
* CVPixelBuffer Format Type that VDA will use for decoded frames; set by
|
||||
* the caller.
|
||||
*/
|
||||
OSType cv_pix_fmt_type;
|
||||
} AVVDAContext;
|
||||
|
||||
/**
|
||||
* Allocate and initialize a VDA context.
|
||||
*
|
||||
* This function should be called from the get_format() callback when the caller
|
||||
* selects the AV_PIX_FMT_VDA format. The caller must then create the decoder
|
||||
* object (using the output callback provided by libavcodec) that will be used
|
||||
* for VDA-accelerated decoding.
|
||||
*
|
||||
* When decoding with VDA is finished, the caller must destroy the decoder
|
||||
* object and free the VDA context using av_free().
|
||||
*
|
||||
* @return the newly allocated context or NULL on failure
|
||||
*/
|
||||
AVVDAContext *av_vda_alloc_context(void);
|
||||
|
||||
/**
|
||||
* This is a convenience function that creates and sets up the VDA context using
|
||||
* an internal implementation.
|
||||
*
|
||||
* @param avctx the corresponding codec context
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR code on failure
|
||||
*/
|
||||
int av_vda_default_init(AVCodecContext *avctx);
|
||||
|
||||
/**
|
||||
* This is a convenience function that creates and sets up the VDA context using
|
||||
* an internal implementation.
|
||||
*
|
||||
* @param avctx the corresponding codec context
|
||||
* @param vdactx the VDA context to use
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR code on failure
|
||||
*/
|
||||
int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx);
|
||||
|
||||
/**
|
||||
* This function must be called to free the VDA context initialized with
|
||||
* av_vda_default_init().
|
||||
*
|
||||
* @param avctx the corresponding codec context
|
||||
*/
|
||||
void av_vda_default_free(AVCodecContext *avctx);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVCODEC_VDA_H */
|
||||
@@ -57,15 +57,6 @@
|
||||
#include "avcodec.h"
|
||||
#include "version.h"
|
||||
|
||||
#if FF_API_BUFS_VDPAU
|
||||
union AVVDPAUPictureInfo {
|
||||
VdpPictureInfoH264 h264;
|
||||
VdpPictureInfoMPEG1Or2 mpeg;
|
||||
VdpPictureInfoVC1 vc1;
|
||||
VdpPictureInfoMPEG4Part2 mpeg4;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct AVCodecContext;
|
||||
struct AVFrame;
|
||||
|
||||
@@ -102,40 +93,6 @@ typedef struct AVVDPAUContext {
|
||||
*/
|
||||
VdpDecoderRender *render;
|
||||
|
||||
#if FF_API_BUFS_VDPAU
|
||||
/**
|
||||
* VDPAU picture information
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
attribute_deprecated
|
||||
union AVVDPAUPictureInfo info;
|
||||
|
||||
/**
|
||||
* Allocated size of the bitstream_buffers table.
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int bitstream_buffers_allocated;
|
||||
|
||||
/**
|
||||
* Useful bitstream buffers in the bitstream buffers table.
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int bitstream_buffers_used;
|
||||
|
||||
/**
|
||||
* Table of bitstream buffers.
|
||||
* The user is responsible for freeing this buffer using av_freep().
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
attribute_deprecated
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
#endif
|
||||
AVVDPAU_Render2 render2;
|
||||
} AVVDPAUContext;
|
||||
|
||||
@@ -214,40 +171,6 @@ attribute_deprecated
|
||||
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
|
||||
#endif
|
||||
|
||||
#if FF_API_CAP_VDPAU
|
||||
/** @brief The videoSurface is used for rendering. */
|
||||
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
|
||||
|
||||
/**
|
||||
* @brief The videoSurface is needed for reference/prediction.
|
||||
* The codec manipulates this.
|
||||
*/
|
||||
#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
|
||||
|
||||
/**
|
||||
* @brief This structure is used as a callback between the FFmpeg
|
||||
* decoder (vd_) and presentation (vo_) module.
|
||||
* This is used for defining a video frame containing surface,
|
||||
* picture parameter, bitstream information etc which are passed
|
||||
* between the FFmpeg decoder and its clients.
|
||||
*/
|
||||
struct vdpau_render_state {
|
||||
VdpVideoSurface surface; ///< Used as rendered surface, never changed.
|
||||
|
||||
int state; ///< Holds FF_VDPAU_STATE_* values.
|
||||
|
||||
/** picture parameter information for all supported codecs */
|
||||
union AVVDPAUPictureInfo info;
|
||||
|
||||
/** Describe size/location of the compressed video data.
|
||||
Set to 0 when freeing bitstream_buffers. */
|
||||
int bitstream_buffers_allocated;
|
||||
int bitstream_buffers_used;
|
||||
/** The user is responsible for freeing this buffer using av_freep(). */
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* @}*/
|
||||
|
||||
#endif /* AVCODEC_VDPAU_H */
|
||||
@@ -27,9 +27,9 @@
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 57
|
||||
#define LIBAVCODEC_VERSION_MINOR 94
|
||||
#define LIBAVCODEC_VERSION_MICRO 101
|
||||
#define LIBAVCODEC_VERSION_MAJOR 58
|
||||
#define LIBAVCODEC_VERSION_MINOR 18
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
@@ -51,139 +51,18 @@
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*/
|
||||
|
||||
#ifndef FF_API_VIMA_DECODER
|
||||
#define FF_API_VIMA_DECODER (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AUDIO_CONVERT
|
||||
#define FF_API_AUDIO_CONVERT (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AVCODEC_RESAMPLE
|
||||
#define FF_API_AVCODEC_RESAMPLE FF_API_AUDIO_CONVERT
|
||||
#endif
|
||||
#ifndef FF_API_GETCHROMA
|
||||
#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_MISSING_SAMPLE
|
||||
#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LOWRES
|
||||
#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_CAP_VDPAU
|
||||
#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_BUFS_VDPAU
|
||||
#define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_VOXWARE
|
||||
#define FF_API_VOXWARE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_SET_DIMENSIONS
|
||||
#define FF_API_SET_DIMENSIONS (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_DEBUG_MV
|
||||
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AC_VLC
|
||||
#define FF_API_AC_VLC (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_MSMPEG4
|
||||
#define FF_API_OLD_MSMPEG4 (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_ASPECT_EXTENDED
|
||||
#define FF_API_ASPECT_EXTENDED (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_ARCH_ALPHA
|
||||
#define FF_API_ARCH_ALPHA (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_XVMC
|
||||
#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_ERROR_RATE
|
||||
#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_QSCALE_TYPE
|
||||
#define FF_API_QSCALE_TYPE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_MB_TYPE
|
||||
#define FF_API_MB_TYPE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_MAX_BFRAMES
|
||||
#define FF_API_MAX_BFRAMES (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_NEG_LINESIZES
|
||||
#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_EMU_EDGE
|
||||
#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_ARCH_SH4
|
||||
#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_ARCH_SPARC
|
||||
#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_UNUSED_MEMBERS
|
||||
#define FF_API_UNUSED_MEMBERS (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_IDCT_XVIDMMX
|
||||
#define FF_API_IDCT_XVIDMMX (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_INPUT_PRESERVED
|
||||
#define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_NORMALIZE_AQP
|
||||
#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_GMC
|
||||
#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_MV0
|
||||
#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_CODEC_NAME
|
||||
#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AFD
|
||||
#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_VISMV
|
||||
/* XXX: don't forget to drop the -vismv documentation */
|
||||
#define FF_API_VISMV (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AUDIOENC_DELAY
|
||||
#define FF_API_AUDIOENC_DELAY (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_VAAPI_CONTEXT
|
||||
#define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_MERGE_SD
|
||||
#define FF_API_MERGE_SD (LIBAVCODEC_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_AVCTX_TIMEBASE
|
||||
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_MPV_OPT
|
||||
#define FF_API_MPV_OPT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_STREAM_CODEC_TAG
|
||||
#define FF_API_STREAM_CODEC_TAG (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_QUANT_BIAS
|
||||
#define FF_API_QUANT_BIAS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_RC_STRATEGY
|
||||
#define FF_API_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CODED_FRAME
|
||||
#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_MOTION_EST
|
||||
#define FF_API_MOTION_EST (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_WITHOUT_PREFIX
|
||||
#define FF_API_WITHOUT_PREFIX (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_SIDEDATA_ONLY_PKT
|
||||
#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
@@ -238,6 +117,21 @@
|
||||
#ifndef FF_API_TAG_STRING
|
||||
#define FF_API_TAG_STRING (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_GETCHROMA
|
||||
#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CODEC_GET_SET
|
||||
#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_USER_VISIBLE_AVHWACCEL
|
||||
#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LOCKMGR
|
||||
#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* AVCODEC_VERSION_H */
|
||||
@@ -194,6 +194,21 @@ typedef struct AVFilter {
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* Filter pre-initialization function
|
||||
*
|
||||
* This callback will be called immediately after the filter context is
|
||||
* allocated, to allow allocating and initing sub-objects.
|
||||
*
|
||||
* If this callback is not NULL, the uninit callback will be called on
|
||||
* allocation failure.
|
||||
*
|
||||
* @return 0 on success,
|
||||
* AVERROR code on failure (but the code will be
|
||||
* dropped and treated as ENOMEM by the calling code)
|
||||
*/
|
||||
int (*preinit)(AVFilterContext *ctx);
|
||||
|
||||
/**
|
||||
* Filter initialization function.
|
||||
*
|
||||
@@ -391,6 +406,22 @@ struct AVFilterContext {
|
||||
* a higher value suggests a more urgent activation.
|
||||
*/
|
||||
unsigned ready;
|
||||
|
||||
/**
|
||||
* Sets the number of extra hardware frames which the filter will
|
||||
* allocate on its output links for use in following filters or by
|
||||
* the caller.
|
||||
*
|
||||
* Some hardware filters require all frames that they will use for
|
||||
* output to be defined in advance before filtering starts. For such
|
||||
* filters, any hardware frame pools used for output must therefore be
|
||||
* of fixed size. The extra frames set here are on top of any number
|
||||
* that the filter needs internally in order to operate normally.
|
||||
*
|
||||
* This field must be set before the graph containing this filter is
|
||||
* configured.
|
||||
*/
|
||||
int extra_hw_frames;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -632,10 +663,14 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
|
||||
*/
|
||||
void avfilter_link_free(AVFilterLink **link);
|
||||
|
||||
#if FF_API_FILTER_GET_SET
|
||||
/**
|
||||
* Get the number of channels of a link.
|
||||
* @deprecated Use av_buffersink_get_channels()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avfilter_link_get_channels(AVFilterLink *link);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Set the closed field of a link.
|
||||
@@ -662,14 +697,21 @@ int avfilter_config_links(AVFilterContext *filter);
|
||||
*/
|
||||
int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags);
|
||||
|
||||
/** Initialize the filter system. Register all builtin filters. */
|
||||
void avfilter_register_all(void);
|
||||
/**
|
||||
* Iterate over all registered filters.
|
||||
*
|
||||
* @param opaque a pointer where libavfilter will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered filter or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVFilter *av_filter_iterate(void **opaque);
|
||||
|
||||
#if FF_API_OLD_FILTER_REGISTER
|
||||
/** Uninitialize the filter system. Unregister all filters. */
|
||||
#if FF_API_NEXT
|
||||
/** Initialize the filter system. Register all builtin filters. */
|
||||
attribute_deprecated
|
||||
void avfilter_uninit(void);
|
||||
#endif
|
||||
void avfilter_register_all(void);
|
||||
|
||||
/**
|
||||
* Register a filter. This is only needed if you plan to use
|
||||
@@ -681,8 +723,18 @@ void avfilter_uninit(void);
|
||||
* @return 0 if the registration was successful, a negative value
|
||||
* otherwise
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avfilter_register(AVFilter *filter);
|
||||
|
||||
/**
|
||||
* Iterate over all registered filters.
|
||||
* @return If prev is non-NULL, next registered filter after prev or NULL if
|
||||
* prev is the last filter. If prev is NULL, return the first registered filter.
|
||||
*/
|
||||
attribute_deprecated
|
||||
const AVFilter *avfilter_next(const AVFilter *prev);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get a filter definition matching the given name.
|
||||
*
|
||||
@@ -690,60 +742,8 @@ int avfilter_register(AVFilter *filter);
|
||||
* @return the filter definition, if any matching one is registered.
|
||||
* NULL if none found.
|
||||
*/
|
||||
#if !FF_API_NOCONST_GET_NAME
|
||||
const
|
||||
#endif
|
||||
AVFilter *avfilter_get_by_name(const char *name);
|
||||
const AVFilter *avfilter_get_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* Iterate over all registered filters.
|
||||
* @return If prev is non-NULL, next registered filter after prev or NULL if
|
||||
* prev is the last filter. If prev is NULL, return the first registered filter.
|
||||
*/
|
||||
const AVFilter *avfilter_next(const AVFilter *prev);
|
||||
|
||||
#if FF_API_OLD_FILTER_REGISTER
|
||||
/**
|
||||
* If filter is NULL, returns a pointer to the first registered filter pointer,
|
||||
* if filter is non-NULL, returns the next pointer after filter.
|
||||
* If the returned pointer points to NULL, the last registered filter
|
||||
* was already reached.
|
||||
* @deprecated use avfilter_next()
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVFilter **av_filter_next(AVFilter **filter);
|
||||
#endif
|
||||
|
||||
#if FF_API_AVFILTER_OPEN
|
||||
/**
|
||||
* Create a filter instance.
|
||||
*
|
||||
* @param filter_ctx put here a pointer to the created filter context
|
||||
* on success, NULL on failure
|
||||
* @param filter the filter to create an instance of
|
||||
* @param inst_name Name to give to the new instance. Can be NULL for none.
|
||||
* @return >= 0 in case of success, a negative error code otherwise
|
||||
* @deprecated use avfilter_graph_alloc_filter() instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name);
|
||||
#endif
|
||||
|
||||
|
||||
#if FF_API_AVFILTER_INIT_FILTER
|
||||
/**
|
||||
* Initialize a filter.
|
||||
*
|
||||
* @param filter the filter to initialize
|
||||
* @param args A string of parameters to use when initializing the filter.
|
||||
* The format and meaning of this string varies by filter.
|
||||
* @param opaque Any extra non-string data needed by the filter. The meaning
|
||||
* of this parameter varies by filter.
|
||||
* @return zero on success
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialize a filter with the supplied parameters.
|
||||
@@ -944,20 +944,6 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
|
||||
*/
|
||||
AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *name);
|
||||
|
||||
#if FF_API_AVFILTER_OPEN
|
||||
/**
|
||||
* Add an existing filter instance to a filter graph.
|
||||
*
|
||||
* @param graphctx the filter graph
|
||||
* @param filter the filter to be added
|
||||
*
|
||||
* @deprecated use avfilter_graph_alloc_filter() to allocate a filter in a
|
||||
* filter graph
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Create and add a filter instance into an existing graph.
|
||||
* The filter instance is created from the filter filt and inited
|
||||
|
||||
@@ -62,7 +62,7 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag
|
||||
/**
|
||||
* Struct to use for initializing a buffersink context.
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct AVBufferSinkParams {
|
||||
const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE
|
||||
} AVBufferSinkParams;
|
||||
|
||||
@@ -76,7 +76,7 @@ AVBufferSinkParams *av_buffersink_params_alloc(void);
|
||||
/**
|
||||
* Struct to use for initializing an abuffersink context.
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct AVABufferSinkParams {
|
||||
const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE
|
||||
const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1
|
||||
const int *channel_counts; ///< list of allowed channel counts, terminated by -1
|
||||
|
||||
@@ -193,6 +193,14 @@ av_warn_unused_result
|
||||
int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
|
||||
AVFrame *frame, int flags);
|
||||
|
||||
/**
|
||||
* Close the buffer source after EOF.
|
||||
*
|
||||
* This is similar to passing NULL to av_buffersrc_add_frame_flags()
|
||||
* except it takes the timestamp of the EOF, i.e. the timestamp of the end
|
||||
* of the last frame.
|
||||
*/
|
||||
int av_buffersrc_close(AVFilterContext *ctx, int64_t pts, unsigned flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define LIBAVFILTER_VERSION_MAJOR 6
|
||||
#define LIBAVFILTER_VERSION_MINOR 88
|
||||
#define LIBAVFILTER_VERSION_MAJOR 7
|
||||
#define LIBAVFILTER_VERSION_MINOR 16
|
||||
#define LIBAVFILTER_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
||||
@@ -49,26 +49,17 @@
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*/
|
||||
|
||||
#ifndef FF_API_OLD_FILTER_OPTS
|
||||
#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_FILTER_OPTS_ERROR
|
||||
#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#endif
|
||||
#ifndef FF_API_AVFILTER_OPEN
|
||||
#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#endif
|
||||
#ifndef FF_API_AVFILTER_INIT_FILTER
|
||||
#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_FILTER_REGISTER
|
||||
#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#endif
|
||||
#ifndef FF_API_NOCONST_GET_NAME
|
||||
#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 8)
|
||||
#endif
|
||||
#ifndef FF_API_LAVR_OPTS
|
||||
#define FF_API_LAVR_OPTS (LIBAVFILTER_VERSION_MAJOR < 7)
|
||||
#define FF_API_LAVR_OPTS (LIBAVFILTER_VERSION_MAJOR < 8)
|
||||
#endif
|
||||
#ifndef FF_API_FILTER_GET_SET
|
||||
#define FF_API_FILTER_GET_SET (LIBAVFILTER_VERSION_MAJOR < 8)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8)
|
||||
#endif
|
||||
|
||||
#endif /* AVFILTER_VERSION_H */
|
||||
@@ -437,19 +437,6 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
|
||||
*/
|
||||
int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
|
||||
|
||||
#if FF_API_LAVF_FRAC
|
||||
/*************************************************/
|
||||
/* fractional numbers for exact pts handling */
|
||||
|
||||
/**
|
||||
* The exact value of the fractional number is: 'val + num / den'.
|
||||
* num is assumed to be 0 <= num < den.
|
||||
*/
|
||||
typedef struct AVFrac {
|
||||
int64_t val, num, den;
|
||||
} AVFrac;
|
||||
#endif
|
||||
|
||||
/*************************************************/
|
||||
/* input/output formats */
|
||||
|
||||
@@ -478,10 +465,6 @@ typedef struct AVProbeData {
|
||||
#define AVFMT_NOFILE 0x0001
|
||||
#define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */
|
||||
#define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */
|
||||
#if FF_API_LAVF_FMT_RAWPICTURE
|
||||
#define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for
|
||||
raw picture data. @deprecated Not used anymore */
|
||||
#endif
|
||||
#define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */
|
||||
#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */
|
||||
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
|
||||
@@ -802,9 +785,9 @@ enum AVStreamParseType {
|
||||
AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */
|
||||
AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
|
||||
AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
|
||||
AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp and position generation by parser for raw
|
||||
this assumes that each packet in the file contains no demuxer level headers and
|
||||
just codec level data, otherwise position generation would fail */
|
||||
AVSTREAM_PARSE_FULL_RAW, /**< full parsing and repack with timestamp and position generation by parser for raw
|
||||
this assumes that each packet in the file contains no demuxer level headers and
|
||||
just codec level data, otherwise position generation would fail */
|
||||
};
|
||||
|
||||
typedef struct AVIndexEntry {
|
||||
@@ -862,6 +845,7 @@ typedef struct AVStreamInternal AVStreamInternal;
|
||||
#define AV_DISPOSITION_CAPTIONS 0x10000
|
||||
#define AV_DISPOSITION_DESCRIPTIONS 0x20000
|
||||
#define AV_DISPOSITION_METADATA 0x40000
|
||||
#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts)
|
||||
|
||||
/**
|
||||
* Options for behavior on timestamp wrap detection.
|
||||
@@ -894,14 +878,6 @@ typedef struct AVStream {
|
||||
#endif
|
||||
void *priv_data;
|
||||
|
||||
#if FF_API_LAVF_FRAC
|
||||
/**
|
||||
* @deprecated this field is unused
|
||||
*/
|
||||
attribute_deprecated
|
||||
struct AVFrac pts;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is the fundamental unit of time (in seconds) in terms
|
||||
* of which frame timestamps are represented.
|
||||
@@ -1001,6 +977,39 @@ typedef struct AVStream {
|
||||
int event_flags;
|
||||
#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata.
|
||||
|
||||
/**
|
||||
* Real base framerate of the stream.
|
||||
* This is the lowest framerate with which all timestamps can be
|
||||
* represented accurately (it is the least common multiple of all
|
||||
* framerates in the stream). Note, this value is just a guess!
|
||||
* For example, if the time base is 1/90000 and all frames have either
|
||||
* approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
|
||||
*/
|
||||
AVRational r_frame_rate;
|
||||
|
||||
#if FF_API_LAVF_FFSERVER
|
||||
/**
|
||||
* String containing pairs of key and values describing recommended encoder configuration.
|
||||
* Pairs are separated by ','.
|
||||
* Keys are separated from values by '='.
|
||||
*
|
||||
* @deprecated unused
|
||||
*/
|
||||
attribute_deprecated
|
||||
char *recommended_encoder_configuration;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Codec parameters associated with this stream. Allocated and freed by
|
||||
* libavformat in avformat_new_stream() and avformat_free_context()
|
||||
* respectively.
|
||||
*
|
||||
* - demuxing: filled by libavformat on stream creation or in
|
||||
* avformat_find_stream_info()
|
||||
* - muxing: filled by the caller before avformat_write_header()
|
||||
*/
|
||||
AVCodecParameters *codecpar;
|
||||
|
||||
/*****************************************************************
|
||||
* All fields below this line are not part of the public API. They
|
||||
* may not be used outside of libavformat and can be changed and
|
||||
@@ -1011,10 +1020,10 @@ typedef struct AVStream {
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
#define MAX_STD_TIMEBASES (30*12+30+3+6)
|
||||
/**
|
||||
* Stream information used internally by avformat_find_stream_info()
|
||||
*/
|
||||
#define MAX_STD_TIMEBASES (30*12+30+3+6)
|
||||
struct {
|
||||
int64_t last_dts;
|
||||
int64_t duration_gcd;
|
||||
@@ -1023,6 +1032,7 @@ typedef struct AVStream {
|
||||
double (*duration_error)[2][MAX_STD_TIMEBASES];
|
||||
int64_t codec_info_duration;
|
||||
int64_t codec_info_duration_fields;
|
||||
int frame_delay_evidence;
|
||||
|
||||
/**
|
||||
* 0 -> decoder has not been searched for yet.
|
||||
@@ -1085,19 +1095,6 @@ typedef struct AVStream {
|
||||
int nb_index_entries;
|
||||
unsigned int index_entries_allocated_size;
|
||||
|
||||
/**
|
||||
* Real base framerate of the stream.
|
||||
* This is the lowest framerate with which all timestamps can be
|
||||
* represented accurately (it is the least common multiple of all
|
||||
* framerates in the stream). Note, this value is just a guess!
|
||||
* For example, if the time base is 1/90000 and all frames have either
|
||||
* approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
|
||||
*
|
||||
* Code outside avformat should access this field using:
|
||||
* av_stream_get/set_r_frame_rate(stream)
|
||||
*/
|
||||
AVRational r_frame_rate;
|
||||
|
||||
/**
|
||||
* Stream Identifier
|
||||
* This is the MPEG-TS stream identifier +1
|
||||
@@ -1203,19 +1200,6 @@ typedef struct AVStream {
|
||||
*/
|
||||
int inject_global_side_data;
|
||||
|
||||
/*****************************************************************
|
||||
* All fields above this line are not part of the public API.
|
||||
* Fields below are part of the public API and ABI again.
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* String containing paris of key and values describing recommended encoder configuration.
|
||||
* Paris are separated by ','.
|
||||
* Keys are separated from values by '='.
|
||||
*/
|
||||
char *recommended_encoder_configuration;
|
||||
|
||||
/**
|
||||
* display aspect ratio (0 if unknown)
|
||||
* - encoding: unused
|
||||
@@ -1223,31 +1207,31 @@ typedef struct AVStream {
|
||||
*/
|
||||
AVRational display_aspect_ratio;
|
||||
|
||||
struct FFFrac *priv_pts;
|
||||
|
||||
/**
|
||||
* An opaque field for libavformat internal usage.
|
||||
* Must not be accessed in any way by callers.
|
||||
*/
|
||||
AVStreamInternal *internal;
|
||||
|
||||
/*
|
||||
* Codec parameters associated with this stream. Allocated and freed by
|
||||
* libavformat in avformat_new_stream() and avformat_free_context()
|
||||
* respectively.
|
||||
*
|
||||
* - demuxing: filled by libavformat on stream creation or in
|
||||
* avformat_find_stream_info()
|
||||
* - muxing: filled by the caller before avformat_write_header()
|
||||
*/
|
||||
AVCodecParameters *codecpar;
|
||||
} AVStream;
|
||||
|
||||
#if FF_API_FORMAT_GET_SET
|
||||
/**
|
||||
* Accessors for some AVStream fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVRational av_stream_get_r_frame_rate(const AVStream *s);
|
||||
attribute_deprecated
|
||||
void av_stream_set_r_frame_rate(AVStream *s, AVRational r);
|
||||
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
|
||||
#if FF_API_LAVF_FFSERVER
|
||||
attribute_deprecated
|
||||
char* av_stream_get_recommended_encoder_configuration(const AVStream *s);
|
||||
attribute_deprecated
|
||||
void av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
|
||||
|
||||
/**
|
||||
* Returns the pts of the last muxed packet + its duration
|
||||
@@ -1292,6 +1276,11 @@ typedef struct AVProgram {
|
||||
|
||||
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
|
||||
(streams are added dynamically) */
|
||||
#define AVFMTCTX_UNSEEKABLE 0x0002 /**< signal that the stream is definitely
|
||||
not seekable, and attempts to call the
|
||||
seek function will fail. For some
|
||||
network protocols (e.g. HLS), this can
|
||||
change dynamically at runtime. */
|
||||
|
||||
typedef struct AVChapter {
|
||||
int id; ///< unique ID to identify the chapter
|
||||
@@ -1406,13 +1395,33 @@ typedef struct AVFormatContext {
|
||||
*/
|
||||
AVStream **streams;
|
||||
|
||||
#if FF_API_FORMAT_FILENAME
|
||||
/**
|
||||
* input or output filename
|
||||
*
|
||||
* - demuxing: set by avformat_open_input()
|
||||
* - muxing: may be set by the caller before avformat_write_header()
|
||||
*
|
||||
* @deprecated Use url instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
char filename[1024];
|
||||
#endif
|
||||
|
||||
/**
|
||||
* input or output URL. Unlike the old filename field, this field has no
|
||||
* length restriction.
|
||||
*
|
||||
* - demuxing: set by avformat_open_input(), initialized to an empty
|
||||
* string if url parameter was NULL in avformat_open_input().
|
||||
* - muxing: may be set by the caller before calling avformat_write_header()
|
||||
* (or avformat_init_output() if that is called first) to a string
|
||||
* which is freeable by av_free(). Set to an empty string if it
|
||||
* was NULL in avformat_init_output().
|
||||
*
|
||||
* Freed by libavformat in avformat_free_context().
|
||||
*/
|
||||
char *url;
|
||||
|
||||
/**
|
||||
* Position of the first frame of the component, in
|
||||
@@ -1469,11 +1478,11 @@ typedef struct AVFormatContext {
|
||||
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
|
||||
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
|
||||
#if FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate. Deprecated, will be the default.
|
||||
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Deprecated, does nothing.
|
||||
#endif
|
||||
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
|
||||
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
|
||||
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer
|
||||
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
|
||||
|
||||
/**
|
||||
* Maximum size of the data read from input for determining
|
||||
@@ -1876,7 +1885,7 @@ typedef struct AVFormatContext {
|
||||
*/
|
||||
char *protocol_whitelist;
|
||||
|
||||
/*
|
||||
/**
|
||||
* A callback for opening new IO streams.
|
||||
*
|
||||
* Whenever a muxer or a demuxer needs to open an IO stream (typically from
|
||||
@@ -1919,29 +1928,46 @@ typedef struct AVFormatContext {
|
||||
int max_streams;
|
||||
} AVFormatContext;
|
||||
|
||||
#if FF_API_FORMAT_GET_SET
|
||||
/**
|
||||
* Accessors for some AVFormatContext fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_format_get_probe_score(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_video_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_audio_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
AVCodec * av_format_get_data_codec(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_data_codec(AVFormatContext *s, AVCodec *c);
|
||||
attribute_deprecated
|
||||
int av_format_get_metadata_header_padding(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_metadata_header_padding(AVFormatContext *s, int c);
|
||||
attribute_deprecated
|
||||
void * av_format_get_opaque(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_opaque(AVFormatContext *s, void *opaque);
|
||||
attribute_deprecated
|
||||
av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s);
|
||||
attribute_deprecated
|
||||
void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback);
|
||||
#if FF_API_OLD_OPEN_CALLBACKS
|
||||
attribute_deprecated AVOpenCallback av_format_get_open_cb(const AVFormatContext *s);
|
||||
attribute_deprecated void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This function will cause global side data to be injected in the next packet
|
||||
@@ -1986,6 +2012,7 @@ const char *avformat_configuration(void);
|
||||
*/
|
||||
const char *avformat_license(void);
|
||||
|
||||
#if FF_API_NEXT
|
||||
/**
|
||||
* Initialize libavformat and register all the muxers, demuxers and
|
||||
* protocols. If you do not call this function, then you can select
|
||||
@@ -1994,31 +2021,44 @@ const char *avformat_license(void);
|
||||
* @see av_register_input_format()
|
||||
* @see av_register_output_format()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_register_all(void);
|
||||
|
||||
attribute_deprecated
|
||||
void av_register_input_format(AVInputFormat *format);
|
||||
attribute_deprecated
|
||||
void av_register_output_format(AVOutputFormat *format);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Do global initialization of network components. This is optional,
|
||||
* but recommended, since it avoids the overhead of implicitly
|
||||
* doing the setup for each session.
|
||||
* Do global initialization of network libraries. This is optional,
|
||||
* and not recommended anymore.
|
||||
*
|
||||
* Calling this function will become mandatory if using network
|
||||
* protocols at some major version bump.
|
||||
* This functions only exists to work around thread-safety issues
|
||||
* with older GnuTLS or OpenSSL libraries. If libavformat is linked
|
||||
* to newer versions of those libraries, or if you do not use them,
|
||||
* calling this function is unnecessary. Otherwise, you need to call
|
||||
* this function before any other threads using them are started.
|
||||
*
|
||||
* This function will be deprecated once support for older GnuTLS and
|
||||
* OpenSSL libraries is removed, and this function has no purpose
|
||||
* anymore.
|
||||
*/
|
||||
int avformat_network_init(void);
|
||||
|
||||
/**
|
||||
* Undo the initialization done by avformat_network_init.
|
||||
* Undo the initialization done by avformat_network_init. Call it only
|
||||
* once for each time you called avformat_network_init.
|
||||
*/
|
||||
int avformat_network_deinit(void);
|
||||
|
||||
#if FF_API_NEXT
|
||||
/**
|
||||
* If f is NULL, returns the first registered input format,
|
||||
* if f is non-NULL, returns the next registered input format after f
|
||||
* or NULL if f is the last one.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVInputFormat *av_iformat_next(const AVInputFormat *f);
|
||||
|
||||
/**
|
||||
@@ -2026,7 +2066,31 @@ AVInputFormat *av_iformat_next(const AVInputFormat *f);
|
||||
* if f is non-NULL, returns the next registered output format after f
|
||||
* or NULL if f is the last one.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVOutputFormat *av_oformat_next(const AVOutputFormat *f);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Iterate over all registered muxers.
|
||||
*
|
||||
* @param opaque a pointer where libavformat will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered muxer or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVOutputFormat *av_muxer_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Iterate over all registered demuxers.
|
||||
*
|
||||
* @param opaque a pointer where libavformat will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered demuxer or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVInputFormat *av_demuxer_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Allocate an AVFormatContext.
|
||||
@@ -2103,13 +2167,8 @@ uint8_t *av_stream_new_side_data(AVStream *stream,
|
||||
* @param size pointer for side information size to store (optional)
|
||||
* @return pointer to data if present or NULL otherwise
|
||||
*/
|
||||
#if FF_API_NOCONST_GET_SIDE_DATA
|
||||
uint8_t *av_stream_get_side_data(AVStream *stream,
|
||||
enum AVPacketSideDataType type, int *size);
|
||||
#else
|
||||
uint8_t *av_stream_get_side_data(const AVStream *stream,
|
||||
enum AVPacketSideDataType type, int *size);
|
||||
#endif
|
||||
|
||||
AVProgram *av_new_program(AVFormatContext *s, int id);
|
||||
|
||||
@@ -2954,6 +3013,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
|
||||
|
||||
int avformat_queue_attached_pictures(AVFormatContext *s);
|
||||
|
||||
#if FF_API_OLD_BSF
|
||||
/**
|
||||
* Apply a list of bitstream filters to a packet.
|
||||
*
|
||||
@@ -2965,7 +3025,6 @@ int avformat_queue_attached_pictures(AVFormatContext *s);
|
||||
* @return >=0 on success;
|
||||
* AVERROR code on failure
|
||||
*/
|
||||
#if FF_API_OLD_BSF
|
||||
attribute_deprecated
|
||||
int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
|
||||
AVBitStreamFilterContext *bsfc);
|
||||
|
||||
@@ -137,7 +137,13 @@ enum AVIODataMarkerType {
|
||||
* Trailer data, which doesn't contain actual content, but only for
|
||||
* finalizing the output file.
|
||||
*/
|
||||
AVIO_DATA_MARKER_TRAILER
|
||||
AVIO_DATA_MARKER_TRAILER,
|
||||
/**
|
||||
* A point in the output bytestream where the underlying AVIOContext might
|
||||
* flush the buffer depending on latency or buffering requirements. Typically
|
||||
* means the end of a packet.
|
||||
*/
|
||||
AVIO_DATA_MARKER_FLUSH_POINT,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -168,8 +174,9 @@ typedef struct AVIOContext {
|
||||
const AVClass *av_class;
|
||||
|
||||
/*
|
||||
* The following shows the relationship between buffer, buf_ptr, buf_end, buf_size,
|
||||
* and pos, when reading and when writing (since AVIOContext is used for both):
|
||||
* The following shows the relationship between buffer, buf_ptr,
|
||||
* buf_ptr_max, buf_end, buf_size, and pos, when reading and when writing
|
||||
* (since AVIOContext is used for both):
|
||||
*
|
||||
**********************************************************************************
|
||||
* READING
|
||||
@@ -196,21 +203,24 @@ typedef struct AVIOContext {
|
||||
* WRITING
|
||||
**********************************************************************************
|
||||
*
|
||||
* | buffer_size |
|
||||
* |-------------------------------|
|
||||
* | |
|
||||
* | buffer_size |
|
||||
* |--------------------------------------|
|
||||
* | |
|
||||
*
|
||||
* buffer buf_ptr buf_end
|
||||
* +-------------------+-----------+
|
||||
* |/ / / / / / / / / /| |
|
||||
* write buffer: | / to be flushed / | |
|
||||
* |/ / / / / / / / / /| |
|
||||
* +-------------------+-----------+
|
||||
* buf_ptr_max
|
||||
* buffer (buf_ptr) buf_end
|
||||
* +-----------------------+--------------+
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* write buffer: | / / to be flushed / / | |
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* +-----------------------+--------------+
|
||||
* buf_ptr can be in this
|
||||
* due to a backward seek
|
||||
*
|
||||
* pos
|
||||
* +--------------------------+-----------------------------------+
|
||||
* output file: | | |
|
||||
* +--------------------------+-----------------------------------+
|
||||
* pos
|
||||
* +-------------+----------------------------------------------+
|
||||
* output file: | | |
|
||||
* +-------------+----------------------------------------------+
|
||||
*
|
||||
*/
|
||||
unsigned char *buffer; /**< Start of the buffer. */
|
||||
@@ -226,7 +236,6 @@ typedef struct AVIOContext {
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
int must_flush; /**< true if the next seek should flush */
|
||||
int eof_reached; /**< true if eof reached */
|
||||
int write_flag; /**< true if open for writing */
|
||||
int max_packet_size;
|
||||
@@ -329,6 +338,17 @@ typedef struct AVIOContext {
|
||||
int (*short_seek_get)(void *opaque);
|
||||
|
||||
int64_t written;
|
||||
|
||||
/**
|
||||
* Maximum reached position before a backward seek in the write buffer,
|
||||
* used keeping track of already written data for a later flush.
|
||||
*/
|
||||
unsigned char *buf_ptr_max;
|
||||
|
||||
/**
|
||||
* Try to buffer at least this amount of data before flushing it
|
||||
*/
|
||||
int min_packet_size;
|
||||
} AVIOContext;
|
||||
|
||||
/**
|
||||
@@ -418,7 +438,7 @@ void avio_free_directory_entry(AVIODirEntry **entry);
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
|
||||
* freed with av_free().
|
||||
* freed with avio_context_free().
|
||||
*
|
||||
* @param buffer Memory block for input/output operations via AVIOContext.
|
||||
* The buffer must be allocated with av_malloc() and friends.
|
||||
@@ -431,6 +451,8 @@ void avio_free_directory_entry(AVIODirEntry **entry);
|
||||
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
|
||||
* @param opaque An opaque pointer to user-specific data.
|
||||
* @param read_packet A function for refilling the buffer, may be NULL.
|
||||
* For stream protocols, must never return 0 but rather
|
||||
* a proper AVERROR code.
|
||||
* @param write_packet A function for writing the buffer contents, may be NULL.
|
||||
* The function may not change the input buffers content.
|
||||
* @param seek A function for seeking to specified byte position, may be NULL.
|
||||
@@ -446,6 +468,14 @@ AVIOContext *avio_alloc_context(
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
|
||||
/**
|
||||
* Free the supplied IO context and everything associated with it.
|
||||
*
|
||||
* @param s Double pointer to the IO context. This function will write NULL
|
||||
* into s.
|
||||
*/
|
||||
void avio_context_free(AVIOContext **s);
|
||||
|
||||
void avio_w8(AVIOContext *s, int b);
|
||||
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
|
||||
void avio_wl64(AVIOContext *s, uint64_t val);
|
||||
@@ -540,13 +570,6 @@ int64_t avio_size(AVIOContext *s);
|
||||
* @return non zero if and only if end of file
|
||||
*/
|
||||
int avio_feof(AVIOContext *s);
|
||||
#if FF_API_URL_FEOF
|
||||
/**
|
||||
* @deprecated use avio_feof()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int url_feof(AVIOContext *s);
|
||||
#endif
|
||||
|
||||
/** @warning Writes up to 4 KiB per call */
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
|
||||
@@ -569,6 +592,15 @@ void avio_flush(AVIOContext *s);
|
||||
*/
|
||||
int avio_read(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed
|
||||
* to read fewer bytes than requested. The missing bytes can be read in the next
|
||||
* call. This always tries to read at least 1 byte.
|
||||
* Useful to reduce latency in certain cases.
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* @name Functions for reading from AVIOContext
|
||||
* @{
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 57
|
||||
#define LIBAVFORMAT_VERSION_MINOR 72
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 58
|
||||
#define LIBAVFORMAT_VERSION_MINOR 12
|
||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
@@ -55,47 +55,44 @@
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*
|
||||
*/
|
||||
#ifndef FF_API_LAVF_BITEXACT
|
||||
#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FRAC
|
||||
#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_CODEC_TB
|
||||
#define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_URL_FEOF
|
||||
#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FMT_RAWPICTURE
|
||||
#define FF_API_LAVF_FMT_RAWPICTURE (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_COMPUTE_PKT_FIELDS2
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_OPEN_CALLBACKS
|
||||
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_AVCTX
|
||||
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_NOCONST_GET_SIDE_DATA
|
||||
#define FF_API_NOCONST_GET_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HTTP_USER_AGENT
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HLS_WRAP
|
||||
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_MERGE_SD
|
||||
#define FF_API_LAVF_MERGE_SD (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ROTATE_API
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 58)
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_GET_SET
|
||||
#define FF_API_FORMAT_GET_SET (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVIO_EOF_0
|
||||
#define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FFSERVER
|
||||
#define FF_API_LAVF_FFSERVER (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_FILENAME
|
||||
#define FF_API_FORMAT_FILENAME (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_RTSP_OPTIONS
|
||||
#define FF_API_OLD_RTSP_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -105,22 +105,31 @@
|
||||
|
||||
typedef struct AVAudioResampleContext AVAudioResampleContext;
|
||||
|
||||
/** Mixing Coefficient Types */
|
||||
enum AVMixCoeffType {
|
||||
/**
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Mixing Coefficient Types */
|
||||
enum attribute_deprecated AVMixCoeffType {
|
||||
AV_MIX_COEFF_TYPE_Q8, /** 16-bit 8.8 fixed-point */
|
||||
AV_MIX_COEFF_TYPE_Q15, /** 32-bit 17.15 fixed-point */
|
||||
AV_MIX_COEFF_TYPE_FLT, /** floating-point */
|
||||
AV_MIX_COEFF_TYPE_NB, /** Number of coeff types. Not part of ABI */
|
||||
};
|
||||
|
||||
/** Resampling Filter Types */
|
||||
enum AVResampleFilterType {
|
||||
/**
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Resampling Filter Types */
|
||||
enum attribute_deprecated AVResampleFilterType {
|
||||
AV_RESAMPLE_FILTER_TYPE_CUBIC, /**< Cubic */
|
||||
AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall Windowed Sinc */
|
||||
AV_RESAMPLE_FILTER_TYPE_KAISER, /**< Kaiser Windowed Sinc */
|
||||
};
|
||||
|
||||
enum AVResampleDitherMethod {
|
||||
/**
|
||||
* @deprecated use libswresample
|
||||
*/
|
||||
enum attribute_deprecated AVResampleDitherMethod {
|
||||
AV_RESAMPLE_DITHER_NONE, /**< Do not use dithering */
|
||||
AV_RESAMPLE_DITHER_RECTANGULAR, /**< Rectangular Dither */
|
||||
AV_RESAMPLE_DITHER_TRIANGULAR, /**< Triangular Dither*/
|
||||
@@ -130,22 +139,37 @@ enum AVResampleDitherMethod {
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Return the LIBAVRESAMPLE_VERSION_INT constant.
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned avresample_version(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Return the libavresample build-time configuration.
|
||||
* @return configure string
|
||||
*/
|
||||
attribute_deprecated
|
||||
const char *avresample_configuration(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Return the libavresample license.
|
||||
*/
|
||||
attribute_deprecated
|
||||
const char *avresample_license(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Get the AVClass for AVAudioResampleContext.
|
||||
*
|
||||
* Can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options
|
||||
@@ -155,16 +179,24 @@ const char *avresample_license(void);
|
||||
*
|
||||
* @return AVClass for AVAudioResampleContext
|
||||
*/
|
||||
attribute_deprecated
|
||||
const AVClass *avresample_get_class(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Allocate AVAudioResampleContext and set options.
|
||||
*
|
||||
* @return allocated audio resample context, or NULL on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVAudioResampleContext *avresample_alloc_context(void);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Initialize AVAudioResampleContext.
|
||||
* @note The context must be configured using the AVOption API.
|
||||
* @note The fields "in_channel_layout", "out_channel_layout",
|
||||
@@ -178,17 +210,25 @@ AVAudioResampleContext *avresample_alloc_context(void);
|
||||
* @param avr audio resample context
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_open(AVAudioResampleContext *avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Check whether an AVAudioResampleContext is open or closed.
|
||||
*
|
||||
* @param avr AVAudioResampleContext to check
|
||||
* @return 1 if avr is open, 0 if avr is closed.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_is_open(AVAudioResampleContext *avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Close AVAudioResampleContext.
|
||||
*
|
||||
* This closes the context, but it does not change the parameters. The context
|
||||
@@ -201,18 +241,26 @@ int avresample_is_open(AVAudioResampleContext *avr);
|
||||
*
|
||||
* @param avr audio resample context
|
||||
*/
|
||||
attribute_deprecated
|
||||
void avresample_close(AVAudioResampleContext *avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Free AVAudioResampleContext and associated AVOption values.
|
||||
*
|
||||
* This also calls avresample_close() before freeing.
|
||||
*
|
||||
* @param avr audio resample context
|
||||
*/
|
||||
attribute_deprecated
|
||||
void avresample_free(AVAudioResampleContext **avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Generate a channel mixing matrix.
|
||||
*
|
||||
* This function is the one used internally by libavresample for building the
|
||||
@@ -234,12 +282,16 @@ void avresample_free(AVAudioResampleContext **avr);
|
||||
* @param matrix_encoding matrixed stereo downmix mode (e.g. dplii)
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
|
||||
double center_mix_level, double surround_mix_level,
|
||||
double lfe_mix_level, int normalize, double *matrix,
|
||||
int stride, enum AVMatrixEncoding matrix_encoding);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Get the current channel mixing matrix.
|
||||
*
|
||||
* If no custom matrix has been previously set or the AVAudioResampleContext is
|
||||
@@ -251,10 +303,14 @@ int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
|
||||
* @param stride distance between adjacent input channels in the matrix array
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
|
||||
int stride);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Set channel mixing matrix.
|
||||
*
|
||||
* Allows for setting a custom mixing matrix, overriding the default matrix
|
||||
@@ -272,10 +328,14 @@ int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
|
||||
* @param stride distance between adjacent input channels in the matrix array
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
|
||||
int stride);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Set a customized input channel mapping.
|
||||
*
|
||||
* This function can only be called when the allocated context is not open.
|
||||
@@ -302,10 +362,14 @@ int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
|
||||
* @param channel_map customized input channel mapping
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_set_channel_mapping(AVAudioResampleContext *avr,
|
||||
const int *channel_map);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Set compensation for resampling.
|
||||
*
|
||||
* This can be called anytime after avresample_open(). If resampling is not
|
||||
@@ -318,10 +382,14 @@ int avresample_set_channel_mapping(AVAudioResampleContext *avr,
|
||||
* @param compensation_distance compensation distance, in samples
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
|
||||
int compensation_distance);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Provide the upper bound on the number of samples the configured
|
||||
* conversion would output.
|
||||
*
|
||||
@@ -331,10 +399,13 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
|
||||
* @return number of samples or AVERROR(EINVAL) if the value
|
||||
* would exceed INT_MAX
|
||||
*/
|
||||
|
||||
attribute_deprecated
|
||||
int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Convert input samples and write them to the output FIFO.
|
||||
*
|
||||
* The upper bound on the number of output samples can be obtained through
|
||||
@@ -376,12 +447,16 @@ int avresample_get_out_samples(AVAudioResampleContext *avr, int in_nb_samples);
|
||||
* not including converted samples added to the internal
|
||||
* output FIFO
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
|
||||
int out_plane_size, int out_samples,
|
||||
uint8_t * const *input, int in_plane_size,
|
||||
int in_samples);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Return the number of samples currently in the resampling delay buffer.
|
||||
*
|
||||
* When resampling, there may be a delay between the input and output. Any
|
||||
@@ -394,9 +469,13 @@ int avresample_convert(AVAudioResampleContext *avr, uint8_t **output,
|
||||
* @param avr audio resample context
|
||||
* @return number of samples currently in the resampling delay buffer
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_get_delay(AVAudioResampleContext *avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Return the number of available samples in the output FIFO.
|
||||
*
|
||||
* During conversion, if the user does not specify an output buffer or
|
||||
@@ -411,9 +490,13 @@ int avresample_get_delay(AVAudioResampleContext *avr);
|
||||
* @param avr audio resample context
|
||||
* @return number of samples available for reading
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_available(AVAudioResampleContext *avr);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Read samples from the output FIFO.
|
||||
*
|
||||
* During conversion, if the user does not specify an output buffer or
|
||||
@@ -430,9 +513,13 @@ int avresample_available(AVAudioResampleContext *avr);
|
||||
* @param nb_samples number of samples to read from the FIFO
|
||||
* @return the number of samples written to output
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_samples);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Convert the samples in the input AVFrame and write them to the output AVFrame.
|
||||
*
|
||||
* Input and output AVFrames must have channel_layout, sample_rate and format set.
|
||||
@@ -476,10 +563,14 @@ int avresample_read(AVAudioResampleContext *avr, uint8_t **output, int nb_sample
|
||||
* @return 0 on success, AVERROR on failure or nonmatching
|
||||
* configuration.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_convert_frame(AVAudioResampleContext *avr,
|
||||
AVFrame *output, AVFrame *input);
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use libswresample
|
||||
*
|
||||
* Configure or reconfigure the AVAudioResampleContext using the information
|
||||
* provided by the AVFrames.
|
||||
*
|
||||
@@ -494,6 +585,7 @@ int avresample_convert_frame(AVAudioResampleContext *avr,
|
||||
* @param in input AVFrame
|
||||
* @return 0 on success, AVERROR on failure.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avresample_config(AVAudioResampleContext *avr, AVFrame *out, AVFrame *in);
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define LIBAVRESAMPLE_VERSION_MAJOR 3
|
||||
#define LIBAVRESAMPLE_VERSION_MINOR 6
|
||||
#define LIBAVRESAMPLE_VERSION_MAJOR 4
|
||||
#define LIBAVRESAMPLE_VERSION_MINOR 0
|
||||
#define LIBAVRESAMPLE_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
|
||||
|
||||
@@ -67,10 +67,15 @@ const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
|
||||
void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* Forcefully change the iv
|
||||
* Forcefully change the 8-byte iv
|
||||
*/
|
||||
void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
|
||||
|
||||
/**
|
||||
* Forcefully change the "full" 16-byte iv, including the counter
|
||||
*/
|
||||
void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv);
|
||||
|
||||
/**
|
||||
* Increment the top 64 bit of the iv (performed after each frame)
|
||||
*/
|
||||
|
||||
@@ -66,19 +66,19 @@
|
||||
# define av_noinline
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6)
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6) || defined(__clang__)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,3) || defined(__clang__)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
@@ -138,19 +138,19 @@
|
||||
# define av_used
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,3)
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,3) || defined(__clang__)
|
||||
# define av_alias __attribute__((may_alias))
|
||||
#else
|
||||
# define av_alias
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define av_builtin_constant_p __builtin_constant_p
|
||||
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
|
||||
#else
|
||||
@@ -158,7 +158,7 @@
|
||||
# define av_printf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,5)
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)
|
||||
# define av_noreturn __attribute__((noreturn))
|
||||
#else
|
||||
# define av_noreturn
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by ffconf */
|
||||
/* Generated by ffmpeg configure */
|
||||
#ifndef AVUTIL_AVCONFIG_H
|
||||
#define AVUTIL_AVCONFIG_H
|
||||
#define AV_HAVE_BIGENDIAN 0
|
||||
|
||||
@@ -158,7 +158,7 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in
|
||||
*/
|
||||
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
|
||||
{
|
||||
if (a&(~0xFF)) return (-a)>>31;
|
||||
if (a&(~0xFF)) return (~a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a)
|
||||
*/
|
||||
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
|
||||
{
|
||||
if (a&(~0xFFFF)) return (-a)>>31;
|
||||
if (a&(~0xFFFF)) return (~a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
@@ -260,13 +260,37 @@ static av_always_inline int av_sat_add32_c(int a, int b)
|
||||
*
|
||||
* @param a first value
|
||||
* @param b value doubled and added to a
|
||||
* @return sum with signed saturation
|
||||
* @return sum sat(a + sat(2*b)) with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_dadd32_c(int a, int b)
|
||||
{
|
||||
return av_sat_add32(a, av_sat_add32(b, b));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract two signed 32-bit values with saturation.
|
||||
*
|
||||
* @param a one value
|
||||
* @param b another value
|
||||
* @return difference with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_sub32_c(int a, int b)
|
||||
{
|
||||
return av_clipl_int32((int64_t)a - b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract a doubled value from another value with saturation at both stages.
|
||||
*
|
||||
* @param a first value
|
||||
* @param b value doubled and subtracted from a
|
||||
* @return difference sat(a - sat(2*b)) with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_dsub32_c(int a, int b)
|
||||
{
|
||||
return av_sat_sub32(a, av_sat_add32(b, b));
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a float value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
@@ -513,6 +537,12 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
|
||||
#ifndef av_sat_dadd32
|
||||
# define av_sat_dadd32 av_sat_dadd32_c
|
||||
#endif
|
||||
#ifndef av_sat_sub32
|
||||
# define av_sat_sub32 av_sat_sub32_c
|
||||
#endif
|
||||
#ifndef av_sat_dsub32
|
||||
# define av_sat_dsub32 av_sat_dsub32_c
|
||||
#endif
|
||||
#ifndef av_clipf
|
||||
# define av_clipf av_clipf_c
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#ifndef AVUTIL_CPU_H
|
||||
#define AVUTIL_CPU_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "attributes.h"
|
||||
|
||||
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
|
||||
@@ -53,6 +55,7 @@
|
||||
#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions
|
||||
#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
|
||||
#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
|
||||
#define AV_CPU_FLAG_AVX512 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used
|
||||
|
||||
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
|
||||
#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
|
||||
@@ -113,4 +116,15 @@ int av_parse_cpu_caps(unsigned *flags, const char *s);
|
||||
*/
|
||||
int av_cpu_count(void);
|
||||
|
||||
/**
|
||||
* Get the maximum data alignment that may be required by FFmpeg.
|
||||
*
|
||||
* Note that this is affected by the build configuration and the CPU flags mask,
|
||||
* so e.g. if the CPU supports AVX, but libavutil has been built with
|
||||
* --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through
|
||||
* av_set_cpu_flags_mask(), then this function will behave as if AVX is not
|
||||
* present.
|
||||
*/
|
||||
size_t av_cpu_max_align(void);
|
||||
|
||||
#endif /* AVUTIL_CPU_H */
|
||||
@@ -53,11 +53,8 @@ typedef enum {
|
||||
AV_CRC_32_IEEE,
|
||||
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
|
||||
AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */
|
||||
#if FF_API_CRC_BIG_TABLE
|
||||
AV_CRC_24_IEEE = 12,
|
||||
#else
|
||||
AV_CRC_24_IEEE,
|
||||
#endif /* FF_API_CRC_BIG_TABLE */
|
||||
AV_CRC_8_EBU,
|
||||
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
|
||||
}AVCRCId;
|
||||
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ENCRYPTION_INFO_H
|
||||
#define AVUTIL_ENCRYPTION_INFO_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct AVSubsampleEncryptionInfo {
|
||||
/** The number of bytes that are clear. */
|
||||
unsigned int bytes_of_clear_data;
|
||||
|
||||
/**
|
||||
* The number of bytes that are protected. If using pattern encryption,
|
||||
* the pattern applies to only the protected bytes; if not using pattern
|
||||
* encryption, all these bytes are encrypted.
|
||||
*/
|
||||
unsigned int bytes_of_protected_data;
|
||||
} AVSubsampleEncryptionInfo;
|
||||
|
||||
/**
|
||||
* This describes encryption info for a packet. This contains frame-specific
|
||||
* info for how to decrypt the packet before passing it to the decoder.
|
||||
*
|
||||
* The size of this struct is not part of the public ABI.
|
||||
*/
|
||||
typedef struct AVEncryptionInfo {
|
||||
/** The fourcc encryption scheme. */
|
||||
uint32_t scheme;
|
||||
|
||||
/**
|
||||
* Only used for pattern encryption. This is the number of 16-byte blocks
|
||||
* that are encrypted.
|
||||
*/
|
||||
uint32_t crypt_byte_block;
|
||||
|
||||
/**
|
||||
* Only used for pattern encryption. This is the number of 16-byte blocks
|
||||
* that are clear.
|
||||
*/
|
||||
uint32_t skip_byte_block;
|
||||
|
||||
/**
|
||||
* The ID of the key used to encrypt the packet. This should always be
|
||||
* 16 bytes long, but may be changed in the future.
|
||||
*/
|
||||
uint8_t *key_id;
|
||||
uint32_t key_id_size;
|
||||
|
||||
/**
|
||||
* The initialization vector. This may have been zero-filled to be the
|
||||
* correct block size. This should always be 16 bytes long, but may be
|
||||
* changed in the future.
|
||||
*/
|
||||
uint8_t *iv;
|
||||
uint32_t iv_size;
|
||||
|
||||
/**
|
||||
* An array of subsample encryption info specifying how parts of the sample
|
||||
* are encrypted. If there are no subsamples, then the whole sample is
|
||||
* encrypted.
|
||||
*/
|
||||
AVSubsampleEncryptionInfo *subsamples;
|
||||
uint32_t subsample_count;
|
||||
} AVEncryptionInfo;
|
||||
|
||||
/**
|
||||
* This describes info used to initialize an encryption key system.
|
||||
*
|
||||
* The size of this struct is not part of the public ABI.
|
||||
*/
|
||||
typedef struct AVEncryptionInitInfo {
|
||||
/**
|
||||
* A unique identifier for the key system this is for, can be NULL if it
|
||||
* is not known. This should always be 16 bytes, but may change in the
|
||||
* future.
|
||||
*/
|
||||
uint8_t* system_id;
|
||||
uint32_t system_id_size;
|
||||
|
||||
/**
|
||||
* An array of key IDs this initialization data is for. All IDs are the
|
||||
* same length. Can be NULL if there are no known key IDs.
|
||||
*/
|
||||
uint8_t** key_ids;
|
||||
/** The number of key IDs. */
|
||||
uint32_t num_key_ids;
|
||||
/**
|
||||
* The number of bytes in each key ID. This should always be 16, but may
|
||||
* change in the future.
|
||||
*/
|
||||
uint32_t key_id_size;
|
||||
|
||||
/**
|
||||
* Key-system specific initialization data. This data is copied directly
|
||||
* from the file and the format depends on the specific key system. This
|
||||
* can be NULL if there is no initialization data; in that case, there
|
||||
* will be at least one key ID.
|
||||
*/
|
||||
uint8_t* data;
|
||||
uint32_t data_size;
|
||||
} AVEncryptionInitInfo;
|
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInfo structure and sub-pointers to hold the given
|
||||
* number of subsamples. This will allocate pointers for the key ID, IV,
|
||||
* and subsample entries, set the size members, and zero-initialize the rest.
|
||||
*
|
||||
* @param subsample_count The number of subsamples.
|
||||
* @param key_id_size The number of bytes in the key ID, should be 16.
|
||||
* @param key_id_size The number of bytes in the IV, should be 16.
|
||||
*
|
||||
* @return The new AVEncryptionInfo structure, or NULL on error.
|
||||
*/
|
||||
AVEncryptionInfo *av_encryption_info_alloc(uint32_t subsample_count, uint32_t key_id_size, uint32_t iv_size);
|
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInfo structure with a copy of the given data.
|
||||
* @return The new AVEncryptionInfo structure, or NULL on error.
|
||||
*/
|
||||
AVEncryptionInfo *av_encryption_info_clone(const AVEncryptionInfo *info);
|
||||
|
||||
/**
|
||||
* Frees the given encryption info object. This MUST NOT be used to free the
|
||||
* side-data data pointer, that should use normal side-data methods.
|
||||
*/
|
||||
void av_encryption_info_free(AVEncryptionInfo *info);
|
||||
|
||||
/**
|
||||
* Creates a copy of the AVEncryptionInfo that is contained in the given side
|
||||
* data. The resulting object should be passed to av_encryption_info_free()
|
||||
* when done.
|
||||
*
|
||||
* @return The new AVEncryptionInfo structure, or NULL on error.
|
||||
*/
|
||||
AVEncryptionInfo *av_encryption_info_get_side_data(const uint8_t *side_data, size_t side_data_size);
|
||||
|
||||
/**
|
||||
* Allocates and initializes side data that holds a copy of the given encryption
|
||||
* info. The resulting pointer should be either freed using av_free or given
|
||||
* to av_packet_add_side_data().
|
||||
*
|
||||
* @return The new side-data pointer, or NULL.
|
||||
*/
|
||||
uint8_t *av_encryption_info_add_side_data(
|
||||
const AVEncryptionInfo *info, size_t *side_data_size);
|
||||
|
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInitInfo structure and sub-pointers to hold the
|
||||
* given sizes. This will allocate pointers and set all the fields.
|
||||
*
|
||||
* @return The new AVEncryptionInitInfo structure, or NULL on error.
|
||||
*/
|
||||
AVEncryptionInitInfo *av_encryption_init_info_alloc(
|
||||
uint32_t system_id_size, uint32_t num_key_ids, uint32_t key_id_size, uint32_t data_size);
|
||||
|
||||
/**
|
||||
* Frees the given encryption init info object. This MUST NOT be used to free
|
||||
* the side-data data pointer, that should use normal side-data methods.
|
||||
*/
|
||||
void av_encryption_init_info_free(AVEncryptionInitInfo* info);
|
||||
|
||||
/**
|
||||
* Creates a copy of the AVEncryptionInitInfo that is contained in the given
|
||||
* side data. The resulting object should be passed to
|
||||
* av_encryption_init_info_free() when done.
|
||||
*
|
||||
* @return The new AVEncryptionInitInfo structure, or NULL on error.
|
||||
*/
|
||||
AVEncryptionInitInfo *av_encryption_init_info_get_side_data(
|
||||
const uint8_t* side_data, size_t side_data_size);
|
||||
|
||||
/**
|
||||
* Allocates and initializes side data that holds a copy of the given encryption
|
||||
* init info. The resulting pointer should be either freed using av_free or
|
||||
* given to av_packet_add_side_data().
|
||||
*
|
||||
* @return The new side-data pointer, or NULL.
|
||||
*/
|
||||
uint8_t *av_encryption_init_info_add_side_data(
|
||||
const AVEncryptionInitInfo *info, size_t *side_data_size);
|
||||
|
||||
#endif /* AVUTIL_ENCRYPTION_INFO_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated by version.sh, do not manually edit! */
|
||||
#ifndef AVUTIL_FFVERSION_H
|
||||
#define AVUTIL_FFVERSION_H
|
||||
#define FFMPEG_VERSION "N-85922-g2162b86"
|
||||
#define FFMPEG_VERSION "4.0"
|
||||
#endif /* AVUTIL_FFVERSION_H */
|
||||
@@ -25,6 +25,7 @@
|
||||
#ifndef AVUTIL_FRAME_H
|
||||
#define AVUTIL_FRAME_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avutil.h"
|
||||
@@ -133,6 +134,30 @@ enum AVFrameSideDataType {
|
||||
* the form of the AVContentLightMetadata struct.
|
||||
*/
|
||||
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL,
|
||||
|
||||
/**
|
||||
* The data contains an ICC profile as an opaque octet buffer following the
|
||||
* format described by ISO 15076-1 with an optional name defined in the
|
||||
* metadata key entry "name".
|
||||
*/
|
||||
AV_FRAME_DATA_ICC_PROFILE,
|
||||
|
||||
#if FF_API_FRAME_QP
|
||||
/**
|
||||
* Implementation-specific description of the format of AV_FRAME_QP_TABLE_DATA.
|
||||
* The contents of this side data are undocumented and internal; use
|
||||
* av_frame_set_qp_table() and av_frame_get_qp_table() to access this in a
|
||||
* meaningful way instead.
|
||||
*/
|
||||
AV_FRAME_DATA_QP_TABLE_PROPERTIES,
|
||||
|
||||
/**
|
||||
* Raw QP table data. Its format is described by
|
||||
* AV_FRAME_DATA_QP_TABLE_PROPERTIES. Use av_frame_set_qp_table() and
|
||||
* av_frame_get_qp_table() to access this instead.
|
||||
*/
|
||||
AV_FRAME_DATA_QP_TABLE_DATA,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum AVActiveFormatDescription {
|
||||
@@ -240,9 +265,18 @@ typedef struct AVFrame {
|
||||
uint8_t **extended_data;
|
||||
|
||||
/**
|
||||
* width and height of the video frame
|
||||
* @name Video dimensions
|
||||
* Video frames only. The coded dimensions (in pixels) of the video frame,
|
||||
* i.e. the size of the rectangle that contains some well-defined values.
|
||||
*
|
||||
* @note The part of the frame intended for display/presentation is further
|
||||
* restricted by the @ref cropping "Cropping rectangle".
|
||||
* @{
|
||||
*/
|
||||
int width, height;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* number of audio samples (per channel) described by this frame
|
||||
@@ -512,6 +546,7 @@ typedef struct AVFrame {
|
||||
attribute_deprecated
|
||||
int qscale_type;
|
||||
|
||||
attribute_deprecated
|
||||
AVBufferRef *qp_table_buf;
|
||||
#endif
|
||||
/**
|
||||
@@ -530,39 +565,93 @@ typedef struct AVFrame {
|
||||
* purpose.
|
||||
*/
|
||||
AVBufferRef *opaque_ref;
|
||||
|
||||
/**
|
||||
* @anchor cropping
|
||||
* @name Cropping
|
||||
* Video frames only. The number of pixels to discard from the the
|
||||
* top/bottom/left/right border of the frame to obtain the sub-rectangle of
|
||||
* the frame intended for presentation.
|
||||
* @{
|
||||
*/
|
||||
size_t crop_top;
|
||||
size_t crop_bottom;
|
||||
size_t crop_left;
|
||||
size_t crop_right;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* AVBufferRef for internal use by a single libav* library.
|
||||
* Must not be used to transfer data between libraries.
|
||||
* Has to be NULL when ownership of the frame leaves the respective library.
|
||||
*
|
||||
* Code outside the FFmpeg libs should never check or change the contents of the buffer ref.
|
||||
*
|
||||
* FFmpeg calls av_buffer_unref() on it when the frame is unreferenced.
|
||||
* av_frame_copy_props() calls create a new reference with av_buffer_ref()
|
||||
* for the target frame's private_ref field.
|
||||
*/
|
||||
AVBufferRef *private_ref;
|
||||
} AVFrame;
|
||||
|
||||
#if FF_API_FRAME_GET_SET
|
||||
/**
|
||||
* Accessors for some AVFrame fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_pkt_duration (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_duration (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_pkt_pos (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_channel_layout (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_channels (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_channels (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_sample_rate (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_sample_rate (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
AVDictionary *av_frame_get_metadata (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_decode_error_flags (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_decode_error_flags (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_pkt_size(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_size(AVFrame *frame, int val);
|
||||
AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame);
|
||||
#if FF_API_FRAME_QP
|
||||
attribute_deprecated
|
||||
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
|
||||
attribute_deprecated
|
||||
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
|
||||
#endif
|
||||
attribute_deprecated
|
||||
enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
|
||||
attribute_deprecated
|
||||
enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_color_range(AVFrame *frame, enum AVColorRange val);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the name of a colorspace.
|
||||
@@ -648,7 +737,9 @@ void av_frame_move_ref(AVFrame *dst, AVFrame *src);
|
||||
* cases.
|
||||
*
|
||||
* @param frame frame in which to store the new buffers.
|
||||
* @param align required buffer size alignment
|
||||
* @param align Required buffer size alignment. If equal to 0, alignment will be
|
||||
* chosen automatically for the current CPU. It is highly
|
||||
* recommended to pass 0 here unless you know what you are doing.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error.
|
||||
*/
|
||||
@@ -727,6 +818,22 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
|
||||
enum AVFrameSideDataType type,
|
||||
int size);
|
||||
|
||||
/**
|
||||
* Add a new side data to a frame from an existing AVBufferRef
|
||||
*
|
||||
* @param frame a frame to which the side data should be added
|
||||
* @param type the type of the added side data
|
||||
* @param buf an AVBufferRef to add as side data. The ownership of
|
||||
* the reference is transferred to the frame.
|
||||
*
|
||||
* @return newly added side data on success, NULL on error. On failure
|
||||
* the frame is unchanged and the AVBufferRef remains owned by
|
||||
* the caller.
|
||||
*/
|
||||
AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame,
|
||||
enum AVFrameSideDataType type,
|
||||
AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* @return a pointer to the side data of a given type on success, NULL if there
|
||||
* is no side data with such type in this frame.
|
||||
@@ -740,6 +847,40 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
|
||||
*/
|
||||
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
|
||||
|
||||
|
||||
/**
|
||||
* Flags for frame cropping.
|
||||
*/
|
||||
enum {
|
||||
/**
|
||||
* Apply the maximum possible cropping, even if it requires setting the
|
||||
* AVFrame.data[] entries to unaligned pointers. Passing unaligned data
|
||||
* to FFmpeg API is generally not allowed, and causes undefined behavior
|
||||
* (such as crashes). You can pass unaligned data only to FFmpeg APIs that
|
||||
* are explicitly documented to accept it. Use this flag only if you
|
||||
* absolutely know what you are doing.
|
||||
*/
|
||||
AV_FRAME_CROP_UNALIGNED = 1 << 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Crop the given video AVFrame according to its crop_left/crop_top/crop_right/
|
||||
* crop_bottom fields. If cropping is successful, the function will adjust the
|
||||
* data pointers and the width/height fields, and set the crop fields to 0.
|
||||
*
|
||||
* In all cases, the cropping boundaries will be rounded to the inherent
|
||||
* alignment of the pixel format. In some cases, such as for opaque hwaccel
|
||||
* formats, the left/top cropping is ignored. The crop fields are set to 0 even
|
||||
* if the cropping was rounded or ignored.
|
||||
*
|
||||
* @param frame the frame which should be cropped
|
||||
* @param flags Some combination of AV_FRAME_CROP_* flags, or 0.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR on error. If the cropping fields
|
||||
* were invalid, AVERROR(ERANGE) is returned, and nothing is changed.
|
||||
*/
|
||||
int av_frame_apply_cropping(AVFrame *frame, int flags);
|
||||
|
||||
/**
|
||||
* @return a string identifying the side data type
|
||||
*/
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_hash Hash Functions
|
||||
* @ingroup lavu_crypto
|
||||
@@ -179,7 +181,11 @@ void av_hash_init(struct AVHashContext *ctx);
|
||||
* @param[in] src Data to be added to the hash context
|
||||
* @param[in] len Size of the additional data
|
||||
*/
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
|
||||
#else
|
||||
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Finalize a hash context and compute the actual hash value.
|
||||
|
||||
@@ -35,7 +35,7 @@ enum AVHMACType {
|
||||
AV_HMAC_SHA1,
|
||||
AV_HMAC_SHA224,
|
||||
AV_HMAC_SHA256,
|
||||
AV_HMAC_SHA384 = 12,
|
||||
AV_HMAC_SHA384,
|
||||
AV_HMAC_SHA512,
|
||||
};
|
||||
|
||||
|
||||
@@ -25,11 +25,17 @@
|
||||
#include "pixfmt.h"
|
||||
|
||||
enum AVHWDeviceType {
|
||||
AV_HWDEVICE_TYPE_NONE,
|
||||
AV_HWDEVICE_TYPE_VDPAU,
|
||||
AV_HWDEVICE_TYPE_CUDA,
|
||||
AV_HWDEVICE_TYPE_VAAPI,
|
||||
AV_HWDEVICE_TYPE_DXVA2,
|
||||
AV_HWDEVICE_TYPE_QSV,
|
||||
AV_HWDEVICE_TYPE_VIDEOTOOLBOX,
|
||||
AV_HWDEVICE_TYPE_D3D11VA,
|
||||
AV_HWDEVICE_TYPE_DRM,
|
||||
AV_HWDEVICE_TYPE_OPENCL,
|
||||
AV_HWDEVICE_TYPE_MEDIACODEC,
|
||||
};
|
||||
|
||||
typedef struct AVHWDeviceInternal AVHWDeviceInternal;
|
||||
@@ -222,6 +228,33 @@ typedef struct AVHWFramesContext {
|
||||
int width, height;
|
||||
} AVHWFramesContext;
|
||||
|
||||
/**
|
||||
* Look up an AVHWDeviceType by name.
|
||||
*
|
||||
* @param name String name of the device type (case-insensitive).
|
||||
* @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if
|
||||
* not found.
|
||||
*/
|
||||
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name);
|
||||
|
||||
/** Get the string name of an AVHWDeviceType.
|
||||
*
|
||||
* @param type Type from enum AVHWDeviceType.
|
||||
* @return Pointer to a static string containing the name, or NULL if the type
|
||||
* is not valid.
|
||||
*/
|
||||
const char *av_hwdevice_get_type_name(enum AVHWDeviceType type);
|
||||
|
||||
/**
|
||||
* Iterate over supported device types.
|
||||
*
|
||||
* @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type
|
||||
* returned by this function in subsequent iterations.
|
||||
* @return The next usable device type from enum AVHWDeviceType, or
|
||||
* AV_HWDEVICE_TYPE_NONE if there are no more.
|
||||
*/
|
||||
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev);
|
||||
|
||||
/**
|
||||
* Allocate an AVHWDeviceContext for a given hardware type.
|
||||
*
|
||||
@@ -269,6 +302,32 @@ int av_hwdevice_ctx_init(AVBufferRef *ref);
|
||||
int av_hwdevice_ctx_create(AVBufferRef **device_ctx, enum AVHWDeviceType type,
|
||||
const char *device, AVDictionary *opts, int flags);
|
||||
|
||||
/**
|
||||
* Create a new device of the specified type from an existing device.
|
||||
*
|
||||
* If the source device is a device of the target type or was originally
|
||||
* derived from such a device (possibly through one or more intermediate
|
||||
* devices of other types), then this will return a reference to the
|
||||
* existing device of the same type as is requested.
|
||||
*
|
||||
* Otherwise, it will attempt to derive a new device from the given source
|
||||
* device. If direct derivation to the new type is not implemented, it will
|
||||
* attempt the same derivation from each ancestor of the source device in
|
||||
* turn looking for an implemented derivation method.
|
||||
*
|
||||
* @param dst_ctx On success, a reference to the newly-created
|
||||
* AVHWDeviceContext.
|
||||
* @param type The type of the new device to create.
|
||||
* @param src_ctx A reference to an existing AVHWDeviceContext which will be
|
||||
* used to create the new device.
|
||||
* @param flags Currently unused; should be set to zero.
|
||||
* @return Zero on success, a negative AVERROR code on failure.
|
||||
*/
|
||||
int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ctx,
|
||||
enum AVHWDeviceType type,
|
||||
AVBufferRef *src_ctx, int flags);
|
||||
|
||||
|
||||
/**
|
||||
* Allocate an AVHWFramesContext tied to a given device context.
|
||||
*
|
||||
@@ -511,7 +570,9 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
|
||||
* AVHWFramesContext on.
|
||||
* @param source_frame_ctx A reference to an existing AVHWFramesContext
|
||||
* which will be mapped to the derived context.
|
||||
* @param flags Currently unused; should be set to zero.
|
||||
* @param flags Some combination of AV_HWFRAME_MAP_* flags, defining the
|
||||
* mapping parameters to apply to frames which are allocated
|
||||
* in the derived device.
|
||||
* @return Zero on success, negative AVERROR code on failure.
|
||||
*/
|
||||
int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx,
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_D3D11VA_H
|
||||
#define AVUTIL_HWCONTEXT_D3D11VA_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* An API-specific header for AV_HWDEVICE_TYPE_D3D11VA.
|
||||
*
|
||||
* The default pool implementation will be fixed-size if initial_pool_size is
|
||||
* set (and allocate elements from an array texture). Otherwise it will allocate
|
||||
* individual textures. Be aware that decoding requires a single array texture.
|
||||
*
|
||||
* Using sw_format==AV_PIX_FMT_YUV420P has special semantics, and maps to
|
||||
* DXGI_FORMAT_420_OPAQUE. av_hwframe_transfer_data() is not supported for
|
||||
* this format. Refer to MSDN for details.
|
||||
*
|
||||
* av_hwdevice_ctx_create() for this device type supports a key named "debug"
|
||||
* for the AVDictionary entry. If this is set to any value, the device creation
|
||||
* code will try to load various supported D3D debugging layers.
|
||||
*/
|
||||
|
||||
#include <d3d11.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* This struct is allocated as AVHWDeviceContext.hwctx
|
||||
*/
|
||||
typedef struct AVD3D11VADeviceContext {
|
||||
/**
|
||||
* Device used for texture creation and access. This can also be used to
|
||||
* set the libavcodec decoding device.
|
||||
*
|
||||
* Must be set by the user. This is the only mandatory field - the other
|
||||
* device context fields are set from this and are available for convenience.
|
||||
*
|
||||
* Deallocating the AVHWDeviceContext will always release this interface,
|
||||
* and it does not matter whether it was user-allocated.
|
||||
*/
|
||||
ID3D11Device *device;
|
||||
|
||||
/**
|
||||
* If unset, this will be set from the device field on init.
|
||||
*
|
||||
* Deallocating the AVHWDeviceContext will always release this interface,
|
||||
* and it does not matter whether it was user-allocated.
|
||||
*/
|
||||
ID3D11DeviceContext *device_context;
|
||||
|
||||
/**
|
||||
* If unset, this will be set from the device field on init.
|
||||
*
|
||||
* Deallocating the AVHWDeviceContext will always release this interface,
|
||||
* and it does not matter whether it was user-allocated.
|
||||
*/
|
||||
ID3D11VideoDevice *video_device;
|
||||
|
||||
/**
|
||||
* If unset, this will be set from the device_context field on init.
|
||||
*
|
||||
* Deallocating the AVHWDeviceContext will always release this interface,
|
||||
* and it does not matter whether it was user-allocated.
|
||||
*/
|
||||
ID3D11VideoContext *video_context;
|
||||
|
||||
/**
|
||||
* Callbacks for locking. They protect accesses to device_context and
|
||||
* video_context calls. They also protect access to the internal staging
|
||||
* texture (for av_hwframe_transfer_data() calls). They do NOT protect
|
||||
* access to hwcontext or decoder state in general.
|
||||
*
|
||||
* If unset on init, the hwcontext implementation will set them to use an
|
||||
* internal mutex.
|
||||
*
|
||||
* The underlying lock must be recursive. lock_ctx is for free use by the
|
||||
* locking implementation.
|
||||
*/
|
||||
void (*lock)(void *lock_ctx);
|
||||
void (*unlock)(void *lock_ctx);
|
||||
void *lock_ctx;
|
||||
} AVD3D11VADeviceContext;
|
||||
|
||||
/**
|
||||
* D3D11 frame descriptor for pool allocation.
|
||||
*
|
||||
* In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
|
||||
* with the data pointer pointing at an object of this type describing the
|
||||
* planes of the frame.
|
||||
*
|
||||
* This has no use outside of custom allocation, and AVFrame AVBufferRef do not
|
||||
* necessarily point to an instance of this struct.
|
||||
*/
|
||||
typedef struct AVD3D11FrameDescriptor {
|
||||
/**
|
||||
* The texture in which the frame is located. The reference count is
|
||||
* managed by the AVBufferRef, and destroying the reference will release
|
||||
* the interface.
|
||||
*
|
||||
* Normally stored in AVFrame.data[0].
|
||||
*/
|
||||
ID3D11Texture2D *texture;
|
||||
|
||||
/**
|
||||
* The index into the array texture element representing the frame, or 0
|
||||
* if the texture is not an array texture.
|
||||
*
|
||||
* Normally stored in AVFrame.data[1] (cast from intptr_t).
|
||||
*/
|
||||
intptr_t index;
|
||||
} AVD3D11FrameDescriptor;
|
||||
|
||||
/**
|
||||
* This struct is allocated as AVHWFramesContext.hwctx
|
||||
*/
|
||||
typedef struct AVD3D11VAFramesContext {
|
||||
/**
|
||||
* The canonical texture used for pool allocation. If this is set to NULL
|
||||
* on init, the hwframes implementation will allocate and set an array
|
||||
* texture if initial_pool_size > 0.
|
||||
*
|
||||
* The only situation when the API user should set this is:
|
||||
* - the user wants to do manual pool allocation (setting
|
||||
* AVHWFramesContext.pool), instead of letting AVHWFramesContext
|
||||
* allocate the pool
|
||||
* - of an array texture
|
||||
* - and wants it to use it for decoding
|
||||
* - this has to be done before calling av_hwframe_ctx_init()
|
||||
*
|
||||
* Deallocating the AVHWFramesContext will always release this interface,
|
||||
* and it does not matter whether it was user-allocated.
|
||||
*
|
||||
* This is in particular used by the libavcodec D3D11VA hwaccel, which
|
||||
* requires a single array texture. It will create ID3D11VideoDecoderOutputView
|
||||
* objects for each array texture element on decoder initialization.
|
||||
*/
|
||||
ID3D11Texture2D *texture;
|
||||
|
||||
/**
|
||||
* D3D11_TEXTURE2D_DESC.BindFlags used for texture creation. The user must
|
||||
* at least set D3D11_BIND_DECODER if the frames context is to be used for
|
||||
* video decoding.
|
||||
* This field is ignored/invalid if a user-allocated texture is provided.
|
||||
*/
|
||||
UINT BindFlags;
|
||||
|
||||
/**
|
||||
* D3D11_TEXTURE2D_DESC.MiscFlags used for texture creation.
|
||||
* This field is ignored/invalid if a user-allocated texture is provided.
|
||||
*/
|
||||
UINT MiscFlags;
|
||||
} AVD3D11VAFramesContext;
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_D3D11VA_H */
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_DRM_H
|
||||
#define AVUTIL_HWCONTEXT_DRM_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* API-specific header for AV_HWDEVICE_TYPE_DRM.
|
||||
*
|
||||
* Internal frame allocation is not currently supported - all frames
|
||||
* must be allocated by the user. Thus AVHWFramesContext is always
|
||||
* NULL, though this may change if support for frame allocation is
|
||||
* added in future.
|
||||
*/
|
||||
|
||||
enum {
|
||||
/**
|
||||
* The maximum number of layers/planes in a DRM frame.
|
||||
*/
|
||||
AV_DRM_MAX_PLANES = 4
|
||||
};
|
||||
|
||||
/**
|
||||
* DRM object descriptor.
|
||||
*
|
||||
* Describes a single DRM object, addressing it as a PRIME file
|
||||
* descriptor.
|
||||
*/
|
||||
typedef struct AVDRMObjectDescriptor {
|
||||
/**
|
||||
* DRM PRIME fd for the object.
|
||||
*/
|
||||
int fd;
|
||||
/**
|
||||
* Total size of the object.
|
||||
*
|
||||
* (This includes any parts not which do not contain image data.)
|
||||
*/
|
||||
size_t size;
|
||||
/**
|
||||
* Format modifier applied to the object (DRM_FORMAT_MOD_*).
|
||||
*
|
||||
* If the format modifier is unknown then this should be set to
|
||||
* DRM_FORMAT_MOD_INVALID.
|
||||
*/
|
||||
uint64_t format_modifier;
|
||||
} AVDRMObjectDescriptor;
|
||||
|
||||
/**
|
||||
* DRM plane descriptor.
|
||||
*
|
||||
* Describes a single plane of a layer, which is contained within
|
||||
* a single object.
|
||||
*/
|
||||
typedef struct AVDRMPlaneDescriptor {
|
||||
/**
|
||||
* Index of the object containing this plane in the objects
|
||||
* array of the enclosing frame descriptor.
|
||||
*/
|
||||
int object_index;
|
||||
/**
|
||||
* Offset within that object of this plane.
|
||||
*/
|
||||
ptrdiff_t offset;
|
||||
/**
|
||||
* Pitch (linesize) of this plane.
|
||||
*/
|
||||
ptrdiff_t pitch;
|
||||
} AVDRMPlaneDescriptor;
|
||||
|
||||
/**
|
||||
* DRM layer descriptor.
|
||||
*
|
||||
* Describes a single layer within a frame. This has the structure
|
||||
* defined by its format, and will contain one or more planes.
|
||||
*/
|
||||
typedef struct AVDRMLayerDescriptor {
|
||||
/**
|
||||
* Format of the layer (DRM_FORMAT_*).
|
||||
*/
|
||||
uint32_t format;
|
||||
/**
|
||||
* Number of planes in the layer.
|
||||
*
|
||||
* This must match the number of planes required by format.
|
||||
*/
|
||||
int nb_planes;
|
||||
/**
|
||||
* Array of planes in this layer.
|
||||
*/
|
||||
AVDRMPlaneDescriptor planes[AV_DRM_MAX_PLANES];
|
||||
} AVDRMLayerDescriptor;
|
||||
|
||||
/**
|
||||
* DRM frame descriptor.
|
||||
*
|
||||
* This is used as the data pointer for AV_PIX_FMT_DRM_PRIME frames.
|
||||
* It is also used by user-allocated frame pools - allocating in
|
||||
* AVHWFramesContext.pool must return AVBufferRefs which contain
|
||||
* an object of this type.
|
||||
*
|
||||
* The fields of this structure should be set such it can be
|
||||
* imported directly by EGL using the EGL_EXT_image_dma_buf_import
|
||||
* and EGL_EXT_image_dma_buf_import_modifiers extensions.
|
||||
* (Note that the exact layout of a particular format may vary between
|
||||
* platforms - we only specify that the same platform should be able
|
||||
* to import it.)
|
||||
*
|
||||
* The total number of planes must not exceed AV_DRM_MAX_PLANES, and
|
||||
* the order of the planes by increasing layer index followed by
|
||||
* increasing plane index must be the same as the order which would
|
||||
* be used for the data pointers in the equivalent software format.
|
||||
*/
|
||||
typedef struct AVDRMFrameDescriptor {
|
||||
/**
|
||||
* Number of DRM objects making up this frame.
|
||||
*/
|
||||
int nb_objects;
|
||||
/**
|
||||
* Array of objects making up the frame.
|
||||
*/
|
||||
AVDRMObjectDescriptor objects[AV_DRM_MAX_PLANES];
|
||||
/**
|
||||
* Number of layers in the frame.
|
||||
*/
|
||||
int nb_layers;
|
||||
/**
|
||||
* Array of layers in the frame.
|
||||
*/
|
||||
AVDRMLayerDescriptor layers[AV_DRM_MAX_PLANES];
|
||||
} AVDRMFrameDescriptor;
|
||||
|
||||
/**
|
||||
* DRM device.
|
||||
*
|
||||
* Allocated as AVHWDeviceContext.hwctx.
|
||||
*/
|
||||
typedef struct AVDRMDeviceContext {
|
||||
/**
|
||||
* File descriptor of DRM device.
|
||||
*
|
||||
* This is used as the device to create frames on, and may also be
|
||||
* used in some derivation and mapping operations.
|
||||
*
|
||||
* If no device is required, set to -1.
|
||||
*/
|
||||
int fd;
|
||||
} AVDRMDeviceContext;
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_DRM_H */
|
||||
@@ -65,6 +65,9 @@ typedef struct AVDXVA2FramesContext {
|
||||
*
|
||||
* If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on
|
||||
* it just before the internal surface pool is freed.
|
||||
*
|
||||
* This is for convenience only. Some code uses other methods to manage the
|
||||
* decoder reference.
|
||||
*/
|
||||
IDirectXVideoDecoder *decoder_to_release;
|
||||
} AVDXVA2FramesContext;
|
||||
|
||||
+16
-8
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* Filter graphs
|
||||
* copyright (c) 2007 Bobby Bingham
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
@@ -19,10 +16,21 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFILTER_AVFILTERGRAPH_H
|
||||
#define AVFILTER_AVFILTERGRAPH_H
|
||||
#ifndef AVUTIL_HWCONTEXT_MEDIACODEC_H
|
||||
#define AVUTIL_HWCONTEXT_MEDIACODEC_H
|
||||
|
||||
#include "avfilter.h"
|
||||
#include "libavutil/log.h"
|
||||
/**
|
||||
* MediaCodec details.
|
||||
*
|
||||
* Allocated as AVHWDeviceContext.hwctx
|
||||
*/
|
||||
typedef struct AVMediaCodecDeviceContext {
|
||||
/**
|
||||
* android/view/Surface handle, to be filled by the user.
|
||||
*
|
||||
* This is the default surface used by decoders on this device.
|
||||
*/
|
||||
void *surface;
|
||||
} AVMediaCodecDeviceContext;
|
||||
|
||||
#endif /* AVFILTER_AVFILTERGRAPH_H */
|
||||
#endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */
|
||||
@@ -51,6 +51,13 @@ enum {
|
||||
* so the surface allocation code will not try to use it.
|
||||
*/
|
||||
AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2),
|
||||
|
||||
/**
|
||||
* The driver does not support surface attributes at all.
|
||||
* The surface allocation code will never pass them to surface allocation,
|
||||
* and the results of the vaQuerySurfaceAttributes() call will be faked.
|
||||
*/
|
||||
AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES = (1 << 3),
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H
|
||||
#define AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <VideoToolbox/VideoToolbox.h>
|
||||
|
||||
#include "pixfmt.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
|
||||
*
|
||||
* This API currently does not support frame allocation, as the raw VideoToolbox
|
||||
* API does allocation, and FFmpeg itself never has the need to allocate frames.
|
||||
*
|
||||
* If the API user sets a custom pool, AVHWFramesContext.pool must return
|
||||
* AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef.
|
||||
*
|
||||
* Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always
|
||||
* NULL.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
|
||||
* Returns AV_PIX_FMT_NONE if no known equivalent was found.
|
||||
*/
|
||||
enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt);
|
||||
|
||||
/**
|
||||
* Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt);
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */
|
||||
@@ -172,7 +172,11 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4],
|
||||
* Return the size in bytes of the amount of data required to store an
|
||||
* image with the given parameters.
|
||||
*
|
||||
* @param[in] align the assumed linesize alignment
|
||||
* @param pix_fmt the pixel format of the image
|
||||
* @param width the width of the image in pixels
|
||||
* @param height the height of the image in pixels
|
||||
* @param align the assumed linesize alignment
|
||||
* @return the buffer size in bytes, a negative error code in case of failure
|
||||
*/
|
||||
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align);
|
||||
|
||||
@@ -238,6 +242,33 @@ int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enu
|
||||
*/
|
||||
int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar);
|
||||
|
||||
/**
|
||||
* Overwrite the image data with black. This is suitable for filling a
|
||||
* sub-rectangle of an image, meaning the padding between the right most pixel
|
||||
* and the left most pixel on the next line will not be overwritten. For some
|
||||
* formats, the image size might be rounded up due to inherent alignment.
|
||||
*
|
||||
* If the pixel format has alpha, the alpha is cleared to opaque.
|
||||
*
|
||||
* This can return an error if the pixel format is not supported. Normally, all
|
||||
* non-hwaccel pixel formats should be supported.
|
||||
*
|
||||
* Passing NULL for dst_data is allowed. Then the function returns whether the
|
||||
* operation would have succeeded. (It can return an error if the pix_fmt is
|
||||
* not supported.)
|
||||
*
|
||||
* @param dst_data data pointers to destination image
|
||||
* @param dst_linesize linesizes for the destination image
|
||||
* @param pix_fmt the pixel format of the image
|
||||
* @param range the color range of the image (important for colorspaces such as YUV)
|
||||
* @param width the width of the image in pixels
|
||||
* @param height the height of the image in pixels
|
||||
* @return 0 if the image data was cleared, a negative AVERROR code otherwise
|
||||
*/
|
||||
int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
|
||||
enum AVPixelFormat pix_fmt, enum AVColorRange range,
|
||||
int width, int height);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -215,7 +215,7 @@ typedef union {
|
||||
* by per-arch headers.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
|
||||
#if defined(__GNUC__)
|
||||
|
||||
union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
|
||||
union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
|
||||
@@ -224,12 +224,7 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
|
||||
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
|
||||
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
|
||||
|
||||
#elif defined(__DECC)
|
||||
|
||||
# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
|
||||
# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
|
||||
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_X64)) && AV_HAVE_FAST_UNALIGNED
|
||||
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_X64) || defined(_M_ARM64)) && AV_HAVE_FAST_UNALIGNED
|
||||
|
||||
# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
|
||||
# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
|
||||
|
||||
@@ -334,20 +334,6 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
|
||||
int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
|
||||
char *line, int line_size, int *print_prefix);
|
||||
|
||||
#if FF_API_DLOG
|
||||
/**
|
||||
* av_dlog macros
|
||||
* @deprecated unused
|
||||
* Useful to print debug messages that shouldn't get compiled in normally.
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
|
||||
#else
|
||||
# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
|
||||
#endif
|
||||
#endif /* FF_API_DLOG */
|
||||
|
||||
/**
|
||||
* Skip repeated messages, this requires the user app to use av_log() instead of
|
||||
* (f)printf as the 2 would otherwise interfere and lead to
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* Copyright (c) 2016 Neil Birkbeck <neil.birkbeck@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
|
||||
@@ -73,6 +73,19 @@
|
||||
* @param v Name of the variable
|
||||
*/
|
||||
|
||||
/**
|
||||
* @def DECLARE_ASM_ALIGNED(n,t,v)
|
||||
* Declare an aligned variable appropriate for use in inline assembly code.
|
||||
*
|
||||
* @code{.c}
|
||||
* DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
|
||||
* @endcode
|
||||
*
|
||||
* @param n Minimum alignment in bytes
|
||||
* @param t Type of the variable (or array element)
|
||||
* @param v Name of the variable
|
||||
*/
|
||||
|
||||
/**
|
||||
* @def DECLARE_ASM_CONST(n,t,v)
|
||||
* Declare a static constant aligned variable appropriate for use in inline
|
||||
@@ -89,25 +102,23 @@
|
||||
|
||||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
#define DECLARE_ALIGNED(n,t,v) \
|
||||
AV_PRAGMA(DATA_ALIGN(v,n)) \
|
||||
t __attribute__((aligned(n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) \
|
||||
AV_PRAGMA(DATA_ALIGN(v,n)) \
|
||||
static const t __attribute__((aligned(n))) v
|
||||
#elif defined(__DJGPP__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
|
||||
#elif defined(_MSC_VER)
|
||||
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
||||
#else
|
||||
#define DECLARE_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
||||
#endif
|
||||
|
||||
@@ -206,12 +217,7 @@ void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
|
||||
* be allocated
|
||||
* @see av_malloc()
|
||||
*/
|
||||
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
|
||||
{
|
||||
if (!size || nmemb >= INT_MAX / size)
|
||||
return NULL;
|
||||
return av_malloc(nmemb * size);
|
||||
}
|
||||
av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
|
||||
|
||||
/**
|
||||
* Allocate a memory block for an array with av_mallocz().
|
||||
@@ -226,12 +232,7 @@ av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t siz
|
||||
* @see av_mallocz()
|
||||
* @see av_malloc_array()
|
||||
*/
|
||||
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
|
||||
{
|
||||
if (!size || nmemb >= INT_MAX / size)
|
||||
return NULL;
|
||||
return av_mallocz(nmemb * size);
|
||||
}
|
||||
av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size);
|
||||
|
||||
/**
|
||||
* Non-inlined equivalent of av_mallocz_array().
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_murmur3 Murmur3
|
||||
* @ingroup lavu_hash
|
||||
@@ -97,7 +99,11 @@ void av_murmur3_init(struct AVMurMur3 *c);
|
||||
* @param[in] src Input data to update hash with
|
||||
* @param[in] len Number of bytes to read from `src`
|
||||
*/
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
|
||||
#else
|
||||
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Finish hashing and output digest value.
|
||||
|
||||
@@ -229,15 +229,15 @@ enum AVOptionType{
|
||||
AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
|
||||
AV_OPT_TYPE_DICT,
|
||||
AV_OPT_TYPE_UINT64,
|
||||
AV_OPT_TYPE_CONST = 128,
|
||||
AV_OPT_TYPE_IMAGE_SIZE = MKBETAG('S','I','Z','E'), ///< offset must point to two consecutive integers
|
||||
AV_OPT_TYPE_PIXEL_FMT = MKBETAG('P','F','M','T'),
|
||||
AV_OPT_TYPE_SAMPLE_FMT = MKBETAG('S','F','M','T'),
|
||||
AV_OPT_TYPE_VIDEO_RATE = MKBETAG('V','R','A','T'), ///< offset must point to AVRational
|
||||
AV_OPT_TYPE_DURATION = MKBETAG('D','U','R',' '),
|
||||
AV_OPT_TYPE_COLOR = MKBETAG('C','O','L','R'),
|
||||
AV_OPT_TYPE_CHANNEL_LAYOUT = MKBETAG('C','H','L','A'),
|
||||
AV_OPT_TYPE_BOOL = MKBETAG('B','O','O','L'),
|
||||
AV_OPT_TYPE_CONST,
|
||||
AV_OPT_TYPE_IMAGE_SIZE, ///< offset must point to two consecutive integers
|
||||
AV_OPT_TYPE_PIXEL_FMT,
|
||||
AV_OPT_TYPE_SAMPLE_FMT,
|
||||
AV_OPT_TYPE_VIDEO_RATE, ///< offset must point to AVRational
|
||||
AV_OPT_TYPE_DURATION,
|
||||
AV_OPT_TYPE_COLOR,
|
||||
AV_OPT_TYPE_CHANNEL_LAYOUT,
|
||||
AV_OPT_TYPE_BOOL,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -275,9 +275,6 @@ typedef struct AVOption {
|
||||
int flags;
|
||||
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
|
||||
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
|
||||
#if FF_API_OPT_TYPE_METADATA
|
||||
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
|
||||
#endif
|
||||
#define AV_OPT_FLAG_AUDIO_PARAM 8
|
||||
#define AV_OPT_FLAG_VIDEO_PARAM 16
|
||||
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
|
||||
@@ -290,6 +287,7 @@ typedef struct AVOption {
|
||||
* This flag only makes sense when AV_OPT_FLAG_EXPORT is also set.
|
||||
*/
|
||||
#define AV_OPT_FLAG_READONLY 128
|
||||
#define AV_OPT_FLAG_BSF_PARAM (1<<8) ///< a generic parameter which can be set by the user for bit stream filtering
|
||||
#define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering
|
||||
//FIXME think about enc-audio, ... style flags
|
||||
|
||||
|
||||
@@ -154,6 +154,14 @@ typedef struct AVPixFmtDescriptor {
|
||||
* in some cases be simpler. Or the data can be interpreted purely based on
|
||||
* the pixel format without using the palette.
|
||||
* An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8
|
||||
*
|
||||
* @deprecated This flag is deprecated, and will be removed. When it is removed,
|
||||
* the extra palette allocation in AVFrame.data[1] is removed as well. Only
|
||||
* actual paletted formats (as indicated by AV_PIX_FMT_FLAG_PAL) will have a
|
||||
* palette. Starting with FFmpeg versions which have this flag deprecated, the
|
||||
* extra "pseudo" palette is already ignored, and API users are not required to
|
||||
* allocate a palette for AV_PIX_FMT_FLAG_PSEUDOPAL formats (it was required
|
||||
* before the deprecation, though).
|
||||
*/
|
||||
#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
|
||||
|
||||
@@ -177,6 +185,12 @@ typedef struct AVPixFmtDescriptor {
|
||||
*/
|
||||
#define AV_PIX_FMT_FLAG_BAYER (1 << 8)
|
||||
|
||||
/**
|
||||
* The pixel format contains IEEE-754 floating point values. Precision (double,
|
||||
* single, or half) should be determined by the pixel size (64, 32, or 16 bits).
|
||||
*/
|
||||
#define AV_PIX_FMT_FLAG_FLOAT (1 << 9)
|
||||
|
||||
/**
|
||||
* Return the number of bits per pixel used by the pixel format
|
||||
* described by pixdesc. Note that this is not the same as the number
|
||||
@@ -219,11 +233,6 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
|
||||
* Utility function to access log2_chroma_w log2_chroma_h from
|
||||
* the pixel format AVPixFmtDescriptor.
|
||||
*
|
||||
* See av_get_chroma_sub_sample() for a function that asserts a
|
||||
* valid pixel format instead of returning an error code.
|
||||
* Its recommended that you use avcodec_get_chroma_sub_sample unless
|
||||
* you do check the return code!
|
||||
*
|
||||
* @param[in] pix_fmt the pixel format
|
||||
* @param[out] h_shift store log2_chroma_w (horizontal/width shift)
|
||||
* @param[out] v_shift store log2_chroma_h (vertical/height shift)
|
||||
@@ -244,26 +253,51 @@ int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
|
||||
*/
|
||||
const char *av_color_range_name(enum AVColorRange range);
|
||||
|
||||
/**
|
||||
* @return the AVColorRange value for name or an AVError if not found.
|
||||
*/
|
||||
int av_color_range_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* @return the name for provided color primaries or NULL if unknown.
|
||||
*/
|
||||
const char *av_color_primaries_name(enum AVColorPrimaries primaries);
|
||||
|
||||
/**
|
||||
* @return the AVColorPrimaries value for name or an AVError if not found.
|
||||
*/
|
||||
int av_color_primaries_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* @return the name for provided color transfer or NULL if unknown.
|
||||
*/
|
||||
const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer);
|
||||
|
||||
/**
|
||||
* @return the AVColorTransferCharacteristic value for name or an AVError if not found.
|
||||
*/
|
||||
int av_color_transfer_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* @return the name for provided color space or NULL if unknown.
|
||||
*/
|
||||
const char *av_color_space_name(enum AVColorSpace space);
|
||||
|
||||
/**
|
||||
* @return the AVColorSpace value for name or an AVError if not found.
|
||||
*/
|
||||
int av_color_space_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* @return the name for provided chroma location or NULL if unknown.
|
||||
*/
|
||||
const char *av_chroma_location_name(enum AVChromaLocation location);
|
||||
|
||||
/**
|
||||
* @return the AVChromaLocation value for name or an AVError if not found.
|
||||
*/
|
||||
int av_chroma_location_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* Return the pixel format corresponding to name.
|
||||
*
|
||||
|
||||
@@ -74,11 +74,6 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range
|
||||
AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range
|
||||
AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range
|
||||
#if FF_API_XVMC
|
||||
AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
AV_PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
AV_PIX_FMT_XVMC = AV_PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
#endif /* FF_API_XVMC */
|
||||
AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
|
||||
AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
|
||||
AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
|
||||
@@ -100,13 +95,6 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
|
||||
AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
#if FF_API_VDPAU
|
||||
AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
#endif
|
||||
AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
@@ -142,9 +130,6 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
#if FF_API_VDPAU
|
||||
AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG-4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
#endif
|
||||
AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
|
||||
|
||||
AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
|
||||
@@ -176,7 +161,6 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
|
||||
AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
|
||||
AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP, // alias for #AV_PIX_FMT_GBRP
|
||||
AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian
|
||||
@@ -221,8 +205,6 @@ enum AVPixelFormat {
|
||||
|
||||
AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
|
||||
|
||||
AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef
|
||||
|
||||
AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian)
|
||||
AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian)
|
||||
|
||||
@@ -240,7 +222,7 @@ enum AVPixelFormat {
|
||||
*/
|
||||
AV_PIX_FMT_MMAL,
|
||||
|
||||
AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer
|
||||
AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer
|
||||
|
||||
/**
|
||||
* HW acceleration through CUDA. data[i] contain CUdeviceptr pointers
|
||||
@@ -248,7 +230,7 @@ enum AVPixelFormat {
|
||||
*/
|
||||
AV_PIX_FMT_CUDA,
|
||||
|
||||
AV_PIX_FMT_0RGB=0x123+4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
|
||||
AV_PIX_FMT_0RGB, ///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
|
||||
AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
|
||||
AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
|
||||
AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
|
||||
@@ -283,9 +265,9 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */
|
||||
AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */
|
||||
AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */
|
||||
#if !FF_API_XVMC
|
||||
|
||||
AV_PIX_FMT_XVMC,///< XVideo Motion Acceleration via common packet passing
|
||||
#endif /* !FF_API_XVMC */
|
||||
|
||||
AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
|
||||
@@ -314,6 +296,40 @@ enum AVPixelFormat {
|
||||
AV_PIX_FMT_P016LE, ///< like NV12, with 16bpp per component, little-endian
|
||||
AV_PIX_FMT_P016BE, ///< like NV12, with 16bpp per component, big-endian
|
||||
|
||||
/**
|
||||
* Hardware surfaces for Direct3D11.
|
||||
*
|
||||
* This is preferred over the legacy AV_PIX_FMT_D3D11VA_VLD. The new D3D11
|
||||
* hwaccel API and filtering support AV_PIX_FMT_D3D11 only.
|
||||
*
|
||||
* data[0] contains a ID3D11Texture2D pointer, and data[1] contains the
|
||||
* texture array index of the frame as intptr_t if the ID3D11Texture2D is
|
||||
* an array texture (or always 0 if it's a normal texture).
|
||||
*/
|
||||
AV_PIX_FMT_D3D11,
|
||||
|
||||
AV_PIX_FMT_GRAY9BE, ///< Y , 9bpp, big-endian
|
||||
AV_PIX_FMT_GRAY9LE, ///< Y , 9bpp, little-endian
|
||||
|
||||
AV_PIX_FMT_GBRPF32BE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian
|
||||
AV_PIX_FMT_GBRPF32LE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian
|
||||
AV_PIX_FMT_GBRAPF32BE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian
|
||||
AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian
|
||||
|
||||
/**
|
||||
* DRM-managed buffers exposed through PRIME buffer sharing.
|
||||
*
|
||||
* data[0] points to an AVDRMFrameDescriptor.
|
||||
*/
|
||||
AV_PIX_FMT_DRM_PRIME,
|
||||
/**
|
||||
* Hardware surfaces for OpenCL.
|
||||
*
|
||||
* data[i] contain 2D image objects (typed in C as cl_mem, used
|
||||
* in OpenCL as image2d_t) for each plane of the surface.
|
||||
*/
|
||||
AV_PIX_FMT_OPENCL,
|
||||
|
||||
AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
||||
};
|
||||
|
||||
@@ -330,6 +346,7 @@ enum AVPixelFormat {
|
||||
#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0)
|
||||
#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0)
|
||||
|
||||
#define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE)
|
||||
#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE)
|
||||
#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE)
|
||||
#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
|
||||
@@ -377,6 +394,8 @@ enum AVPixelFormat {
|
||||
#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE)
|
||||
#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE)
|
||||
|
||||
#define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE)
|
||||
#define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
|
||||
|
||||
#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
|
||||
#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
|
||||
@@ -465,10 +484,11 @@ enum AVColorSpace {
|
||||
AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system
|
||||
AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system
|
||||
AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x
|
||||
AVCOL_SPC_CHROMA_DERIVED_NCL = 12, ///< Chromaticity-derived non-constant luminance system
|
||||
AVCOL_SPC_CHROMA_DERIVED_CL = 13, ///< Chromaticity-derived constant luminance system
|
||||
AVCOL_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp
|
||||
AVCOL_SPC_NB ///< Not part of ABI
|
||||
};
|
||||
#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
|
||||
|
||||
|
||||
/**
|
||||
* MPEG vs JPEG YUV range.
|
||||
|
||||
@@ -66,7 +66,11 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits);
|
||||
* @param data input data to update hash with
|
||||
* @param len input data length
|
||||
*/
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
|
||||
#else
|
||||
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Finish hashing and output digest value.
|
||||
|
||||
@@ -141,6 +141,25 @@ enum AVStereo3DType {
|
||||
AV_STEREO3D_COLUMNS,
|
||||
};
|
||||
|
||||
/**
|
||||
* List of possible view types.
|
||||
*/
|
||||
enum AVStereo3DView {
|
||||
/**
|
||||
* Frame contains two packed views.
|
||||
*/
|
||||
AV_STEREO3D_VIEW_PACKED,
|
||||
|
||||
/**
|
||||
* Frame contains only the left view.
|
||||
*/
|
||||
AV_STEREO3D_VIEW_LEFT,
|
||||
|
||||
/**
|
||||
* Frame contains only the right view.
|
||||
*/
|
||||
AV_STEREO3D_VIEW_RIGHT,
|
||||
};
|
||||
|
||||
/**
|
||||
* Inverted views, Right/Bottom represents the left view.
|
||||
@@ -164,6 +183,11 @@ typedef struct AVStereo3D {
|
||||
* Additional information about the frame packing.
|
||||
*/
|
||||
int flags;
|
||||
|
||||
/**
|
||||
* Determines which views are packed.
|
||||
*/
|
||||
enum AVStereo3DView view;
|
||||
} AVStereo3D;
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 55
|
||||
#define LIBAVUTIL_VERSION_MINOR 61
|
||||
#define LIBAVUTIL_VERSION_MAJOR 56
|
||||
#define LIBAVUTIL_VERSION_MINOR 14
|
||||
#define LIBAVUTIL_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
@@ -105,38 +105,29 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef FF_API_VDPAU
|
||||
#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_XVMC
|
||||
#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_OPT_TYPE_METADATA
|
||||
#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_DLOG
|
||||
#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_VAAPI
|
||||
#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_FRAME_QP
|
||||
#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_PLUS1_MINUS1
|
||||
#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_ERROR_FRAME
|
||||
#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
#ifndef FF_API_CRC_BIG_TABLE
|
||||
#define FF_API_CRC_BIG_TABLE (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_PKT_PTS
|
||||
#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_CRYPTO_SIZE_T
|
||||
#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 56)
|
||||
#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_FRAME_GET_SET
|
||||
#define FF_API_FRAME_GET_SET (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_PSEUDOPAL
|
||||
#define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -126,10 +126,6 @@
|
||||
|
||||
#include "libswresample/version.h"
|
||||
|
||||
#if LIBSWRESAMPLE_VERSION_MAJOR < 1
|
||||
#define SWR_CH_MAX 32 ///< Maximum number of channels
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name Option constants
|
||||
* These constants are used for the @ref avoptions interface for lswr.
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBSWRESAMPLE_VERSION_MAJOR 2
|
||||
#define LIBSWRESAMPLE_VERSION_MINOR 8
|
||||
#define LIBSWRESAMPLE_VERSION_MAJOR 3
|
||||
#define LIBSWRESAMPLE_VERSION_MINOR 1
|
||||
#define LIBSWRESAMPLE_VERSION_MICRO 100
|
||||
|
||||
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
|
||||
|
||||
Reference in new issue
Block a user