summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome.dll.deps4
-rw-r--r--chrome/common/chrome_paths.cc2
-rw-r--r--third_party/ffmpeg/README.chromium2
-rw-r--r--third_party/ffmpeg/avcodec-52.def7
-rw-r--r--third_party/ffmpeg/avutil-50.def (renamed from third_party/ffmpeg/avutil-49.def)2
-rw-r--r--third_party/ffmpeg/ffmpeg.vcproj2
-rwxr-xr-xthird_party/ffmpeg/generate_libs.bat3
-rw-r--r--third_party/ffmpeg/include/libavcodec/avcodec.h431
-rw-r--r--third_party/ffmpeg/include/libavcodec/opt.h2
-rw-r--r--third_party/ffmpeg/include/libavcodec/vdpau.h3
-rw-r--r--third_party/ffmpeg/include/libavcodec/xvmc.h172
-rw-r--r--third_party/ffmpeg/include/libavformat/avformat.h228
-rw-r--r--third_party/ffmpeg/include/libavformat/avio.h40
-rw-r--r--third_party/ffmpeg/include/libavformat/rtsp.h161
-rw-r--r--third_party/ffmpeg/include/libavformat/rtspcodes.h40
-rw-r--r--third_party/ffmpeg/include/libavutil/avstring.h8
-rw-r--r--third_party/ffmpeg/include/libavutil/avutil.h95
-rw-r--r--third_party/ffmpeg/include/libavutil/base64.h25
-rw-r--r--third_party/ffmpeg/include/libavutil/common.h134
-rw-r--r--third_party/ffmpeg/include/libavutil/crc.h2
-rw-r--r--third_party/ffmpeg/include/libavutil/fifo.h56
-rw-r--r--third_party/ffmpeg/include/libavutil/log.h42
-rw-r--r--third_party/ffmpeg/include/libavutil/lzo.h41
-rw-r--r--third_party/ffmpeg/include/libavutil/mathematics.h23
-rw-r--r--third_party/ffmpeg/include/libavutil/mem.h55
-rw-r--r--third_party/ffmpeg/include/libavutil/pixfmt.h140
-rw-r--r--third_party/ffmpeg/include/libavutil/random.h73
-rw-r--r--third_party/ffmpeg/include/libavutil/rational.h50
-rw-r--r--third_party/ffmpeg/using_ffmpeg.vsprops4
29 files changed, 1133 insertions, 714 deletions
diff --git a/chrome/app/chrome.dll.deps b/chrome/app/chrome.dll.deps
index c87f48d..afb5710 100644
--- a/chrome/app/chrome.dll.deps
+++ b/chrome/app/chrome.dll.deps
@@ -29,7 +29,7 @@ delay_loaded = [
'dwmapi.dll',
'COMDLG32.dll',
'urlmon.dll',
- 'avutil-49.dll',
- 'avformat-52.dll',
'avcodec-52.dll',
+ 'avformat-52.dll',
+ 'avutil-50.dll',
]
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 81b5ab8..b8d7867 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -170,7 +170,7 @@ bool PathProvider(int key, FilePath* result) {
return false;
break;
case chrome::FILE_LIBAVUTIL:
- if (!GetFFmpegLibraryPath(&cur, FILE_PATH_LITERAL("avutil-49.dll")))
+ if (!GetFFmpegLibraryPath(&cur, FILE_PATH_LITERAL("avutil-50.dll")))
return false;
break;
// The following are only valid in the development environment, and
diff --git a/third_party/ffmpeg/README.chromium b/third_party/ffmpeg/README.chromium
index 1291d99..816d4d0 100644
--- a/third_party/ffmpeg/README.chromium
+++ b/third_party/ffmpeg/README.chromium
@@ -1,5 +1,5 @@
This contains FFmpeg's public header files from the output of a "make install"
-command. The header files are from FFmpeg revision 16647.
+command. The header files are from FFmpeg revision 18286.
Steps to reproduce:
1) If on Windows, refer to http://ffmpeg.arrozcru.org for environment setup
diff --git a/third_party/ffmpeg/avcodec-52.def b/third_party/ffmpeg/avcodec-52.def
index 4bab0fc..13e99ff 100644
--- a/third_party/ffmpeg/avcodec-52.def
+++ b/third_party/ffmpeg/avcodec-52.def
@@ -2,9 +2,12 @@ LIBRARY avcodec-52
EXPORTS
av_bitstream_filter_init
avcodec_alloc_context
+ avcodec_decode_audio2
+ avcodec_decode_video
avcodec_find_decoder
avcodec_get_frame_defaults
avcodec_init
avcodec_open
- avcodec_decode_audio2
- avcodec_decode_video
+ avcodec_thread_execute
+ avcodec_thread_free
+ avcodec_thread_init
diff --git a/third_party/ffmpeg/avutil-49.def b/third_party/ffmpeg/avutil-50.def
index 22b5ea39..23bb5db 100644
--- a/third_party/ffmpeg/avutil-49.def
+++ b/third_party/ffmpeg/avutil-50.def
@@ -1,4 +1,4 @@
-LIBRARY avutil-49
+LIBRARY avutil-50
EXPORTS
av_free
av_malloc
diff --git a/third_party/ffmpeg/ffmpeg.vcproj b/third_party/ffmpeg/ffmpeg.vcproj
index e2eba0b..189b977 100644
--- a/third_party/ffmpeg/ffmpeg.vcproj
+++ b/third_party/ffmpeg/ffmpeg.vcproj
@@ -183,7 +183,7 @@
>
</File>
<File
- RelativePath=".\avutil-49.def"
+ RelativePath=".\avutil-50.def"
>
</File>
<File
diff --git a/third_party/ffmpeg/generate_libs.bat b/third_party/ffmpeg/generate_libs.bat
index dcebc2d..156ae17 100755
--- a/third_party/ffmpeg/generate_libs.bat
+++ b/third_party/ffmpeg/generate_libs.bat
@@ -5,5 +5,4 @@ set OUTDIR=%1
lib /nologo /machine:X86 /def:avcodec-52.def /out:%OUTDIR%\lib\avcodec-52.lib
lib /nologo /machine:X86 /def:avformat-52.def /out:%OUTDIR%\lib\avformat-52.lib
-lib /nologo /machine:X86 /def:avutil-49.def /out:%OUTDIR%\lib\avutil-49.lib
-
+lib /nologo /machine:X86 /def:avutil-50.def /out:%OUTDIR%\lib\avutil-50.lib
diff --git a/third_party/ffmpeg/include/libavcodec/avcodec.h b/third_party/ffmpeg/include/libavcodec/avcodec.h
index dd36dc2..2b9adf2 100644
--- a/third_party/ffmpeg/include/libavcodec/avcodec.h
+++ b/third_party/ffmpeg/include/libavcodec/avcodec.h
@@ -22,16 +22,16 @@
#define AVCODEC_AVCODEC_H
/**
- * @file avcodec.h
+ * @file libavcodec/avcodec.h
* external API header
*/
-
+#include <errno.h>
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 10
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MINOR 22
+#define LIBAVCODEC_VERSION_MICRO 3
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -190,9 +190,9 @@ enum CodecID {
CODEC_ID_MOTIONPIXELS,
CODEC_ID_TGV,
CODEC_ID_TGQ,
-
- /* "codecs" for HW decoding with VDPAU */
- CODEC_ID_H264_VDPAU= 0x9000,
+ CODEC_ID_TQI,
+ CODEC_ID_AURA,
+ CODEC_ID_AURA2,
/* various PCM "codecs" */
CODEC_ID_PCM_S16LE= 0x10000,
@@ -248,6 +248,7 @@ enum CodecID {
CODEC_ID_ADPCM_IMA_EA_EACS,
CODEC_ID_ADPCM_EA_XAS,
CODEC_ID_ADPCM_EA_MAXIS_XA,
+ CODEC_ID_ADPCM_IMA_ISS,
/* AMR */
CODEC_ID_AMR_NB= 0x12000,
@@ -310,6 +311,8 @@ enum CodecID {
CODEC_ID_EAC3,
CODEC_ID_SIPR,
CODEC_ID_MP1,
+ CODEC_ID_TWINVQ,
+ CODEC_ID_TRUEHD,
/* subtitle codecs */
CODEC_ID_DVD_SUBTITLE= 0x17000,
@@ -659,6 +662,7 @@ typedef struct AVPanScan{
* is this picture used as reference\
* The values for this are the same as the MpegEncContext.picture_structure\
* variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\
+ * Set to 4 for delayed, non-reference frames.\
* - encoding: unused\
* - decoding: Set by libavcodec. (before get_buffer() call)).\
*/\
@@ -806,6 +810,13 @@ typedef struct AVPanScan{
* - decoding: Read by user.\
*/\
int64_t reordered_opaque;\
+\
+ /**\
+ * hardware accelerator private data (FFmpeg allocated)\
+ * - encoding: unused\
+ * - decoding: Set by libavcodec\
+ */\
+ void *hwaccel_picture_private;\
#define FF_QSCALE_TYPE_MPEG1 0
@@ -961,6 +972,13 @@ typedef struct AVCodecContext {
* decoder to draw a horizontal band. It improves cache usage. Not
* all codecs can do that. You must check the codec capabilities
* beforehand.
+ * The function is also used by hardware acceleration APIs.
+ * It is called at least once during frame decoding to pass
+ * the data needed for hardware render.
+ * In that mode instead of pixel data, AVFrame points to
+ * a structure specific to the acceleration API. The application
+ * reads the structure and can change some fields to indicate progress
+ * or mark state.
* - encoding: unused
* - decoding: Set by user.
* @param height the height of the slice
@@ -1213,7 +1231,8 @@ typedef struct AVCodecContext {
void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
/**
- * If 1 the stream has a 1 frame delay during decoding.
+ * Size of the frame reordering buffer in the decoder.
+ * For MPEG-2 it is 1 IPB or 0 low delay IP.
* - encoding: Set by libavcodec.
* - decoding: Set by libavcodec.
*/
@@ -1400,6 +1419,7 @@ typedef struct AVCodecContext {
#define FF_IDCT_FAAN 20
#define FF_IDCT_EA 21
#define FF_IDCT_SIMPLENEON 22
+#define FF_IDCT_SIMPLEALPHA 23
/**
* slice count
@@ -2307,6 +2327,34 @@ typedef struct AVCodecContext {
* - decoding: unused.
*/
float rc_min_vbv_overflow_use;
+
+ /**
+ * Hardware accelerator in use
+ * - encoding: unused.
+ * - decoding: Set by libavcodec
+ */
+ struct AVHWAccel *hwaccel;
+
+ /**
+ * For some codecs, the time base is closer to the field rate than the frame rate.
+ * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+ * if no telecine is used ...
+ *
+ * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+ */
+ int ticks_per_frame;
+
+ /**
+ * Hardware accelerator context.
+ * For some hardware accelerators, a global context needs to be
+ * provided by the user. In that case, this holds display-dependent
+ * data FFmpeg cannot instantiate itself. Please refer to the
+ * FFmpeg HW accelerator documentation to know how to fill this
+ * is. e.g. for VA API, this is a struct vaapi_context.
+ * - encoding: unused
+ * - decoding: Set by user
+ */
+ void *hwaccel_context;
} AVCodecContext;
/**
@@ -2352,6 +2400,96 @@ typedef struct AVCodec {
} AVCodec;
/**
+ * AVHWAccel.
+ */
+typedef struct AVHWAccel {
+ /**
+ * Name of the hardware accelerated codec.
+ * The name is globally unique among encoders and among decoders (but an
+ * encoder and a decoder can share the same name).
+ */
+ const char *name;
+
+ /**
+ * Type of codec implemented by the hardware accelerator.
+ *
+ * See CODEC_TYPE_xxx
+ */
+ enum CodecType type;
+
+ /**
+ * Codec implemented by the hardware accelerator.
+ *
+ * See CODEC_ID_xxx
+ */
+ enum CodecID id;
+
+ /**
+ * Supported pixel format.
+ *
+ * Only hardware accelerated formats are supported here.
+ */
+ enum PixelFormat pix_fmt;
+
+ /**
+ * Hardware accelerated codec capabilities.
+ * see FF_HWACCEL_CODEC_CAP_*
+ */
+ int capabilities;
+
+ struct AVHWAccel *next;
+
+ /**
+ * Called at the beginning of each frame or field picture.
+ *
+ * Meaningful frame information (codec specific) is guaranteed to
+ * be parsed at this point. This function is mandatory.
+ *
+ * Note that \p buf can be NULL along with \p buf_size set to 0.
+ * Otherwise, this means the whole frame is available at this point.
+ *
+ * @param avctx the codec context
+ * @param buf the frame data buffer base
+ * @param buf_size the size of the frame in bytes
+ * @return zero if successful, a negative value otherwise
+ */
+ int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+ /**
+ * Callback for each slice.
+ *
+ * Meaningful slice information (codec specific) is guaranteed to
+ * be parsed at this point. This function is mandatory.
+ *
+ * @param avctx the codec context
+ * @param buf the slice data buffer base
+ * @param buf_size the size of the slice in bytes
+ * @return zero if successful, a negative value otherwise
+ */
+ int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+ /**
+ * Called at the end of each frame or field picture.
+ *
+ * The whole picture is parsed at this point and can now be sent
+ * to the hardware accelerator. This function is mandatory.
+ *
+ * @param avctx the codec context
+ * @return zero if successful, a negative value otherwise
+ */
+ int (*end_frame)(AVCodecContext *avctx);
+
+ /**
+ * Size of HW accelerator private data.
+ *
+ * Private data is allocated with av_mallocz() before
+ * AVCodecContext.get_buffer() and deallocated after
+ * AVCodecContext.release_buffer().
+ */
+ int priv_data_size;
+} AVHWAccel;
+
+/**
* four components are given, that's all.
* the last component is alpha
*/
@@ -2360,6 +2498,7 @@ typedef struct AVPicture {
int linesize[4]; ///< number of bytes per line
} AVPicture;
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* AVPaletteControl
* This structure defines a method for communicating palette changes
@@ -2383,6 +2522,7 @@ typedef struct AVPaletteControl {
unsigned int palette[AVPALETTE_COUNT];
} AVPaletteControl attribute_deprecated;
+#endif
enum AVSubtitleType {
SUBTITLE_NONE,
@@ -2442,13 +2582,75 @@ struct AVResampleContext;
typedef struct ReSampleContext ReSampleContext;
-ReSampleContext *audio_resample_init(int output_channels, int input_channels,
- int output_rate, int input_rate);
+#if LIBAVCODEC_VERSION_MAJOR < 53
+/**
+ * @deprecated Use av_audio_resample_init() instead.
+ */
+attribute_deprecated ReSampleContext *audio_resample_init(int output_channels, int input_channels,
+ int output_rate, int input_rate);
+#endif
+/**
+ * Initializes audio resampling context
+ *
+ * @param output_channels number of output channels
+ * @param input_channels number of input channels
+ * @param output_rate output sample rate
+ * @param input_rate input sample rate
+ * @param sample_fmt_out requested output sample format
+ * @param sample_fmt_in input sample format
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear If 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+ * @return allocated ReSampleContext, NULL if error occured
+ */
+ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
+ int output_rate, int input_rate,
+ enum SampleFormat sample_fmt_out,
+ enum SampleFormat sample_fmt_in,
+ int filter_length, int log2_phase_count,
+ int linear, double cutoff);
+
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
void audio_resample_close(ReSampleContext *s);
+
+/**
+ * Initializes an audio resampler.
+ * Note, if either rate is not an integer then simply scale both rates up so they are.
+ * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq
+ * @param log2_phase_count log2 of the number of entries in the polyphase filterbank
+ * @param linear If 1 then the used FIR filter will be linearly interpolated
+ between the 2 closest, if 0 the closest will be used
+ * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
+ */
struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
+
+/**
+ * resamples.
+ * @param src an array of unconsumed samples
+ * @param consumed the number of samples of src which have been consumed are returned here
+ * @param src_size the number of unconsumed samples available
+ * @param dst_size the amount of space in samples available in dst
+ * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
+ * @return the number of samples written in dst or -1 if an error occurred
+ */
int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
+
+
+/**
+ * Compensates samplerate/timestamp drift. The compensation is done by changing
+ * the resampler parameters, so no audible clicks or similar distortions occur
+ * @param compensation_distance distance in output samples over which the compensation should be performed
+ * @param sample_delta number of output samples which should be output less
+ *
+ * example: av_resample_compensate(c, 10, 500)
+ * here instead of 510 samples only 500 samples would be output
+ *
+ * note, due to rounding the actual compensation might be slightly different,
+ * especially if the compensation_distance is large and the in_rate used during init is small
+ */
void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
void av_resample_close(struct AVResampleContext *c);
@@ -2461,7 +2663,7 @@ void av_resample_close(struct AVResampleContext *c);
* @param height the height of the picture
* @return zero if successful, a negative value if not
*/
-int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);
+int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
/**
* Free a picture previously allocated by avpicture_alloc().
@@ -2478,6 +2680,7 @@ void avpicture_free(AVPicture *picture);
* If a planar format is specified, several pointers will be set pointing to
* the different picture planes and the line sizes of the different planes
* will be stored in the lines_sizes array.
+ * Call with ptr == NULL to get the required size for the ptr buffer.
*
* @param picture AVPicture whose fields are to be filled in
* @param ptr Buffer which will contain or contains the actual image data
@@ -2488,22 +2691,37 @@ void avpicture_free(AVPicture *picture);
*/
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
int pix_fmt, int width, int height);
-int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
+int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
unsigned char *dest, int dest_size);
/**
* Calculate the size in bytes that a picture of the given width and height
* would occupy if stored in the given picture format.
+ * Note that this returns the size of a compact representation as generated
+ * by avpicture_layout, which can be smaller than the size required for e.g.
+ * avpicture_fill.
*
* @param pix_fmt the given picture format
* @param width the width of the image
* @param height the height of the image
- * @return Image data size in bytes
+ * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
*/
-int avpicture_get_size(int pix_fmt, int width, int height);
-void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);
-const char *avcodec_get_pix_fmt_name(int pix_fmt);
+int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
+void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
+const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
+
+/**
+ * Returns the pixel format corresponding to the name \p name.
+ *
+ * If there is no pixel format with name \p name, then looks for a
+ * pixel format with the name corresponding to the native endian
+ * format of \p name.
+ * For example in a little-endian system, first looks for "gray16",
+ * then for "gray16le".
+ *
+ * Finally if no pixel format has been found, returns \c PIX_FMT_NONE.
+ */
enum PixelFormat avcodec_get_pix_fmt(const char* name);
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
@@ -2531,7 +2749,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @return Combination of flags informing you what kind of losses will occur.
*/
-int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
+int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha);
/**
@@ -2556,7 +2774,7 @@ int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,
* @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
* @return The best pixel format to convert to or -1 if none was found.
*/
-int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
+enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr);
@@ -2570,7 +2788,7 @@ int avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, int src_pix_fmt,
* a negative value to print the corresponding header.
* Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
*/
-void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
+void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
@@ -2580,15 +2798,20 @@ void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt);
* @return ored mask of FF_ALPHA_xxx constants
*/
int img_get_alpha_info(const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/* deinterlace a picture */
/* deinterlace - if not supported return -1 */
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/* external high level API */
+/**
+ * If c is NULL, returns the first registered codec,
+ * if c is non-NULL, returns the next registered codec after c,
+ * or NULL if c is the last one.
+ */
AVCodec *av_codec_next(AVCodec *c);
/**
@@ -2604,12 +2827,19 @@ unsigned avcodec_version(void);
*/
void avcodec_init(void);
+#if LIBAVCODEC_VERSION_MAJOR < 53
+/**
+ * @deprecated Deprecated in favor of avcodec_register().
+ */
+attribute_deprecated void register_avcodec(AVCodec *codec);
+#endif
+
/**
* Register the codec \p codec and initialize libavcodec.
*
* @see avcodec_init()
*/
-void register_avcodec(AVCodec *codec);
+void avcodec_register(AVCodec *codec);
/**
* Finds a registered encoder with a matching codec ID.
@@ -2859,7 +3089,7 @@ int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
* @param[in] buf_size the size of the output buffer in bytes
* @param[in] pict the input picture to encode
* @return On error a negative value is returned, on success zero or the number
- * of bytes used from the input buffer.
+ * of bytes used from the output buffer.
*/
int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict);
@@ -2874,7 +3104,7 @@ int avcodec_close(AVCodecContext *avctx);
* which formats you want to support, by using the individual registration
* functions.
*
- * @see register_avcodec
+ * @see avcodec_register
* @see av_register_codec_parser
* @see av_register_bitstream_filter
*/
@@ -2923,6 +3153,15 @@ typedef struct AVCodecParserContext {
int64_t next_frame_offset; /* offset of the next frame */
/* video info */
int pict_type; /* XXX: Put it back in AVCodecContext. */
+ /**
+ * This field is used for proper frame duration computation in lavf.
+ * It signals, how much longer the frame duration of the current frame
+ * is compared to normal frame duration.
+ *
+ * frame_duration = (1 + repeat_pict) * time_base
+ *
+ * It is used by codecs like H.264 to display telecined material.
+ */
int repeat_pict; /* XXX: Put it back in AVCodecContext. */
int64_t pts; /* pts of the current frame */
int64_t dts; /* dts of the current frame */
@@ -2943,6 +3182,89 @@ typedef struct AVCodecParserContext {
int64_t offset; ///< byte offset from starting packet start
int64_t cur_frame_end[AV_PARSER_PTS_NB];
+
+ /*!
+ * Set by parser to 1 for key frames and 0 for non-key frames.
+ * It is initialized to -1, so if the parser doesn't set this flag,
+ * old-style fallback using FF_I_TYPE picture type as key frames
+ * will be used.
+ */
+ int key_frame;
+
+ /**
+ * Time difference in stream time base units from the pts of this
+ * packet to the point at which the output from the decoder has converged
+ * independent from the availability of previous frames. That is, the
+ * frames are virtually identical no matter if decoding started from
+ * the very first frame or from this keyframe.
+ * Is AV_NOPTS_VALUE if unknown.
+ * This field is not the display duration of the current frame.
+ *
+ * The purpose of this field is to allow seeking in streams that have no
+ * keyframes in the conventional sense. It corresponds to the
+ * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+ * essential for some types of subtitle streams to ensure that all
+ * subtitles are correctly displayed after seeking.
+ */
+ int64_t convergence_duration;
+
+ // Timestamp generation support:
+ /**
+ * Synchronization point for start of timestamp generation.
+ *
+ * Set to >0 for sync point, 0 for no sync point and <0 for undefined
+ * (default).
+ *
+ * For example, this corresponds to presence of H.264 buffering period
+ * SEI message.
+ */
+ int dts_sync_point;
+
+ /**
+ * Offset of the current timestamp against last timestamp sync point in
+ * units of AVCodecContext.time_base.
+ *
+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ * contain a valid timestamp offset.
+ *
+ * Note that the timestamp of sync point has usually a nonzero
+ * dts_ref_dts_delta, which refers to the previous sync point. Offset of
+ * the next frame after timestamp sync point will be usually 1.
+ *
+ * For example, this corresponds to H.264 cpb_removal_delay.
+ */
+ int dts_ref_dts_delta;
+
+ /**
+ * Presentation delay of current frame in units of AVCodecContext.time_base.
+ *
+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ * contain valid non-negative timestamp delta (presentation time of a frame
+ * must not lie in the past).
+ *
+ * This delay represents the difference between decoding and presentation
+ * time of the frame.
+ *
+ * For example, this corresponds to H.264 dpb_output_delay.
+ */
+ int pts_dts_delta;
+
+ /**
+ * Position of the packet in file.
+ *
+ * Analogous to cur_frame_pts/dts
+ */
+ int64_t cur_frame_pos[AV_PARSER_PTS_NB];
+
+ /**
+ * Byte position of currently parsed frame in stream.
+ */
+ int64_t pos;
+
+ /**
+ * Previous frame byte position.
+ */
+ int64_t last_pos;
} AVCodecParserContext;
typedef struct AVCodecParser {
@@ -2962,11 +3284,51 @@ AVCodecParser *av_parser_next(AVCodecParser *c);
void av_register_codec_parser(AVCodecParser *parser);
AVCodecParserContext *av_parser_init(int codec_id);
+
+#if LIBAVCODEC_VERSION_MAJOR < 53
+attribute_deprecated
int av_parser_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts);
+#endif
+
+/**
+ * Parse a packet.
+ *
+ * @param s parser context.
+ * @param avctx codec context.
+ * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished.
+ * @param poutbuf_size set to size of parsed buffer or zero if not yet finished.
+ * @param buf input buffer.
+ * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output).
+ * @param pts input presentation timestamp.
+ * @param dts input decoding timestamp.
+ * @param pos input byte position in stream.
+ * @return the number of bytes of the input bitstream used.
+ *
+ * Example:
+ * @code
+ * while(in_len){
+ * len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
+ * in_data, in_len,
+ * pts, dts, pos);
+ * in_data += len;
+ * in_len -= len;
+ *
+ * if(size)
+ * decode_frame(data, size);
+ * }
+ * @endcode
+ */
+int av_parser_parse2(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size,
+ int64_t pts, int64_t dts,
+ int64_t pos);
+
int av_parser_change(AVCodecParserContext *s,
AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
@@ -3017,18 +3379,18 @@ void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
* Copy image 'src' to 'dst'.
*/
void av_picture_copy(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int width, int height);
+ enum PixelFormat pix_fmt, int width, int height);
/**
* Crop image top and left side.
*/
int av_picture_crop(AVPicture *dst, const AVPicture *src,
- int pix_fmt, int top_band, int left_band);
+ enum PixelFormat pix_fmt, int top_band, int left_band);
/**
* Pad image.
*/
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt,
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
int padtop, int padbottom, int padleft, int padright, int *color);
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
@@ -3051,7 +3413,7 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
*
* @return 0 in case of a successful parsing, a negative value otherwise
* @param[in] str the string to parse: it has to be a string in the format
- * <frame_rate_nom>/<frame_rate_den>, a float number or a valid video rate abbreviation
+ * <frame_rate_num>/<frame_rate_den>, a float number or a valid video rate abbreviation
* @param[in,out] frame_rate pointer to the AVRational which will contain the detected
* frame rate
*/
@@ -3074,6 +3436,19 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
#define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
+#define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
+/**
+ * Registers the hardware accelerator \p hwaccel.
+ */
+void av_register_hwaccel(AVHWAccel *hwaccel);
+
+/**
+ * If hwaccel is NULL, returns the first registered hardware accelerator,
+ * if hwaccel is non-NULL, returns the next registered hardware accelerator
+ * after hwaccel, or NULL if hwaccel is the last one.
+ */
+AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
+
#endif /* AVCODEC_AVCODEC_H */
diff --git a/third_party/ffmpeg/include/libavcodec/opt.h b/third_party/ffmpeg/include/libavcodec/opt.h
index 0e39e3d..50d483e 100644
--- a/third_party/ffmpeg/include/libavcodec/opt.h
+++ b/third_party/ffmpeg/include/libavcodec/opt.h
@@ -23,7 +23,7 @@
#define AVCODEC_OPT_H
/**
- * @file opt.h
+ * @file libavcodec/opt.h
* AVOptions
*/
diff --git a/third_party/ffmpeg/include/libavcodec/vdpau.h b/third_party/ffmpeg/include/libavcodec/vdpau.h
index a28ad7f..53dbd7c 100644
--- a/third_party/ffmpeg/include/libavcodec/vdpau.h
+++ b/third_party/ffmpeg/include/libavcodec/vdpau.h
@@ -70,8 +70,9 @@ struct vdpau_render_state {
/** picture parameter information for all supported codecs */
union VdpPictureInfo {
- VdpPictureInfoMPEG1Or2 mpeg;
VdpPictureInfoH264 h264;
+ VdpPictureInfoMPEG1Or2 mpeg;
+ VdpPictureInfoVC1 vc1;
} info;
/** Describe size/location of the compressed video data. */
diff --git a/third_party/ffmpeg/include/libavcodec/xvmc.h b/third_party/ffmpeg/include/libavcodec/xvmc.h
new file mode 100644
index 0000000..01f84b2
--- /dev/null
+++ b/third_party/ffmpeg/include/libavcodec/xvmc.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2003 Ivan Kalvachev
+ *
+ * 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_XVMC_H
+#define AVCODEC_XVMC_H
+
+#include <X11/extensions/XvMC.h>
+
+#include "avcodec.h"
+
+#if LIBAVCODEC_VERSION_MAJOR < 53
+#define AV_XVMC_STATE_DISPLAY_PENDING 1 /** the surface should be shown, the video driver manipulates this */
+#define AV_XVMC_STATE_PREDICTION 2 /** the surface is needed for prediction, the codec manipulates this */
+#define AV_XVMC_STATE_OSD_SOURCE 4 /** the surface is needed for subpicture rendering */
+#endif
+#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
+ the number is 1337 speak for the letters IDCT MCo (motion compensation) */
+
+struct xvmc_pix_fmt {
+ /** The field contains the special constant value AV_XVMC_ID.
+ It is used as a test that the application correctly uses the API,
+ and that there is no corruption caused by pixel routines.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ int xvmc_id;
+
+ /** Pointer to the block array allocated by XvMCCreateBlocks().
+ The array has to be freed by XvMCDestroyBlocks().
+ Each group of 64 values represents one data block of differential
+ pixel information (in MoCo mode) or coefficients for IDCT.
+ - application - set the pointer during initialization
+ - libavcodec - fills coefficients/pixel data into the array
+ */
+ short* data_blocks;
+
+ /** Pointer to the macroblock description array allocated by
+ XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
+ - application - set the pointer during initialization
+ - libavcodec - fills description data into the array
+ */
+ XvMCMacroBlock* mv_blocks;
+
+ /** Number of macroblock descriptions that can be stored in the mv_blocks
+ array.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ int allocated_mv_blocks;
+
+ /** Number of blocks that can be stored at once in the data_blocks array.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ int allocated_data_blocks;
+
+ /** Indicates that the hardware would interpret data_blocks as IDCT
+ coefficients and perform IDCT on them.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ int idct;
+
+ /** In MoCo mode it indicates that intra macroblocks are assumed to be in
+ unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ int unsigned_intra;
+
+ /** Pointer to the surface allocated by XvMCCreateSurface().
+ It has to be freed by XvMCDestroySurface() on application exit.
+ It identifies the frame and its state on the video hardware.
+ - application - set during initialization
+ - libavcodec - unchanged
+ */
+ XvMCSurface* p_surface;
+
+/** Set by the decoder before calling ff_draw_horiz_band(),
+ needed by the XvMCRenderSurface function. */
+//@{
+ /** Pointer to the surface used as past reference
+ - application - unchanged
+ - libavcodec - set
+ */
+ XvMCSurface* p_past_surface;
+
+ /** Pointer to the surface used as future reference
+ - application - unchanged
+ - libavcodec - set
+ */
+ XvMCSurface* p_future_surface;
+
+ /** top/bottom field or frame
+ - application - unchanged
+ - libavcodec - set
+ */
+ unsigned int picture_structure;
+
+ /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
+ - application - unchanged
+ - libavcodec - set
+ */
+ unsigned int flags;
+//}@
+
+ /** Number of macroblock descriptions in the mv_blocks array
+ that have already been passed to the hardware.
+ - application - zeroes it on get_buffer().
+ A successful ff_draw_horiz_band() may increment it
+ with filled_mb_block_num or zero both.
+ - libavcodec - unchanged
+ */
+ int start_mv_blocks_num;
+
+ /** Number of new macroblock descriptions in the mv_blocks array (after
+ start_mv_blocks_num) that are filled by libavcodec and have to be
+ passed to the hardware.
+ - application - zeroes it on get_buffer() or after successful
+ ff_draw_horiz_band().
+ - libavcodec - increment with one of each stored MB
+ */
+ int filled_mv_blocks_num;
+
+ /** Number of the the next free data block; one data block consists of
+ 64 short values in the data_blocks array.
+ All blocks before this one have already been claimed by placing their
+ position into the corresponding block description structure field,
+ that are part of the mv_blocks array.
+ - application - zeroes it on get_buffer().
+ A successful ff_draw_horiz_band() may zero it together
+ with start_mb_blocks_num.
+ - libavcodec - each decoded macroblock increases it by the number
+ of coded blocks it contains.
+ */
+ int next_free_data_block_num;
+
+/** extensions may be placed here */
+#if LIBAVCODEC_VERSION_MAJOR < 53
+//@{
+ /** State flags used to work around limitations in the MPlayer video system.
+ 0 - Surface is not used.
+ 1 - Surface is still held in application to be displayed or is
+ still visible.
+ 2 - Surface is still held in libavcodec buffer for prediction.
+ */
+ int state;
+
+ /** pointer to the surface where the subpicture is rendered */
+ void* p_osd_target_surface_render;
+//}@
+#endif
+};
+
+#endif /* AVCODEC_XVMC_H */
diff --git a/third_party/ffmpeg/include/libavformat/avformat.h b/third_party/ffmpeg/include/libavformat/avformat.h
index e8b7100..5458db9 100644
--- a/third_party/ffmpeg/include/libavformat/avformat.h
+++ b/third_party/ffmpeg/include/libavformat/avformat.h
@@ -22,8 +22,8 @@
#define AVFORMAT_AVFORMAT_H
#define LIBAVFORMAT_VERSION_MAJOR 52
-#define LIBAVFORMAT_VERSION_MINOR 23
-#define LIBAVFORMAT_VERSION_MICRO 1
+#define LIBAVFORMAT_VERSION_MINOR 32
+#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
@@ -46,6 +46,8 @@ unsigned avformat_version(void);
#include "avio.h"
+struct AVFormatContext;
+
/*
* Public Metadata API.
@@ -67,7 +69,7 @@ unsigned avformat_version(void);
* A demuxer should set a default if it sets any translated tag.
*/
-#define AV_METADATA_IGNORE_CASE 1
+#define AV_METADATA_MATCH_CASE 1
#define AV_METADATA_IGNORE_SUFFIX 2
typedef struct {
@@ -76,25 +78,36 @@ typedef struct {
}AVMetadataTag;
typedef struct AVMetadata AVMetadata;
+typedef struct AVMetadataConv AVMetadataConv;
/**
- * gets a metadata element with matching key.
- * @param prev set to the previous matching element to find the next.
- * @param flags allows case as well as suffix insensitive comparissions.
- * @return found tag or NULL, changing key or value leads to undefined behavior.
+ * Gets a metadata element with matching key.
+ * @param prev Set to the previous matching element to find the next.
+ * @param flags Allows case as well as suffix-insensitive comparisons.
+ * @return Found tag or NULL, changing key or value leads to undefined behavior.
*/
AVMetadataTag *
av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
/**
- * sets the given tag in m, overwriting an existing tag.
- * @param tag tag to add to m, key and value will be av_strduped.
- * @return >= 0 if success otherwise error code that is <0.
+ * Sets the given tag in m, overwriting an existing tag.
+ * @param key tag key to add to m (will be av_strduped)
+ * @param value tag value to add to m (will be av_strduped)
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
+
+/**
+ * Convert all the metadata sets from ctx according to the source and
+ * destination conversion tables.
+ * @param d_conv destination tags format conversion table
+ * @param s_conv source tags format conversion table
*/
-int av_metadata_set(AVMetadata **m, AVMetadataTag tag);
+void av_metadata_conv(struct AVFormatContext *ctx,const AVMetadataConv *d_conv,
+ const AVMetadataConv *s_conv);
/**
- * Free all the memory allocated for an AVMetadata struct.
+ * Frees all the memory allocated for an AVMetadata struct.
*/
void av_metadata_free(AVMetadata **m);
@@ -103,19 +116,18 @@ void av_metadata_free(AVMetadata **m);
typedef struct AVPacket {
/**
- * Presentation timestamp in time_base units.
- * This is the time at which the decompressed packet will be presented
- * to the user.
+ * Presentation timestamp in time_base units; the time at which the
+ * decompressed packet will be presented to the user.
* Can be AV_NOPTS_VALUE if it is not stored in the file.
* pts MUST be larger or equal to dts as presentation cannot happen before
* decompression, unless one wants to view hex dumps. Some formats misuse
- * the terms dts and pts/cts to mean something different, these timestamps
+ * the terms dts and pts/cts to mean something different. Such timestamps
* must be converted to true pts/dts before they are stored in AVPacket.
*/
int64_t pts;
/**
- * Decompression timestamp in time_base units.
- * This is the time at which the packet is decompressed.
+ * Decompression timestamp in time_base units; the time at which the
+ * packet is decompressed.
* Can be AV_NOPTS_VALUE if it is not stored in the file.
*/
int64_t dts;
@@ -209,8 +221,7 @@ static inline void av_free_packet(AVPacket *pkt)
/**
* The exact value of the fractional number is: 'val + num / den'.
* num is assumed to be 0 <= num < den.
- * @deprecated Use AVRational instead.
-*/
+ */
typedef struct AVFrac {
int64_t val, num, den;
} AVFrac;
@@ -220,8 +231,6 @@ typedef struct AVFrac {
struct AVCodecTag;
-struct AVFormatContext;
-
/** This structure contains the data a format has to probe a file. */
typedef struct AVProbeData {
const char *filename;
@@ -229,7 +238,7 @@ typedef struct AVProbeData {
int buf_size;
} AVProbeData;
-#define AVPROBE_SCORE_MAX 100 ///< Maximum score, half of that is used for file-extension-based detection.
+#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection
#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer
typedef struct AVFormatParameters {
@@ -264,6 +273,7 @@ typedef struct AVFormatParameters {
#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. */
+#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */
typedef struct AVOutputFormat {
const char *name;
@@ -275,7 +285,7 @@ typedef struct AVOutputFormat {
const char *long_name;
const char *mime_type;
const char *extensions; /**< comma-separated filename extensions */
- /** Size of private data so that it can be allocated in the wrapper. */
+ /** size of private data so that it can be allocated in the wrapper */
int priv_data_size;
/* output support */
enum CodecID audio_codec; /**< default audio codec */
@@ -292,12 +302,14 @@ typedef struct AVOutputFormat {
/**
* List of supported codec_id-codec_tag pairs, ordered by "better
- * choice first". The arrays are all CODEC_ID_NONE terminated.
+ * choice first". The arrays are all terminated by CODEC_ID_NONE.
*/
const struct AVCodecTag * const *codec_tag;
enum CodecID subtitle_codec; /**< default subtitle codec */
+ const AVMetadataConv *metadata_conv;
+
/* private fields */
struct AVOutputFormat *next;
} AVOutputFormat;
@@ -313,7 +325,7 @@ typedef struct AVInputFormat {
/** Size of private data so that it can be allocated in the wrapper. */
int priv_data_size;
/**
- * Tell if a given file has a chance of being parsed by this format.
+ * Tell if a given file has a chance of being parsed as this format.
* The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
* big so you do not have to check for that unless you need more.
*/
@@ -331,16 +343,19 @@ typedef struct AVInputFormat {
/** Close the stream. The AVFormatContext and AVStreams are not
freed by this function */
int (*read_close)(struct AVFormatContext *);
+
+#if LIBAVFORMAT_VERSION_MAJOR < 53
/**
* Seek to a given timestamp relative to the frames in
* stream component stream_index.
- * @param stream_index must not be -1
- * @param flags selects which direction should be preferred if no exact
- * match is available
+ * @param stream_index Must not be -1.
+ * @param flags Selects which direction should be preferred if no exact
+ * match is available.
* @return >= 0 on success (but not necessarily the new offset)
*/
int (*read_seek)(struct AVFormatContext *,
int stream_index, int64_t timestamp, int flags);
+#endif
/**
* Gets the next timestamp in stream[stream_index].time_base units.
* @return the timestamp or AV_NOPTS_VALUE if an error occurred
@@ -366,6 +381,16 @@ typedef struct AVInputFormat {
const struct AVCodecTag * const *codec_tag;
+ /**
+ * Seek to timestamp ts.
+ * Seeking will be done so that the point from which all active streams
+ * can be presented successfully will be closest to ts and within min/max_ts.
+ * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+ */
+ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+ const AVMetadataConv *metadata_conv;
+
/* private fields */
struct AVInputFormat *next;
} AVInputFormat;
@@ -405,11 +430,11 @@ typedef struct AVStream {
int id; /**< format-specific stream ID */
AVCodecContext *codec; /**< codec context */
/**
- * Real base frame rate of the stream.
- * This is the lowest frame rate with which all timestamps can be
+ * 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
- * frame rates in the stream). Note, this value is just a guess!
- * For example if the time base is 1/90000 and all frames have either
+ * 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;
@@ -423,7 +448,7 @@ typedef struct AVStream {
/**
* This is the fundamental unit of time (in seconds) in terms
* of which frame timestamps are represented. For fixed-fps content,
- * time base should be 1/frame rate and timestamp increments should be 1.
+ * time base should be 1/framerate and timestamp increments should be 1.
*/
AVRational time_base;
int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
@@ -450,7 +475,9 @@ typedef struct AVStream {
*/
int64_t duration;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
+#endif
/* av_read_frame() support */
enum AVStreamParseType need_parsing;
@@ -469,9 +496,9 @@ typedef struct AVStream {
#if LIBAVFORMAT_VERSION_INT < (53<<16)
int64_t unused[4+1];
-#endif
char *filename; /**< source filename of the stream */
+#endif
int disposition; /**< AV_DISPOSITION_* bit field */
@@ -487,6 +514,21 @@ typedef struct AVStream {
AVRational sample_aspect_ratio;
AVMetadata *metadata;
+
+ /* av_read_frame() support */
+ const uint8_t *cur_ptr;
+ int cur_len;
+ AVPacket cur_pkt;
+
+ // Timestamp generation support:
+ /**
+ * Timestamp corresponding to the last dts sync point.
+ *
+ * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
+ * a DTS is received from the underlying container. Otherwise set to
+ * AV_NOPTS_VALUE by default.
+ */
+ int64_t reference_dts;
} AVStream;
#define AV_PROGRAM_RUNNING 1
@@ -499,8 +541,10 @@ typedef struct AVStream {
*/
typedef struct AVProgram {
int id;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
char *provider_name; ///< network name for DVB streams
char *name; ///< service name for DVB streams
+#endif
int flags;
enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller
unsigned int *stream_index;
@@ -515,7 +559,9 @@ typedef struct AVChapter {
int id; ///< unique ID to identify the chapter
AVRational time_base; ///< time base in which the start/end timestamps are specified
int64_t start, end; ///< chapter start/end time in time_base units
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
char *title; ///< chapter title
+#endif
AVMetadata *metadata;
} AVChapter;
@@ -529,7 +575,7 @@ typedef struct AVChapter {
* sizeof(AVFormatContext) must not be used outside libav*.
*/
typedef struct AVFormatContext {
- const AVClass *av_class; /**< Set by av_alloc_format_context. */
+ const AVClass *av_class; /**< Set by avformat_alloc_context. */
/* Can only be iformat or oformat, not both at the same time. */
struct AVInputFormat *iformat;
struct AVOutputFormat *oformat;
@@ -540,6 +586,7 @@ typedef struct AVFormatContext {
char filename[1024]; /**< input or output filename */
/* stream info */
int64_t timestamp;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
char title[512];
char author[512];
char copyright[512];
@@ -548,6 +595,7 @@ typedef struct AVFormatContext {
int year; /**< ID3 year, 0 if none */
int track; /**< track number, 0 if none */
char genre[32]; /**< ID3 genre */
+#endif
int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
/* private data for pts handling (do not modify directly). */
@@ -568,14 +616,16 @@ typedef struct AVFormatContext {
int64_t file_size;
/** Decoding: total stream bitrate in bit/s, 0 if not
available. Never set it directly if the file_size and the
- duration are known as ffmpeg can compute it automatically. */
+ duration are known as FFmpeg can compute it automatically. */
int bit_rate;
/* av_read_frame() support */
AVStream *cur_st;
- const uint8_t *cur_ptr;
- int cur_len;
- AVPacket cur_pkt;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
+ const uint8_t *cur_ptr_deprecated;
+ int cur_len_deprecated;
+ AVPacket cur_pkt_deprecated;
+#endif
/* av_seek_frame() support */
int64_t data_offset; /** offset of the first packet */
@@ -592,12 +642,12 @@ typedef struct AVFormatContext {
int loop_output;
int flags;
-#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate pts if missing even if it requires parsing future frames.
+#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames.
#define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index.
#define AVFMT_FLAG_NONBLOCK 0x0004 ///< Do not block when reading packets from input.
int loop_input;
- /** Decoding: size of data to probe; encoding: unused. */
+ /** decoding: size of data to probe; encoding: unused. */
unsigned int probesize;
/**
@@ -629,8 +679,8 @@ typedef struct AVFormatContext {
enum CodecID subtitle_codec_id;
/**
- * Maximum amount of memory in bytes to use per stream for the index.
- * If the needed index exceeds this size, entries will be discarded as
+ * Maximum amount of memory in bytes to use for the index of each stream.
+ * If the index exceeds this size, entries will be discarded as
* needed to maintain a smaller size. This can lead to slower or less
* accurate seeking (depends on demuxer).
* Demuxers for which a full in-memory index is mandatory will ignore
@@ -679,13 +729,24 @@ extern AVInputFormat *first_iformat;
extern AVOutputFormat *first_oformat;
#endif
+/**
+ * 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.
+ */
AVInputFormat *av_iformat_next(AVInputFormat *f);
+
+/**
+ * If f is NULL, returns the first registered output format,
+ * if f is non-NULL, returns the next registered output format after f
+ * or NULL if f is the last one.
+ */
AVOutputFormat *av_oformat_next(AVOutputFormat *f);
enum CodecID av_guess_image2_codec(const char *filename);
-/* XXX: use automatic init with either ELF sections or C file parser */
-/* modules */
+/* XXX: Use automatic init with either ELF sections or C file parser */
+/* modules. */
/* utils.c */
void av_register_input_format(AVInputFormat *format);
@@ -750,6 +811,15 @@ void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
*/
void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
+/**
+ * Initialize libavformat and register all the muxers, demuxers and
+ * protocols. If you do not call this function, then you can select
+ * exactly which formats you want to support.
+ *
+ * @see av_register_input_format()
+ * @see av_register_output_format()
+ * @see av_register_protocol()
+ */
void av_register_all(void);
/** codec tag <-> codec id */
@@ -795,17 +865,25 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
AVInputFormat *fmt,
int buf_size,
AVFormatParameters *ap);
+
+#if LIBAVFORMAT_VERSION_MAJOR < 53
+/**
+ * @deprecated Use avformat_alloc_context() instead.
+ */
+attribute_deprecated AVFormatContext *av_alloc_format_context(void);
+#endif
+
/**
* Allocate an AVFormatContext.
* Can be freed with av_free() but do not forget to free everything you
* explicitly allocated as well!
*/
-AVFormatContext *av_alloc_format_context(void);
+AVFormatContext *avformat_alloc_context(void);
/**
* Read packets of a media file to get stream information. This
* is useful for file formats with no headers such as MPEG. This
- * function also computes the real frame rate in case of MPEG-2 repeat
+ * function also computes the real framerate in case of MPEG-2 repeat
* frame mode.
* The logical file position is not changed by this function;
* examined packets may be buffered for later processing.
@@ -841,7 +919,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
* then it contains one frame.
*
* pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.timebase units (and guessed if the format cannot
+ * values in AVStream.time_base units (and guessed if the format cannot
* provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
* has B-frames, so it is better to rely on pkt->dts if you do not
* decompress the payload.
@@ -851,7 +929,7 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
int av_read_frame(AVFormatContext *s, AVPacket *pkt);
/**
- * Seek to the key frame at timestamp.
+ * Seek to the keyframe at timestamp.
* 'timestamp' in 'stream_index'.
* @param stream_index If stream_index is (-1), a default
* stream is selected, and timestamp is automatically converted
@@ -865,13 +943,41 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
int flags);
/**
- * Start playing a network based stream (e.g. RTSP stream) at the
+ * Seek to timestamp ts.
+ * Seeking will be done so that the point from which all active streams
+ * can be presented successfully will be closest to ts and within min/max_ts.
+ * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+ *
+ * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
+ * are the file position (this may not be supported by all demuxers).
+ * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
+ * in the stream with stream_index (this may not be supported by all demuxers).
+ * Otherwise all timestamps are in units of the stream selected by stream_index
+ * or if stream_index is -1, in AV_TIME_BASE units.
+ * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
+ * keyframes (this may not be supported by all demuxers).
+ *
+ * @param stream_index index of the stream which is used as time base reference
+ * @param min_ts smallest acceptable timestamp
+ * @param ts target timestamp
+ * @param max_ts largest acceptable timestamp
+ * @param flags flags
+ * @returns >=0 on success, error code otherwise
+ *
+ * @NOTE This is part of the new seek API which is still under construction.
+ * Thus do not use this yet. It may change at any time, do not expect
+ * ABI compatibility yet!
+ */
+int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+/**
+ * Start playing a network-based stream (e.g. RTSP stream) at the
* current position.
*/
int av_read_play(AVFormatContext *s);
/**
- * Pause a network based stream (e.g. RTSP stream).
+ * Pause a network-based stream (e.g. RTSP stream).
*
* Use av_read_play() to resume it.
*/
@@ -949,7 +1055,7 @@ int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
/**
* Ensures the index uses less memory than the maximum specified in
- * AVFormatContext.max_index_size, by discarding entries if it grows
+ * AVFormatContext.max_index_size by discarding entries if it grows
* too large.
* This function is not part of the public API and should only be called
* by demuxers.
@@ -1030,7 +1136,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
* Writes a packet to an output media file ensuring correct interleaving.
*
* The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved the application should
+ * If the packets are already correctly interleaved, the application should
* call av_write_frame() instead as it is slightly faster. It is also important
* to keep in mind that completely non-interleaved input will need huge amounts
* of memory to interleave with this, so it is preferable to interleave at the
@@ -1047,7 +1153,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
* Interleave a packet per dts in an output media file.
*
* Packets with pkt->destruct == av_destruct_packet will be freed inside this
- * function, so they cannot be used after it, note calling av_free_packet()
+ * function, so they cannot be used after it. Note that calling av_free_packet()
* on them is still safe.
*
* @param s media file handle
@@ -1086,7 +1192,7 @@ attribute_deprecated int parse_image_size(int *width_ptr, int *height_ptr,
const char *str);
/**
- * Converts frame rate from string to a fraction.
+ * Converts framerate from a string to a fraction.
* @deprecated Use av_parse_video_frame_rate instead.
*/
attribute_deprecated int parse_frame_rate(int *frame_rate, int *frame_rate_base,
@@ -1127,7 +1233,7 @@ int64_t av_gettime(void);
/* ffm-specific for ffserver */
#define FFM_PACKET_SIZE 4096
int64_t ffm_read_write_index(int fd);
-void ffm_write_write_index(int fd, int64_t pos);
+int ffm_write_write_index(int fd, int64_t pos);
void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
/**
@@ -1139,7 +1245,7 @@ void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
/**
- * Returns in 'buf' the path with '%d' replaced by number.
+ * Returns in 'buf' the path with '%d' replaced by a number.
*
* Also handles the '%0nd' format where 'n' is the total number
* of digits and '%%'.
@@ -1179,7 +1285,7 @@ int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
#ifdef HAVE_AV_CONFIG_H
-void ff_dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
+void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
#ifdef __GNUC__
#define dynarray_add(tab, nb_ptr, elem)\
@@ -1187,12 +1293,12 @@ do {\
__typeof__(tab) _tab = (tab);\
__typeof__(elem) _elem = (elem);\
(void)sizeof(**_tab == _elem); /* check that types are compatible */\
- ff_dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
+ ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
} while(0)
#else
#define dynarray_add(tab, nb_ptr, elem)\
do {\
- ff_dynarray_add((unsigned long **)(tab), nb_ptr, (unsigned long)(elem));\
+ ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
} while(0)
#endif
diff --git a/third_party/ffmpeg/include/libavformat/avio.h b/third_party/ffmpeg/include/libavformat/avio.h
index 3bb88b3..be02b06 100644
--- a/third_party/ffmpeg/include/libavformat/avio.h
+++ b/third_party/ffmpeg/include/libavformat/avio.h
@@ -1,5 +1,4 @@
/*
- * unbuffered io for ffmpeg system
* copyright (c) 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
@@ -21,8 +20,18 @@
#ifndef AVFORMAT_AVIO_H
#define AVFORMAT_AVIO_H
+/**
+ * @file libavformat/avio.h
+ * unbuffered I/O operations
+ *
+ * @warning This file has to be considered an internal but installed
+ * header, so it should not be directly included in your projects.
+ */
+
#include <stdint.h>
+#include "libavutil/common.h"
+
/* unbuffered I/O */
/**
@@ -69,6 +78,15 @@ int url_exist(const char *filename);
int64_t url_filesize(URLContext *h);
/**
+ * Return the file descriptor associated with this URL. For RTP, this
+ * will return only the RTP file descriptor, not the RTCP file descriptor.
+ * To get both, use rtp_get_file_handles().
+ *
+ * @return the file descriptor associated with this URL, or <0 on error.
+ */
+int url_get_file_handle(URLContext *h);
+
+/**
* Return the maximum packet size associated to packetized file
* handle. If the file is not packetized (stream like HTTP or file on
* disk), then 0 is returned.
@@ -135,14 +153,30 @@ typedef struct URLProtocol {
int (*url_read_pause)(URLContext *h, int pause);
int64_t (*url_read_seek)(URLContext *h, int stream_index,
int64_t timestamp, int flags);
+ int (*url_get_file_handle)(URLContext *h);
} URLProtocol;
+#if LIBAVFORMAT_VERSION_MAJOR < 53
extern URLProtocol *first_protocol;
+#endif
+
extern URLInterruptCB *url_interrupt_cb;
+/**
+ * If protocol is NULL, returns the first registered protocol,
+ * if protocol is non-NULL, returns the next registered protocol after protocol,
+ * or NULL if protocol is the last one.
+ */
URLProtocol *av_protocol_next(URLProtocol *p);
-int register_protocol(URLProtocol *protocol);
+#if LIBAVFORMAT_VERSION_MAJOR < 53
+/**
+ * @deprecated Use av_register_protocol() instead.
+ */
+attribute_deprecated int register_protocol(URLProtocol *protocol);
+#endif
+
+int av_register_protocol(URLProtocol *protocol);
/**
* Bytestream IO Context.
@@ -365,6 +399,8 @@ void init_checksum(ByteIOContext *s,
/* udp.c */
int udp_set_remote_url(URLContext *h, const char *uri);
int udp_get_local_port(URLContext *h);
+#if (LIBAVFORMAT_VERSION_MAJOR <= 52)
int udp_get_file_handle(URLContext *h);
+#endif
#endif /* AVFORMAT_AVIO_H */
diff --git a/third_party/ffmpeg/include/libavformat/rtsp.h b/third_party/ffmpeg/include/libavformat/rtsp.h
deleted file mode 100644
index ec3477b..0000000
--- a/third_party/ffmpeg/include/libavformat/rtsp.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * RTSP definitions
- * Copyright (c) 2002 Fabrice Bellard.
- *
- * 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 FFMPEG_RTSP_H
-#define FFMPEG_RTSP_H
-
-#include <stdint.h>
-#include "avformat.h"
-#include "rtspcodes.h"
-#include "rtp.h"
-#include "network.h"
-
-enum RTSPLowerTransport {
- RTSP_LOWER_TRANSPORT_UDP = 0,
- RTSP_LOWER_TRANSPORT_TCP = 1,
- RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2,
- /**
- * This is not part of public API and shouldn't be used outside of ffmpeg.
- */
- RTSP_LOWER_TRANSPORT_LAST
-};
-
-#define RTSP_DEFAULT_PORT 554
-#define RTSP_MAX_TRANSPORTS 8
-#define RTSP_TCP_MAX_PACKET_SIZE 1472
-#define RTSP_DEFAULT_NB_AUDIO_CHANNELS 2
-#define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
-#define RTSP_RTP_PORT_MIN 5000
-#define RTSP_RTP_PORT_MAX 10000
-
-typedef struct RTSPTransportField {
- int interleaved_min, interleaved_max; /**< interleave ids, if TCP transport */
- int port_min, port_max; /**< RTP ports */
- int client_port_min, client_port_max; /**< RTP ports */
- int server_port_min, server_port_max; /**< RTP ports */
- int ttl; /**< ttl value */
- uint32_t destination; /**< destination IP address */
- int transport;
- enum RTSPLowerTransport lower_transport;
-} RTSPTransportField;
-
-typedef struct RTSPHeader {
- int content_length;
- enum RTSPStatusCode status_code; /**< response code from server */
- int nb_transports;
- /** in AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
- int64_t range_start, range_end;
- RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
- int seq; /**< sequence number */
- char session_id[512];
- char real_challenge[64]; /**< the RealChallenge1 field from the server */
- char server[64];
-} RTSPHeader;
-
-enum RTSPClientState {
- RTSP_STATE_IDLE,
- RTSP_STATE_PLAYING,
- RTSP_STATE_PAUSED,
-};
-
-enum RTSPServerType {
- RTSP_SERVER_RTP, /**< Standards-compliant RTP-server */
- RTSP_SERVER_REAL, /**< Realmedia-style server */
- RTSP_SERVER_WMS, /**< Windows Media server */
- RTSP_SERVER_LAST
-};
-
-enum RTSPTransport {
- RTSP_TRANSPORT_RTP,
- RTSP_TRANSPORT_RDT,
- RTSP_TRANSPORT_LAST
-};
-
-typedef struct RTSPState {
- URLContext *rtsp_hd; /* RTSP TCP connexion handle */
- int nb_rtsp_streams;
- struct RTSPStream **rtsp_streams;
-
- enum RTSPClientState state;
- int64_t seek_timestamp;
-
- /* XXX: currently we use unbuffered input */
- // ByteIOContext rtsp_gb;
- int seq; /* RTSP command sequence number */
- char session_id[512];
- enum RTSPTransport transport;
- enum RTSPLowerTransport lower_transport;
- enum RTSPServerType server_type;
- char last_reply[2048]; /* XXX: allocate ? */
- void *cur_tx;
- int need_subscription;
- enum AVDiscard real_setup_cache[MAX_STREAMS];
- char last_subscription[1024];
-} RTSPState;
-
-typedef struct RTSPStream {
- URLContext *rtp_handle; /* RTP stream handle */
- void *tx_ctx; /* RTP/RDT parse context */
-
- int stream_index; /* corresponding stream index, if any. -1 if none (MPEG2TS case) */
- int interleaved_min, interleaved_max; /* interleave ids, if TCP transport */
- char control_url[1024]; /* url for this stream (from SDP) */
-
- int sdp_port; /* port (from SDP content - not used in RTSP) */
- struct in_addr sdp_ip; /* IP address (from SDP content - not used in RTSP) */
- int sdp_ttl; /* IP TTL (from SDP content - not used in RTSP) */
- int sdp_payload_type; /* payload type - only used in SDP */
- RTPPayloadData rtp_payload_data; /* rtp payload parsing infos from SDP */
-
- RTPDynamicProtocolHandler *dynamic_handler; ///< Only valid if it's a dynamic protocol. (This is the handler structure)
- PayloadContext *dynamic_protocol_context; ///< Only valid if it's a dynamic protocol. (This is any private data associated with the dynamic protocol)
-} RTSPStream;
-
-/** the callback can be used to extend the connection setup/teardown step */
-enum RTSPCallbackAction {
- RTSP_ACTION_SERVER_SETUP,
- RTSP_ACTION_SERVER_TEARDOWN,
- RTSP_ACTION_CLIENT_SETUP,
- RTSP_ACTION_CLIENT_TEARDOWN,
-};
-
-typedef struct RTSPActionServerSetup {
- uint32_t ipaddr;
- char transport_option[512];
-} RTSPActionServerSetup;
-
-typedef int FFRTSPCallback(enum RTSPCallbackAction action,
- const char *session_id,
- char *buf, int buf_size,
- void *arg);
-
-int rtsp_init(void);
-void rtsp_parse_line(RTSPHeader *reply, const char *buf);
-
-#if LIBAVFORMAT_VERSION_INT < (53 << 16)
-extern int rtsp_default_protocols;
-#endif
-extern int rtsp_rtp_port_min;
-extern int rtsp_rtp_port_max;
-
-int rtsp_pause(AVFormatContext *s);
-int rtsp_resume(AVFormatContext *s);
-
-#endif /* FFMPEG_RTSP_H */
diff --git a/third_party/ffmpeg/include/libavformat/rtspcodes.h b/third_party/ffmpeg/include/libavformat/rtspcodes.h
deleted file mode 100644
index 9ee96bf..0000000
--- a/third_party/ffmpeg/include/libavformat/rtspcodes.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * RTSP definitions
- * copyright (c) 2002 Fabrice Bellard
- *
- * 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 AVFORMAT_RTSPCODES_H
-#define AVFORMAT_RTSPCODES_H
-
-/** RTSP handling */
-enum RTSPStatusCode {
-RTSP_STATUS_OK =200, /**< OK */
-RTSP_STATUS_METHOD =405, /**< Method Not Allowed */
-RTSP_STATUS_BANDWIDTH =453, /**< Not Enough Bandwidth */
-RTSP_STATUS_SESSION =454, /**< Session Not Found */
-RTSP_STATUS_STATE =455, /**< Method Not Valid in This State */
-RTSP_STATUS_AGGREGATE =459, /**< Aggregate operation not allowed */
-RTSP_STATUS_ONLY_AGGREGATE =460, /**< Only aggregate operation allowed */
-RTSP_STATUS_TRANSPORT =461, /**< Unsupported transport */
-RTSP_STATUS_INTERNAL =500, /**< Internal Server Error */
-RTSP_STATUS_SERVICE =503, /**< Service Unavailable */
-RTSP_STATUS_VERSION =505, /**< RTSP Version not supported */
-};
-
-#endif /* AVFORMAT_RTSPCODES_H */
diff --git a/third_party/ffmpeg/include/libavutil/avstring.h b/third_party/ffmpeg/include/libavutil/avstring.h
index 9541745..97c2f38 100644
--- a/third_party/ffmpeg/include/libavutil/avstring.h
+++ b/third_party/ffmpeg/include/libavutil/avstring.h
@@ -29,7 +29,7 @@
*
* @param str input string
* @param pfx prefix to test
- * @param ptr updated after the prefix in str in there is a match
+ * @param ptr updated if the prefix is matched inside str
* @return non-zero if the prefix matches, zero otherwise
*/
int av_strstart(const char *str, const char *pfx, const char **ptr);
@@ -41,14 +41,14 @@ int av_strstart(const char *str, const char *pfx, const char **ptr);
*
* @param str input string
* @param pfx prefix to test
- * @param ptr updated after the prefix in str in there is a match
+ * @param ptr updated if the prefix is matched inside str
* @return non-zero if the prefix matches, zero otherwise
*/
int av_stristart(const char *str, const char *pfx, const char **ptr);
/**
* Copy the string src to dst, but no more than size - 1 bytes, and
- * null terminate dst.
+ * null-terminate dst.
*
* This function is the same as BSD strlcpy().
*
@@ -61,7 +61,7 @@ size_t av_strlcpy(char *dst, const char *src, size_t size);
/**
* Append the string src to the string dst, but to a total length of
- * no more than size - 1 bytes, and null terminate dst.
+ * no more than size - 1 bytes, and null-terminate dst.
*
* This function is similar to BSD strlcat(), but differs when
* size <= strlen(dst).
diff --git a/third_party/ffmpeg/include/libavutil/avutil.h b/third_party/ffmpeg/include/libavutil/avutil.h
index ad5af257..dfc129b 100644
--- a/third_party/ffmpeg/include/libavutil/avutil.h
+++ b/third_party/ffmpeg/include/libavutil/avutil.h
@@ -22,7 +22,7 @@
#define AVUTIL_AVUTIL_H
/**
- * @file avutil.h
+ * @file libavutil/avutil.h
* external API header
*/
@@ -34,8 +34,8 @@
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-#define LIBAVUTIL_VERSION_MAJOR 49
-#define LIBAVUTIL_VERSION_MINOR 12
+#define LIBAVUTIL_VERSION_MAJOR 50
+#define LIBAVUTIL_VERSION_MINOR 2
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@@ -58,93 +58,6 @@ unsigned avutil_version(void);
#include "rational.h"
#include "intfloat_readwrite.h"
#include "log.h"
-
-/**
- * Pixel format. Notes:
- *
- * PIX_FMT_RGB32 is handled in an endian-specific manner. A RGBA
- * color is put together as:
- * (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little endian CPU architectures and ARGB on
- * big endian CPUs.
- *
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1] and, is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- */
-enum PixelFormat {
- PIX_FMT_NONE= -1,
- PIX_FMT_YUV420P, ///< Planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
- PIX_FMT_YUYV422, ///< Packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
- PIX_FMT_RGB24, ///< Packed RGB 8:8:8, 24bpp, RGBRGB...
- PIX_FMT_BGR24, ///< Packed RGB 8:8:8, 24bpp, BGRBGR...
- PIX_FMT_YUV422P, ///< Planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
- PIX_FMT_YUV444P, ///< Planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
- PIX_FMT_RGB32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in cpu endianness
- PIX_FMT_YUV410P, ///< Planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
- PIX_FMT_YUV411P, ///< Planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
- PIX_FMT_RGB565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), in cpu endianness
- PIX_FMT_RGB555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in cpu endianness most significant bit to 0
- PIX_FMT_GRAY8, ///< Y , 8bpp
- PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
- PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
- PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
- PIX_FMT_YUVJ420P, ///< Planar YUV 4:2:0, 12bpp, full scale (jpeg)
- PIX_FMT_YUVJ422P, ///< Planar YUV 4:2:2, 16bpp, full scale (jpeg)
- PIX_FMT_YUVJ444P, ///< Planar YUV 4:4:4, 24bpp, full scale (jpeg)
- PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing(xvmc_render.h)
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_UYVY422, ///< Packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
- PIX_FMT_UYYVYY411, ///< Packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
- PIX_FMT_BGR32, ///< Packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in cpu endianness
- PIX_FMT_BGR565, ///< Packed RGB 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), in cpu endianness
- PIX_FMT_BGR555, ///< Packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in cpu endianness most significant bit to 1
- PIX_FMT_BGR8, ///< Packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
- PIX_FMT_BGR4, ///< Packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_BGR4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
- PIX_FMT_RGB8, ///< Packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
- PIX_FMT_RGB4, ///< Packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_RGB4_BYTE, ///< Packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
- PIX_FMT_NV12, ///< Planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
- PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
-
- PIX_FMT_RGB32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in cpu endianness
- PIX_FMT_BGR32_1, ///< Packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in cpu endianness
-
- PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
- PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
- PIX_FMT_YUV440P, ///< Planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- PIX_FMT_YUVJ440P, ///< Planar YUV 4:4:0 full scale (jpeg)
- PIX_FMT_YUVA420P, ///< Planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
- PIX_FMT_VDPAU_H264,///< H264 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
- PIX_FMT_VDPAU_MPEG1,///< MPEG1 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
- PIX_FMT_VDPAU_MPEG2,///< MPEG2 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
- 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
-};
-
-#ifdef WORDS_BIGENDIAN
-#define PIX_FMT_RGBA PIX_FMT_RGB32_1
-#define PIX_FMT_BGRA PIX_FMT_BGR32_1
-#define PIX_FMT_ARGB PIX_FMT_RGB32
-#define PIX_FMT_ABGR PIX_FMT_BGR32
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16BE
-#else
-#define PIX_FMT_RGBA PIX_FMT_BGR32
-#define PIX_FMT_BGRA PIX_FMT_RGB32
-#define PIX_FMT_ARGB PIX_FMT_BGR32_1
-#define PIX_FMT_ABGR PIX_FMT_RGB32_1
-#define PIX_FMT_GRAY16 PIX_FMT_GRAY16LE
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define PIX_FMT_UYVY411 PIX_FMT_UYYVYY411
-#define PIX_FMT_RGBA32 PIX_FMT_RGB32
-#define PIX_FMT_YUV422 PIX_FMT_YUYV422
-#endif
+#include "pixfmt.h"
#endif /* AVUTIL_AVUTIL_H */
diff --git a/third_party/ffmpeg/include/libavutil/base64.h b/third_party/ffmpeg/include/libavutil/base64.h
index 91df541..e3152eb 100644
--- a/third_party/ffmpeg/include/libavutil/base64.h
+++ b/third_party/ffmpeg/include/libavutil/base64.h
@@ -1,5 +1,4 @@
/*
- * Base64.c
* Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
*
* This file is part of FFmpeg.
@@ -25,16 +24,26 @@
#include <stdint.h>
/**
- * decodes base64
- * param order as strncpy()
+ * Decodes the base64-encoded string in \p in and puts the decoded
+ * data in \p out.
+ *
+ * @param out_size size in bytes of the \p out buffer, it should be at
+ * least 3/4 of the length of \p in
+ * @return the number of bytes written, or a negative value in case of
+ * error
*/
-int av_base64_decode(uint8_t * out, const char *in, int out_length);
+int av_base64_decode(uint8_t *out, const char *in, int out_size);
/**
- * encodes base64
- * @param src data, not a string
- * @param buf output string
+ * Encodes in base64 the data in \p in and puts the resulting string
+ * in \p out.
+ *
+ * @param out_size size in bytes of the \p out string, it should be at
+ * least ((\p in_size + 2) / 3) * 4 + 1
+ * @param in_size size in bytes of the \p in buffer
+ * @return the string containing the encoded data, or NULL in case of
+ * error
*/
-char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len);
+char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
#endif /* AVUTIL_BASE64_H */
diff --git a/third_party/ffmpeg/include/libavutil/common.h b/third_party/ffmpeg/include/libavutil/common.h
index ed295cf..15eaf98 100644
--- a/third_party/ffmpeg/include/libavutil/common.h
+++ b/third_party/ffmpeg/include/libavutil/common.h
@@ -19,29 +19,27 @@
*/
/**
- * @file common.h
+ * @file libavutil/common.h
* common internal and external API header
*/
#ifndef AVUTIL_COMMON_H
#define AVUTIL_COMMON_H
+#include <ctype.h>
+#include <errno.h>
#include <inttypes.h>
-
-#ifdef HAVE_AV_CONFIG_H
-/* only include the following when compiling package */
-# include "config.h"
-
-# include <stdlib.h>
-# include <stdio.h>
-# include <string.h>
-# include <ctype.h>
-# include <limits.h>
-# include <errno.h>
-# include <math.h>
-#endif /* HAVE_AV_CONFIG_H */
-
-#define AV_GCC_VERSION_AT_LEAST(x,y) (defined(__GNUC__) && (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y))
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __GNUC__
+# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
+#else
+# define AV_GCC_VERSION_AT_LEAST(x,y) 0
+#endif
#ifndef av_always_inline
#if AV_GCC_VERSION_AT_LEAST(3,1)
@@ -83,9 +81,13 @@
#endif
#endif
-#ifdef HAVE_AV_CONFIG_H
-# include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
+#ifndef av_flatten
+#if AV_GCC_VERSION_AT_LEAST(4,1)
+# define av_flatten __attribute__((flatten))
+#else
+# define av_flatten
+#endif
+#endif
#ifndef attribute_deprecated
#if AV_GCC_VERSION_AT_LEAST(3,1)
@@ -103,9 +105,15 @@
#endif
#endif
-#include "mem.h"
+#ifndef av_uninit
+#if defined(__GNUC__) && !defined(__ICC)
+# define av_uninit(x) x=x
+#else
+# define av_uninit(x) x
+#endif
+#endif
-//rounded divison & shift
+//rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
/* assume b>0 */
#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
@@ -151,49 +159,8 @@ static inline av_const int av_log2_16bit(unsigned int v)
return n;
}
-/* median of 3 */
-static inline av_const int mid_pred(int a, int b, int c)
-{
-#if HAVE_CMOV
- int i=b;
- __asm__ volatile(
- "cmp %2, %1 \n\t"
- "cmovg %1, %0 \n\t"
- "cmovg %2, %1 \n\t"
- "cmp %3, %1 \n\t"
- "cmovl %3, %1 \n\t"
- "cmp %1, %0 \n\t"
- "cmovg %1, %0 \n\t"
- :"+&r"(i), "+&r"(a)
- :"r"(b), "r"(c)
- );
- return i;
-#elif 0
- int t= (a-b)&((a-b)>>31);
- a-=t;
- b+=t;
- b-= (b-c)&((b-c)>>31);
- b+= (a-b)&((a-b)>>31);
-
- return b;
-#else
- if(a>b){
- if(c>b){
- if(c>a) b=a;
- else b=c;
- }
- }else{
- if(b>c){
- if(c>a) b=c;
- else b=a;
- }
- }
- return b;
-#endif
-}
-
/**
- * clip a signed integer value into the amin-amax range
+ * Clips a signed integer value into the amin-amax range.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
@@ -207,7 +174,7 @@ static inline av_const int av_clip(int a, int amin, int amax)
}
/**
- * clip a signed integer value into the 0-255 range
+ * Clips a signed integer value into the 0-255 range.
* @param a value to clip
* @return clipped value
*/
@@ -218,7 +185,7 @@ static inline av_const uint8_t av_clip_uint8(int a)
}
/**
- * clip a signed integer value into the -32768,32767 range
+ * Clips a signed integer value into the -32768,32767 range.
* @param a value to clip
* @return clipped value
*/
@@ -229,7 +196,7 @@ static inline av_const int16_t av_clip_int16(int a)
}
/**
- * clip a float value into the amin-amax range
+ * Clips a float value into the amin-amax range.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
@@ -242,26 +209,12 @@ static inline av_const float av_clipf(float a, float amin, float amax)
else return a;
}
-/* math */
-int64_t av_const ff_gcd(int64_t a, int64_t b);
-
-/**
- * converts fourcc string to int
- */
-static inline av_pure int ff_get_fourcc(const char *s){
-#ifdef HAVE_AV_CONFIG_H
- assert( strlen(s)==4 );
-#endif
-
- return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
-}
-
#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
/*!
* \def GET_UTF8(val, GET_BYTE, ERROR)
- * converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
+ * Converts a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
* \param val is the output and should be of type uint32_t. It holds the converted
* UCS-4 character and should be a left value.
* \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
@@ -289,19 +242,19 @@ static inline av_pure int ff_get_fourcc(const char *s){
/*!
* \def PUT_UTF8(val, tmp, PUT_BYTE)
- * converts a 32-bit unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * \param val is an input only argument and should be of type uint32_t. It holds
- * a ucs4 encoded unicode character that is to be converted to UTF-8. If
- * val is given as a function it's executed only once.
+ * Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+ * \param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+ * val is given as a function it is executed only once.
* \param tmp is a temporary variable and should be of type uint8_t. It
* represents an intermediate value during conversion that is to be
- * outputted by PUT_BYTE.
+ * output by PUT_BYTE.
* \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
* It could be a function or a statement, and uses tmp as the input byte.
* For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
* executed up to 4 times for values in the valid UTF-8 range and up to
* 7 times in the general case, depending on the length of the converted
- * unicode character.
+ * Unicode character.
*/
#define PUT_UTF8(val, tmp, PUT_BYTE)\
{\
@@ -323,4 +276,11 @@ static inline av_pure int ff_get_fourcc(const char *s){
}\
}
+#include "mem.h"
+
+#ifdef HAVE_AV_CONFIG_H
+# include "config.h"
+# include "internal.h"
+#endif /* HAVE_AV_CONFIG_H */
+
#endif /* AVUTIL_COMMON_H */
diff --git a/third_party/ffmpeg/include/libavutil/crc.h b/third_party/ffmpeg/include/libavutil/crc.h
index e07e65a..fa34059 100644
--- a/third_party/ffmpeg/include/libavutil/crc.h
+++ b/third_party/ffmpeg/include/libavutil/crc.h
@@ -33,7 +33,7 @@ typedef enum {
AV_CRC_16_CCITT,
AV_CRC_32_IEEE,
AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
- AV_CRC_MAX, /*< not part of public API! don't use outside lavu */
+ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
}AVCRCId;
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
diff --git a/third_party/ffmpeg/include/libavutil/fifo.h b/third_party/ffmpeg/include/libavutil/fifo.h
index 93756e9..d353844 100644
--- a/third_party/ffmpeg/include/libavutil/fifo.h
+++ b/third_party/ffmpeg/include/libavutil/fifo.h
@@ -17,8 +17,8 @@
*/
/**
- * @file fifo.h
- * A very simple circular buffer FIFO implementation.
+ * @file libavutil/fifo.h
+ * a very simple circular buffer FIFO implementation
*/
#ifndef AVUTIL_FIFO_H
@@ -31,15 +31,15 @@
typedef struct AVFifoBuffer {
uint8_t *buffer;
uint8_t *rptr, *wptr, *end;
+ uint32_t rndx, wndx;
} AVFifoBuffer;
/**
* Initializes an AVFifoBuffer.
- * @param *f AVFifoBuffer to initialize
* @param size of FIFO
- * @return <0 for failure >=0 otherwise
+ * @return AVFifoBuffer or NULL if mem allocation failure
*/
-int av_fifo_init(AVFifoBuffer *f, unsigned int size);
+AVFifoBuffer *av_fifo_alloc(unsigned int size);
/**
* Frees an AVFifoBuffer.
@@ -48,6 +48,12 @@ int av_fifo_init(AVFifoBuffer *f, unsigned int size);
void av_fifo_free(AVFifoBuffer *f);
/**
+ * Resets the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
+ * @param *f AVFifoBuffer to reset
+ */
+void av_fifo_reset(AVFifoBuffer *f);
+
+/**
* Returns the amount of data in bytes in the AVFifoBuffer, that is the
* amount of data you can read from it.
* @param *f AVFifoBuffer to read from
@@ -56,59 +62,33 @@ void av_fifo_free(AVFifoBuffer *f);
int av_fifo_size(AVFifoBuffer *f);
/**
- * Reads data from an AVFifoBuffer.
- * @param *f AVFifoBuffer to read from
- * @param *buf data destination
- * @param buf_size number of bytes to read
- */
-int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
-
-/**
- * Feeds data from an AVFifoBuffer to a user supplied callback.
+ * Feeds data from an AVFifoBuffer to a user-supplied callback.
* @param *f AVFifoBuffer to read from
* @param buf_size number of bytes to read
* @param *func generic read function
* @param *dest data destination
*/
-int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest);
-
-/**
- * Writes data into an AVFifoBuffer.
- * @param *f AVFifoBuffer to write to
- * @param *buf data source
- * @param size data size
- */
-attribute_deprecated void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
+int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
/**
- * Feeds data from a user supplied callback to an AVFifoBuffer.
+ * Feeds data from a user-supplied callback to an AVFifoBuffer.
* @param *f AVFifoBuffer to write to
* @param *src data source
* @param size number of bytes to write
- * @param *func generic write function. First parameter is src,
- * second is dest_buf, third is dest_buf_size.
+ * @param *func generic write function; the first parameter is src,
+ * the second is dest_buf, the third is dest_buf_size.
* func must return the number of bytes written to dest_buf, or <= 0 to
* indicate no more data available to write.
* If func is NULL, src is interpreted as a simple byte array for source data.
- * @return the number of bytes written to the fifo.
+ * @return the number of bytes written to the FIFO
*/
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
-#if LIBAVUTIL_VERSION_MAJOR < 50
-/**
- * Resizes an AVFifoBuffer.
- * @param *f AVFifoBuffer to resize
- * @param size new AVFifoBuffer size in bytes
- * @see av_fifo_realloc2()
- */
-attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
-#endif
-
/**
* Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
- * @return <0 for failure >=0 otherwise
+ * @return <0 for failure, >=0 otherwise
*/
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
diff --git a/third_party/ffmpeg/include/libavutil/log.h b/third_party/ffmpeg/include/libavutil/log.h
index 8c93f9c..1206a2f 100644
--- a/third_party/ffmpeg/include/libavutil/log.h
+++ b/third_party/ffmpeg/include/libavutil/log.h
@@ -25,7 +25,7 @@
#include "avutil.h"
/**
- * Describes the class of an AVClass context structure, that is an
+ * Describes the class of an AVClass context structure. That is an
* arbitrary struct of which the first field is a pointer to an
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
*/
@@ -38,8 +38,8 @@ struct AVCLASS {
const char* class_name;
/**
- * a pointer to a function which returns the name of a context
- * instance \p ctx associated with the class
+ * A pointer to a function which returns the name of a context
+ * instance \p ctx associated with the class.
*/
const char* (*item_name)(void* ctx);
@@ -53,38 +53,29 @@ struct AVCLASS {
/* av_log API */
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-#define AV_LOG_QUIET -1
-#define AV_LOG_FATAL 0
-#define AV_LOG_ERROR 0
-#define AV_LOG_WARNING 1
-#define AV_LOG_INFO 1
-#define AV_LOG_VERBOSE 1
-#define AV_LOG_DEBUG 2
-#else
#define AV_LOG_QUIET -8
/**
- * something went really wrong and we will crash now
+ * Something went really wrong and we will crash now.
*/
#define AV_LOG_PANIC 0
/**
- * something went wrong and recovery is not possible
- * like no header in a format which depends on it or a combination
- * of parameters which are not allowed
+ * Something went wrong and recovery is not possible.
+ * For example, no header was found for a format which depends
+ * on headers or an illegal combination of parameters is used.
*/
#define AV_LOG_FATAL 8
/**
- * something went wrong and cannot losslessly be recovered
- * but not all future data is affected
+ * Something went wrong and cannot losslessly be recovered.
+ * However, not all future data is affected.
*/
#define AV_LOG_ERROR 16
/**
- * something somehow does not look correct / something which may or may not
- * lead to some problems like use of -vstrict -2
+ * Something somehow does not look correct. This may or may not
+ * lead to problems. An example would be the use of '-vstrict -2'.
*/
#define AV_LOG_WARNING 24
@@ -92,18 +83,13 @@ struct AVCLASS {
#define AV_LOG_VERBOSE 40
/**
- * stuff which is only useful for libav* developers
+ * Stuff which is only useful for libav* developers.
*/
#define AV_LOG_DEBUG 48
-#endif
-
-#if LIBAVUTIL_VERSION_INT < (50<<16)
-extern int av_log_level;
-#endif
/**
- * Send the specified message to the log if the level is less than or equal to
- * the current av_log_level. By default, all logging messages are sent to
+ * Sends the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
* stderr. This behavior can be altered by setting a different av_vlog callback
* function.
*
diff --git a/third_party/ffmpeg/include/libavutil/lzo.h b/third_party/ffmpeg/include/libavutil/lzo.h
index 2f09f9f..6788054 100644
--- a/third_party/ffmpeg/include/libavutil/lzo.h
+++ b/third_party/ffmpeg/include/libavutil/lzo.h
@@ -24,16 +24,43 @@
#include <stdint.h>
-#define LZO_INPUT_DEPLETED 1
-#define LZO_OUTPUT_FULL 2
-#define LZO_INVALID_BACKPTR 4
-#define LZO_ERROR 8
+/** \defgroup errflags Error flags returned by av_lzo1x_decode
+ * \{ */
+//! end of the input buffer reached before decoding finished
+#define AV_LZO_INPUT_DEPLETED 1
+//! decoded data did not fit into output buffer
+#define AV_LZO_OUTPUT_FULL 2
+//! a reference to previously decoded data was wrong
+#define AV_LZO_INVALID_BACKPTR 4
+//! a non-specific error in the compressed bitstream
+#define AV_LZO_ERROR 8
+/** \} */
-#define LZO_INPUT_PADDING 8
-#define LZO_OUTPUT_PADDING 12
+#define AV_LZO_INPUT_PADDING 8
+#define AV_LZO_OUTPUT_PADDING 12
-int lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+/**
+ * \brief Decodes LZO 1x compressed data.
+ * \param out output buffer
+ * \param outlen size of output buffer, number of bytes left are returned here
+ * \param in input buffer
+ * \param inlen size of input buffer, number of bytes left are returned here
+ * \return 0 on success, otherwise a combination of the error flags above
+ *
+ * Make sure all buffers are appropriately padded, in must provide
+ * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
+ */
+int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
+/**
+ * \brief deliberately overlapping memcpy implementation
+ * \param dst destination buffer; must be padded with 12 additional bytes
+ * \param back how many bytes back we start (the initial size of the overlapping window)
+ * \param cnt number of bytes to copy, must be >= 0
+ *
+ * cnt > back is valid, this will copy the bytes we just copied,
+ * thus creating a repeating pattern with a period length of back.
+ */
void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
#endif /* AVUTIL_LZO_H */
diff --git a/third_party/ffmpeg/include/libavutil/mathematics.h b/third_party/ffmpeg/include/libavutil/mathematics.h
index 7438527..782efcc 100644
--- a/third_party/ffmpeg/include/libavutil/mathematics.h
+++ b/third_party/ffmpeg/include/libavutil/mathematics.h
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <math.h>
+#include "common.h"
#include "rational.h"
#ifndef M_E
@@ -42,27 +43,29 @@
#endif
enum AVRounding {
- AV_ROUND_ZERO = 0, ///< round toward zero
- AV_ROUND_INF = 1, ///< round away from zero
- AV_ROUND_DOWN = 2, ///< round toward -infinity
- AV_ROUND_UP = 3, ///< round toward +infinity
- AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
+ AV_ROUND_ZERO = 0, ///< Round toward zero.
+ AV_ROUND_INF = 1, ///< Round away from zero.
+ AV_ROUND_DOWN = 2, ///< Round toward -infinity.
+ AV_ROUND_UP = 3, ///< Round toward +infinity.
+ AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
};
+int64_t av_const av_gcd(int64_t a, int64_t b);
+
/**
- * rescale a 64bit integer with rounding to nearest.
- * a simple a*b/c isn't possible as it can overflow
+ * Rescales a 64-bit integer with rounding to nearest.
+ * A simple a*b/c isn't possible as it can overflow.
*/
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
/**
- * rescale a 64bit integer with specified rounding.
- * a simple a*b/c isn't possible as it can overflow
+ * Rescales a 64-bit integer with specified rounding.
+ * A simple a*b/c isn't possible as it can overflow.
*/
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
/**
- * rescale a 64bit integer by 2 rational numbers.
+ * Rescales a 64-bit integer by 2 rational numbers.
*/
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
diff --git a/third_party/ffmpeg/include/libavutil/mem.h b/third_party/ffmpeg/include/libavutil/mem.h
index ec6e3b7..e50553a 100644
--- a/third_party/ffmpeg/include/libavutil/mem.h
+++ b/third_party/ffmpeg/include/libavutil/mem.h
@@ -19,8 +19,8 @@
*/
/**
- * @file mem.h
- * Memory handling functions.
+ * @file libavutil/mem.h
+ * memory handling functions
*/
#ifndef AVUTIL_MEM_H
@@ -28,22 +28,6 @@
#include "common.h"
-#if defined(__ICC) || defined(__SUNPRO_C)
- #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
- #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
-#elif defined(__GNUC__)
- #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
- #define DECLARE_ASM_CONST(n,t,v) static const t v attribute_used __attribute__ ((aligned (n)))
-#elif defined(_MSC_VER)
- #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
- #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
-#elif HAVE_INLINE_ASM
- #error The asm code needs alignment, but we do not know how to do it for this compiler.
-#else
- #define DECLARE_ALIGNED(n,t,v) t v
- #define DECLARE_ASM_CONST(n,t,v) static const t v
-#endif
-
#if AV_GCC_VERSION_AT_LEAST(3,1)
#define av_malloc_attrib __attribute__((__malloc__))
#else
@@ -57,31 +41,31 @@
#endif
/**
- * Allocate a block of \p size bytes with alignment suitable for all
+ * Allocates a block of \p size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU).
* @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot allocate
- * it.
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
* @see av_mallocz()
*/
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
/**
- * Allocate or reallocate a block of memory.
- * If \p ptr is NULL and \p size > 0, allocate a new block. If \p
- * size is zero, free the memory block pointed by \p ptr.
+ * Allocates or reallocates a block of memory.
+ * If \p ptr is NULL and \p size > 0, allocates a new block. If \p
+ * size is zero, frees the memory block pointed to by \p ptr.
* @param size Size in bytes for the memory block to be allocated or
* reallocated.
* @param ptr Pointer to a memory block already allocated with
* av_malloc(z)() or av_realloc() or NULL.
- * @return Pointer to a newly reallocated block or NULL if it cannot
- * reallocate or the function is used to free the memory block.
+ * @return Pointer to a newly reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
* @see av_fast_realloc()
*/
void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
/**
- * Free a memory block which has been allocated with av_malloc(z)() or
+ * Frees a memory block which has been allocated with av_malloc(z)() or
* av_realloc().
* @param ptr Pointer to the memory block which should be freed.
* @note ptr = NULL is explicitly allowed.
@@ -91,27 +75,26 @@ void *av_realloc(void *ptr, unsigned int size) av_alloc_size(2);
void av_free(void *ptr);
/**
- * Allocate a block of \p size bytes with alignment suitable for all
+ * Allocates a block of \p size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU) and
- * set to zeroes all the bytes of the block.
+ * zeroes all the bytes of the block.
* @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot allocate
- * it.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
* @see av_malloc()
*/
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
/**
- * Duplicate the string \p s.
- * @param s String to be duplicated.
+ * Duplicates the string \p s.
+ * @param s string to be duplicated
* @return Pointer to a newly allocated string containing a
- * copy of \p s or NULL if it cannot be allocated.
+ * copy of \p s or NULL if the string cannot be allocated.
*/
char *av_strdup(const char *s) av_malloc_attrib;
/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc() and set to NULL the pointer to it.
+ * Frees a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc() and set the pointer pointing to it to NULL.
* @param ptr Pointer to the pointer to the memory block which should
* be freed.
* @see av_free()
diff --git a/third_party/ffmpeg/include/libavutil/pixfmt.h b/third_party/ffmpeg/include/libavutil/pixfmt.h
new file mode 100644
index 0000000..21a72a8
--- /dev/null
+++ b/third_party/ffmpeg/include/libavutil/pixfmt.h
@@ -0,0 +1,140 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
+ *
+ * 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_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file libavutil/pixfmt.h
+ * pixel format definitions
+ *
+ * @warning This file has to be considered an internal but installed
+ * header, so it should not be directly included in your projects.
+ */
+
+/**
+ * Pixel format. Notes:
+ *
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ * (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * Note, make sure that all newly added big endian formats have pix_fmt&1==1
+ * and that all newly added little endian formats have pix_fmt&1==0
+ * this allows simpler detection of big vs little endian.
+ */
+enum PixelFormat {
+ PIX_FMT_NONE= -1,
+ PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+ PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+ PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+ PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+ PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+ PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+ PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+ PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+ PIX_FMT_GRAY8, ///< Y , 8bpp
+ PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
+ PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
+ PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
+ PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
+ PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
+ PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
+ PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+ PIX_FMT_XVMC_MPEG2_IDCT,
+ PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+ PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+ PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
+ PIX_FMT_BGR4, ///< packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
+ PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
+ PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
+ PIX_FMT_RGB4, ///< packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb)
+ PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
+ PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
+ PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
+
+ PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+ PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+ PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+ PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+ PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
+ PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
+ PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+ PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG)
+ PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+ 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
+ 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
+ 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
+ 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
+ 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
+ PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian
+ PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian
+
+ PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
+ PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
+ PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+ PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+ PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
+ PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
+ PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+ PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+ PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+ PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+ PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+ 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
+};
+
+#ifdef WORDS_BIGENDIAN
+# define PIX_FMT_NE(be, le) PIX_FMT_##be
+#else
+# define PIX_FMT_NE(be, le) PIX_FMT_##le
+#endif
+
+#define PIX_FMT_RGB32 PIX_FMT_NE(ARGB, BGRA)
+#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
+#define PIX_FMT_BGR32 PIX_FMT_NE(ABGR, RGBA)
+#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
+
+#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define PIX_FMT_RGB48 PIX_FMT_NE(RGB48BE, RGB48LE)
+#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
+#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
+#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
+#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/third_party/ffmpeg/include/libavutil/random.h b/third_party/ffmpeg/include/libavutil/random.h
deleted file mode 100644
index f243676..0000000
--- a/third_party/ffmpeg/include/libavutil/random.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Mersenne Twister Random Algorithm
- * Copyright (c) 2006 Ryan Martell.
- * Based on A C-program for MT19937, with initialization improved 2002/1/26. Coded by
- * Takuji Nishimura and Makoto Matsumoto.
- *
- * 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_RANDOM_H
-#define AVUTIL_RANDOM_H
-
-#define AV_RANDOM_N 624
-
-typedef struct {
- unsigned int mt[AV_RANDOM_N]; ///< the array for the state vector
- int index; ///< Current untempered value we use as the base.
-} AVRandomState;
-
-
-void av_init_random(unsigned int seed, AVRandomState *state); ///< To be inlined, the struct must be visible. So it does not make sense to try and keep it opaque with malloc/free-like calls.
-void av_random_generate_untempered_numbers(AVRandomState *state); ///< Regenerate the untempered numbers (must be done every 624 iterations, or it will loop).
-
-/**
- * Generates a random number from the interval [0,0xffffffff].
- *
- * Please do NOT use the Mersenne Twister, it is slow. Use the random generator
- * from lfg.c/h or a simple LCG like state= state*1664525+1013904223.
- * If you still choose to use MT, expect that you will have to provide
- * some evidence that it makes a difference for the case where you use it.
- */
-static inline unsigned int av_random(AVRandomState *state)
-{
- unsigned int y;
-
- // Regenerate the untempered numbers if we should...
- if (state->index >= AV_RANDOM_N)
- av_random_generate_untempered_numbers(state);
-
- // Grab one...
- y = state->mt[state->index++];
-
- /* Now temper (Mersenne Twister coefficients). The coefficients for MT19937 are.. */
- y ^= (y >> 11);
- y ^= (y << 7) & 0x9d2c5680;
- y ^= (y << 15) & 0xefc60000;
- y ^= (y >> 18);
-
- return y;
-}
-
-/** Return random in range [0-1] as double. */
-static inline double av_random_real1(AVRandomState *state)
-{
- /* divided by 2^32-1 */
- return av_random(state) * (1.0 / 4294967296.0);
-}
-
-#endif /* AVUTIL_RANDOM_H */
diff --git a/third_party/ffmpeg/include/libavutil/rational.h b/third_party/ffmpeg/include/libavutil/rational.h
index 70b7735..5ee70c9 100644
--- a/third_party/ffmpeg/include/libavutil/rational.h
+++ b/third_party/ffmpeg/include/libavutil/rational.h
@@ -1,5 +1,5 @@
/*
- * Rational numbers
+ * rational numbers
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
@@ -20,8 +20,8 @@
*/
/**
- * @file rational.h
- * Rational numbers.
+ * @file libavutil/rational.h
+ * rational numbers
* @author Michael Niedermayer <michaelni@gmx.at>
*/
@@ -32,7 +32,7 @@
#include "common.h"
/**
- * Rational number num/den.
+ * rational number numerator/denominator
*/
typedef struct AVRational{
int num; ///< numerator
@@ -40,10 +40,10 @@ typedef struct AVRational{
} AVRational;
/**
- * Compare two rationals.
+ * Compares two rationals.
* @param a first rational
* @param b second rational
- * @return 0 if a==b, 1 if a>b and -1 if a<b.
+ * @return 0 if a==b, 1 if a>b and -1 if a<b
*/
static inline int av_cmp_q(AVRational a, AVRational b){
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
@@ -53,7 +53,7 @@ static inline int av_cmp_q(AVRational a, AVRational b){
}
/**
- * Rational to double conversion.
+ * Converts rational to double.
* @param a rational to convert
* @return (double) a
*/
@@ -62,46 +62,46 @@ static inline double av_q2d(AVRational a){
}
/**
- * Reduce a fraction.
+ * Reduces a fraction.
* This is useful for framerate calculations.
- * @param dst_nom destination numerator
+ * @param dst_num destination numerator
* @param dst_den destination denominator
- * @param nom source numerator
+ * @param num source numerator
* @param den source denominator
- * @param max the maximum allowed for dst_nom & dst_den
+ * @param max the maximum allowed for dst_num & dst_den
* @return 1 if exact, 0 otherwise
*/
-int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);
+int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
/**
* Multiplies two rationals.
- * @param b first rational.
- * @param c second rational.
- * @return b*c.
+ * @param b first rational
+ * @param c second rational
+ * @return b*c
*/
AVRational av_mul_q(AVRational b, AVRational c) av_const;
/**
* Divides one rational by another.
- * @param b first rational.
- * @param c second rational.
- * @return b/c.
+ * @param b first rational
+ * @param c second rational
+ * @return b/c
*/
AVRational av_div_q(AVRational b, AVRational c) av_const;
/**
* Adds two rationals.
- * @param b first rational.
- * @param c second rational.
- * @return b+c.
+ * @param b first rational
+ * @param c second rational
+ * @return b+c
*/
AVRational av_add_q(AVRational b, AVRational c) av_const;
/**
* Subtracts one rational from another.
- * @param b first rational.
- * @param c second rational.
- * @return b-c.
+ * @param b first rational
+ * @param c second rational
+ * @return b-c
*/
AVRational av_sub_q(AVRational b, AVRational c) av_const;
@@ -109,7 +109,7 @@ AVRational av_sub_q(AVRational b, AVRational c) av_const;
* Converts a double precision floating point number to a rational.
* @param d double to convert
* @param max the maximum allowed numerator and denominator
- * @return (AVRational) d.
+ * @return (AVRational) d
*/
AVRational av_d2q(double d, int max) av_const;
diff --git a/third_party/ffmpeg/using_ffmpeg.vsprops b/third_party/ffmpeg/using_ffmpeg.vsprops
index d3459ee..1a569b3 100644
--- a/third_party/ffmpeg/using_ffmpeg.vsprops
+++ b/third_party/ffmpeg/using_ffmpeg.vsprops
@@ -10,7 +10,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="avcodec-52.lib avformat-52.lib avutil-49.lib"
- DelayLoadDLLs="avcodec-52.dll;avformat-52.dll;avutil-49.dll"
+ AdditionalDependencies="avcodec-52.lib avformat-52.lib avutil-50.lib"
+ DelayLoadDLLs="avcodec-52.dll;avformat-52.dll;avutil-50.dll"
/>
</VisualStudioPropertySheet>