mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avformat/avformat: Avoid including codec.h, frame.h
AVCodec is only ever used as an incomplete type (i.e. via a pointer to an AVCodec) in avformat.h and it is not really part of the core of avformat.h or libavformat; almost none of our internal users make use of it (and none make use of hwcontext.h, which is implicitly included). So switch to use struct AVCodec, but continue to include codec.h for external users for compatibility. Also, do the same for AVFrame and frame.h, which is implicitly included by codec.h (via lavu/hwcontext.h). Also, remove an unnecessary inclusion of <time.h>. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
4e633e51da
commit
0c6e5f321b
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
|
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
#include "libavutil/time.h"
|
#include "libavutil/time.h"
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "libavutil/log.h"
|
#include "libavutil/log.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "libavformat/mux.h"
|
#include "libavformat/mux.h"
|
||||||
#include "libavformat/version.h"
|
#include "libavformat/version.h"
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/time.h"
|
#include "libavutil/time.h"
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <X11/extensions/Xvlib.h>
|
#include <X11/extensions/Xvlib.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/attributes.h"
|
#include "libavutil/attributes.h"
|
||||||
#include "libavutil/common.h"
|
#include "libavutil/common.h"
|
||||||
#include "libavutil/dict.h"
|
#include "libavutil/dict.h"
|
||||||
|
@ -23,12 +23,14 @@
|
|||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixfmt.h"
|
#include "libavutil/pixfmt.h"
|
||||||
#include "libavutil/samplefmt.h"
|
#include "libavutil/samplefmt.h"
|
||||||
#include "libavcodec/avcodec.h"
|
#include "libavcodec/avcodec.h"
|
||||||
|
#include "libavcodec/codec.h"
|
||||||
#include "libavcodec/bsf.h"
|
#include "libavcodec/bsf.h"
|
||||||
#include "libavcodec/codec_desc.h"
|
#include "libavcodec/codec_desc.h"
|
||||||
#include "libavcodec/packet_internal.h"
|
#include "libavcodec/packet_internal.h"
|
||||||
|
@ -307,10 +307,8 @@
|
|||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
#include <stdio.h> /* FILE */
|
#include <stdio.h> /* FILE */
|
||||||
|
|
||||||
#include "libavcodec/codec.h"
|
|
||||||
#include "libavcodec/codec_par.h"
|
#include "libavcodec/codec_par.h"
|
||||||
#include "libavcodec/defs.h"
|
#include "libavcodec/defs.h"
|
||||||
#include "libavcodec/packet.h"
|
#include "libavcodec/packet.h"
|
||||||
@ -325,10 +323,13 @@
|
|||||||
* to avoid unnecessary rebuilds. When included externally, keep including
|
* to avoid unnecessary rebuilds. When included externally, keep including
|
||||||
* the full version information. */
|
* the full version information. */
|
||||||
#include "libavformat/version.h"
|
#include "libavformat/version.h"
|
||||||
|
|
||||||
|
#include "libavutil/frame.h"
|
||||||
|
#include "libavcodec/codec.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct AVFormatContext;
|
struct AVFormatContext;
|
||||||
|
struct AVFrame;
|
||||||
struct AVDeviceInfoList;
|
struct AVDeviceInfoList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1569,7 +1570,7 @@ typedef struct AVFormatContext {
|
|||||||
* the same codec_id.
|
* the same codec_id.
|
||||||
* Demuxing: Set by user
|
* Demuxing: Set by user
|
||||||
*/
|
*/
|
||||||
const AVCodec *video_codec;
|
const struct AVCodec *video_codec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forced audio codec.
|
* Forced audio codec.
|
||||||
@ -1577,7 +1578,7 @@ typedef struct AVFormatContext {
|
|||||||
* the same codec_id.
|
* the same codec_id.
|
||||||
* Demuxing: Set by user
|
* Demuxing: Set by user
|
||||||
*/
|
*/
|
||||||
const AVCodec *audio_codec;
|
const struct AVCodec *audio_codec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forced subtitle codec.
|
* Forced subtitle codec.
|
||||||
@ -1585,7 +1586,7 @@ typedef struct AVFormatContext {
|
|||||||
* the same codec_id.
|
* the same codec_id.
|
||||||
* Demuxing: Set by user
|
* Demuxing: Set by user
|
||||||
*/
|
*/
|
||||||
const AVCodec *subtitle_codec;
|
const struct AVCodec *subtitle_codec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forced data codec.
|
* Forced data codec.
|
||||||
@ -1593,7 +1594,7 @@ typedef struct AVFormatContext {
|
|||||||
* the same codec_id.
|
* the same codec_id.
|
||||||
* Demuxing: Set by user
|
* Demuxing: Set by user
|
||||||
*/
|
*/
|
||||||
const AVCodec *data_codec;
|
const struct AVCodec *data_codec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of bytes to be written as padding in a metadata header.
|
* Number of bytes to be written as padding in a metadata header.
|
||||||
@ -1842,7 +1843,7 @@ const AVClass *av_stream_get_class(void);
|
|||||||
*
|
*
|
||||||
* @return newly created stream or NULL on error.
|
* @return newly created stream or NULL on error.
|
||||||
*/
|
*/
|
||||||
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
|
AVStream *avformat_new_stream(AVFormatContext *s, const struct AVCodec *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrap an existing array as stream side data.
|
* Wrap an existing array as stream side data.
|
||||||
@ -2076,7 +2077,7 @@ int av_find_best_stream(AVFormatContext *ic,
|
|||||||
enum AVMediaType type,
|
enum AVMediaType type,
|
||||||
int wanted_stream_nb,
|
int wanted_stream_nb,
|
||||||
int related_stream,
|
int related_stream,
|
||||||
const AVCodec **decoder_ret,
|
const struct AVCodec **decoder_ret,
|
||||||
int flags);
|
int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2352,7 +2353,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
|
|||||||
* See av_interleaved_write_uncoded_frame() for details.
|
* See av_interleaved_write_uncoded_frame() for details.
|
||||||
*/
|
*/
|
||||||
int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
|
int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
|
||||||
AVFrame *frame);
|
struct AVFrame *frame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write an uncoded frame to an output media file.
|
* Write an uncoded frame to an output media file.
|
||||||
@ -2371,7 +2372,7 @@ int av_write_uncoded_frame(AVFormatContext *s, int stream_index,
|
|||||||
* @return >=0 for success, a negative code on error
|
* @return >=0 for success, a negative code on error
|
||||||
*/
|
*/
|
||||||
int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
|
int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index,
|
||||||
AVFrame *frame);
|
struct AVFrame *frame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether a muxer supports uncoded frame.
|
* Test whether a muxer supports uncoded frame.
|
||||||
@ -2759,7 +2760,8 @@ const struct AVCodecTag *avformat_get_mov_audio_tags(void);
|
|||||||
* @param frame the frame with the aspect ratio to be determined
|
* @param frame the frame with the aspect ratio to be determined
|
||||||
* @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea
|
* @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea
|
||||||
*/
|
*/
|
||||||
AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame);
|
AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream,
|
||||||
|
struct AVFrame *frame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guess the frame rate, based on both the container and codec information.
|
* Guess the frame rate, based on both the container and codec information.
|
||||||
@ -2769,7 +2771,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea
|
|||||||
* @param frame the frame for which the frame rate should be determined, may be NULL
|
* @param frame the frame for which the frame rate should be determined, may be NULL
|
||||||
* @return the guessed (valid) frame rate, 0/1 if no idea
|
* @return the guessed (valid) frame rate, 0/1 if no idea
|
||||||
*/
|
*/
|
||||||
AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame);
|
AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream,
|
||||||
|
struct AVFrame *frame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the stream st contained in s is matched by the stream specifier
|
* Check if the stream st contained in s is matched by the stream specifier
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
|
#include <time.h>
|
||||||
#include "libavutil/bprint.h"
|
#include "libavutil/bprint.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/time.h"
|
#include "libavutil/time.h"
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "config_components.h"
|
#include "config_components.h"
|
||||||
|
#include <time.h>
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/parseutils.h"
|
#include "libavutil/parseutils.h"
|
||||||
#include "avio_internal.h"
|
#include "avio_internal.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "config_components.h"
|
#include "config_components.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <time.h>
|
||||||
#if HAVE_UNISTD_H
|
#if HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/time_internal.h"
|
#include "libavutil/time_internal.h"
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "config_components.h"
|
#include "config_components.h"
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
#if CONFIG_ZLIB
|
#if CONFIG_ZLIB
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif /* CONFIG_ZLIB */
|
#endif /* CONFIG_ZLIB */
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "config_components.h"
|
#include "config_components.h"
|
||||||
|
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
|
@ -566,7 +566,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
|
|||||||
|
|
||||||
enum AVCodecID ff_guess_image2_codec(const char *filename);
|
enum AVCodecID ff_guess_image2_codec(const char *filename);
|
||||||
|
|
||||||
const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
|
const struct AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
|
||||||
enum AVCodecID codec_id);
|
enum AVCodecID codec_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
* Magic Lantern Video (MLV) demuxer
|
* Magic Lantern Video (MLV) demuxer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/rational.h"
|
#include "libavutil/rational.h"
|
||||||
|
@ -24,12 +24,14 @@
|
|||||||
#include "mux.h"
|
#include "mux.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "libavcodec/bsf.h"
|
#include "libavcodec/bsf.h"
|
||||||
|
#include "libavcodec/codec_desc.h"
|
||||||
#include "libavcodec/internal.h"
|
#include "libavcodec/internal.h"
|
||||||
#include "libavcodec/packet_internal.h"
|
#include "libavcodec/packet_internal.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/dict.h"
|
#include "libavutil/dict.h"
|
||||||
#include "libavutil/timestamp.h"
|
#include "libavutil/timestamp.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ typedef struct FFOutputFormat {
|
|||||||
* by setting the pointer to NULL.
|
* by setting the pointer to NULL.
|
||||||
*/
|
*/
|
||||||
int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
|
int (*write_uncoded_frame)(AVFormatContext *, int stream_index,
|
||||||
AVFrame **frame, unsigned flags);
|
struct AVFrame **frame, unsigned flags);
|
||||||
/**
|
/**
|
||||||
* Returns device list with it properties.
|
* Returns device list with it properties.
|
||||||
* @see avdevice_list_devices() for more details.
|
* @see avdevice_list_devices() for more details.
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/aes.h"
|
#include "libavutil/aes.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "libavutil/adler32.h"
|
#include "libavutil/adler32.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/bprint.h"
|
#include "libavutil/bprint.h"
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "libavformat/mux.h"
|
#include "libavformat/mux.h"
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
#include "libavutil/dict.h"
|
#include "libavutil/dict.h"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "matroska.h"
|
#include "matroska.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/frame.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user