123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- #ifndef AVCODEC_CODEC_H
- #define AVCODEC_CODEC_H
- #include <stdint.h>
- #include "libavutil/avutil.h"
- #include "libavutil/hwcontext.h"
- #include "libavutil/log.h"
- #include "libavutil/pixfmt.h"
- #include "libavutil/rational.h"
- #include "libavutil/samplefmt.h"
- #include "libavcodec/codec_id.h"
- #include "libavcodec/version.h"
- #define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
- #define AV_CODEC_CAP_DR1 (1 << 1)
- #define AV_CODEC_CAP_TRUNCATED (1 << 3)
- #define AV_CODEC_CAP_DELAY (1 << 5)
- #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
- #define AV_CODEC_CAP_SUBFRAMES (1 << 8)
- #define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
- #define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
- #define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
- #define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
- #define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
- #define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
- #if FF_API_AUTO_THREADS
- #define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS
- #endif
- #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
- #define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
- #if FF_API_UNUSED_CODEC_CAPS
- #define AV_CODEC_CAP_INTRA_ONLY 0x40000000
- #define AV_CODEC_CAP_LOSSLESS 0x80000000
- #endif
- #define AV_CODEC_CAP_HARDWARE (1 << 18)
- #define AV_CODEC_CAP_HYBRID (1 << 19)
- #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
- #define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
- typedef struct AVProfile {
- int profile;
- const char *name;
- } AVProfile;
- typedef struct AVCodecDefault AVCodecDefault;
- struct AVCodecContext;
- struct AVSubtitle;
- struct AVPacket;
- typedef struct AVCodec {
-
- const char *name;
-
- const char *long_name;
- enum AVMediaType type;
- enum AVCodecID id;
-
- int capabilities;
- const AVRational *supported_framerates;
- const enum AVPixelFormat *pix_fmts;
- const int *supported_samplerates;
- const enum AVSampleFormat *sample_fmts;
- const uint64_t *channel_layouts;
- uint8_t max_lowres;
- const AVClass *priv_class;
- const AVProfile *profiles;
-
- const char *wrapper_name;
-
- int priv_data_size;
- #if FF_API_NEXT
- struct AVCodec *next;
- #endif
-
-
- int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
-
-
- const AVCodecDefault *defaults;
-
- void (*init_static_data)(struct AVCodec *codec);
- int (*init)(struct AVCodecContext *);
- int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size,
- const struct AVSubtitle *sub);
-
- int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
- const struct AVFrame *frame, int *got_packet_ptr);
-
- int (*decode)(struct AVCodecContext *avctx, void *outdata,
- int *got_frame_ptr, struct AVPacket *avpkt);
- int (*close)(struct AVCodecContext *);
-
- int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt);
-
- int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame);
-
- void (*flush)(struct AVCodecContext *);
-
- int caps_internal;
-
- const char *bsfs;
-
- const struct AVCodecHWConfigInternal *const *hw_configs;
-
- const uint32_t *codec_tags;
- } AVCodec;
- const AVCodec *av_codec_iterate(void **opaque);
- AVCodec *avcodec_find_decoder(enum AVCodecID id);
- AVCodec *avcodec_find_decoder_by_name(const char *name);
- AVCodec *avcodec_find_encoder(enum AVCodecID id);
- AVCodec *avcodec_find_encoder_by_name(const char *name);
- int av_codec_is_encoder(const AVCodec *codec);
- int av_codec_is_decoder(const AVCodec *codec);
- enum {
-
- AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01,
-
- AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02,
-
- AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04,
-
- AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08,
- };
- typedef struct AVCodecHWConfig {
-
- enum AVPixelFormat pix_fmt;
-
- int methods;
-
- enum AVHWDeviceType device_type;
- } AVCodecHWConfig;
- const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
- #endif
|