"atomic bomb" commit. Reorganized OpenCV directory structure
This commit is contained in:
30
3rdparty/include/ffmpeg_/adler32.h
vendored
Normal file
30
3rdparty/include/ffmpeg_/adler32.h
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* copyright (c) 2006 Mans Rullgard
|
||||
*
|
||||
* 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_ADLER32_H
|
||||
#define AVUTIL_ADLER32_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
|
||||
unsigned int len) av_pure;
|
||||
|
||||
#endif /* AVUTIL_ADLER32_H */
|
3384
3rdparty/include/ffmpeg_/avcodec.h
vendored
Normal file
3384
3rdparty/include/ffmpeg_/avcodec.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
46
3rdparty/include/ffmpeg_/avdevice.h
vendored
Normal file
46
3rdparty/include/ffmpeg_/avdevice.h
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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 AVDEVICE_AVDEVICE_H
|
||||
#define AVDEVICE_AVDEVICE_H
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 52
|
||||
#define LIBAVDEVICE_VERSION_MINOR 1
|
||||
#define LIBAVDEVICE_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
|
||||
|
||||
/**
|
||||
* Returns the LIBAVDEVICE_VERSION_INT constant.
|
||||
*/
|
||||
unsigned avdevice_version(void);
|
||||
|
||||
/**
|
||||
* Initialize libavdevice and register all the input and output devices.
|
||||
* @warning This function is not thread safe.
|
||||
*/
|
||||
void avdevice_register_all(void);
|
||||
|
||||
#endif /* AVDEVICE_AVDEVICE_H */
|
||||
|
1324
3rdparty/include/ffmpeg_/avformat.h
vendored
Normal file
1324
3rdparty/include/ffmpeg_/avformat.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
394
3rdparty/include/ffmpeg_/avio.h
vendored
Normal file
394
3rdparty/include/ffmpeg_/avio.h
vendored
Normal file
@@ -0,0 +1,394 @@
|
||||
/*
|
||||
* copyright (c) 2001 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_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 "common.h"
|
||||
|
||||
/* unbuffered I/O */
|
||||
|
||||
/**
|
||||
* URL Context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
* Removal, reordering and changes to existing fields require a major
|
||||
* version bump.
|
||||
* sizeof(URLContext) must not be used outside libav*.
|
||||
*/
|
||||
struct URLContext {
|
||||
#if LIBAVFORMAT_VERSION_MAJOR >= 53
|
||||
const AVClass *av_class; ///< information for av_log(). Set by url_open().
|
||||
#endif
|
||||
struct URLProtocol *prot;
|
||||
int flags;
|
||||
int is_streamed; /**< true if streamed (no seek possible), default = false */
|
||||
int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
|
||||
void *priv_data;
|
||||
char *filename; /**< specified filename */
|
||||
};
|
||||
|
||||
typedef struct URLContext URLContext;
|
||||
|
||||
typedef struct URLPollEntry {
|
||||
URLContext *handle;
|
||||
int events;
|
||||
int revents;
|
||||
} URLPollEntry;
|
||||
|
||||
#define URL_RDONLY 0
|
||||
#define URL_WRONLY 1
|
||||
#define URL_RDWR 2
|
||||
|
||||
typedef int URLInterruptCB(void);
|
||||
|
||||
int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
const char *filename, int flags);
|
||||
int url_open(URLContext **h, const char *filename, int flags);
|
||||
int url_read(URLContext *h, unsigned char *buf, int size);
|
||||
int url_write(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t url_seek(URLContext *h, int64_t pos, int whence);
|
||||
int url_close(URLContext *h);
|
||||
int url_exist(const char *filename);
|
||||
int64_t url_filesize(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.
|
||||
*
|
||||
* @param h file handle
|
||||
* @return maximum packet size in bytes
|
||||
*/
|
||||
int url_get_max_packet_size(URLContext *h);
|
||||
void url_get_filename(URLContext *h, char *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* The callback is called in blocking functions to test regulary if
|
||||
* asynchronous interruption is needed. AVERROR(EINTR) is returned
|
||||
* in this case by the interrupted function. 'NULL' means no interrupt
|
||||
* callback is given.
|
||||
*/
|
||||
void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
|
||||
|
||||
/* not implemented */
|
||||
int url_poll(URLPollEntry *poll_table, int n, int timeout);
|
||||
|
||||
/**
|
||||
* Pause and resume playing - only meaningful if using a network streaming
|
||||
* protocol (e.g. MMS).
|
||||
* @param pause 1 for pause, 0 for resume
|
||||
*/
|
||||
int av_url_read_pause(URLContext *h, int pause);
|
||||
|
||||
/**
|
||||
* Seek to a given timestamp relative to some component stream.
|
||||
* Only meaningful if using a network streaming protocol (e.g. MMS.).
|
||||
* @param stream_index The stream index that the timestamp is relative to.
|
||||
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
|
||||
* units from the beginning of the presentation.
|
||||
* If a stream_index >= 0 is used and the protocol does not support
|
||||
* seeking based on component streams, the call will fail with ENOTSUP.
|
||||
* @param timestamp timestamp in AVStream.time_base units
|
||||
* or if there is no stream specified then in AV_TIME_BASE units.
|
||||
* @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
|
||||
* and AVSEEK_FLAG_ANY. The protocol may silently ignore
|
||||
* AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
|
||||
* fail with ENOTSUP if used and not supported.
|
||||
* @return >= 0 on success
|
||||
* @see AVInputFormat::read_seek
|
||||
*/
|
||||
int64_t av_url_read_seek(URLContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
|
||||
/**
|
||||
* Passing this as the "whence" parameter to a seek function causes it to
|
||||
* return the filesize without seeking anywhere. Supporting this is optional.
|
||||
* If it is not supported then the seek function will return <0.
|
||||
*/
|
||||
#define AVSEEK_SIZE 0x10000
|
||||
|
||||
typedef struct URLProtocol {
|
||||
const char *name;
|
||||
int (*url_open)(URLContext *h, const char *filename, int flags);
|
||||
int (*url_read)(URLContext *h, unsigned char *buf, int size);
|
||||
int (*url_write)(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
|
||||
int (*url_close)(URLContext *h);
|
||||
struct URLProtocol *next;
|
||||
int (*url_read_pause)(URLContext *h, int pause);
|
||||
int64_t (*url_read_seek)(URLContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
} 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);
|
||||
|
||||
#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.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
* Removal, reordering and changes to existing fields require a major
|
||||
* version bump.
|
||||
* sizeof(ByteIOContext) must not be used outside libav*.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned char *buffer;
|
||||
int buffer_size;
|
||||
unsigned char *buf_ptr, *buf_end;
|
||||
void *opaque;
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
int must_flush; /**< true if the next seek should flush */
|
||||
int eof_reached; /**< true if eof reached */
|
||||
int write_flag; /**< true if open for writing */
|
||||
int is_streamed;
|
||||
int max_packet_size;
|
||||
unsigned long checksum;
|
||||
unsigned char *checksum_ptr;
|
||||
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
|
||||
int error; ///< contains the error code or 0 if no error happened
|
||||
int (*read_pause)(void *opaque, int pause);
|
||||
int64_t (*read_seek)(void *opaque, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
} ByteIOContext;
|
||||
|
||||
int init_put_byte(ByteIOContext *s,
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
int write_flag,
|
||||
void *opaque,
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
ByteIOContext *av_alloc_put_byte(
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
int write_flag,
|
||||
void *opaque,
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
|
||||
void put_byte(ByteIOContext *s, int b);
|
||||
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
|
||||
void put_le64(ByteIOContext *s, uint64_t val);
|
||||
void put_be64(ByteIOContext *s, uint64_t val);
|
||||
void put_le32(ByteIOContext *s, unsigned int val);
|
||||
void put_be32(ByteIOContext *s, unsigned int val);
|
||||
void put_le24(ByteIOContext *s, unsigned int val);
|
||||
void put_be24(ByteIOContext *s, unsigned int val);
|
||||
void put_le16(ByteIOContext *s, unsigned int val);
|
||||
void put_be16(ByteIOContext *s, unsigned int val);
|
||||
void put_tag(ByteIOContext *s, const char *tag);
|
||||
|
||||
void put_strz(ByteIOContext *s, const char *buf);
|
||||
|
||||
/**
|
||||
* fseek() equivalent for ByteIOContext.
|
||||
* @return new position or AVERROR.
|
||||
*/
|
||||
int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
|
||||
|
||||
/**
|
||||
* Skip given number of bytes forward.
|
||||
* @param offset number of bytes
|
||||
*/
|
||||
void url_fskip(ByteIOContext *s, int64_t offset);
|
||||
|
||||
/**
|
||||
* ftell() equivalent for ByteIOContext.
|
||||
* @return position or AVERROR.
|
||||
*/
|
||||
int64_t url_ftell(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Gets the filesize.
|
||||
* @return filesize or AVERROR
|
||||
*/
|
||||
int64_t url_fsize(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* feof() equivalent for ByteIOContext.
|
||||
* @return non zero if and only if end of file
|
||||
*/
|
||||
int url_feof(ByteIOContext *s);
|
||||
|
||||
int url_ferror(ByteIOContext *s);
|
||||
|
||||
int av_url_read_fpause(ByteIOContext *h, int pause);
|
||||
int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
|
||||
#define URL_EOF (-1)
|
||||
/** @note return URL_EOF (-1) if EOF */
|
||||
int url_fgetc(ByteIOContext *s);
|
||||
|
||||
/** @warning currently size is limited */
|
||||
#ifdef __GNUC__
|
||||
int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
int url_fprintf(ByteIOContext *s, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
/** @note unlike fgets, the EOL character is not returned and a whole
|
||||
line is parsed. return NULL if first char read was EOF */
|
||||
char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
|
||||
|
||||
void put_flush_packet(ByteIOContext *s);
|
||||
|
||||
|
||||
/**
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* @returns number of bytes read or AVERROR
|
||||
*/
|
||||
int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* This reads at most 1 packet. If that is not enough fewer bytes will be
|
||||
* returned.
|
||||
* @returns number of bytes read or AVERROR
|
||||
*/
|
||||
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/** @note return 0 if EOF, so you cannot use it if EOF handling is
|
||||
necessary */
|
||||
int get_byte(ByteIOContext *s);
|
||||
unsigned int get_le24(ByteIOContext *s);
|
||||
unsigned int get_le32(ByteIOContext *s);
|
||||
uint64_t get_le64(ByteIOContext *s);
|
||||
unsigned int get_le16(ByteIOContext *s);
|
||||
|
||||
char *get_strz(ByteIOContext *s, char *buf, int maxlen);
|
||||
unsigned int get_be16(ByteIOContext *s);
|
||||
unsigned int get_be24(ByteIOContext *s);
|
||||
unsigned int get_be32(ByteIOContext *s);
|
||||
uint64_t get_be64(ByteIOContext *s);
|
||||
|
||||
uint64_t ff_get_v(ByteIOContext *bc);
|
||||
|
||||
static inline int url_is_streamed(ByteIOContext *s)
|
||||
{
|
||||
return s->is_streamed;
|
||||
}
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
int url_fdopen(ByteIOContext **s, URLContext *h);
|
||||
|
||||
/** @warning must be called before any I/O */
|
||||
int url_setbufsize(ByteIOContext *s, int buf_size);
|
||||
/** Reset the buffer for reading or writing.
|
||||
* @note Will drop any data currently in the buffer without transmitting it.
|
||||
* @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
|
||||
* to set up the buffer for writing. */
|
||||
int url_resetbuf(ByteIOContext *s, int flags);
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
int url_fopen(ByteIOContext **s, const char *filename, int flags);
|
||||
int url_fclose(ByteIOContext *s);
|
||||
URLContext *url_fileno(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Return the maximum packet size associated to packetized buffered file
|
||||
* handle. If the file is not packetized (stream like http or file on
|
||||
* disk), then 0 is returned.
|
||||
*
|
||||
* @param s buffered file handle
|
||||
* @return maximum packet size in bytes
|
||||
*/
|
||||
int url_fget_max_packet_size(ByteIOContext *s);
|
||||
|
||||
int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
|
||||
|
||||
/** return the written or read size */
|
||||
int url_close_buf(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Open a write only memory stream.
|
||||
*
|
||||
* @param s new IO context
|
||||
* @return zero if no error.
|
||||
*/
|
||||
int url_open_dyn_buf(ByteIOContext **s);
|
||||
|
||||
/**
|
||||
* Open a write only packetized memory stream with a maximum packet
|
||||
* size of 'max_packet_size'. The stream is stored in a memory buffer
|
||||
* with a big endian 4 byte header giving the packet size in bytes.
|
||||
*
|
||||
* @param s new IO context
|
||||
* @param max_packet_size maximum packet size (must be > 0)
|
||||
* @return zero if no error.
|
||||
*/
|
||||
int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer. The buffer
|
||||
* must be freed with av_free().
|
||||
* @param s IO context
|
||||
* @param pbuffer pointer to a byte buffer
|
||||
* @return the length of the byte buffer
|
||||
*/
|
||||
int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
|
||||
unsigned int len);
|
||||
unsigned long get_checksum(ByteIOContext *s);
|
||||
void init_checksum(ByteIOContext *s,
|
||||
unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
|
||||
unsigned long checksum);
|
||||
|
||||
/* udp.c */
|
||||
int udp_set_remote_url(URLContext *h, const char *uri);
|
||||
int udp_get_local_port(URLContext *h);
|
||||
int udp_get_file_handle(URLContext *h);
|
||||
|
||||
#endif /* AVFORMAT_AVIO_H */
|
90
3rdparty/include/ffmpeg_/avstring.h
vendored
Normal file
90
3rdparty/include/ffmpeg_/avstring.h
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Mans Rullgard
|
||||
*
|
||||
* 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_AVSTRING_H
|
||||
#define AVUTIL_AVSTRING_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
|
||||
* the address of the first character in str after the prefix.
|
||||
*
|
||||
* @param str input string
|
||||
* @param pfx prefix to test
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* Return non-zero if pfx is a prefix of str independent of case. If
|
||||
* it is, *ptr is set to the address of the first character in str
|
||||
* after the prefix.
|
||||
*
|
||||
* @param str input string
|
||||
* @param pfx prefix to test
|
||||
* @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.
|
||||
*
|
||||
* This function is the same as BSD strlcpy().
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param src source string
|
||||
* @param size size of destination buffer
|
||||
* @return the length of src
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* This function is similar to BSD strlcat(), but differs when
|
||||
* size <= strlen(dst).
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param src source string
|
||||
* @param size size of destination buffer
|
||||
* @return the total length of src and dst
|
||||
*/
|
||||
size_t av_strlcat(char *dst, const char *src, size_t size);
|
||||
|
||||
/**
|
||||
* Append output to a string, according to a format. Never write out of
|
||||
* the destination buffer, and and always put a terminating 0 within
|
||||
* the buffer.
|
||||
* @param dst destination buffer (string to which the output is
|
||||
* appended)
|
||||
* @param size total size of the destination buffer
|
||||
* @param fmt printf-compatible format string, specifying how the
|
||||
* following parameters are used
|
||||
* @return the length of the string that would have been generated
|
||||
* if enough space had been available
|
||||
*/
|
||||
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
|
||||
|
||||
#endif /* AVUTIL_AVSTRING_H */
|
63
3rdparty/include/ffmpeg_/avutil.h
vendored
Normal file
63
3rdparty/include/ffmpeg_/avutil.h
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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_AVUTIL_H
|
||||
#define AVUTIL_AVUTIL_H
|
||||
|
||||
/**
|
||||
* @file libavutil/avutil.h
|
||||
* external API header
|
||||
*/
|
||||
|
||||
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s)
|
||||
#define AV_TOSTRING(s) #s
|
||||
|
||||
#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
|
||||
#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 15
|
||||
#define LIBAVUTIL_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO)
|
||||
#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO)
|
||||
#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
|
||||
|
||||
#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
|
||||
|
||||
/**
|
||||
* Returns the LIBAVUTIL_VERSION_INT constant.
|
||||
*/
|
||||
unsigned avutil_version(void);
|
||||
|
||||
#include "common.h"
|
||||
#include "mathematics.h"
|
||||
#include "rational.h"
|
||||
#include "intfloat_readwrite.h"
|
||||
#include "log.h"
|
||||
#include "pixfmt.h"
|
||||
|
||||
#endif /* AVUTIL_AVUTIL_H */
|
49
3rdparty/include/ffmpeg_/base64.h
vendored
Normal file
49
3rdparty/include/ffmpeg_/base64.h
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
|
||||
*
|
||||
* 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_BASE64_H
|
||||
#define AVUTIL_BASE64_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* 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_size);
|
||||
|
||||
/**
|
||||
* 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 *out, int out_size, const uint8_t *in, int in_size);
|
||||
|
||||
#endif /* AVUTIL_BASE64_H */
|
286
3rdparty/include/ffmpeg_/common.h
vendored
Normal file
286
3rdparty/include/ffmpeg_/common.h
vendored
Normal file
@@ -0,0 +1,286 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @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>
|
||||
#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)
|
||||
# define av_always_inline __attribute__((always_inline)) inline
|
||||
#else
|
||||
# define av_always_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noinline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
#else
|
||||
# define av_noinline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_pure
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_const
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_cold
|
||||
#if (!defined(__ICC) || __ICC > 1100) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#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)
|
||||
# define attribute_deprecated __attribute__((deprecated))
|
||||
#else
|
||||
# define attribute_deprecated
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_unused
|
||||
#if defined(__GNUC__)
|
||||
# define av_unused __attribute__((unused))
|
||||
#else
|
||||
# define av_unused
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_uninit
|
||||
#if defined(__GNUC__) && !defined(__ICC)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//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))
|
||||
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
|
||||
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
|
||||
|
||||
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
|
||||
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
|
||||
#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
|
||||
|
||||
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
|
||||
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
/* misc math functions */
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
|
||||
static inline av_const int av_log2(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xffff0000) {
|
||||
v >>= 16;
|
||||
n += 16;
|
||||
}
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline av_const int av_log2_16bit(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const int av_clip(int a, int amin, int amax)
|
||||
{
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the 0-255 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const uint8_t av_clip_uint8(int a)
|
||||
{
|
||||
if (a&(~255)) return (-a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the -32768,32767 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const int16_t av_clip_int16(int a)
|
||||
{
|
||||
if ((a+32768) & ~65535) return (a>>31) ^ 32767;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const float av_clipf(float a, float amin, float amax)
|
||||
{
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
#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
|
||||
* \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
|
||||
* a function or a statement whose return value or evaluated value is of type
|
||||
* uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
|
||||
* and up to 7 times in the general case.
|
||||
* \param ERROR action that should be taken when an invalid UTF-8 byte is returned
|
||||
* from GET_BYTE. It should be a statement that jumps out of the macro,
|
||||
* like exit(), goto, return, break, or continue.
|
||||
*/
|
||||
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
||||
val= GET_BYTE;\
|
||||
{\
|
||||
int ones= 7 - av_log2(val ^ 255);\
|
||||
if(ones==1)\
|
||||
ERROR\
|
||||
val&= 127>>ones;\
|
||||
while(--ones > 0){\
|
||||
int tmp= GET_BYTE - 128;\
|
||||
if(tmp>>6)\
|
||||
ERROR\
|
||||
val= (val<<6) + tmp;\
|
||||
}\
|
||||
}
|
||||
|
||||
/*!
|
||||
* \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 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
|
||||
* 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.
|
||||
*/
|
||||
#define PUT_UTF8(val, tmp, PUT_BYTE)\
|
||||
{\
|
||||
int bytes, shift;\
|
||||
uint32_t in = val;\
|
||||
if (in < 0x80) {\
|
||||
tmp = in;\
|
||||
PUT_BYTE\
|
||||
} else {\
|
||||
bytes = (av_log2(in) + 4) / 5;\
|
||||
shift = (bytes - 1) * 6;\
|
||||
tmp = (256 - (256 >> bytes)) | (in >> shift);\
|
||||
PUT_BYTE\
|
||||
while (shift >= 6) {\
|
||||
shift -= 6;\
|
||||
tmp = 0x80 | ((in >> shift) & 0x3f);\
|
||||
PUT_BYTE\
|
||||
}\
|
||||
}\
|
||||
}
|
||||
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
# include "internal.h"
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
|
||||
#endif /* AVUTIL_COMMON_H */
|
44
3rdparty/include/ffmpeg_/crc.h
vendored
Normal file
44
3rdparty/include/ffmpeg_/crc.h
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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_CRC_H
|
||||
#define AVUTIL_CRC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "common.h"
|
||||
|
||||
typedef uint32_t AVCRC;
|
||||
|
||||
typedef enum {
|
||||
AV_CRC_8_ATM,
|
||||
AV_CRC_16_ANSI,
|
||||
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! Do not use outside libavutil. */
|
||||
}AVCRCId;
|
||||
|
||||
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
|
||||
const AVCRC *av_crc_get_table(AVCRCId crc_id);
|
||||
uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
|
||||
|
||||
#endif /* AVUTIL_CRC_H */
|
||||
|
131
3rdparty/include/ffmpeg_/fifo.h
vendored
Normal file
131
3rdparty/include/ffmpeg_/fifo.h
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/fifo.h
|
||||
* a very simple circular buffer FIFO implementation
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_FIFO_H
|
||||
#define AVUTIL_FIFO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "avutil.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct AVFifoBuffer {
|
||||
uint8_t *buffer;
|
||||
uint8_t *rptr, *wptr, *end;
|
||||
} AVFifoBuffer;
|
||||
|
||||
/**
|
||||
* Initializes an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to initialize
|
||||
* @param size of FIFO
|
||||
* @return <0 for failure >=0 otherwise
|
||||
*/
|
||||
int av_fifo_init(AVFifoBuffer *f, unsigned int size);
|
||||
|
||||
/**
|
||||
* Frees an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to free
|
||||
*/
|
||||
void av_fifo_free(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
|
||||
* @return size
|
||||
*/
|
||||
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.
|
||||
* @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);
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR < 50
|
||||
/**
|
||||
* 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);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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; 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
|
||||
|
||||
/**
|
||||
* Reads and discards the specified amount of data from an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param size amount of data to read in bytes
|
||||
*/
|
||||
void av_fifo_drain(AVFifoBuffer *f, int size);
|
||||
|
||||
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
|
||||
{
|
||||
uint8_t *ptr = f->rptr + offs;
|
||||
if (ptr >= f->end)
|
||||
ptr -= f->end - f->buffer;
|
||||
return *ptr;
|
||||
}
|
||||
#endif /* AVUTIL_FIFO_H */
|
41
3rdparty/include/ffmpeg_/imgconvert.h
vendored
Normal file
41
3rdparty/include/ffmpeg_/imgconvert.h
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Misc image conversion routines
|
||||
* most functionality is exported to the public API, see avcodec.h
|
||||
*
|
||||
* Copyright (c) 2008 Vitor Sessak
|
||||
*
|
||||
* 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_IMGCONVERT_H
|
||||
#define AVCODEC_IMGCONVERT_H
|
||||
|
||||
//#include <stdint.h>
|
||||
#include "avcodec.h"
|
||||
|
||||
int ff_fill_linesize(AVPicture *picture, int pix_fmt, int width);
|
||||
|
||||
int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, int pix_fmt, int height);
|
||||
|
||||
int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane);
|
||||
|
||||
int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt);
|
||||
|
||||
int img_convert(AVPicture *dst, int dst_pix_fmt, const AVPicture *src,
|
||||
int src_pix_fmt, int src_width, int src_height);
|
||||
|
||||
#endif /* AVCODEC_IMGCONVERT_H */
|
86
3rdparty/include/ffmpeg_/integer.h
vendored
Normal file
86
3rdparty/include/ffmpeg_/integer.h
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* arbitrary precision integers
|
||||
* Copyright (c) 2004 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/integer.h
|
||||
* arbitrary precision integers
|
||||
* @author Michael Niedermayer <michaelni@gmx.at>
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_INTEGER_H
|
||||
#define AVUTIL_INTEGER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
#define AV_INTEGER_SIZE 8
|
||||
|
||||
typedef struct AVInteger{
|
||||
uint16_t v[AV_INTEGER_SIZE];
|
||||
} AVInteger;
|
||||
|
||||
AVInteger av_add_i(AVInteger a, AVInteger b) av_const;
|
||||
AVInteger av_sub_i(AVInteger a, AVInteger b) av_const;
|
||||
|
||||
/**
|
||||
* Returns the rounded-down value of the base 2 logarithm of the given
|
||||
* AVInteger. This is simply the index of the most significant bit
|
||||
* which is 1, or 0 if all bits are 0.
|
||||
*/
|
||||
int av_log2_i(AVInteger a) av_const;
|
||||
AVInteger av_mul_i(AVInteger a, AVInteger b) av_const;
|
||||
|
||||
/**
|
||||
* Returns 0 if a==b, 1 if a>b and -1 if a<b.
|
||||
*/
|
||||
int av_cmp_i(AVInteger a, AVInteger b) av_const;
|
||||
|
||||
/**
|
||||
* bitwise shift
|
||||
* @param s the number of bits by which the value should be shifted right,
|
||||
may be negative for shifting left
|
||||
*/
|
||||
AVInteger av_shr_i(AVInteger a, int s) av_const;
|
||||
|
||||
/**
|
||||
* Returns a % b.
|
||||
* @param quot a/b will be stored here.
|
||||
*/
|
||||
AVInteger av_mod_i(AVInteger *quot, AVInteger a, AVInteger b);
|
||||
|
||||
/**
|
||||
* Returns a/b.
|
||||
*/
|
||||
AVInteger av_div_i(AVInteger a, AVInteger b) av_const;
|
||||
|
||||
/**
|
||||
* Converts the given int64_t to an AVInteger.
|
||||
*/
|
||||
AVInteger av_int2i(int64_t a) av_const;
|
||||
|
||||
/**
|
||||
* Converts the given AVInteger to an int64_t.
|
||||
* If the AVInteger is too large to fit into an int64_t,
|
||||
* then only the least significant 64 bits will be used.
|
||||
*/
|
||||
int64_t av_i2int(AVInteger a) av_const;
|
||||
|
||||
#endif /* AVUTIL_INTEGER_H */
|
40
3rdparty/include/ffmpeg_/intfloat_readwrite.h
vendored
Normal file
40
3rdparty/include/ffmpeg_/intfloat_readwrite.h
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* copyright (c) 2005 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_INTFLOAT_READWRITE_H
|
||||
#define AVUTIL_INTFLOAT_READWRITE_H
|
||||
|
||||
//#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
/* IEEE 80 bits extended float */
|
||||
typedef struct AVExtFloat {
|
||||
uint8_t exponent[2];
|
||||
uint8_t mantissa[8];
|
||||
} AVExtFloat;
|
||||
|
||||
double av_int2dbl(int64_t v) av_const;
|
||||
float av_int2flt(int32_t v) av_const;
|
||||
double av_ext2dbl(const AVExtFloat ext) av_const;
|
||||
int64_t av_dbl2int(double d) av_const;
|
||||
int32_t av_flt2int(float d) av_const;
|
||||
AVExtFloat av_dbl2ext(double d) av_const;
|
||||
|
||||
#endif /* AVUTIL_INTFLOAT_READWRITE_H */
|
130
3rdparty/include/ffmpeg_/log.h
vendored
Normal file
130
3rdparty/include/ffmpeg_/log.h
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 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_LOG_H
|
||||
#define AVUTIL_LOG_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "avutil.h"
|
||||
|
||||
/**
|
||||
* 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.).
|
||||
*/
|
||||
typedef struct AVCLASS AVClass;
|
||||
struct AVCLASS {
|
||||
/**
|
||||
* The name of the class; usually it is the same name as the
|
||||
* context structure type to which the AVClass is associated.
|
||||
*/
|
||||
const char* class_name;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* a pointer to the first option specified in the class if any or NULL
|
||||
*
|
||||
* @see av_set_default_options()
|
||||
*/
|
||||
const struct AVOption *option;
|
||||
};
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
#define AV_LOG_PANIC 0
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* However, not all future data is affected.
|
||||
*/
|
||||
#define AV_LOG_ERROR 16
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
#define AV_LOG_INFO 32
|
||||
#define AV_LOG_VERBOSE 40
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param avcl A pointer to an arbitrary struct of which the first field is a
|
||||
* pointer to an AVClass struct.
|
||||
* @param level The importance level of the message, lower values signifying
|
||||
* higher importance.
|
||||
* @param fmt The format string (printf-compatible) that specifies how
|
||||
* subsequent arguments are converted to output.
|
||||
* @see av_vlog
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
#else
|
||||
void av_log(void*, int level, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
void av_vlog(void*, int level, const char *fmt, va_list);
|
||||
int av_log_get_level(void);
|
||||
void av_log_set_level(int);
|
||||
void av_log_set_callback(void (*)(void*, int, const char*, va_list));
|
||||
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
|
||||
|
||||
#endif /* AVUTIL_LOG_H */
|
66
3rdparty/include/ffmpeg_/lzo.h
vendored
Normal file
66
3rdparty/include/ffmpeg_/lzo.h
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* LZO 1x decompression
|
||||
* copyright (c) 2006 Reimar Doeffinger
|
||||
*
|
||||
* 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_LZO_H
|
||||
#define AVUTIL_LZO_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** \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 AV_LZO_INPUT_PADDING 8
|
||||
#define AV_LZO_OUTPUT_PADDING 12
|
||||
|
||||
/**
|
||||
* \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 */
|
72
3rdparty/include/ffmpeg_/mathematics.h
vendored
Normal file
72
3rdparty/include/ffmpeg_/mathematics.h
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* copyright (c) 2005 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_MATHEMATICS_H
|
||||
#define AVUTIL_MATHEMATICS_H
|
||||
|
||||
//#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include "common.h"
|
||||
#include "rational.h"
|
||||
|
||||
#ifndef M_E
|
||||
#define M_E 2.7182818284590452354 /* e */
|
||||
#endif
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942 /* log_e 2 */
|
||||
#endif
|
||||
#ifndef M_LN10
|
||||
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#endif
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
#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.
|
||||
};
|
||||
|
||||
int64_t av_const av_gcd(int64_t a, int64_t b);
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Rescales a 64-bit integer by 2 rational numbers.
|
||||
*/
|
||||
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
|
||||
|
||||
#endif /* AVUTIL_MATHEMATICS_H */
|
36
3rdparty/include/ffmpeg_/md5.h
vendored
Normal file
36
3rdparty/include/ffmpeg_/md5.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_MD5_H
|
||||
#define AVUTIL_MD5_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const int av_md5_size;
|
||||
|
||||
struct AVMD5;
|
||||
|
||||
void av_md5_init(struct AVMD5 *ctx);
|
||||
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
|
||||
void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
|
||||
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
|
||||
|
||||
#endif /* AVUTIL_MD5_H */
|
||||
|
104
3rdparty/include/ffmpeg_/mem.h
vendored
Normal file
104
3rdparty/include/ffmpeg_/mem.h
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/mem.h
|
||||
* memory handling functions
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_MEM_H
|
||||
#define AVUTIL_MEM_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
#define av_malloc_attrib __attribute__((__malloc__))
|
||||
#else
|
||||
#define av_malloc_attrib
|
||||
#endif
|
||||
|
||||
#if (!defined(__ICC) || __ICC > 1100) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
#define av_alloc_size(n) __attribute__((alloc_size(n)))
|
||||
#else
|
||||
#define av_alloc_size(n)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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 the block cannot
|
||||
* be allocated.
|
||||
* @see av_mallocz()
|
||||
*/
|
||||
void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* 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 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);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @note It is recommended that you use av_freep() instead.
|
||||
* @see av_freep()
|
||||
*/
|
||||
void av_free(void *ptr);
|
||||
|
||||
/**
|
||||
* Allocates a block of \p size bytes with alignment suitable for all
|
||||
* memory accesses (including vectors if available on the CPU) and
|
||||
* 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 be allocated.
|
||||
* @see av_malloc()
|
||||
*/
|
||||
void *av_mallocz(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* 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 the string cannot be allocated.
|
||||
*/
|
||||
char *av_strdup(const char *s) av_malloc_attrib;
|
||||
|
||||
/**
|
||||
* 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()
|
||||
*/
|
||||
void av_freep(void *ptr);
|
||||
|
||||
#endif /* AVUTIL_MEM_H */
|
156
3rdparty/include/ffmpeg_/opt.h
vendored
Normal file
156
3rdparty/include/ffmpeg_/opt.h
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* AVOptions
|
||||
* copyright (c) 2005 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 AVCODEC_OPT_H
|
||||
#define AVCODEC_OPT_H
|
||||
|
||||
/**
|
||||
* @file libavcodec/opt.h
|
||||
* AVOptions
|
||||
*/
|
||||
|
||||
#include "libavutil/rational.h"
|
||||
#include "avcodec.h"
|
||||
|
||||
enum AVOptionType{
|
||||
FF_OPT_TYPE_FLAGS,
|
||||
FF_OPT_TYPE_INT,
|
||||
FF_OPT_TYPE_INT64,
|
||||
FF_OPT_TYPE_DOUBLE,
|
||||
FF_OPT_TYPE_FLOAT,
|
||||
FF_OPT_TYPE_STRING,
|
||||
FF_OPT_TYPE_RATIONAL,
|
||||
FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
|
||||
FF_OPT_TYPE_CONST=128,
|
||||
};
|
||||
|
||||
/**
|
||||
* AVOption
|
||||
*/
|
||||
typedef struct AVOption {
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
* short English help text
|
||||
* @todo What about other languages?
|
||||
*/
|
||||
const char *help;
|
||||
|
||||
/**
|
||||
* The offset relative to the context structure where the option
|
||||
* value is stored. It should be 0 for named constants.
|
||||
*/
|
||||
int offset;
|
||||
enum AVOptionType type;
|
||||
|
||||
/**
|
||||
* the default value for scalar options
|
||||
*/
|
||||
double default_val;
|
||||
double min; ///< minimum valid value for the option
|
||||
double max; ///< maximum valid value for the option
|
||||
|
||||
int flags;
|
||||
#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding
|
||||
#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding
|
||||
#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ...
|
||||
#define AV_OPT_FLAG_AUDIO_PARAM 8
|
||||
#define AV_OPT_FLAG_VIDEO_PARAM 16
|
||||
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
|
||||
//FIXME think about enc-audio, ... style flags
|
||||
|
||||
/**
|
||||
* The logical unit to which the option belongs. Non-constant
|
||||
* options and corresponding named constants share the same
|
||||
* unit. May be NULL.
|
||||
*/
|
||||
const char *unit;
|
||||
} AVOption;
|
||||
|
||||
|
||||
/**
|
||||
* Looks for an option in \p obj. Looks only for the options which
|
||||
* have the flags set as specified in \p mask and \p flags (that is,
|
||||
* for which it is the case that opt->flags & mask == flags).
|
||||
*
|
||||
* @param[in] obj a pointer to a struct whose first element is a
|
||||
* pointer to an AVClass
|
||||
* @param[in] name the name of the option to look for
|
||||
* @param[in] unit the unit of the option to look for, or any if NULL
|
||||
* @return a pointer to the option found, or NULL if no option
|
||||
* has been found
|
||||
*/
|
||||
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* @see av_set_string2()
|
||||
*/
|
||||
attribute_deprecated const AVOption *av_set_string(void *obj, const char *name, const char *val);
|
||||
|
||||
/**
|
||||
* @return a pointer to the AVOption corresponding to the field set or
|
||||
* NULL if no matching AVOption exists, or if the value \p val is not
|
||||
* valid
|
||||
* @see av_set_string3()
|
||||
*/
|
||||
attribute_deprecated const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Sets the field of obj with the given name to value.
|
||||
*
|
||||
* @param[in] obj A struct whose first element is a pointer to an
|
||||
* AVClass.
|
||||
* @param[in] name the name of the field to set
|
||||
* @param[in] val The value to set. If the field is not of a string
|
||||
* type, then the given string is parsed.
|
||||
* SI postfixes and some named scalars are supported.
|
||||
* If the field is of a numeric type, it has to be a numeric or named
|
||||
* scalar. Behavior with more than one scalar and +- infix operators
|
||||
* is undefined.
|
||||
* If the field is of a flags type, it has to be a sequence of numeric
|
||||
* scalars or named flags separated by '+' or '-'. Prefixing a flag
|
||||
* with '+' causes it to be set without affecting the other flags;
|
||||
* similarly, '-' unsets a flag.
|
||||
* @param[out] o_out if non-NULL put here a pointer to the AVOption
|
||||
* found
|
||||
* @param alloc when 1 then the old value will be av_freed() and the
|
||||
* new av_strduped()
|
||||
* when 0 then no av_free() nor av_strdup() will be used
|
||||
* @return 0 if the value has been set, an AVERROR* error code if no
|
||||
* matching option exists, or if the value \p val is not valid
|
||||
*/
|
||||
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
|
||||
|
||||
const AVOption *av_set_double(void *obj, const char *name, double n);
|
||||
const AVOption *av_set_q(void *obj, const char *name, AVRational n);
|
||||
const AVOption *av_set_int(void *obj, const char *name, int64_t n);
|
||||
double av_get_double(void *obj, const char *name, const AVOption **o_out);
|
||||
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
|
||||
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
|
||||
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
|
||||
const AVOption *av_next_option(void *obj, const AVOption *last);
|
||||
int av_opt_show(void *obj, void *av_log_obj);
|
||||
void av_opt_set_defaults(void *s);
|
||||
void av_opt_set_defaults2(void *s, int mask, int flags);
|
||||
|
||||
#endif /* AVCODEC_OPT_H */
|
137
3rdparty/include/ffmpeg_/pixfmt.h
vendored
Normal file
137
3rdparty/include/ffmpeg_/pixfmt.h
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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_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
|
||||
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,///< 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_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[0] 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[0] contains a vaapi_render_state struct which contains fields extracted from headers
|
||||
PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[0] 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_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
|
||||
#define PIX_FMT_RGB48 PIX_FMT_RGB48BE
|
||||
#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
|
||||
#define PIX_FMT_RGB48 PIX_FMT_RGB48LE
|
||||
#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
|
||||
|
||||
#endif /* AVUTIL_PIXFMT_H */
|
79
3rdparty/include/ffmpeg_/random.h
vendored
Normal file
79
3rdparty/include/ffmpeg_/random.h
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Mersenne Twister PRNG 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
|
||||
|
||||
#include "avutil.h"
|
||||
#include "common.h"
|
||||
|
||||
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;
|
||||
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR < 50
|
||||
attribute_deprecated void av_init_random(unsigned int seed, AVRandomState *state);
|
||||
#endif
|
||||
void av_random_init(AVRandomState *state, unsigned int seed); ///< 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 number
|
||||
* 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;
|
||||
}
|
||||
|
||||
/** Returns a random number in the 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 */
|
129
3rdparty/include/ffmpeg_/rational.h
vendored
Normal file
129
3rdparty/include/ffmpeg_/rational.h
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* rational numbers
|
||||
* Copyright (c) 2003 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/rational.h
|
||||
* rational numbers
|
||||
* @author Michael Niedermayer <michaelni@gmx.at>
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_RATIONAL_H
|
||||
#define AVUTIL_RATIONAL_H
|
||||
|
||||
//#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* rational number numerator/denominator
|
||||
*/
|
||||
typedef struct AVRational{
|
||||
int num; ///< numerator
|
||||
int den; ///< denominator
|
||||
} AVRational;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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;
|
||||
|
||||
if(tmp) return (tmp>>63)|1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts rational to double.
|
||||
* @param a rational to convert
|
||||
* @return (double) a
|
||||
*/
|
||||
static inline double av_q2d(AVRational a){
|
||||
return a.num / (double) a.den;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces a fraction.
|
||||
* This is useful for framerate calculations.
|
||||
* @param dst_num destination numerator
|
||||
* @param dst_den destination denominator
|
||||
* @param num source numerator
|
||||
* @param den source denominator
|
||||
* @param max the maximum allowed for dst_num & dst_den
|
||||
* @return 1 if exact, 0 otherwise
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
AVRational av_div_q(AVRational b, AVRational c) av_const;
|
||||
|
||||
/**
|
||||
* Adds two rationals.
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
AVRational av_d2q(double d, int max) av_const;
|
||||
|
||||
/**
|
||||
* @return 1 if \q1 is nearer to \p q than \p q2, -1 if \p q2 is nearer
|
||||
* than \p q1, 0 if they have the same distance.
|
||||
*/
|
||||
int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
|
||||
|
||||
/**
|
||||
* Finds the nearest value in \p q_list to \p q.
|
||||
* @param q_list an array of rationals terminated by {0, 0}
|
||||
* @return the index of the nearest value found in the array
|
||||
*/
|
||||
int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
|
||||
|
||||
#endif /* AVUTIL_RATIONAL_H */
|
147
3rdparty/include/ffmpeg_/rgb2rgb.h
vendored
Normal file
147
3rdparty/include/ffmpeg_/rgb2rgb.h
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* software RGB to RGB converter
|
||||
* pluralize by Software PAL8 to RGB converter
|
||||
* Software YUV to YUV converter
|
||||
* Software YUV to RGB converter
|
||||
* Written by Nick Kurshev.
|
||||
* palette & YUV & runtime CPU stuff by Michael (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 SWSCALE_RGB2RGB_H
|
||||
#define SWSCALE_RGB2RGB_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/* A full collection of RGB to RGB(BGR) converters */
|
||||
extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb15to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb16to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
|
||||
void rgb24to32 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb32to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb16to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb15to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
||||
void bgr8torgb8 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||
|
||||
|
||||
void palette8topacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
void palette8topacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
void palette8tobgr16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||
|
||||
/**
|
||||
* Height should be a multiple of 2 and width should be a multiple of 16.
|
||||
* (If this is a problem for anyone then tell me, and I will fix it.)
|
||||
* Chrominance data is only taken from every second line, others are ignored.
|
||||
* FIXME: Write high quality version.
|
||||
*/
|
||||
//void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||
|
||||
/**
|
||||
* Height should be a multiple of 2 and width should be a multiple of 16.
|
||||
* (If this is a problem for anyone then tell me, and I will fix it.)
|
||||
*/
|
||||
extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long dstStride);
|
||||
|
||||
/**
|
||||
* Width should be a multiple of 16.
|
||||
*/
|
||||
extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long dstStride);
|
||||
|
||||
/**
|
||||
* Height should be a multiple of 2 and width should be a multiple of 16.
|
||||
* (If this is a problem for anyone then tell me, and I will fix it.)
|
||||
*/
|
||||
extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long srcStride);
|
||||
|
||||
/**
|
||||
* Height should be a multiple of 2 and width should be a multiple of 16.
|
||||
* (If this is a problem for anyone then tell me, and I will fix it.)
|
||||
*/
|
||||
extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long dstStride);
|
||||
|
||||
/**
|
||||
* Width should be a multiple of 16.
|
||||
*/
|
||||
extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long dstStride);
|
||||
|
||||
/**
|
||||
* Height should be a multiple of 2 and width should be a multiple of 2.
|
||||
* (If this is a problem for anyone then tell me, and I will fix it.)
|
||||
* Chrominance data is only taken from every second line, others are ignored.
|
||||
* FIXME: Write high quality version.
|
||||
*/
|
||||
extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||
long width, long height,
|
||||
long lumStride, long chromStride, long srcStride);
|
||||
extern void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
|
||||
long srcStride, long dstStride);
|
||||
|
||||
extern void (*interleaveBytes)(uint8_t *src1, uint8_t *src2, uint8_t *dst,
|
||||
long width, long height, long src1Stride,
|
||||
long src2Stride, long dstStride);
|
||||
|
||||
extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
|
||||
uint8_t *dst1, uint8_t *dst2,
|
||||
long width, long height,
|
||||
long srcStride1, long srcStride2,
|
||||
long dstStride1, long dstStride2);
|
||||
|
||||
extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
|
||||
uint8_t *dst,
|
||||
long width, long height,
|
||||
long srcStride1, long srcStride2,
|
||||
long srcStride3, long dstStride);
|
||||
|
||||
void sws_rgb2rgb_init(int flags);
|
||||
|
||||
#endif /* SWSCALE_RGB2RGB_H */
|
79
3rdparty/include/ffmpeg_/rtp.h
vendored
Normal file
79
3rdparty/include/ffmpeg_/rtp.h
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* RTP 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_RTP_H
|
||||
#define AVFORMAT_RTP_H
|
||||
|
||||
#include "avcodec.h"
|
||||
|
||||
/**
|
||||
* Return the payload type for a given codec.
|
||||
*
|
||||
* @param codec The context of the codec
|
||||
* @return In case of unknown payload type or dynamic payload type, a
|
||||
* negative value is returned; otherwise, the payload type (the 'PT' field
|
||||
* in the RTP header) is returned.
|
||||
*/
|
||||
int ff_rtp_get_payload_type(AVCodecContext *codec);
|
||||
|
||||
/**
|
||||
* Initialize a codec context based on the payload type.
|
||||
*
|
||||
* Fill the codec_type and codec_id fields of a codec context with
|
||||
* information depending on the payload type; for audio codecs, the
|
||||
* channels and sample_rate fields are also filled.
|
||||
*
|
||||
* @param codec The context of the codec
|
||||
* @param payload_type The payload type (the 'PT' field in the RTP header)
|
||||
* @return In case of unknown payload type or dynamic payload type, a
|
||||
* negative value is returned; otherwise, 0 is returned
|
||||
*/
|
||||
int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type);
|
||||
|
||||
/**
|
||||
* Return the encoding name (as defined in
|
||||
* http://www.iana.org/assignments/rtp-parameters) for a given payload type.
|
||||
*
|
||||
* @param payload_type The payload type (the 'PT' field in the RTP header)
|
||||
* @return In case of unknown payload type or dynamic payload type, a pointer
|
||||
* to an empty string is returned; otherwise, a pointer to a string containing
|
||||
* the encoding name is returned
|
||||
*/
|
||||
const char *ff_rtp_enc_name(int payload_type);
|
||||
|
||||
/**
|
||||
* Return the codec id for the given encoding name and codec type.
|
||||
*
|
||||
* @param buf A pointer to the string containing the encoding name
|
||||
* @param codec_type The codec type
|
||||
* @return In case of unknown encoding name, CODEC_ID_NONE is returned;
|
||||
* otherwise, the codec id is returned
|
||||
*/
|
||||
enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type);
|
||||
|
||||
#define RTP_PT_PRIVATE 96
|
||||
#define RTP_VERSION 2
|
||||
#define RTP_MAX_SDES 256 /**< maximum text length for SDES */
|
||||
|
||||
/* RTCP paquets use 0.5 % of the bandwidth */
|
||||
#define RTCP_TX_RATIO_NUM 5
|
||||
#define RTCP_TX_RATIO_DEN 1000
|
||||
|
||||
#endif /* AVFORMAT_RTP_H */
|
282
3rdparty/include/ffmpeg_/rtsp.h
vendored
Normal file
282
3rdparty/include/ffmpeg_/rtsp.h
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* 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 "rtpdec.h"
|
||||
#include "network.h"
|
||||
|
||||
/**
|
||||
* Network layer over which RTP/etc packet data will be transported.
|
||||
*/
|
||||
enum RTSPLowerTransport {
|
||||
RTSP_LOWER_TRANSPORT_UDP = 0, /**< UDP/unicast */
|
||||
RTSP_LOWER_TRANSPORT_TCP = 1, /**< TCP; interleaved in RTSP */
|
||||
RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, /**< UDP/multicast */
|
||||
RTSP_LOWER_TRANSPORT_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* Packet profile of the data that we will be receiving. Real servers
|
||||
* commonly send RDT (although they can sometimes send RTP as well),
|
||||
* whereas most others will send RTP.
|
||||
*/
|
||||
enum RTSPTransport {
|
||||
RTSP_TRANSPORT_RTP, /**< Standards-compliant RTP */
|
||||
RTSP_TRANSPORT_RDT, /**< Realmedia Data Transport */
|
||||
RTSP_TRANSPORT_NB
|
||||
};
|
||||
|
||||
#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
|
||||
|
||||
/**
|
||||
* This describes a single item in the "Transport:" line of one stream as
|
||||
* negotiated by the SETUP RTSP command. Multiple transports are comma-
|
||||
* separated ("Transport: x-read-rdt/tcp;interleaved=0-1,rtp/avp/udp;
|
||||
* client_port=1000-1001;server_port=1800-1801") and described in separate
|
||||
* RTSPTransportFields.
|
||||
*/
|
||||
typedef struct RTSPTransportField {
|
||||
/** interleave ids, if TCP transport; each TCP/RTSP data packet starts
|
||||
* with a '$', stream length and stream ID. If the stream ID is within
|
||||
* the range of this interleaved_min-max, then the packet belongs to
|
||||
* this stream. */
|
||||
int interleaved_min, interleaved_max;
|
||||
|
||||
/** UDP multicast port range; the ports to which we should connect to
|
||||
* receive multicast UDP data. */
|
||||
int port_min, port_max;
|
||||
|
||||
/** UDP client ports; these should be the local ports of the UDP RTP
|
||||
* (and RTCP) sockets over which we receive RTP/RTCP data. */
|
||||
int client_port_min, client_port_max;
|
||||
|
||||
/** UDP unicast server port range; the ports to which we should connect
|
||||
* to receive unicast UDP RTP/RTCP data. */
|
||||
int server_port_min, server_port_max;
|
||||
|
||||
/** time-to-live value (required for multicast); the amount of HOPs that
|
||||
* packets will be allowed to make before being discarded. */
|
||||
int ttl;
|
||||
|
||||
uint32_t destination; /**< destination IP address */
|
||||
|
||||
/** data/packet transport protocol; e.g. RTP or RDT */
|
||||
enum RTSPTransport transport;
|
||||
|
||||
/** network layer transport protocol; e.g. TCP or UDP uni-/multicast */
|
||||
enum RTSPLowerTransport lower_transport;
|
||||
} RTSPTransportField;
|
||||
|
||||
/**
|
||||
* This describes the server response to each RTSP command.
|
||||
*/
|
||||
typedef struct RTSPMessageHeader {
|
||||
/** length of the data following this header */
|
||||
int content_length;
|
||||
|
||||
enum RTSPStatusCode status_code; /**< response code from server */
|
||||
|
||||
/** number of items in the 'transports' variable below */
|
||||
int nb_transports;
|
||||
|
||||
/** Time range of the streams that the server will stream. In
|
||||
* AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
|
||||
int64_t range_start, range_end;
|
||||
|
||||
/** describes the complete "Transport:" line of the server in response
|
||||
* to a SETUP RTSP command by the client */
|
||||
RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
|
||||
|
||||
int seq; /**< sequence number */
|
||||
|
||||
/** the "Session:" field. This value is initially set by the server and
|
||||
* should be re-transmitted by the client in every RTSP command. */
|
||||
char session_id[512];
|
||||
|
||||
/** the "RealChallenge1:" field from the server */
|
||||
char real_challenge[64];
|
||||
|
||||
/** the "Server: field, which can be used to identify some special-case
|
||||
* servers that are not 100% standards-compliant. We use this to identify
|
||||
* Windows Media Server, which has a value "WMServer/v.e.r.sion", where
|
||||
* version is a sequence of digits (e.g. 9.0.0.3372). Helix/Real servers
|
||||
* use something like "Helix [..] Server Version v.e.r.sion (platform)
|
||||
* (RealServer compatible)" or "RealServer Version v.e.r.sion (platform)",
|
||||
* where platform is the output of $uname -msr | sed 's/ /-/g'. */
|
||||
char server[64];
|
||||
} RTSPMessageHeader;
|
||||
|
||||
/**
|
||||
* Client state, i.e. whether we are currently receiving data (PLAYING) or
|
||||
* setup-but-not-receiving (PAUSED). State can be changed in applications
|
||||
* by calling av_read_play/pause().
|
||||
*/
|
||||
enum RTSPClientState {
|
||||
RTSP_STATE_IDLE, /**< not initialized */
|
||||
RTSP_STATE_PLAYING, /**< initialized and receiving data */
|
||||
RTSP_STATE_PAUSED, /**< initialized, but not receiving data */
|
||||
};
|
||||
|
||||
/**
|
||||
* Identifies particular servers that require special handling, such as
|
||||
* standards-incompliant "Transport:" lines in the SETUP request.
|
||||
*/
|
||||
enum RTSPServerType {
|
||||
RTSP_SERVER_RTP, /**< Standards-compliant RTP-server */
|
||||
RTSP_SERVER_REAL, /**< Realmedia-style server */
|
||||
RTSP_SERVER_WMS, /**< Windows Media server */
|
||||
RTSP_SERVER_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* Private data for the RTSP demuxer.
|
||||
*/
|
||||
typedef struct RTSPState {
|
||||
URLContext *rtsp_hd; /* RTSP TCP connexion handle */
|
||||
|
||||
/** number of items in the 'rtsp_streams' variable */
|
||||
int nb_rtsp_streams;
|
||||
|
||||
struct RTSPStream **rtsp_streams; /**< streams in this session */
|
||||
|
||||
/** indicator of whether we are currently receiving data from the
|
||||
* server. Basically this isn't more than a simple cache of the
|
||||
* last PLAY/PAUSE command sent to the server, to make sure we don't
|
||||
* send 2x the same unexpectedly or commands in the wrong state. */
|
||||
enum RTSPClientState state;
|
||||
|
||||
/** the seek value requested when calling av_seek_frame(). This value
|
||||
* is subsequently used as part of the "Range" parameter when emitting
|
||||
* the RTSP PLAY command. If we are currently playing, this command is
|
||||
* called instantly. If we are currently paused, this command is called
|
||||
* whenever we resume playback. Either way, the value is only used once,
|
||||
* see rtsp_read_play() and rtsp_read_seek(). */
|
||||
int64_t seek_timestamp;
|
||||
|
||||
/* XXX: currently we use unbuffered input */
|
||||
// ByteIOContext rtsp_gb;
|
||||
|
||||
int seq; /**< RTSP command sequence number */
|
||||
|
||||
/** copy of RTSPMessageHeader->session_id, i.e. the server-provided session
|
||||
* identifier that the client should re-transmit in each RTSP command */
|
||||
char session_id[512];
|
||||
|
||||
/** the negotiated data/packet transport protocol; e.g. RTP or RDT */
|
||||
enum RTSPTransport transport;
|
||||
|
||||
/** the negotiated network layer transport protocol; e.g. TCP or UDP
|
||||
* uni-/multicast */
|
||||
enum RTSPLowerTransport lower_transport;
|
||||
|
||||
/** brand of server that we're talking to; e.g. WMS, REAL or other.
|
||||
* Detected based on the value of RTSPMessageHeader->server or the presence
|
||||
* of RTSPMessageHeader->real_challenge */
|
||||
enum RTSPServerType server_type;
|
||||
|
||||
/** The last reply of the server to a RTSP command */
|
||||
char last_reply[2048]; /* XXX: allocate ? */
|
||||
|
||||
/** RTSPStream->transport_priv of the last stream that we read a
|
||||
* packet from */
|
||||
void *cur_transport_priv;
|
||||
|
||||
/** The following are used for Real stream selection */
|
||||
//@{
|
||||
/** whether we need to send a "SET_PARAMETER Subscribe:" command */
|
||||
int need_subscription;
|
||||
|
||||
/** stream setup during the last frame read. This is used to detect if
|
||||
* we need to subscribe or unsubscribe to any new streams. */
|
||||
enum AVDiscard real_setup_cache[MAX_STREAMS];
|
||||
|
||||
/** the last value of the "SET_PARAMETER Subscribe:" RTSP command.
|
||||
* this is used to send the same "Unsubscribe:" if stream setup changed,
|
||||
* before sending a new "Subscribe:" command. */
|
||||
char last_subscription[1024];
|
||||
//@}
|
||||
} RTSPState;
|
||||
|
||||
/**
|
||||
* Describes a single stream, as identified by a single m= line block in the
|
||||
* SDP content. In the case of RDT, one RTSPStream can represent multiple
|
||||
* AVStreams. In this case, each AVStream in this set has similar content
|
||||
* (but different codec/bitrate).
|
||||
*/
|
||||
typedef struct RTSPStream {
|
||||
URLContext *rtp_handle; /**< RTP stream handle (if UDP) */
|
||||
void *transport_priv; /**< RTP/RDT parse context */
|
||||
|
||||
/** corresponding stream index, if any. -1 if none (MPEG2TS case) */
|
||||
int stream_index;
|
||||
|
||||
/** interleave IDs; copies of RTSPTransportField->interleaved_min/max
|
||||
* for the selected transport. Only used for TCP. */
|
||||
int interleaved_min, interleaved_max;
|
||||
|
||||
char control_url[1024]; /**< url for this stream (from SDP) */
|
||||
|
||||
/** The following are used only in SDP, not RTSP */
|
||||
//@{
|
||||
int sdp_port; /**< port (from SDP content) */
|
||||
struct in_addr sdp_ip; /**< IP address (from SDP content) */
|
||||
int sdp_ttl; /**< IP Time-To-Live (from SDP content) */
|
||||
int sdp_payload_type; /**< payload type */
|
||||
//@}
|
||||
|
||||
/** rtp payload parsing infos from SDP (i.e. mapping between private
|
||||
* payload IDs and media-types (string), so that we can derive what
|
||||
* type of payload we're dealing with (and how to parse it). */
|
||||
RTPPayloadData rtp_payload_data;
|
||||
|
||||
/** The following are used for dynamic protocols (rtp_*.c/rdt.c) */
|
||||
//@{
|
||||
/** handler structure */
|
||||
RTPDynamicProtocolHandler *dynamic_handler;
|
||||
|
||||
/** private data associated with the dynamic protocol */
|
||||
PayloadContext *dynamic_protocol_context;
|
||||
//@}
|
||||
} RTSPStream;
|
||||
|
||||
int rtsp_init(void);
|
||||
void rtsp_parse_line(RTSPMessageHeader *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 */
|
40
3rdparty/include/ffmpeg_/rtspcodes.h
vendored
Normal file
40
3rdparty/include/ffmpeg_/rtspcodes.h
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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 */
|
34
3rdparty/include/ffmpeg_/sha1.h
vendored
Normal file
34
3rdparty/include/ffmpeg_/sha1.h
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2007 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_SHA1_H
|
||||
#define AVUTIL_SHA1_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const int av_sha1_size;
|
||||
|
||||
struct AVSHA1;
|
||||
|
||||
void av_sha1_init(struct AVSHA1* context);
|
||||
void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len);
|
||||
void av_sha1_final(struct AVSHA1* context, uint8_t digest[20]);
|
||||
|
||||
#endif /* AVUTIL_SHA1_H */
|
86
3rdparty/include/ffmpeg_/vdpau.h
vendored
Normal file
86
3rdparty/include/ffmpeg_/vdpau.h
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* The Video Decode and Presentation API for UNIX (VDPAU) is used for
|
||||
* hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
|
||||
*
|
||||
* Copyright (C) 2008 NVIDIA
|
||||
*
|
||||
* 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_VDPAU_H
|
||||
#define AVCODEC_VDPAU_H
|
||||
|
||||
/**
|
||||
* \defgroup Decoder VDPAU Decoder and Renderer
|
||||
*
|
||||
* VDPAU hardware acceleration has two modules
|
||||
* - VDPAU decoding
|
||||
* - VDPAU presentation
|
||||
*
|
||||
* The VDPAU decoding module parses all headers using FFmpeg
|
||||
* parsing mechanisms and uses VDPAU for the actual decoding.
|
||||
*
|
||||
* As per the current implementation, the actual decoding
|
||||
* and rendering (API calls) are done as part of the VDPAU
|
||||
* presentation (vo_vdpau.c) module.
|
||||
*
|
||||
* @{
|
||||
* \defgroup VDPAU_Decoding VDPAU Decoding
|
||||
* \ingroup Decoder
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <vdpau/vdpau.h>
|
||||
#include <vdpau/vdpau_x11.h>
|
||||
|
||||
/** \brief The videoSurface is used for rendering. */
|
||||
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
|
||||
|
||||
/**
|
||||
* \brief The videoSurface is needed for reference/prediction.
|
||||
* The codec manipulates this.
|
||||
*/
|
||||
#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
|
||||
|
||||
/**
|
||||
* \brief This structure is used as a callback between the FFmpeg
|
||||
* decoder (vd_) and presentation (vo_) module.
|
||||
* This is used for defining a video frame containing surface,
|
||||
* picture parameter, bitstream information etc which are passed
|
||||
* between the FFmpeg decoder and its clients.
|
||||
*/
|
||||
struct vdpau_render_state {
|
||||
VdpVideoSurface surface; ///< Used as rendered surface, never changed.
|
||||
|
||||
int state; ///< Holds FF_VDPAU_STATE_* values.
|
||||
|
||||
/** picture parameter information for all supported codecs */
|
||||
union VdpPictureInfo {
|
||||
VdpPictureInfoH264 h264;
|
||||
VdpPictureInfoMPEG1Or2 mpeg;
|
||||
VdpPictureInfoVC1 vc1;
|
||||
} info;
|
||||
|
||||
/** Describe size/location of the compressed video data. */
|
||||
int bitstream_buffers_allocated;
|
||||
int bitstream_buffers_used;
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
};
|
||||
|
||||
/* @}*/
|
||||
|
||||
#endif /* AVCODEC_VDPAU_H */
|
172
3rdparty/include/ffmpeg_/xvmc.h
vendored
Normal file
172
3rdparty/include/ffmpeg_/xvmc.h
vendored
Normal file
@@ -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 are already claimed by filling their number
|
||||
into the corresponding blocks description structure field,
|
||||
that are hold in 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 */
|
Reference in New Issue
Block a user