Compare commits
3 Commits
master
...
ffmpeg_3.4
Author | SHA1 | Date |
---|---|---|
luoye | aac3f8dc83 | 1 year ago |
luoye | cdf8257a11 | 1 year ago |
luoye | fe6eed6207 | 2 years ago |
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@ |
||||
/*
|
||||
* AC-3 parser prototypes |
||||
* Copyright (c) 2003 Fabrice Bellard |
||||
* Copyright (c) 2003 Michael Niedermayer |
||||
* |
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVCODEC_AC3_PARSER_H |
||||
#define AVCODEC_AC3_PARSER_H |
||||
|
||||
#include <stddef.h> |
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* Extract the bitstream ID and the frame size from AC-3 data. |
||||
*/ |
||||
int av_ac3_parse_header(const uint8_t *buf, size_t size, |
||||
uint8_t *bitstream_id, uint16_t *frame_size); |
||||
|
||||
|
||||
#endif /* AVCODEC_AC3_PARSER_H */ |
@ -1,37 +0,0 @@ |
||||
/*
|
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVCODEC_ADTS_PARSER_H |
||||
#define AVCODEC_ADTS_PARSER_H |
||||
|
||||
#include <stddef.h> |
||||
#include <stdint.h> |
||||
|
||||
#define AV_AAC_ADTS_HEADER_SIZE 7 |
||||
|
||||
/**
|
||||
* Extract the number of samples and frames from AAC data. |
||||
* @param[in] buf pointer to AAC data buffer |
||||
* @param[out] samples Pointer to where number of samples is written |
||||
* @param[out] frames Pointer to where number of frames is written |
||||
* @return Returns 0 on success, error code on failure. |
||||
*/ |
||||
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples, |
||||
uint8_t *frames); |
||||
|
||||
#endif /* AVCODEC_ADTS_PARSER_H */ |
File diff suppressed because it is too large
Load Diff
@ -1,332 +0,0 @@ |
||||
/*
|
||||
* Bitstream filters public API |
||||
* |
||||
* 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_BSF_H |
||||
#define AVCODEC_BSF_H |
||||
|
||||
#include "libavutil/dict.h" |
||||
#include "libavutil/log.h" |
||||
#include "libavutil/rational.h" |
||||
|
||||
#include "codec_id.h" |
||||
#include "codec_par.h" |
||||
#include "packet.h" |
||||
|
||||
/**
|
||||
* @defgroup lavc_bsf Bitstream filters |
||||
* @ingroup libavc |
||||
* |
||||
* Bitstream filters transform encoded media data without decoding it. This |
||||
* allows e.g. manipulating various header values. Bitstream filters operate on |
||||
* @ref AVPacket "AVPackets". |
||||
* |
||||
* The bitstream filtering API is centered around two structures: |
||||
* AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter |
||||
* in abstract, the latter a specific filtering process. Obtain an |
||||
* AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass |
||||
* it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable |
||||
* AVBSFContext fields, as described in its documentation, then call |
||||
* av_bsf_init() to prepare the filter context for use. |
||||
* |
||||
* Submit packets for filtering using av_bsf_send_packet(), obtain filtered |
||||
* results with av_bsf_receive_packet(). When no more input packets will be |
||||
* sent, submit a NULL AVPacket to signal the end of the stream to the filter. |
||||
* av_bsf_receive_packet() will then return trailing packets, if any are |
||||
* produced by the filter. |
||||
* |
||||
* Finally, free the filter context with av_bsf_free(). |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* The bitstream filter state. |
||||
* |
||||
* This struct must be allocated with av_bsf_alloc() and freed with |
||||
* av_bsf_free(). |
||||
* |
||||
* The fields in the struct will only be changed (by the caller or by the |
||||
* filter) as described in their documentation, and are to be considered |
||||
* immutable otherwise. |
||||
*/ |
||||
typedef struct AVBSFContext { |
||||
/**
|
||||
* A class for logging and AVOptions |
||||
*/ |
||||
const AVClass *av_class; |
||||
|
||||
/**
|
||||
* The bitstream filter this context is an instance of. |
||||
*/ |
||||
const struct AVBitStreamFilter *filter; |
||||
|
||||
/**
|
||||
* Opaque filter-specific private data. If filter->priv_class is non-NULL, |
||||
* this is an AVOptions-enabled struct. |
||||
*/ |
||||
void *priv_data; |
||||
|
||||
/**
|
||||
* Parameters of the input stream. This field is allocated in |
||||
* av_bsf_alloc(), it needs to be filled by the caller before |
||||
* av_bsf_init(). |
||||
*/ |
||||
AVCodecParameters *par_in; |
||||
|
||||
/**
|
||||
* Parameters of the output stream. This field is allocated in |
||||
* av_bsf_alloc(), it is set by the filter in av_bsf_init(). |
||||
*/ |
||||
AVCodecParameters *par_out; |
||||
|
||||
/**
|
||||
* The timebase used for the timestamps of the input packets. Set by the |
||||
* caller before av_bsf_init(). |
||||
*/ |
||||
AVRational time_base_in; |
||||
|
||||
/**
|
||||
* The timebase used for the timestamps of the output packets. Set by the |
||||
* filter in av_bsf_init(). |
||||
*/ |
||||
AVRational time_base_out; |
||||
} AVBSFContext; |
||||
|
||||
typedef struct AVBitStreamFilter { |
||||
const char *name; |
||||
|
||||
/**
|
||||
* A list of codec ids supported by the filter, terminated by |
||||
* AV_CODEC_ID_NONE. |
||||
* May be NULL, in that case the bitstream filter works with any codec id. |
||||
*/ |
||||
const enum AVCodecID *codec_ids; |
||||
|
||||
/**
|
||||
* A class for the private data, used to declare bitstream filter private |
||||
* AVOptions. This field is NULL for bitstream filters that do not declare |
||||
* any options. |
||||
* |
||||
* If this field is non-NULL, the first member of the filter private data |
||||
* must be a pointer to AVClass, which will be set by libavcodec generic |
||||
* code to this class. |
||||
*/ |
||||
const AVClass *priv_class; |
||||
} AVBitStreamFilter; |
||||
|
||||
/**
|
||||
* @return a bitstream filter with the specified name or NULL if no such |
||||
* bitstream filter exists. |
||||
*/ |
||||
const AVBitStreamFilter *av_bsf_get_by_name(const char *name); |
||||
|
||||
/**
|
||||
* Iterate over all registered bitstream filters. |
||||
* |
||||
* @param opaque a pointer where libavcodec will store the iteration state. Must |
||||
* point to NULL to start the iteration. |
||||
* |
||||
* @return the next registered bitstream filter or NULL when the iteration is |
||||
* finished |
||||
*/ |
||||
const AVBitStreamFilter *av_bsf_iterate(void **opaque); |
||||
|
||||
/**
|
||||
* Allocate a context for a given bitstream filter. The caller must fill in the |
||||
* context parameters as described in the documentation and then call |
||||
* av_bsf_init() before sending any data to the filter. |
||||
* |
||||
* @param filter the filter for which to allocate an instance. |
||||
* @param[out] ctx a pointer into which the pointer to the newly-allocated context |
||||
* will be written. It must be freed with av_bsf_free() after the |
||||
* filtering is done. |
||||
* |
||||
* @return 0 on success, a negative AVERROR code on failure |
||||
*/ |
||||
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx); |
||||
|
||||
/**
|
||||
* Prepare the filter for use, after all the parameters and options have been |
||||
* set. |
||||
* |
||||
* @param ctx a AVBSFContext previously allocated with av_bsf_alloc() |
||||
*/ |
||||
int av_bsf_init(AVBSFContext *ctx); |
||||
|
||||
/**
|
||||
* Submit a packet for filtering. |
||||
* |
||||
* After sending each packet, the filter must be completely drained by calling |
||||
* av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or |
||||
* AVERROR_EOF. |
||||
* |
||||
* @param ctx an initialized AVBSFContext |
||||
* @param pkt the packet to filter. The bitstream filter will take ownership of |
||||
* the packet and reset the contents of pkt. pkt is not touched if an error occurs. |
||||
* If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), |
||||
* it signals the end of the stream (i.e. no more non-empty packets will be sent; |
||||
* sending more empty packets does nothing) and will cause the filter to output |
||||
* any packets it may have buffered internally. |
||||
* |
||||
* @return |
||||
* - 0 on success. |
||||
* - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using |
||||
* av_bsf_receive_packet()) before new input can be consumed. |
||||
* - Another negative AVERROR value if an error occurs. |
||||
*/ |
||||
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Retrieve a filtered packet. |
||||
* |
||||
* @param ctx an initialized AVBSFContext |
||||
* @param[out] pkt this struct will be filled with the contents of the filtered |
||||
* packet. It is owned by the caller and must be freed using |
||||
* av_packet_unref() when it is no longer needed. |
||||
* This parameter should be "clean" (i.e. freshly allocated |
||||
* with av_packet_alloc() or unreffed with av_packet_unref()) |
||||
* when this function is called. If this function returns |
||||
* successfully, the contents of pkt will be completely |
||||
* overwritten by the returned data. On failure, pkt is not |
||||
* touched. |
||||
* |
||||
* @return |
||||
* - 0 on success. |
||||
* - AVERROR(EAGAIN) if more packets need to be sent to the filter (using |
||||
* av_bsf_send_packet()) to get more output. |
||||
* - AVERROR_EOF if there will be no further output from the filter. |
||||
* - Another negative AVERROR value if an error occurs. |
||||
* |
||||
* @note one input packet may result in several output packets, so after sending |
||||
* a packet with av_bsf_send_packet(), this function needs to be called |
||||
* repeatedly until it stops returning 0. It is also possible for a filter to |
||||
* output fewer packets than were sent to it, so this function may return |
||||
* AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. |
||||
*/ |
||||
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Reset the internal bitstream filter state. Should be called e.g. when seeking. |
||||
*/ |
||||
void av_bsf_flush(AVBSFContext *ctx); |
||||
|
||||
/**
|
||||
* Free a bitstream filter context and everything associated with it; write NULL |
||||
* into the supplied pointer. |
||||
*/ |
||||
void av_bsf_free(AVBSFContext **ctx); |
||||
|
||||
/**
|
||||
* Get the AVClass for AVBSFContext. It can be used in combination with |
||||
* AV_OPT_SEARCH_FAKE_OBJ for examining options. |
||||
* |
||||
* @see av_opt_find(). |
||||
*/ |
||||
const AVClass *av_bsf_get_class(void); |
||||
|
||||
/**
|
||||
* Structure for chain/list of bitstream filters. |
||||
* Empty list can be allocated by av_bsf_list_alloc(). |
||||
*/ |
||||
typedef struct AVBSFList AVBSFList; |
||||
|
||||
/**
|
||||
* Allocate empty list of bitstream filters. |
||||
* The list must be later freed by av_bsf_list_free() |
||||
* or finalized by av_bsf_list_finalize(). |
||||
* |
||||
* @return Pointer to @ref AVBSFList on success, NULL in case of failure |
||||
*/ |
||||
AVBSFList *av_bsf_list_alloc(void); |
||||
|
||||
/**
|
||||
* Free list of bitstream filters. |
||||
* |
||||
* @param lst Pointer to pointer returned by av_bsf_list_alloc() |
||||
*/ |
||||
void av_bsf_list_free(AVBSFList **lst); |
||||
|
||||
/**
|
||||
* Append bitstream filter to the list of bitstream filters. |
||||
* |
||||
* @param lst List to append to |
||||
* @param bsf Filter context to be appended |
||||
* |
||||
* @return >=0 on success, negative AVERROR in case of failure |
||||
*/ |
||||
int av_bsf_list_append(AVBSFList *lst, AVBSFContext *bsf); |
||||
|
||||
/**
|
||||
* Construct new bitstream filter context given it's name and options |
||||
* and append it to the list of bitstream filters. |
||||
* |
||||
* @param lst List to append to |
||||
* @param bsf_name Name of the bitstream filter |
||||
* @param options Options for the bitstream filter, can be set to NULL |
||||
* |
||||
* @return >=0 on success, negative AVERROR in case of failure |
||||
*/ |
||||
int av_bsf_list_append2(AVBSFList *lst, const char * bsf_name, AVDictionary **options); |
||||
/**
|
||||
* Finalize list of bitstream filters. |
||||
* |
||||
* This function will transform @ref AVBSFList to single @ref AVBSFContext, |
||||
* so the whole chain of bitstream filters can be treated as single filter |
||||
* freshly allocated by av_bsf_alloc(). |
||||
* If the call is successful, @ref AVBSFList structure is freed and lst |
||||
* will be set to NULL. In case of failure, caller is responsible for |
||||
* freeing the structure by av_bsf_list_free() |
||||
* |
||||
* @param lst Filter list structure to be transformed |
||||
* @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure |
||||
* representing the chain of bitstream filters |
||||
* |
||||
* @return >=0 on success, negative AVERROR in case of failure |
||||
*/ |
||||
int av_bsf_list_finalize(AVBSFList **lst, AVBSFContext **bsf); |
||||
|
||||
/**
|
||||
* Parse string describing list of bitstream filters and create single |
||||
* @ref AVBSFContext describing the whole chain of bitstream filters. |
||||
* Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext freshly |
||||
* allocated by av_bsf_alloc(). |
||||
* |
||||
* @param str String describing chain of bitstream filters in format |
||||
* `bsf1[=opt1=val1:opt2=val2][,bsf2]` |
||||
* @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure |
||||
* representing the chain of bitstream filters |
||||
* |
||||
* @return >=0 on success, negative AVERROR in case of failure |
||||
*/ |
||||
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf); |
||||
|
||||
/**
|
||||
* Get null/pass-through bitstream filter. |
||||
* |
||||
* @param[out] bsf Pointer to be set to new instance of pass-through bitstream filter |
||||
* |
||||
* @return |
||||
*/ |
||||
int av_bsf_get_null_filter(AVBSFContext **bsf); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif // AVCODEC_BSF_H
|
@ -1,375 +0,0 @@ |
||||
/*
|
||||
* AVCodec public API |
||||
* |
||||
* 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_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_major.h" |
||||
|
||||
/**
|
||||
* @addtogroup lavc_core |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Decoder can use draw_horiz_band callback. |
||||
*/ |
||||
#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) |
||||
/**
|
||||
* Codec uses get_buffer() or get_encode_buffer() for allocating buffers and |
||||
* supports custom allocators. |
||||
* If not set, it might not use get_buffer() or get_encode_buffer() at all, or |
||||
* use operations that assume the buffer was allocated by |
||||
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. |
||||
*/ |
||||
#define AV_CODEC_CAP_DR1 (1 << 1) |
||||
/**
|
||||
* Encoder or decoder requires flushing with NULL input at the end in order to |
||||
* give the complete and correct output. |
||||
* |
||||
* NOTE: If this flag is not set, the codec is guaranteed to never be fed with |
||||
* with NULL data. The user can still send NULL data to the public encode |
||||
* or decode function, but libavcodec will not pass it along to the codec |
||||
* unless this flag is set. |
||||
* |
||||
* Decoders: |
||||
* The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, |
||||
* avpkt->size=0 at the end to get the delayed data until the decoder no longer |
||||
* returns frames. |
||||
* |
||||
* Encoders: |
||||
* The encoder needs to be fed with NULL data at the end of encoding until the |
||||
* encoder no longer returns data. |
||||
* |
||||
* NOTE: For encoders implementing the AVCodec.encode2() function, setting this |
||||
* flag also means that the encoder must set the pts and duration for |
||||
* each output packet. If this flag is not set, the pts and duration will |
||||
* be determined by libavcodec from the input frame. |
||||
*/ |
||||
#define AV_CODEC_CAP_DELAY (1 << 5) |
||||
/**
|
||||
* Codec can be fed a final frame with a smaller size. |
||||
* This can be used to prevent truncation of the last audio samples. |
||||
*/ |
||||
#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) |
||||
|
||||
/**
|
||||
* Codec can output multiple frames per AVPacket |
||||
* Normally demuxers return one frame at a time, demuxers which do not do |
||||
* are connected to a parser to split what they return into proper frames. |
||||
* This flag is reserved to the very rare category of codecs which have a |
||||
* bitstream that cannot be split into frames without timeconsuming |
||||
* operations like full decoding. Demuxers carrying such bitstreams thus |
||||
* may return multiple frames in a packet. This has many disadvantages like |
||||
* prohibiting stream copy in many cases thus it should only be considered |
||||
* as a last resort. |
||||
*/ |
||||
#define AV_CODEC_CAP_SUBFRAMES (1 << 8) |
||||
/**
|
||||
* Codec is experimental and is thus avoided in favor of non experimental |
||||
* encoders |
||||
*/ |
||||
#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9) |
||||
/**
|
||||
* Codec should fill in channel configuration and samplerate instead of container |
||||
*/ |
||||
#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10) |
||||
/**
|
||||
* Codec supports frame-level multithreading. |
||||
*/ |
||||
#define AV_CODEC_CAP_FRAME_THREADS (1 << 12) |
||||
/**
|
||||
* Codec supports slice-based (or partition-based) multithreading. |
||||
*/ |
||||
#define AV_CODEC_CAP_SLICE_THREADS (1 << 13) |
||||
/**
|
||||
* Codec supports changed parameters at any point. |
||||
*/ |
||||
#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) |
||||
/**
|
||||
* Codec supports multithreading through a method other than slice- or |
||||
* frame-level multithreading. Typically this marks wrappers around |
||||
* multithreading-capable external libraries. |
||||
*/ |
||||
#define AV_CODEC_CAP_OTHER_THREADS (1 << 15) |
||||
/**
|
||||
* Audio encoder supports receiving a different number of samples in each call. |
||||
*/ |
||||
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16) |
||||
/**
|
||||
* Decoder is not a preferred choice for probing. |
||||
* This indicates that the decoder is not a good choice for probing. |
||||
* It could for example be an expensive to spin up hardware decoder, |
||||
* or it could simply not provide a lot of useful information about |
||||
* the stream. |
||||
* A decoder marked with this flag should only be used as last resort |
||||
* choice for probing. |
||||
*/ |
||||
#define AV_CODEC_CAP_AVOID_PROBING (1 << 17) |
||||
|
||||
/**
|
||||
* Codec is backed by a hardware implementation. Typically used to |
||||
* identify a non-hwaccel hardware decoder. For information about hwaccels, use |
||||
* avcodec_get_hw_config() instead. |
||||
*/ |
||||
#define AV_CODEC_CAP_HARDWARE (1 << 18) |
||||
|
||||
/**
|
||||
* Codec is potentially backed by a hardware implementation, but not |
||||
* necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the |
||||
* implementation provides some sort of internal fallback. |
||||
*/ |
||||
#define AV_CODEC_CAP_HYBRID (1 << 19) |
||||
|
||||
/**
|
||||
* This encoder can reorder user opaque values from input AVFrames and return |
||||
* them with corresponding output packets. |
||||
* @see AV_CODEC_FLAG_COPY_OPAQUE |
||||
*/ |
||||
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) |
||||
|
||||
/**
|
||||
* This encoder can be flushed using avcodec_flush_buffers(). If this flag is |
||||
* not set, the encoder must be closed and reopened to ensure that no frames |
||||
* remain pending. |
||||
*/ |
||||
#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) |
||||
|
||||
/**
|
||||
* The encoder is able to output reconstructed frame data, i.e. raw frames that |
||||
* would be produced by decoding the encoded bitstream. |
||||
* |
||||
* Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag. |
||||
*/ |
||||
#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22) |
||||
|
||||
/**
|
||||
* AVProfile. |
||||
*/ |
||||
typedef struct AVProfile { |
||||
int profile; |
||||
const char *name; ///< short name for the profile
|
||||
} AVProfile; |
||||
|
||||
/**
|
||||
* AVCodec. |
||||
*/ |
||||
typedef struct AVCodec { |
||||
/**
|
||||
* Name of the codec implementation. |
||||
* The name is globally unique among encoders and among decoders (but an |
||||
* encoder and a decoder can share the same name). |
||||
* This is the primary way to find a codec from the user perspective. |
||||
*/ |
||||
const char *name; |
||||
/**
|
||||
* Descriptive name for the codec, meant to be more human readable than name. |
||||
* You should use the NULL_IF_CONFIG_SMALL() macro to define it. |
||||
*/ |
||||
const char *long_name; |
||||
enum AVMediaType type; |
||||
enum AVCodecID id; |
||||
/**
|
||||
* Codec capabilities. |
||||
* see AV_CODEC_CAP_* |
||||
*/ |
||||
int capabilities; |
||||
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
|
||||
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
|
||||
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
|
||||
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
|
||||
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT |
||||
/**
|
||||
* @deprecated use ch_layouts instead |
||||
*/ |
||||
attribute_deprecated |
||||
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
|
||||
#endif |
||||
const AVClass *priv_class; ///< AVClass for the private context
|
||||
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
|
||||
|
||||
/**
|
||||
* Group name of the codec implementation. |
||||
* This is a short symbolic name of the wrapper backing this codec. A |
||||
* wrapper uses some kind of external implementation for the codec, such |
||||
* as an external library, or a codec implementation provided by the OS or |
||||
* the hardware. |
||||
* If this field is NULL, this is a builtin, libavcodec native codec. |
||||
* If non-NULL, this will be the suffix in AVCodec.name in most cases |
||||
* (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>"). |
||||
*/ |
||||
const char *wrapper_name; |
||||
|
||||
/**
|
||||
* Array of supported channel layouts, terminated with a zeroed layout. |
||||
*/ |
||||
const AVChannelLayout *ch_layouts; |
||||
} AVCodec; |
||||
|
||||
/**
|
||||
* Iterate over all registered codecs. |
||||
* |
||||
* @param opaque a pointer where libavcodec will store the iteration state. Must |
||||
* point to NULL to start the iteration. |
||||
* |
||||
* @return the next registered codec or NULL when the iteration is |
||||
* finished |
||||
*/ |
||||
const AVCodec *av_codec_iterate(void **opaque); |
||||
|
||||
/**
|
||||
* Find a registered decoder with a matching codec ID. |
||||
* |
||||
* @param id AVCodecID of the requested decoder |
||||
* @return A decoder if one was found, NULL otherwise. |
||||
*/ |
||||
const AVCodec *avcodec_find_decoder(enum AVCodecID id); |
||||
|
||||
/**
|
||||
* Find a registered decoder with the specified name. |
||||
* |
||||
* @param name name of the requested decoder |
||||
* @return A decoder if one was found, NULL otherwise. |
||||
*/ |
||||
const AVCodec *avcodec_find_decoder_by_name(const char *name); |
||||
|
||||
/**
|
||||
* Find a registered encoder with a matching codec ID. |
||||
* |
||||
* @param id AVCodecID of the requested encoder |
||||
* @return An encoder if one was found, NULL otherwise. |
||||
*/ |
||||
const AVCodec *avcodec_find_encoder(enum AVCodecID id); |
||||
|
||||
/**
|
||||
* Find a registered encoder with the specified name. |
||||
* |
||||
* @param name name of the requested encoder |
||||
* @return An encoder if one was found, NULL otherwise. |
||||
*/ |
||||
const AVCodec *avcodec_find_encoder_by_name(const char *name); |
||||
/**
|
||||
* @return a non-zero number if codec is an encoder, zero otherwise |
||||
*/ |
||||
int av_codec_is_encoder(const AVCodec *codec); |
||||
|
||||
/**
|
||||
* @return a non-zero number if codec is a decoder, zero otherwise |
||||
*/ |
||||
int av_codec_is_decoder(const AVCodec *codec); |
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available. |
||||
* |
||||
* @param codec the codec that is searched for the given profile |
||||
* @param profile the profile value for which a name is requested |
||||
* @return A name for the profile if found, NULL otherwise. |
||||
*/ |
||||
const char *av_get_profile_name(const AVCodec *codec, int profile); |
||||
|
||||
enum { |
||||
/**
|
||||
* The codec supports this format via the hw_device_ctx interface. |
||||
* |
||||
* When selecting this format, AVCodecContext.hw_device_ctx should |
||||
* have been set to a device of the specified type before calling |
||||
* avcodec_open2(). |
||||
*/ |
||||
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01, |
||||
/**
|
||||
* The codec supports this format via the hw_frames_ctx interface. |
||||
* |
||||
* When selecting this format for a decoder, |
||||
* AVCodecContext.hw_frames_ctx should be set to a suitable frames |
||||
* context inside the get_format() callback. The frames context |
||||
* must have been created on a device of the specified type. |
||||
* |
||||
* When selecting this format for an encoder, |
||||
* AVCodecContext.hw_frames_ctx should be set to the context which |
||||
* will be used for the input frames before calling avcodec_open2(). |
||||
*/ |
||||
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02, |
||||
/**
|
||||
* The codec supports this format by some internal method. |
||||
* |
||||
* This format can be selected without any additional configuration - |
||||
* no device or frames context is required. |
||||
*/ |
||||
AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04, |
||||
/**
|
||||
* The codec supports this format by some ad-hoc method. |
||||
* |
||||
* Additional settings and/or function calls are required. See the |
||||
* codec-specific documentation for details. (Methods requiring |
||||
* this sort of configuration are deprecated and others should be |
||||
* used in preference.) |
||||
*/ |
||||
AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08, |
||||
}; |
||||
|
||||
typedef struct AVCodecHWConfig { |
||||
/**
|
||||
* For decoders, a hardware pixel format which that decoder may be |
||||
* able to decode to if suitable hardware is available. |
||||
* |
||||
* For encoders, a pixel format which the encoder may be able to |
||||
* accept. If set to AV_PIX_FMT_NONE, this applies to all pixel |
||||
* formats supported by the codec. |
||||
*/ |
||||
enum AVPixelFormat pix_fmt; |
||||
/**
|
||||
* Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible |
||||
* setup methods which can be used with this configuration. |
||||
*/ |
||||
int methods; |
||||
/**
|
||||
* The device type associated with the configuration. |
||||
* |
||||
* Must be set for AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX and |
||||
* AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX, otherwise unused. |
||||
*/ |
||||
enum AVHWDeviceType device_type; |
||||
} AVCodecHWConfig; |
||||
|
||||
/**
|
||||
* Retrieve supported hardware configurations for a codec. |
||||
* |
||||
* Values of index from zero to some maximum return the indexed configuration |
||||
* descriptor; all other values return NULL. If the codec does not support |
||||
* any hardware configurations then it will always return NULL. |
||||
*/ |
||||
const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVCODEC_CODEC_H */ |
@ -1,128 +0,0 @@ |
||||
/*
|
||||
* Codec descriptors public API |
||||
* |
||||
* 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_CODEC_DESC_H |
||||
#define AVCODEC_CODEC_DESC_H |
||||
|
||||
#include "libavutil/avutil.h" |
||||
|
||||
#include "codec_id.h" |
||||
|
||||
/**
|
||||
* @addtogroup lavc_core |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* This struct describes the properties of a single codec described by an |
||||
* AVCodecID. |
||||
* @see avcodec_descriptor_get() |
||||
*/ |
||||
typedef struct AVCodecDescriptor { |
||||
enum AVCodecID id; |
||||
enum AVMediaType type; |
||||
/**
|
||||
* Name of the codec described by this descriptor. It is non-empty and |
||||
* unique for each codec descriptor. It should contain alphanumeric |
||||
* characters and '_' only. |
||||
*/ |
||||
const char *name; |
||||
/**
|
||||
* A more descriptive name for this codec. May be NULL. |
||||
*/ |
||||
const char *long_name; |
||||
/**
|
||||
* Codec properties, a combination of AV_CODEC_PROP_* flags. |
||||
*/ |
||||
int props; |
||||
/**
|
||||
* MIME type(s) associated with the codec. |
||||
* May be NULL; if not, a NULL-terminated array of MIME types. |
||||
* The first item is always non-NULL and is the preferred MIME type. |
||||
*/ |
||||
const char *const *mime_types; |
||||
/**
|
||||
* If non-NULL, an array of profiles recognized for this codec. |
||||
* Terminated with FF_PROFILE_UNKNOWN. |
||||
*/ |
||||
const struct AVProfile *profiles; |
||||
} AVCodecDescriptor; |
||||
|
||||
/**
|
||||
* Codec uses only intra compression. |
||||
* Video and audio codecs only. |
||||
*/ |
||||
#define AV_CODEC_PROP_INTRA_ONLY (1 << 0) |
||||
/**
|
||||
* Codec supports lossy compression. Audio and video codecs only. |
||||
* @note a codec may support both lossy and lossless |
||||
* compression modes |
||||
*/ |
||||
#define AV_CODEC_PROP_LOSSY (1 << 1) |
||||
/**
|
||||
* Codec supports lossless compression. Audio and video codecs only. |
||||
*/ |
||||
#define AV_CODEC_PROP_LOSSLESS (1 << 2) |
||||
/**
|
||||
* Codec supports frame reordering. That is, the coded order (the order in which |
||||
* the encoded packets are output by the encoders / stored / input to the |
||||
* decoders) may be different from the presentation order of the corresponding |
||||
* frames. |
||||
* |
||||
* For codecs that do not have this property set, PTS and DTS should always be |
||||
* equal. |
||||
*/ |
||||
#define AV_CODEC_PROP_REORDER (1 << 3) |
||||
/**
|
||||
* Subtitle codec is bitmap based |
||||
* Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. |
||||
*/ |
||||
#define AV_CODEC_PROP_BITMAP_SUB (1 << 16) |
||||
/**
|
||||
* Subtitle codec is text based. |
||||
* Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. |
||||
*/ |
||||
#define AV_CODEC_PROP_TEXT_SUB (1 << 17) |
||||
|
||||
/**
|
||||
* @return descriptor for given codec ID or NULL if no descriptor exists. |
||||
*/ |
||||
const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id); |
||||
|
||||
/**
|
||||
* Iterate over all codec descriptors known to libavcodec. |
||||
* |
||||
* @param prev previous descriptor. NULL to get the first descriptor. |
||||
* |
||||
* @return next descriptor or NULL after the last descriptor |
||||
*/ |
||||
const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev); |
||||
|
||||
/**
|
||||
* @return codec descriptor with the given name or NULL if no such descriptor |
||||
* exists. |
||||
*/ |
||||
const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif // AVCODEC_CODEC_DESC_H
|
@ -1,661 +0,0 @@ |
||||
/*
|
||||
* Codec IDs |
||||
* |
||||
* 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_CODEC_ID_H |
||||
#define AVCODEC_CODEC_ID_H |
||||
|
||||
#include "libavutil/avutil.h" |
||||
#include "libavutil/samplefmt.h" |
||||
|
||||
#include "version_major.h" |
||||
|
||||
/**
|
||||
* @addtogroup lavc_core |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Identify the syntax and semantics of the bitstream. |
||||
* The principle is roughly: |
||||
* Two decoders with the same ID can decode the same streams. |
||||
* Two encoders with the same ID can encode compatible streams. |
||||
* There may be slight deviations from the principle due to implementation |
||||
* details. |
||||
* |
||||
* If you add a codec ID to this list, add it so that |
||||
* 1. no value of an existing codec ID changes (that would break ABI), |
||||
* 2. it is as close as possible to similar codecs |
||||
* |
||||
* After adding new codec IDs, do not forget to add an entry to the codec |
||||
* descriptor list and bump libavcodec minor version. |
||||
*/ |
||||
enum AVCodecID { |
||||
AV_CODEC_ID_NONE, |
||||
|
||||
/* video codecs */ |
||||
AV_CODEC_ID_MPEG1VIDEO, |
||||
AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
|
||||
AV_CODEC_ID_H261, |
||||
AV_CODEC_ID_H263, |
||||
AV_CODEC_ID_RV10, |
||||
AV_CODEC_ID_RV20, |
||||
AV_CODEC_ID_MJPEG, |
||||
AV_CODEC_ID_MJPEGB, |
||||
AV_CODEC_ID_LJPEG, |
||||
AV_CODEC_ID_SP5X, |
||||
AV_CODEC_ID_JPEGLS, |
||||
AV_CODEC_ID_MPEG4, |
||||
AV_CODEC_ID_RAWVIDEO, |
||||
AV_CODEC_ID_MSMPEG4V1, |
||||
AV_CODEC_ID_MSMPEG4V2, |
||||
AV_CODEC_ID_MSMPEG4V3, |
||||
AV_CODEC_ID_WMV1, |
||||
AV_CODEC_ID_WMV2, |
||||
AV_CODEC_ID_H263P, |
||||
AV_CODEC_ID_H263I, |
||||
AV_CODEC_ID_FLV1, |
||||
AV_CODEC_ID_SVQ1, |
||||
AV_CODEC_ID_SVQ3, |
||||
AV_CODEC_ID_DVVIDEO, |
||||
AV_CODEC_ID_HUFFYUV, |
||||
AV_CODEC_ID_CYUV, |
||||
AV_CODEC_ID_H264, |
||||
AV_CODEC_ID_INDEO3, |
||||
AV_CODEC_ID_VP3, |
||||
AV_CODEC_ID_THEORA, |
||||
AV_CODEC_ID_ASV1, |
||||
AV_CODEC_ID_ASV2, |
||||
AV_CODEC_ID_FFV1, |
||||
AV_CODEC_ID_4XM, |
||||
AV_CODEC_ID_VCR1, |
||||
AV_CODEC_ID_CLJR, |
||||
AV_CODEC_ID_MDEC, |
||||
AV_CODEC_ID_ROQ, |
||||
AV_CODEC_ID_INTERPLAY_VIDEO, |
||||
AV_CODEC_ID_XAN_WC3, |
||||
AV_CODEC_ID_XAN_WC4, |
||||
AV_CODEC_ID_RPZA, |
||||
AV_CODEC_ID_CINEPAK, |
||||
AV_CODEC_ID_WS_VQA, |
||||
AV_CODEC_ID_MSRLE, |
||||
AV_CODEC_ID_MSVIDEO1, |
||||
AV_CODEC_ID_IDCIN, |
||||
AV_CODEC_ID_8BPS, |
||||
AV_CODEC_ID_SMC, |
||||
AV_CODEC_ID_FLIC, |
||||
AV_CODEC_ID_TRUEMOTION1, |
||||
AV_CODEC_ID_VMDVIDEO, |
||||
AV_CODEC_ID_MSZH, |
||||
AV_CODEC_ID_ZLIB, |
||||
AV_CODEC_ID_QTRLE, |
||||
AV_CODEC_ID_TSCC, |
||||
AV_CODEC_ID_ULTI, |
||||
AV_CODEC_ID_QDRAW, |
||||
AV_CODEC_ID_VIXL, |
||||
AV_CODEC_ID_QPEG, |
||||
AV_CODEC_ID_PNG, |
||||
AV_CODEC_ID_PPM, |
||||
AV_CODEC_ID_PBM, |
||||
AV_CODEC_ID_PGM, |
||||
AV_CODEC_ID_PGMYUV, |
||||
AV_CODEC_ID_PAM, |
||||
AV_CODEC_ID_FFVHUFF, |
||||
AV_CODEC_ID_RV30, |
||||
AV_CODEC_ID_RV40, |
||||
AV_CODEC_ID_VC1, |
||||
AV_CODEC_ID_WMV3, |
||||
AV_CODEC_ID_LOCO, |
||||
AV_CODEC_ID_WNV1, |
||||
AV_CODEC_ID_AASC, |
||||
AV_CODEC_ID_INDEO2, |
||||
AV_CODEC_ID_FRAPS, |
||||
AV_CODEC_ID_TRUEMOTION2, |
||||
AV_CODEC_ID_BMP, |
||||
AV_CODEC_ID_CSCD, |
||||
AV_CODEC_ID_MMVIDEO, |
||||
AV_CODEC_ID_ZMBV, |
||||
AV_CODEC_ID_AVS, |
||||
AV_CODEC_ID_SMACKVIDEO, |
||||
AV_CODEC_ID_NUV, |
||||
AV_CODEC_ID_KMVC, |
||||
AV_CODEC_ID_FLASHSV, |
||||
AV_CODEC_ID_CAVS, |
||||
AV_CODEC_ID_JPEG2000, |
||||
AV_CODEC_ID_VMNC, |
||||
AV_CODEC_ID_VP5, |
||||
AV_CODEC_ID_VP6, |
||||
AV_CODEC_ID_VP6F, |
||||
AV_CODEC_ID_TARGA, |
||||
AV_CODEC_ID_DSICINVIDEO, |
||||
AV_CODEC_ID_TIERTEXSEQVIDEO, |
||||
AV_CODEC_ID_TIFF, |
||||
AV_CODEC_ID_GIF, |
||||
AV_CODEC_ID_DXA, |
||||
AV_CODEC_ID_DNXHD, |
||||
AV_CODEC_ID_THP, |
||||
AV_CODEC_ID_SGI, |
||||
AV_CODEC_ID_C93, |
||||
AV_CODEC_ID_BETHSOFTVID, |
||||
AV_CODEC_ID_PTX, |
||||
AV_CODEC_ID_TXD, |
||||
AV_CODEC_ID_VP6A, |
||||
AV_CODEC_ID_AMV, |
||||
AV_CODEC_ID_VB, |
||||
AV_CODEC_ID_PCX, |
||||
AV_CODEC_ID_SUNRAST, |
||||
AV_CODEC_ID_INDEO4, |
||||
AV_CODEC_ID_INDEO5, |
||||
AV_CODEC_ID_MIMIC, |
||||
AV_CODEC_ID_RL2, |
||||
AV_CODEC_ID_ESCAPE124, |
||||
AV_CODEC_ID_DIRAC, |
||||
AV_CODEC_ID_BFI, |
||||
AV_CODEC_ID_CMV, |
||||
AV_CODEC_ID_MOTIONPIXELS, |
||||
AV_CODEC_ID_TGV, |
||||
AV_CODEC_ID_TGQ, |
||||
AV_CODEC_ID_TQI, |
||||
AV_CODEC_ID_AURA, |
||||
AV_CODEC_ID_AURA2, |
||||
AV_CODEC_ID_V210X, |
||||
AV_CODEC_ID_TMV, |
||||
AV_CODEC_ID_V210, |
||||
AV_CODEC_ID_DPX, |
||||
AV_CODEC_ID_MAD, |
||||
AV_CODEC_ID_FRWU, |
||||
AV_CODEC_ID_FLASHSV2, |
||||
AV_CODEC_ID_CDGRAPHICS, |
||||
AV_CODEC_ID_R210, |
||||
AV_CODEC_ID_ANM, |
||||
AV_CODEC_ID_BINKVIDEO, |
||||
AV_CODEC_ID_IFF_ILBM, |
||||
#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM |
||||
AV_CODEC_ID_KGV1, |
||||
AV_CODEC_ID_YOP, |
||||
AV_CODEC_ID_VP8, |
||||
AV_CODEC_ID_PICTOR, |
||||
AV_CODEC_ID_ANSI, |
||||
AV_CODEC_ID_A64_MULTI, |
||||
AV_CODEC_ID_A64_MULTI5, |
||||
AV_CODEC_ID_R10K, |
||||
AV_CODEC_ID_MXPEG, |
||||
AV_CODEC_ID_LAGARITH, |
||||
AV_CODEC_ID_PRORES, |
||||
AV_CODEC_ID_JV, |
||||
AV_CODEC_ID_DFA, |
||||
AV_CODEC_ID_WMV3IMAGE, |
||||
AV_CODEC_ID_VC1IMAGE, |
||||
AV_CODEC_ID_UTVIDEO, |
||||
AV_CODEC_ID_BMV_VIDEO, |
||||
AV_CODEC_ID_VBLE, |
||||
AV_CODEC_ID_DXTORY, |
||||
AV_CODEC_ID_V410, |
||||
AV_CODEC_ID_XWD, |
||||
AV_CODEC_ID_CDXL, |
||||
AV_CODEC_ID_XBM, |
||||
AV_CODEC_ID_ZEROCODEC, |
||||
AV_CODEC_ID_MSS1, |
||||
AV_CODEC_ID_MSA1, |
||||
AV_CODEC_ID_TSCC2, |
||||
AV_CODEC_ID_MTS2, |
||||
AV_CODEC_ID_CLLC, |
||||
AV_CODEC_ID_MSS2, |
||||
AV_CODEC_ID_VP9, |
||||
AV_CODEC_ID_AIC, |
||||
AV_CODEC_ID_ESCAPE130, |
||||
AV_CODEC_ID_G2M, |
||||
AV_CODEC_ID_WEBP, |
||||
AV_CODEC_ID_HNM4_VIDEO, |
||||
AV_CODEC_ID_HEVC, |
||||
#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC |
||||
AV_CODEC_ID_FIC, |
||||
AV_CODEC_ID_ALIAS_PIX, |
||||
AV_CODEC_ID_BRENDER_PIX, |
||||
AV_CODEC_ID_PAF_VIDEO, |
||||
AV_CODEC_ID_EXR, |
||||
AV_CODEC_ID_VP7, |
||||
AV_CODEC_ID_SANM, |
||||
AV_CODEC_ID_SGIRLE, |
||||
AV_CODEC_ID_MVC1, |
||||
AV_CODEC_ID_MVC2, |
||||
AV_CODEC_ID_HQX, |
||||
AV_CODEC_ID_TDSC, |
||||
AV_CODEC_ID_HQ_HQA, |
||||
AV_CODEC_ID_HAP, |
||||
AV_CODEC_ID_DDS, |
||||
AV_CODEC_ID_DXV, |
||||
AV_CODEC_ID_SCREENPRESSO, |
||||
AV_CODEC_ID_RSCC, |
||||
AV_CODEC_ID_AVS2, |
||||
AV_CODEC_ID_PGX, |
||||
AV_CODEC_ID_AVS3, |
||||
AV_CODEC_ID_MSP2, |
||||
AV_CODEC_ID_VVC, |
||||
#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC |
||||
AV_CODEC_ID_Y41P, |
||||
AV_CODEC_ID_AVRP, |
||||
AV_CODEC_ID_012V, |
||||
AV_CODEC_ID_AVUI, |
||||
#if FF_API_AYUV_CODECID |
||||
AV_CODEC_ID_AYUV, |
||||
#endif |
||||
AV_CODEC_ID_TARGA_Y216, |
||||
AV_CODEC_ID_V308, |
||||
AV_CODEC_ID_V408, |
||||
AV_CODEC_ID_YUV4, |
||||
AV_CODEC_ID_AVRN, |
||||
AV_CODEC_ID_CPIA, |
||||
AV_CODEC_ID_XFACE, |
||||
AV_CODEC_ID_SNOW, |
||||
AV_CODEC_ID_SMVJPEG, |
||||
AV_CODEC_ID_APNG, |
||||
AV_CODEC_ID_DAALA, |
||||
AV_CODEC_ID_CFHD, |
||||
AV_CODEC_ID_TRUEMOTION2RT, |
||||
AV_CODEC_ID_M101, |
||||
AV_CODEC_ID_MAGICYUV, |
||||
AV_CODEC_ID_SHEERVIDEO, |
||||
AV_CODEC_ID_YLC, |
||||
AV_CODEC_ID_PSD, |
||||
AV_CODEC_ID_PIXLET, |
||||
AV_CODEC_ID_SPEEDHQ, |
||||
AV_CODEC_ID_FMVC, |
||||
AV_CODEC_ID_SCPR, |
||||
AV_CODEC_ID_CLEARVIDEO, |
||||
AV_CODEC_ID_XPM, |
||||
AV_CODEC_ID_AV1, |
||||
AV_CODEC_ID_BITPACKED, |
||||
AV_CODEC_ID_MSCC, |
||||
AV_CODEC_ID_SRGC, |
||||
AV_CODEC_ID_SVG, |
||||
AV_CODEC_ID_GDV, |
||||
AV_CODEC_ID_FITS, |
||||
AV_CODEC_ID_IMM4, |
||||
AV_CODEC_ID_PROSUMER, |
||||
AV_CODEC_ID_MWSC, |
||||
AV_CODEC_ID_WCMV, |
||||
AV_CODEC_ID_RASC, |
||||
AV_CODEC_ID_HYMT, |
||||
AV_CODEC_ID_ARBC, |
||||
AV_CODEC_ID_AGM, |
||||
AV_CODEC_ID_LSCR, |
||||
AV_CODEC_ID_VP4, |
||||
AV_CODEC_ID_IMM5, |
||||
AV_CODEC_ID_MVDV, |
||||
AV_CODEC_ID_MVHA, |
||||
AV_CODEC_ID_CDTOONS, |
||||
AV_CODEC_ID_MV30, |
||||
AV_CODEC_ID_NOTCHLC, |
||||
AV_CODEC_ID_PFM, |
||||
AV_CODEC_ID_MOBICLIP, |
||||
AV_CODEC_ID_PHOTOCD, |
||||
AV_CODEC_ID_IPU, |
||||
AV_CODEC_ID_ARGO, |
||||
AV_CODEC_ID_CRI, |
||||
AV_CODEC_ID_SIMBIOSIS_IMX, |
||||
AV_CODEC_ID_SGA_VIDEO, |
||||
AV_CODEC_ID_GEM, |
||||
AV_CODEC_ID_VBN, |
||||
AV_CODEC_ID_JPEGXL, |
||||
AV_CODEC_ID_QOI, |
||||
AV_CODEC_ID_PHM, |
||||
AV_CODEC_ID_RADIANCE_HDR, |
||||
AV_CODEC_ID_WBMP, |
||||
AV_CODEC_ID_MEDIA100, |
||||
AV_CODEC_ID_VQC, |
||||
|
||||
/* various PCM "codecs" */ |
||||
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
|
||||
AV_CODEC_ID_PCM_S16LE = 0x10000, |
||||
AV_CODEC_ID_PCM_S16BE, |
||||
AV_CODEC_ID_PCM_U16LE, |
||||
AV_CODEC_ID_PCM_U16BE, |
||||
AV_CODEC_ID_PCM_S8, |
||||
AV_CODEC_ID_PCM_U8, |
||||
AV_CODEC_ID_PCM_MULAW, |
||||
AV_CODEC_ID_PCM_ALAW, |
||||
AV_CODEC_ID_PCM_S32LE, |
||||
AV_CODEC_ID_PCM_S32BE, |
||||
AV_CODEC_ID_PCM_U32LE, |
||||
AV_CODEC_ID_PCM_U32BE, |
||||
AV_CODEC_ID_PCM_S24LE, |
||||
AV_CODEC_ID_PCM_S24BE, |
||||
AV_CODEC_ID_PCM_U24LE, |
||||
AV_CODEC_ID_PCM_U24BE, |
||||
AV_CODEC_ID_PCM_S24DAUD, |
||||
AV_CODEC_ID_PCM_ZORK, |
||||
AV_CODEC_ID_PCM_S16LE_PLANAR, |
||||
AV_CODEC_ID_PCM_DVD, |
||||
AV_CODEC_ID_PCM_F32BE, |
||||
AV_CODEC_ID_PCM_F32LE, |
||||
AV_CODEC_ID_PCM_F64BE, |
||||
AV_CODEC_ID_PCM_F64LE, |
||||
AV_CODEC_ID_PCM_BLURAY, |
||||
AV_CODEC_ID_PCM_LXF, |
||||
AV_CODEC_ID_S302M, |
||||
AV_CODEC_ID_PCM_S8_PLANAR, |
||||
AV_CODEC_ID_PCM_S24LE_PLANAR, |
||||
AV_CODEC_ID_PCM_S32LE_PLANAR, |
||||
AV_CODEC_ID_PCM_S16BE_PLANAR, |
||||
AV_CODEC_ID_PCM_S64LE, |
||||
AV_CODEC_ID_PCM_S64BE, |
||||
AV_CODEC_ID_PCM_F16LE, |
||||
AV_CODEC_ID_PCM_F24LE, |
||||
AV_CODEC_ID_PCM_VIDC, |
||||
AV_CODEC_ID_PCM_SGA, |
||||
|
||||
/* various ADPCM codecs */ |
||||
AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, |
||||
AV_CODEC_ID_ADPCM_IMA_WAV, |
||||
AV_CODEC_ID_ADPCM_IMA_DK3, |
||||
AV_CODEC_ID_ADPCM_IMA_DK4, |
||||
AV_CODEC_ID_ADPCM_IMA_WS, |
||||
AV_CODEC_ID_ADPCM_IMA_SMJPEG, |
||||
AV_CODEC_ID_ADPCM_MS, |
||||
AV_CODEC_ID_ADPCM_4XM, |
||||
AV_CODEC_ID_ADPCM_XA, |
||||
AV_CODEC_ID_ADPCM_ADX, |
||||
AV_CODEC_ID_ADPCM_EA, |
||||
AV_CODEC_ID_ADPCM_G726, |
||||
AV_CODEC_ID_ADPCM_CT, |
||||
AV_CODEC_ID_ADPCM_SWF, |
||||
AV_CODEC_ID_ADPCM_YAMAHA, |
||||
AV_CODEC_ID_ADPCM_SBPRO_4, |
||||
AV_CODEC_ID_ADPCM_SBPRO_3, |
||||
AV_CODEC_ID_ADPCM_SBPRO_2, |
||||
AV_CODEC_ID_ADPCM_THP, |
||||
AV_CODEC_ID_ADPCM_IMA_AMV, |
||||
AV_CODEC_ID_ADPCM_EA_R1, |
||||
AV_CODEC_ID_ADPCM_EA_R3, |
||||
AV_CODEC_ID_ADPCM_EA_R2, |
||||
AV_CODEC_ID_ADPCM_IMA_EA_SEAD, |
||||
AV_CODEC_ID_ADPCM_IMA_EA_EACS, |
||||
AV_CODEC_ID_ADPCM_EA_XAS, |
||||
AV_CODEC_ID_ADPCM_EA_MAXIS_XA, |
||||
AV_CODEC_ID_ADPCM_IMA_ISS, |
||||
AV_CODEC_ID_ADPCM_G722, |
||||
AV_CODEC_ID_ADPCM_IMA_APC, |
||||
AV_CODEC_ID_ADPCM_VIMA, |
||||
AV_CODEC_ID_ADPCM_AFC, |
||||
AV_CODEC_ID_ADPCM_IMA_OKI, |
||||
AV_CODEC_ID_ADPCM_DTK, |
||||
AV_CODEC_ID_ADPCM_IMA_RAD, |
||||
AV_CODEC_ID_ADPCM_G726LE, |
||||
AV_CODEC_ID_ADPCM_THP_LE, |
||||
AV_CODEC_ID_ADPCM_PSX, |
||||
AV_CODEC_ID_ADPCM_AICA, |
||||
AV_CODEC_ID_ADPCM_IMA_DAT4, |
||||
AV_CODEC_ID_ADPCM_MTAF, |
||||
AV_CODEC_ID_ADPCM_AGM, |
||||
AV_CODEC_ID_ADPCM_ARGO, |
||||
AV_CODEC_ID_ADPCM_IMA_SSI, |
||||
AV_CODEC_ID_ADPCM_ZORK, |
||||
AV_CODEC_ID_ADPCM_IMA_APM, |
||||
AV_CODEC_ID_ADPCM_IMA_ALP, |
||||
AV_CODEC_ID_ADPCM_IMA_MTF, |
||||
AV_CODEC_ID_ADPCM_IMA_CUNNING, |
||||
AV_CODEC_ID_ADPCM_IMA_MOFLEX, |
||||
AV_CODEC_ID_ADPCM_IMA_ACORN, |
||||
AV_CODEC_ID_ADPCM_XMD, |
||||
|
||||
/* AMR */ |
||||
AV_CODEC_ID_AMR_NB = 0x12000, |
||||
AV_CODEC_ID_AMR_WB, |
||||
|
||||
/* RealAudio codecs*/ |
||||
AV_CODEC_ID_RA_144 = 0x13000, |
||||
AV_CODEC_ID_RA_288, |
||||
|
||||
/* various DPCM codecs */ |
||||
AV_CODEC_ID_ROQ_DPCM = 0x14000, |
||||
AV_CODEC_ID_INTERPLAY_DPCM, |
||||
AV_CODEC_ID_XAN_DPCM, |
||||
AV_CODEC_ID_SOL_DPCM, |
||||
AV_CODEC_ID_SDX2_DPCM, |
||||
AV_CODEC_ID_GREMLIN_DPCM, |
||||
AV_CODEC_ID_DERF_DPCM, |
||||
AV_CODEC_ID_WADY_DPCM, |
||||
AV_CODEC_ID_CBD2_DPCM, |
||||
|
||||
/* audio codecs */ |
||||
AV_CODEC_ID_MP2 = 0x15000, |
||||
AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
|
||||
AV_CODEC_ID_AAC, |
||||
AV_CODEC_ID_AC3, |
||||
AV_CODEC_ID_DTS, |
||||
AV_CODEC_ID_VORBIS, |
||||
AV_CODEC_ID_DVAUDIO, |
||||
AV_CODEC_ID_WMAV1, |
||||
AV_CODEC_ID_WMAV2, |
||||
AV_CODEC_ID_MACE3, |
||||
AV_CODEC_ID_MACE6, |
||||
AV_CODEC_ID_VMDAUDIO, |
||||
AV_CODEC_ID_FLAC, |
||||
AV_CODEC_ID_MP3ADU, |
||||
AV_CODEC_ID_MP3ON4, |
||||
AV_CODEC_ID_SHORTEN, |
||||
AV_CODEC_ID_ALAC, |
||||
AV_CODEC_ID_WESTWOOD_SND1, |
||||
AV_CODEC_ID_GSM, ///< as in Berlin toast format
|
||||
AV_CODEC_ID_QDM2, |
||||
AV_CODEC_ID_COOK, |
||||
AV_CODEC_ID_TRUESPEECH, |
||||
AV_CODEC_ID_TTA, |
||||
AV_CODEC_ID_SMACKAUDIO, |
||||
AV_CODEC_ID_QCELP, |
||||
AV_CODEC_ID_WAVPACK, |
||||
AV_CODEC_ID_DSICINAUDIO, |
||||
AV_CODEC_ID_IMC, |
||||
AV_CODEC_ID_MUSEPACK7, |
||||
AV_CODEC_ID_MLP, |
||||
AV_CODEC_ID_GSM_MS, /* as found in WAV */ |
||||
AV_CODEC_ID_ATRAC3, |
||||
AV_CODEC_ID_APE, |
||||
AV_CODEC_ID_NELLYMOSER, |
||||
AV_CODEC_ID_MUSEPACK8, |
||||
AV_CODEC_ID_SPEEX, |
||||
AV_CODEC_ID_WMAVOICE, |
||||
AV_CODEC_ID_WMAPRO, |
||||
AV_CODEC_ID_WMALOSSLESS, |
||||
AV_CODEC_ID_ATRAC3P, |
||||
AV_CODEC_ID_EAC3, |
||||
AV_CODEC_ID_SIPR, |
||||
AV_CODEC_ID_MP1, |
||||
AV_CODEC_ID_TWINVQ, |
||||
AV_CODEC_ID_TRUEHD, |
||||
AV_CODEC_ID_MP4ALS, |
||||
AV_CODEC_ID_ATRAC1, |
||||
AV_CODEC_ID_BINKAUDIO_RDFT, |
||||
AV_CODEC_ID_BINKAUDIO_DCT, |
||||
AV_CODEC_ID_AAC_LATM, |
||||
AV_CODEC_ID_QDMC, |
||||
AV_CODEC_ID_CELT, |
||||
AV_CODEC_ID_G723_1, |
||||
AV_CODEC_ID_G729, |
||||
AV_CODEC_ID_8SVX_EXP, |
||||
AV_CODEC_ID_8SVX_FIB, |
||||
AV_CODEC_ID_BMV_AUDIO, |
||||
AV_CODEC_ID_RALF, |
||||
AV_CODEC_ID_IAC, |
||||
AV_CODEC_ID_ILBC, |
||||
AV_CODEC_ID_OPUS, |
||||
AV_CODEC_ID_COMFORT_NOISE, |
||||
AV_CODEC_ID_TAK, |
||||
AV_CODEC_ID_METASOUND, |
||||
AV_CODEC_ID_PAF_AUDIO, |
||||
AV_CODEC_ID_ON2AVC, |
||||
AV_CODEC_ID_DSS_SP, |
||||
AV_CODEC_ID_CODEC2, |
||||
AV_CODEC_ID_FFWAVESYNTH, |
||||
AV_CODEC_ID_SONIC, |
||||
AV_CODEC_ID_SONIC_LS, |
||||
AV_CODEC_ID_EVRC, |
||||
AV_CODEC_ID_SMV, |
||||
AV_CODEC_ID_DSD_LSBF, |
||||
AV_CODEC_ID_DSD_MSBF, |
||||
AV_CODEC_ID_DSD_LSBF_PLANAR, |
||||
AV_CODEC_ID_DSD_MSBF_PLANAR, |
||||
AV_CODEC_ID_4GV, |
||||
AV_CODEC_ID_INTERPLAY_ACM, |
||||
AV_CODEC_ID_XMA1, |
||||
AV_CODEC_ID_XMA2, |
||||
AV_CODEC_ID_DST, |
||||
AV_CODEC_ID_ATRAC3AL, |
||||
AV_CODEC_ID_ATRAC3PAL, |
||||
AV_CODEC_ID_DOLBY_E, |
||||
AV_CODEC_ID_APTX, |
||||
AV_CODEC_ID_APTX_HD, |
||||
AV_CODEC_ID_SBC, |
||||
AV_CODEC_ID_ATRAC9, |
||||
AV_CODEC_ID_HCOM, |
||||
AV_CODEC_ID_ACELP_KELVIN, |
||||
AV_CODEC_ID_MPEGH_3D_AUDIO, |
||||
AV_CODEC_ID_SIREN, |
||||
AV_CODEC_ID_HCA, |
||||
AV_CODEC_ID_FASTAUDIO, |
||||
AV_CODEC_ID_MSNSIREN, |
||||
AV_CODEC_ID_DFPWM, |
||||
AV_CODEC_ID_BONK, |
||||
AV_CODEC_ID_MISC4, |
||||
AV_CODEC_ID_APAC, |
||||
AV_CODEC_ID_FTR, |
||||
AV_CODEC_ID_WAVARC, |
||||
AV_CODEC_ID_RKA, |
||||
|
||||
/* subtitle codecs */ |
||||
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
|
||||
AV_CODEC_ID_DVD_SUBTITLE = 0x17000, |
||||
AV_CODEC_ID_DVB_SUBTITLE, |
||||
AV_CODEC_ID_TEXT, ///< raw UTF-8 text
|
||||
AV_CODEC_ID_XSUB, |
||||
AV_CODEC_ID_SSA, |
||||
AV_CODEC_ID_MOV_TEXT, |
||||
AV_CODEC_ID_HDMV_PGS_SUBTITLE, |
||||
AV_CODEC_ID_DVB_TELETEXT, |
||||
AV_CODEC_ID_SRT, |
||||
AV_CODEC_ID_MICRODVD, |
||||
AV_CODEC_ID_EIA_608, |
||||
AV_CODEC_ID_JACOSUB, |
||||
AV_CODEC_ID_SAMI, |
||||
AV_CODEC_ID_REALTEXT, |
||||
AV_CODEC_ID_STL, |
||||
AV_CODEC_ID_SUBVIEWER1, |
||||
AV_CODEC_ID_SUBVIEWER, |
||||
AV_CODEC_ID_SUBRIP, |
||||
AV_CODEC_ID_WEBVTT, |
||||
AV_CODEC_ID_MPL2, |
||||
AV_CODEC_ID_VPLAYER, |
||||
AV_CODEC_ID_PJS, |
||||
AV_CODEC_ID_ASS, |
||||
AV_CODEC_ID_HDMV_TEXT_SUBTITLE, |
||||
AV_CODEC_ID_TTML, |
||||
AV_CODEC_ID_ARIB_CAPTION, |
||||
|
||||
/* other specific kind of codecs (generally used for attachments) */ |
||||
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
|
||||
AV_CODEC_ID_TTF = 0x18000, |
||||
|
||||
AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
|
||||
AV_CODEC_ID_EPG, |
||||
AV_CODEC_ID_BINTEXT, |
||||
AV_CODEC_ID_XBIN, |
||||
AV_CODEC_ID_IDF, |
||||
AV_CODEC_ID_OTF, |
||||
AV_CODEC_ID_SMPTE_KLV, |
||||
AV_CODEC_ID_DVD_NAV, |
||||
AV_CODEC_ID_TIMED_ID3, |
||||
AV_CODEC_ID_BIN_DATA, |
||||
|
||||
|
||||
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
|
||||
|
||||
AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
|
||||
* stream (only used by libavformat) */ |
||||
AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
|
||||
* stream (only used by libavformat) */ |
||||
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
|
||||
AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket
|
||||
/**
|
||||
* Dummy null video codec, useful mainly for development and debugging. |
||||
* Null encoder/decoder discard all input and never return any output. |
||||
*/ |
||||
AV_CODEC_ID_VNULL, |
||||
/**
|
||||
* Dummy null audio codec, useful mainly for development and debugging. |
||||
* Null encoder/decoder discard all input and never return any output. |
||||
*/ |
||||
AV_CODEC_ID_ANULL, |
||||
}; |
||||
|
||||
/**
|
||||
* Get the type of the given codec. |
||||
*/ |
||||
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); |
||||
|
||||
/**
|
||||
* Get the name of a codec. |
||||
* @return a static string identifying the codec; never NULL |
||||
*/ |
||||
const char *avcodec_get_name(enum AVCodecID id); |
||||
|
||||
/**
|
||||
* Return codec bits per sample. |
||||
* |
||||
* @param[in] codec_id the codec |
||||
* @return Number of bits per sample or zero if unknown for the given codec. |
||||
*/ |
||||
int av_get_bits_per_sample(enum AVCodecID codec_id); |
||||
|
||||
/**
|
||||
* Return codec bits per sample. |
||||
* Only return non-zero if the bits per sample is exactly correct, not an |
||||
* approximation. |
||||
* |
||||
* @param[in] codec_id the codec |
||||
* @return Number of bits per sample or zero if unknown for the given codec. |
||||
*/ |
||||
int av_get_exact_bits_per_sample(enum AVCodecID codec_id); |
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available. |
||||
* |
||||
* @param codec_id the ID of the codec to which the requested profile belongs |
||||
* @param profile the profile value for which a name is requested |
||||
* @return A name for the profile if found, NULL otherwise. |
||||
* |
||||
* @note unlike av_get_profile_name(), which searches a list of profiles |
||||
* supported by a specific decoder or encoder implementation, this |
||||
* function searches the list of profiles from the AVCodecDescriptor |
||||
*/ |
||||
const char *avcodec_profile_name(enum AVCodecID codec_id, int profile); |
||||
|
||||
/**
|
||||
* Return the PCM codec associated with a sample format. |
||||
* @param be endianness, 0 for little, 1 for big, |
||||
* -1 (or anything else) for native |
||||
* @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE |
||||
*/ |
||||
enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif // AVCODEC_CODEC_ID_H
|
@ -1,247 +0,0 @@ |
||||
/*
|
||||
* Codec parameters public API |
||||
* |
||||
* 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_CODEC_PAR_H |
||||
#define AVCODEC_CODEC_PAR_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
#include "libavutil/avutil.h" |
||||
#include "libavutil/channel_layout.h" |
||||
#include "libavutil/rational.h" |
||||
#include "libavutil/pixfmt.h" |
||||
|
||||
#include "codec_id.h" |
||||
|
||||
/**
|
||||
* @addtogroup lavc_core |
||||
* @{ |
||||
*/ |
||||
|
||||
enum AVFieldOrder { |
||||
AV_FIELD_UNKNOWN, |
||||
AV_FIELD_PROGRESSIVE, |
||||
AV_FIELD_TT, ///< Top coded_first, top displayed first
|
||||
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
|
||||
AV_FIELD_TB, ///< Top coded first, bottom displayed first
|
||||
AV_FIELD_BT, ///< Bottom coded first, top displayed first
|
||||
}; |
||||
|
||||
/**
|
||||
* This struct describes the properties of an encoded stream. |
||||
* |
||||
* sizeof(AVCodecParameters) is not a part of the public ABI, this struct must |
||||
* be allocated with avcodec_parameters_alloc() and freed with |
||||
* avcodec_parameters_free(). |
||||
*/ |
||||
typedef struct AVCodecParameters { |
||||
/**
|
||||
* General type of the encoded data. |
||||
*/ |
||||
enum AVMediaType codec_type; |
||||
/**
|
||||
* Specific type of the encoded data (the codec used). |
||||
*/ |
||||
enum AVCodecID codec_id; |
||||
/**
|
||||
* Additional information about the codec (corresponds to the AVI FOURCC). |
||||
*/ |
||||
uint32_t codec_tag; |
||||
|
||||
/**
|
||||
* Extra binary data needed for initializing the decoder, codec-dependent. |
||||
* |
||||
* Must be allocated with av_malloc() and will be freed by |
||||
* avcodec_parameters_free(). The allocated size of extradata must be at |
||||
* least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding |
||||
* bytes zeroed. |
||||
*/ |
||||
uint8_t *extradata; |
||||
/**
|
||||
* Size of the extradata content in bytes. |
||||
*/ |
||||
int extradata_size; |
||||
|
||||
/**
|
||||
* - video: the pixel format, the value corresponds to enum AVPixelFormat. |
||||
* - audio: the sample format, the value corresponds to enum AVSampleFormat. |
||||
*/ |
||||
int format; |
||||
|
||||
/**
|
||||
* The average bitrate of the encoded data (in bits per second). |
||||
*/ |
||||
int64_t bit_rate; |
||||
|
||||
/**
|
||||
* The number of bits per sample in the codedwords. |
||||
* |
||||
* This is basically the bitrate per sample. It is mandatory for a bunch of |
||||
* formats to actually decode them. It's the number of bits for one sample in |
||||
* the actual coded bitstream. |
||||
* |
||||
* This could be for example 4 for ADPCM |
||||
* For PCM formats this matches bits_per_raw_sample |
||||
* Can be 0 |
||||
*/ |
||||
int bits_per_coded_sample; |
||||
|
||||
/**
|
||||
* This is the number of valid bits in each output sample. If the |
||||
* sample format has more bits, the least significant bits are additional |
||||
* padding bits, which are always 0. Use right shifts to reduce the sample |
||||
* to its actual size. For example, audio formats with 24 bit samples will |
||||
* have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. |
||||
* To get the original sample use "(int32_t)sample >> 8"." |
||||
* |
||||
* For ADPCM this might be 12 or 16 or similar |
||||
* Can be 0 |
||||
*/ |
||||
int bits_per_raw_sample; |
||||
|
||||
/**
|
||||
* Codec-specific bitstream restrictions that the stream conforms to. |
||||
*/ |
||||
int profile; |
||||
int level; |
||||
|
||||
/**
|
||||
* Video only. The dimensions of the video frame in pixels. |
||||
*/ |
||||
int width; |
||||
int height; |
||||
|
||||
/**
|
||||
* Video only. The aspect ratio (width / height) which a single pixel |
||||
* should have when displayed. |
||||
* |
||||
* When the aspect ratio is unknown / undefined, the numerator should be |
||||
* set to 0 (the denominator may have any value). |
||||
*/ |
||||
AVRational sample_aspect_ratio; |
||||
|
||||
/**
|
||||
* Video only. The order of the fields in interlaced video. |
||||
*/ |
||||
enum AVFieldOrder field_order; |
||||
|
||||
/**
|
||||
* Video only. Additional colorspace characteristics. |
||||
*/ |
||||
enum AVColorRange color_range; |
||||
enum AVColorPrimaries color_primaries; |
||||
enum AVColorTransferCharacteristic color_trc; |
||||
enum AVColorSpace color_space; |
||||
enum AVChromaLocation chroma_location; |
||||
|
||||
/**
|
||||
* Video only. Number of delayed frames. |
||||
*/ |
||||
int video_delay; |
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT |
||||
/**
|
||||
* Audio only. The channel layout bitmask. May be 0 if the channel layout is |
||||
* unknown or unspecified, otherwise the number of bits set must be equal to |
||||
* the channels field. |
||||
* @deprecated use ch_layout |
||||
*/ |
||||
attribute_deprecated |
||||
uint64_t channel_layout; |
||||
/**
|
||||
* Audio only. The number of audio channels. |
||||
* @deprecated use ch_layout.nb_channels |
||||
*/ |
||||
attribute_deprecated |
||||
int channels; |
||||
#endif |
||||
/**
|
||||
* Audio only. The number of audio samples per second. |
||||
*/ |
||||
int sample_rate; |
||||
/**
|
||||
* Audio only. The number of bytes per coded audio frame, required by some |
||||
* formats. |
||||
* |
||||
* Corresponds to nBlockAlign in WAVEFORMATEX. |
||||
*/ |
||||
int block_align; |
||||
/**
|
||||
* Audio only. Audio frame size, if known. Required by some formats to be static. |
||||
*/ |
||||
int frame_size; |
||||
|
||||
/**
|
||||
* Audio only. The amount of padding (in samples) inserted by the encoder at |
||||
* the beginning of the audio. I.e. this number of leading decoded samples |
||||
* must be discarded by the caller to get the original audio without leading |
||||
* padding. |
||||
*/ |
||||
int initial_padding; |
||||
/**
|
||||
* Audio only. The amount of padding (in samples) appended by the encoder to |
||||
* the end of the audio. I.e. this number of decoded samples must be |
||||
* discarded by the caller from the end of the stream to get the original |
||||
* audio without any trailing padding. |
||||
*/ |
||||
int trailing_padding; |
||||
/**
|
||||
* Audio only. Number of samples to skip after a discontinuity. |
||||
*/ |
||||
int seek_preroll; |
||||
|
||||
/**
|
||||
* Audio only. The channel layout and number of channels. |
||||
*/ |
||||
AVChannelLayout ch_layout; |
||||
} AVCodecParameters; |
||||
|
||||
/**
|
||||
* Allocate a new AVCodecParameters and set its fields to default values |
||||
* (unknown/invalid/0). The returned struct must be freed with |
||||
* avcodec_parameters_free(). |
||||
*/ |
||||
AVCodecParameters *avcodec_parameters_alloc(void); |
||||
|
||||
/**
|
||||
* Free an AVCodecParameters instance and everything associated with it and |
||||
* write NULL to the supplied pointer. |
||||
*/ |
||||
void avcodec_parameters_free(AVCodecParameters **par); |
||||
|
||||
/**
|
||||
* Copy the contents of src to dst. Any allocated fields in dst are freed and |
||||
* replaced with newly allocated duplicates of the corresponding fields in src. |
||||
* |
||||
* @return >= 0 on success, a negative AVERROR code on failure. |
||||
*/ |
||||
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src); |
||||
|
||||
/**
|
||||
* This function is the same as av_get_audio_frame_duration(), except it works |
||||
* with AVCodecParameters instead of an AVCodecContext. |
||||
*/ |
||||
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif // AVCODEC_CODEC_PAR_H
|
@ -1,192 +0,0 @@ |
||||
/*
|
||||
* |
||||
* 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_DEFS_H |
||||
#define AVCODEC_DEFS_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup libavc |
||||
* Misc types and constants that do not belong anywhere else. |
||||
*/ |
||||
|
||||
#include <stdint.h> |
||||
#include <stdlib.h> |
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding |
||||
* Required number of additionally allocated bytes at the end of the input bitstream for decoding. |
||||
* This is mainly needed because some optimized bitstream readers read |
||||
* 32 or 64 bit at once and could read over the end.<br> |
||||
* Note: If the first 23 bits of the additional bytes are not 0, then damaged |
||||
* MPEG bitstreams could cause overread and segfault. |
||||
*/ |
||||
#define AV_INPUT_BUFFER_PADDING_SIZE 64 |
||||
|
||||
/**
|
||||
* Verify checksums embedded in the bitstream (could be of either encoded or |
||||
* decoded data, depending on the format) and print an error message on mismatch. |
||||
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the |
||||
* decoder/demuxer returning an error. |
||||
*/ |
||||
#define AV_EF_CRCCHECK (1<<0) |
||||
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
|
||||
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
|
||||
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
|
||||
|
||||
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
|
||||
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
|
||||
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
|
||||
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error
|
||||
|
||||
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
|
||||
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
|
||||
#define FF_COMPLIANCE_NORMAL 0 |
||||
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
|
||||
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
|
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding |
||||
*/ |
||||
enum AVDiscard{ |
||||
/* We leave some space between them for extensions (drop some
|
||||
* keyframes for intra-only or drop just some bidir frames). */ |
||||
AVDISCARD_NONE =-16, ///< discard nothing
|
||||
AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
|
||||
AVDISCARD_NONREF = 8, ///< discard all non reference
|
||||
AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
|
||||
AVDISCARD_NONINTRA= 24, ///< discard all non intra frames
|
||||
AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
|
||||
AVDISCARD_ALL = 48, ///< discard all
|
||||
}; |
||||
|
||||
enum AVAudioServiceType { |
||||
AV_AUDIO_SERVICE_TYPE_MAIN = 0, |
||||
AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, |
||||
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, |
||||
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, |
||||
AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, |
||||
AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, |
||||
AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, |
||||
AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, |
||||
AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, |
||||
AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
|
||||
}; |
||||
|
||||
/**
|
||||
* Pan Scan area. |
||||
* This specifies the area which should be displayed. |
||||
* Note there may be multiple such areas for one frame. |
||||
*/ |
||||
typedef struct AVPanScan { |
||||
/**
|
||||
* id |
||||
* - encoding: Set by user. |
||||
* - decoding: Set by libavcodec. |
||||
*/ |
||||
int id; |
||||
|
||||
/**
|
||||
* width and height in 1/16 pel |
||||
* - encoding: Set by user. |
||||
* - decoding: Set by libavcodec. |
||||
*/ |
||||
int width; |
||||
int height; |
||||
|
||||
/**
|
||||
* position of the top left corner in 1/16 pel for up to 3 fields/frames |
||||
* - encoding: Set by user. |
||||
* - decoding: Set by libavcodec. |
||||
*/ |
||||
int16_t position[3][2]; |
||||
} AVPanScan; |
||||
|
||||
/**
|
||||
* This structure describes the bitrate properties of an encoded bitstream. It |
||||
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD |
||||
* parameters for H.264/HEVC. |
||||
*/ |
||||
typedef struct AVCPBProperties { |
||||
/**
|
||||
* Maximum bitrate of the stream, in bits per second. |
||||
* Zero if unknown or unspecified. |
||||
*/ |
||||
int64_t max_bitrate; |
||||
/**
|
||||
* Minimum bitrate of the stream, in bits per second. |
||||
* Zero if unknown or unspecified. |
||||
*/ |
||||
int64_t min_bitrate; |
||||
/**
|
||||
* Average bitrate of the stream, in bits per second. |
||||
* Zero if unknown or unspecified. |
||||
*/ |
||||
int64_t avg_bitrate; |
||||
|
||||
/**
|
||||
* The size of the buffer to which the ratecontrol is applied, in bits. |
||||
* Zero if unknown or unspecified. |
||||
*/ |
||||
int64_t buffer_size; |
||||
|
||||
/**
|
||||
* The delay between the time the packet this structure is associated with |
||||
* is received and the time when it should be decoded, in periods of a 27MHz |
||||
* clock. |
||||
* |
||||
* UINT64_MAX when unknown or unspecified. |
||||
*/ |
||||
uint64_t vbv_delay; |
||||
} AVCPBProperties; |
||||
|
||||
/**
|
||||
* Allocate a CPB properties structure and initialize its fields to default |
||||
* values. |
||||
* |
||||
* @param size if non-NULL, the size of the allocated struct will be written |
||||
* here. This is useful for embedding it in side data. |
||||
* |
||||
* @return the newly allocated struct or NULL on failure |
||||
*/ |
||||
AVCPBProperties *av_cpb_properties_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* This structure supplies correlation between a packet timestamp and a wall clock |
||||
* production time. The definition follows the Producer Reference Time ('prft') |
||||
* as defined in ISO/IEC 14496-12 |
||||
*/ |
||||
typedef struct AVProducerReferenceTime { |
||||
/**
|
||||
* A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()). |
||||
*/ |
||||
int64_t wallclock; |
||||
int flags; |
||||
} AVProducerReferenceTime; |
||||
|
||||
/**
|
||||
* Encode extradata length to a buffer. Used by xiph codecs. |
||||
* |
||||
* @param s buffer to write to; must be at least (v/255+1) bytes long |
||||
* @param v size of extradata in bytes |
||||
* @return number of bytes written to the buffer. |
||||
*/ |
||||
unsigned int av_xiphlacing(unsigned char *s, unsigned int v); |
||||
|
||||
#endif // AVCODEC_DEFS_H
|
@ -1,731 +0,0 @@ |
||||
/*
|
||||
* AVPacket public API |
||||
* |
||||
* 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_PACKET_H |
||||
#define AVCODEC_PACKET_H |
||||
|
||||
#include <stddef.h> |
||||
#include <stdint.h> |
||||
|
||||
#include "libavutil/attributes.h" |
||||
#include "libavutil/buffer.h" |
||||
#include "libavutil/dict.h" |
||||
#include "libavutil/rational.h" |
||||
#include "libavutil/version.h" |
||||
|
||||
#include "libavcodec/version_major.h" |
||||
|
||||
/**
|
||||
* @defgroup lavc_packet AVPacket |
||||
* |
||||
* Types and functions for working with AVPacket. |
||||
* @{ |
||||
*/ |
||||
enum AVPacketSideDataType { |
||||
/**
|
||||
* An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE |
||||
* bytes worth of palette. This side data signals that a new palette is |
||||
* present. |
||||
*/ |
||||
AV_PKT_DATA_PALETTE, |
||||
|
||||
/**
|
||||
* The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format |
||||
* that the extradata buffer was changed and the receiving side should |
||||
* act upon it appropriately. The new extradata is embedded in the side |
||||
* data buffer and should be immediately used for processing the current |
||||
* frame or packet. |
||||
*/ |
||||
AV_PKT_DATA_NEW_EXTRADATA, |
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: |
||||
* @code |
||||
* u32le param_flags |
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) |
||||
* s32le channel_count |
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) |
||||
* u64le channel_layout |
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) |
||||
* s32le sample_rate |
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) |
||||
* s32le width |
||||
* s32le height |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_PARAM_CHANGE, |
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of |
||||
* structures with info about macroblocks relevant to splitting the |
||||
* packet into smaller packets on macroblock edges (e.g. as for RFC 2190). |
||||
* That is, it does not necessarily contain info about all macroblocks, |
||||
* as long as the distance between macroblocks in the info is smaller |
||||
* than the target payload size. |
||||
* Each MB info structure is 12 bytes, and is laid out as follows: |
||||
* @code |
||||
* u32le bit offset from the start of the packet |
||||
* u8 current quantizer at the start of the macroblock |
||||
* u8 GOB number |
||||
* u16le macroblock address within the GOB |
||||
* u8 horizontal MV predictor |
||||
* u8 vertical MV predictor |
||||
* u8 horizontal MV predictor for block number 3 |
||||
* u8 vertical MV predictor for block number 3 |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_H263_MB_INFO, |
||||
|
||||
/**
|
||||
* This side data should be associated with an audio stream and contains |
||||
* ReplayGain information in form of the AVReplayGain struct. |
||||
*/ |
||||
AV_PKT_DATA_REPLAYGAIN, |
||||
|
||||
/**
|
||||
* This side data contains a 3x3 transformation matrix describing an affine |
||||
* transformation that needs to be applied to the decoded video frames for |
||||
* correct presentation. |
||||
* |
||||
* See libavutil/display.h for a detailed description of the data. |
||||
*/ |
||||
AV_PKT_DATA_DISPLAYMATRIX, |
||||
|
||||
/**
|
||||
* This side data should be associated with a video stream and contains |
||||
* Stereoscopic 3D information in form of the AVStereo3D struct. |
||||
*/ |
||||
AV_PKT_DATA_STEREO3D, |
||||
|
||||
/**
|
||||
* This side data should be associated with an audio stream and corresponds |
||||
* to enum AVAudioServiceType. |
||||
*/ |
||||
AV_PKT_DATA_AUDIO_SERVICE_TYPE, |
||||
|
||||
/**
|
||||
* This side data contains quality related information from the encoder. |
||||
* @code |
||||
* u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). |
||||
* u8 picture type |
||||
* u8 error count |
||||
* u16 reserved |
||||
* u64le[error count] sum of squared differences between encoder in and output |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_QUALITY_STATS, |
||||
|
||||
/**
|
||||
* This side data contains an integer value representing the stream index |
||||
* of a "fallback" track. A fallback track indicates an alternate |
||||
* track to use when the current track can not be decoded for some reason. |
||||
* e.g. no decoder available for codec. |
||||
*/ |
||||
AV_PKT_DATA_FALLBACK_TRACK, |
||||
|
||||
/**
|
||||
* This side data corresponds to the AVCPBProperties struct. |
||||
*/ |
||||
AV_PKT_DATA_CPB_PROPERTIES, |
||||
|
||||
/**
|
||||
* Recommmends skipping the specified number of samples |
||||
* @code |
||||
* u32le number of samples to skip from start of this packet |
||||
* u32le number of samples to skip from end of this packet |
||||
* u8 reason for start skip |
||||
* u8 reason for end skip (0=padding silence, 1=convergence) |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_SKIP_SAMPLES, |
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_JP_DUALMONO side data packet indicates that |
||||
* the packet may contain "dual mono" audio specific to Japanese DTV |
||||
* and if it is true, recommends only the selected channel to be used. |
||||
* @code |
||||
* u8 selected channels (0=main/left, 1=sub/right, 2=both) |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_JP_DUALMONO, |
||||
|
||||
/**
|
||||
* A list of zero terminated key/value strings. There is no end marker for |
||||
* the list, so it is required to rely on the side data size to stop. |
||||
*/ |
||||
AV_PKT_DATA_STRINGS_METADATA, |
||||
|
||||
/**
|
||||
* Subtitle event position |
||||
* @code |
||||
* u32le x1 |
||||
* u32le y1 |
||||
* u32le x2 |
||||
* u32le y2 |
||||
* @endcode |
||||
*/ |
||||
AV_PKT_DATA_SUBTITLE_POSITION, |
||||
|
||||
/**
|
||||
* Data found in BlockAdditional element of matroska container. There is |
||||
* no end marker for the data, so it is required to rely on the side data |
||||
* size to recognize the end. 8 byte id (as found in BlockAddId) followed |
||||
* by data. |
||||
*/ |
||||
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, |
||||
|
||||
/**
|
||||
* The optional first identifier line of a WebVTT cue. |
||||
*/ |
||||
AV_PKT_DATA_WEBVTT_IDENTIFIER, |
||||
|
||||
/**
|
||||
* The optional settings (rendering instructions) that immediately |
||||
* follow the timestamp specifier of a WebVTT cue. |
||||
*/ |
||||
AV_PKT_DATA_WEBVTT_SETTINGS, |
||||
|
||||
/**
|
||||
* A list of zero terminated key/value strings. There is no end marker for |
||||
* the list, so it is required to rely on the side data size to stop. This |
||||
* side data includes updated metadata which appeared in the stream. |
||||
*/ |
||||
AV_PKT_DATA_METADATA_UPDATE, |
||||
|
||||
/**
|
||||
* MPEGTS stream ID as uint8_t, this is required to pass the stream ID |
||||
* information from the demuxer to the corresponding muxer. |
||||
*/ |
||||
AV_PKT_DATA_MPEGTS_STREAM_ID, |
||||
|
||||
/**
|
||||
* Mastering display metadata (based on SMPTE-2086:2014). This metadata |
||||
* should be associated with a video stream and contains data in the form |
||||
* of the AVMasteringDisplayMetadata struct. |
||||
*/ |
||||
AV_PKT_DATA_MASTERING_DISPLAY_METADATA, |
||||
|
||||
/**
|
||||
* This side data should be associated with a video stream and corresponds |
||||
* to the AVSphericalMapping structure. |
||||
*/ |
||||
AV_PKT_DATA_SPHERICAL, |
||||
|
||||
/**
|
||||
* Content light level (based on CTA-861.3). This metadata should be |
||||
* associated with a video stream and contains data in the form of the |
||||
* AVContentLightMetadata struct. |
||||
*/ |
||||
AV_PKT_DATA_CONTENT_LIGHT_LEVEL, |
||||
|
||||
/**
|
||||
* ATSC A53 Part 4 Closed Captions. This metadata should be associated with |
||||
* a video stream. A53 CC bitstream is stored as uint8_t in AVPacketSideData.data. |
||||
* The number of bytes of CC data is AVPacketSideData.size. |
||||
*/ |
||||
AV_PKT_DATA_A53_CC, |
||||
|
||||
/**
|
||||
* This side data is encryption initialization data. |
||||
* The format is not part of ABI, use av_encryption_init_info_* methods to |
||||
* access. |
||||
*/ |
||||
AV_PKT_DATA_ENCRYPTION_INIT_INFO, |
||||
|
||||
/**
|
||||
* This side data contains encryption info for how to decrypt the packet. |
||||
* The format is not part of ABI, use av_encryption_info_* methods to access. |
||||
*/ |
||||
AV_PKT_DATA_ENCRYPTION_INFO, |
||||
|
||||
/**
|
||||
* Active Format Description data consisting of a single byte as specified |
||||
* in ETSI TS 101 154 using AVActiveFormatDescription enum. |
||||
*/ |
||||
AV_PKT_DATA_AFD, |
||||
|
||||
/**
|
||||
* Producer Reference Time data corresponding to the AVProducerReferenceTime struct, |
||||
* usually exported by some encoders (on demand through the prft flag set in the |
||||
* AVCodecContext export_side_data field). |
||||
*/ |
||||
AV_PKT_DATA_PRFT, |
||||
|
||||
/**
|
||||
* ICC profile data consisting of an opaque octet buffer following the |
||||
* format described by ISO 15076-1. |
||||
*/ |
||||
AV_PKT_DATA_ICC_PROFILE, |
||||
|
||||
/**
|
||||
* DOVI configuration |
||||
* ref: |
||||
* dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2 |
||||
* dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3 |
||||
* Tags are stored in struct AVDOVIDecoderConfigurationRecord. |
||||
*/ |
||||
AV_PKT_DATA_DOVI_CONF, |
||||
|
||||
/**
|
||||
* Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 4 uint32_t |
||||
* where the first uint32_t describes how many (1-3) of the other timecodes are used. |
||||
* The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum() |
||||
* function in libavutil/timecode.h. |
||||
*/ |
||||
AV_PKT_DATA_S12M_TIMECODE, |
||||
|
||||
/**
|
||||
* HDR10+ dynamic metadata associated with a video frame. The metadata is in |
||||
* the form of the AVDynamicHDRPlus struct and contains |
||||
* information for color volume transform - application 4 of |
||||
* SMPTE 2094-40:2016 standard. |
||||
*/ |
||||
AV_PKT_DATA_DYNAMIC_HDR10_PLUS, |
||||
|
||||
/**
|
||||
* The number of side data types. |
||||
* This is not part of the public API/ABI in the sense that it may |
||||
* change when new side data types are added. |
||||
* This must stay the last enum value. |
||||
* If its value becomes huge, some code using it |
||||
* needs to be updated as it assumes it to be smaller than other limits. |
||||
*/ |
||||
AV_PKT_DATA_NB |
||||
}; |
||||
|
||||
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
|
||||
|
||||
typedef struct AVPacketSideData { |
||||
uint8_t *data; |
||||
size_t size; |
||||
enum AVPacketSideDataType type; |
||||
} AVPacketSideData; |
||||
|
||||
/**
|
||||
* This structure stores compressed data. It is typically exported by demuxers |
||||
* and then passed as input to decoders, or received as output from encoders and |
||||
* then passed to muxers. |
||||
* |
||||
* For video, it should typically contain one compressed frame. For audio it may |
||||
* contain several compressed frames. Encoders are allowed to output empty |
||||
* packets, with no compressed data, containing only side data |
||||
* (e.g. to update some stream parameters at the end of encoding). |
||||
* |
||||
* The semantics of data ownership depends on the buf field. |
||||
* If it is set, the packet data is dynamically allocated and is |
||||
* valid indefinitely until a call to av_packet_unref() reduces the |
||||
* reference count to 0. |
||||
* |
||||
* If the buf field is not set av_packet_ref() would make a copy instead |
||||
* of increasing the reference count. |
||||
* |
||||
* The side data is always allocated with av_malloc(), copied by |
||||
* av_packet_ref() and freed by av_packet_unref(). |
||||
* |
||||
* sizeof(AVPacket) being a part of the public ABI is deprecated. once |
||||
* av_init_packet() is removed, new packets will only be able to be allocated |
||||
* with av_packet_alloc(), and new fields may be added to the end of the struct |
||||
* with a minor bump. |
||||
* |
||||
* @see av_packet_alloc |
||||
* @see av_packet_ref |
||||
* @see av_packet_unref |
||||
*/ |
||||
typedef struct AVPacket { |
||||
/**
|
||||
* A reference to the reference-counted buffer where the packet data is |
||||
* stored. |
||||
* May be NULL, then the packet data is not reference-counted. |
||||
*/ |
||||
AVBufferRef *buf; |
||||
/**
|
||||
* Presentation timestamp in AVStream->time_base units; the time at which |
||||
* the decompressed packet will be presented to the user. |
||||
* Can be AV_NOPTS_VALUE if it is not stored in the file. |
||||
* pts MUST be larger or equal to dts as presentation cannot happen before |
||||
* decompression, unless one wants to view hex dumps. Some formats misuse |
||||
* the terms dts and pts/cts to mean something different. Such timestamps |
||||
* must be converted to true pts/dts before they are stored in AVPacket. |
||||
*/ |
||||
int64_t pts; |
||||
/**
|
||||
* Decompression timestamp in AVStream->time_base units; the time at which |
||||
* the packet is decompressed. |
||||
* Can be AV_NOPTS_VALUE if it is not stored in the file. |
||||
*/ |
||||
int64_t dts; |
||||
uint8_t *data; |
||||
int size; |
||||
int stream_index; |
||||
/**
|
||||
* A combination of AV_PKT_FLAG values |
||||
*/ |
||||
int flags; |
||||
/**
|
||||
* Additional packet data that can be provided by the container. |
||||
* Packet can contain several types of side information. |
||||
*/ |
||||
AVPacketSideData *side_data; |
||||
int side_data_elems; |
||||
|
||||
/**
|
||||
* Duration of this packet in AVStream->time_base units, 0 if unknown. |
||||
* Equals next_pts - this_pts in presentation order. |
||||
*/ |
||||
int64_t duration; |
||||
|
||||
int64_t pos; ///< byte position in stream, -1 if unknown
|
||||
|
||||
/**
|
||||
* for some private data of the user |
||||
*/ |
||||
void *opaque; |
||||
|
||||
/**
|
||||
* AVBufferRef for free use by the API user. FFmpeg will never check the |
||||
* contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when |
||||
* the packet is unreferenced. av_packet_copy_props() calls create a new |
||||
* reference with av_buffer_ref() for the target packet's opaque_ref field. |
||||
* |
||||
* This is unrelated to the opaque field, although it serves a similar |
||||
* purpose. |
||||
*/ |
||||
AVBufferRef *opaque_ref; |
||||
|
||||
/**
|
||||
* Time base of the packet's timestamps. |
||||
* In the future, this field may be set on packets output by encoders or |
||||
* demuxers, but its value will be by default ignored on input to decoders |
||||
* or muxers. |
||||
*/ |
||||
AVRational time_base; |
||||
} AVPacket; |
||||
|
||||
#if FF_API_INIT_PACKET |
||||
attribute_deprecated |
||||
typedef struct AVPacketList { |
||||
AVPacket pkt; |
||||
struct AVPacketList *next; |
||||
} AVPacketList; |
||||
#endif |
||||
|
||||
#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
|
||||
#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
|
||||
/**
|
||||
* Flag is used to discard packets which are required to maintain valid |
||||
* decoder state but are not required for output and should be dropped |
||||
* after decoding. |
||||
**/ |
||||
#define AV_PKT_FLAG_DISCARD 0x0004 |
||||
/**
|
||||
* The packet comes from a trusted source. |
||||
* |
||||
* Otherwise-unsafe constructs such as arbitrary pointers to data |
||||
* outside the packet may be followed. |
||||
*/ |
||||
#define AV_PKT_FLAG_TRUSTED 0x0008 |
||||
/**
|
||||
* Flag is used to indicate packets that contain frames that can |
||||
* be discarded by the decoder. I.e. Non-reference frames. |
||||
*/ |
||||
#define AV_PKT_FLAG_DISPOSABLE 0x0010 |
||||
|
||||
enum AVSideDataParamChangeFlags { |
||||
#if FF_API_OLD_CHANNEL_LAYOUT |
||||
/**
|
||||
* @deprecated those are not used by any decoder |
||||
*/ |
||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, |
||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, |
||||
#endif |
||||
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, |
||||
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, |
||||
}; |
||||
|
||||
/**
|
||||
* Allocate an AVPacket and set its fields to default values. The resulting |
||||
* struct must be freed using av_packet_free(). |
||||
* |
||||
* @return An AVPacket filled with default values or NULL on failure. |
||||
* |
||||
* @note this only allocates the AVPacket itself, not the data buffers. Those |
||||
* must be allocated through other means such as av_new_packet. |
||||
* |
||||
* @see av_new_packet |
||||
*/ |
||||
AVPacket *av_packet_alloc(void); |
||||
|
||||
/**
|
||||
* Create a new packet that references the same data as src. |
||||
* |
||||
* This is a shortcut for av_packet_alloc()+av_packet_ref(). |
||||
* |
||||
* @return newly created AVPacket on success, NULL on error. |
||||
* |
||||
* @see av_packet_alloc |
||||
* @see av_packet_ref |
||||
*/ |
||||
AVPacket *av_packet_clone(const AVPacket *src); |
||||
|
||||
/**
|
||||
* Free the packet, if the packet is reference counted, it will be |
||||
* unreferenced first. |
||||
* |
||||
* @param pkt packet to be freed. The pointer will be set to NULL. |
||||
* @note passing NULL is a no-op. |
||||
*/ |
||||
void av_packet_free(AVPacket **pkt); |
||||
|
||||
#if FF_API_INIT_PACKET |
||||
/**
|
||||
* Initialize optional fields of a packet with default values. |
||||
* |
||||
* Note, this does not touch the data and size members, which have to be |
||||
* initialized separately. |
||||
* |
||||
* @param pkt packet |
||||
* |
||||
* @see av_packet_alloc |
||||
* @see av_packet_unref |
||||
* |
||||
* @deprecated This function is deprecated. Once it's removed, |
||||
sizeof(AVPacket) will not be a part of the ABI anymore. |
||||
*/ |
||||
attribute_deprecated |
||||
void av_init_packet(AVPacket *pkt); |
||||
#endif |
||||
|
||||
/**
|
||||
* Allocate the payload of a packet and initialize its fields with |
||||
* default values. |
||||
* |
||||
* @param pkt packet |
||||
* @param size wanted payload size |
||||
* @return 0 if OK, AVERROR_xxx otherwise |
||||
*/ |
||||
int av_new_packet(AVPacket *pkt, int size); |
||||
|
||||
/**
|
||||
* Reduce packet size, correctly zeroing padding |
||||
* |
||||
* @param pkt packet |
||||
* @param size new size |
||||
*/ |
||||
void av_shrink_packet(AVPacket *pkt, int size); |
||||
|
||||
/**
|
||||
* Increase packet size, correctly zeroing padding |
||||
* |
||||
* @param pkt packet |
||||
* @param grow_by number of bytes by which to increase the size of the packet |
||||
*/ |
||||
int av_grow_packet(AVPacket *pkt, int grow_by); |
||||
|
||||
/**
|
||||
* Initialize a reference-counted packet from av_malloc()ed data. |
||||
* |
||||
* @param pkt packet to be initialized. This function will set the data, size, |
||||
* and buf fields, all others are left untouched. |
||||
* @param data Data allocated by av_malloc() to be used as packet data. If this |
||||
* function returns successfully, the data is owned by the underlying AVBuffer. |
||||
* The caller may not access the data through other means. |
||||
* @param size size of data in bytes, without the padding. I.e. the full buffer |
||||
* size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error |
||||
*/ |
||||
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); |
||||
|
||||
/**
|
||||
* Allocate new information of a packet. |
||||
* |
||||
* @param pkt packet |
||||
* @param type side information type |
||||
* @param size side information size |
||||
* @return pointer to fresh allocated data or NULL otherwise |
||||
*/ |
||||
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
||||
size_t size); |
||||
|
||||
/**
|
||||
* Wrap an existing array as a packet side data. |
||||
* |
||||
* @param pkt packet |
||||
* @param type side information type |
||||
* @param data the side data array. It must be allocated with the av_malloc() |
||||
* family of functions. The ownership of the data is transferred to |
||||
* pkt. |
||||
* @param size side information size |
||||
* @return a non-negative number on success, a negative AVERROR code on |
||||
* failure. On failure, the packet is unchanged and the data remains |
||||
* owned by the caller. |
||||
*/ |
||||
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
||||
uint8_t *data, size_t size); |
||||
|
||||
/**
|
||||
* Shrink the already allocated side data buffer |
||||
* |
||||
* @param pkt packet |
||||
* @param type side information type |
||||
* @param size new side information size |
||||
* @return 0 on success, < 0 on failure |
||||
*/ |
||||
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, |
||||
size_t size); |
||||
|
||||
/**
|
||||
* Get side information from packet. |
||||
* |
||||
* @param pkt packet |
||||
* @param type desired side information type |
||||
* @param size If supplied, *size will be set to the size of the side data |
||||
* or to zero if the desired side data is not present. |
||||
* @return pointer to data if present or NULL otherwise |
||||
*/ |
||||
uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, |
||||
size_t *size); |
||||
|
||||
const char *av_packet_side_data_name(enum AVPacketSideDataType type); |
||||
|
||||
/**
|
||||
* Pack a dictionary for use in side_data. |
||||
* |
||||
* @param dict The dictionary to pack. |
||||
* @param size pointer to store the size of the returned data |
||||
* @return pointer to data if successful, NULL otherwise |
||||
*/ |
||||
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size); |
||||
/**
|
||||
* Unpack a dictionary from side_data. |
||||
* |
||||
* @param data data from side_data |
||||
* @param size size of the data |
||||
* @param dict the metadata storage dictionary |
||||
* @return 0 on success, < 0 on failure |
||||
*/ |
||||
int av_packet_unpack_dictionary(const uint8_t *data, size_t size, |
||||
AVDictionary **dict); |
||||
|
||||
/**
|
||||
* Convenience function to free all the side data stored. |
||||
* All the other fields stay untouched. |
||||
* |
||||
* @param pkt packet |
||||
*/ |
||||
void av_packet_free_side_data(AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Setup a new reference to the data described by a given packet |
||||
* |
||||
* If src is reference-counted, setup dst as a new reference to the |
||||
* buffer in src. Otherwise allocate a new buffer in dst and copy the |
||||
* data from src into it. |
||||
* |
||||
* All the other fields are copied from src. |
||||
* |
||||
* @see av_packet_unref |
||||
* |
||||
* @param dst Destination packet. Will be completely overwritten. |
||||
* @param src Source packet |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error. On error, dst |
||||
* will be blank (as if returned by av_packet_alloc()). |
||||
*/ |
||||
int av_packet_ref(AVPacket *dst, const AVPacket *src); |
||||
|
||||
/**
|
||||
* Wipe the packet. |
||||
* |
||||
* Unreference the buffer referenced by the packet and reset the |
||||
* remaining packet fields to their default values. |
||||
* |
||||
* @param pkt The packet to be unreferenced. |
||||
*/ |
||||
void av_packet_unref(AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Move every field in src to dst and reset src. |
||||
* |
||||
* @see av_packet_unref |
||||
* |
||||
* @param src Source packet, will be reset |
||||
* @param dst Destination packet |
||||
*/ |
||||
void av_packet_move_ref(AVPacket *dst, AVPacket *src); |
||||
|
||||
/**
|
||||
* Copy only "properties" fields from src to dst. |
||||
* |
||||
* Properties for the purpose of this function are all the fields |
||||
* beside those related to the packet data (buf, data, size) |
||||
* |
||||
* @param dst Destination packet |
||||
* @param src Source packet |
||||
* |
||||
* @return 0 on success AVERROR on failure. |
||||
*/ |
||||
int av_packet_copy_props(AVPacket *dst, const AVPacket *src); |
||||
|
||||
/**
|
||||
* Ensure the data described by a given packet is reference counted. |
||||
* |
||||
* @note This function does not ensure that the reference will be writable. |
||||
* Use av_packet_make_writable instead for that purpose. |
||||
* |
||||
* @see av_packet_ref |
||||
* @see av_packet_make_writable |
||||
* |
||||
* @param pkt packet whose data should be made reference counted. |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error. On failure, the |
||||
* packet is unchanged. |
||||
*/ |
||||
int av_packet_make_refcounted(AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Create a writable reference for the data described by a given packet, |
||||
* avoiding data copy if possible. |
||||
* |
||||
* @param pkt Packet whose data should be made writable. |
||||
* |
||||
* @return 0 on success, a negative AVERROR on failure. On failure, the |
||||
* packet is unchanged. |
||||
*/ |
||||
int av_packet_make_writable(AVPacket *pkt); |
||||
|
||||
/**
|
||||
* Convert valid timing fields (timestamps / durations) in a packet from one |
||||
* timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be |
||||
* ignored. |
||||
* |
||||
* @param pkt packet on which the conversion will be performed |
||||
* @param tb_src source timebase, in which the timing fields in pkt are |
||||
* expressed |
||||
* @param tb_dst destination timebase, to which the timing fields will be |
||||
* converted |
||||
*/ |
||||
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif // AVCODEC_PACKET_H
|
@ -0,0 +1,195 @@ |
||||
/*
|
||||
* Video Acceleration API (shared data between FFmpeg and the video player) |
||||
* HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 |
||||
* |
||||
* Copyright (C) 2008-2009 Splitted-Desktop Systems |
||||
* |
||||
* 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_VAAPI_H |
||||
#define AVCODEC_VAAPI_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavc_codec_hwaccel_vaapi |
||||
* Public libavcodec VA API header. |
||||
*/ |
||||
|
||||
#include <stdint.h> |
||||
#include "libavutil/attributes.h" |
||||
#include "version.h" |
||||
|
||||
#if FF_API_STRUCT_VAAPI_CONTEXT |
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vaapi VA API Decoding |
||||
* @ingroup lavc_codec_hwaccel |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* This structure is used to share data between the FFmpeg library and |
||||
* the client video application. |
||||
* This shall be zero-allocated and available as |
||||
* AVCodecContext.hwaccel_context. All user members can be set once |
||||
* during initialization or through each AVCodecContext.get_buffer() |
||||
* function call. In any case, they must be valid prior to calling |
||||
* decoding functions. |
||||
* |
||||
* Deprecated: use AVCodecContext.hw_frames_ctx instead. |
||||
*/ |
||||
struct attribute_deprecated vaapi_context { |
||||
/**
|
||||
* Window system dependent data |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by user |
||||
*/ |
||||
void *display; |
||||
|
||||
/**
|
||||
* Configuration ID |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by user |
||||
*/ |
||||
uint32_t config_id; |
||||
|
||||
/**
|
||||
* Context ID (video decode pipeline) |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by user |
||||
*/ |
||||
uint32_t context_id; |
||||
|
||||
#if FF_API_VAAPI_CONTEXT |
||||
/**
|
||||
* VAPictureParameterBuffer ID |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t pic_param_buf_id; |
||||
|
||||
/**
|
||||
* VAIQMatrixBuffer ID |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t iq_matrix_buf_id; |
||||
|
||||
/**
|
||||
* VABitPlaneBuffer ID (for VC-1 decoding) |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t bitplane_buf_id; |
||||
|
||||
/**
|
||||
* Slice parameter/data buffer IDs |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t *slice_buf_ids; |
||||
|
||||
/**
|
||||
* Number of effective slice buffer IDs to send to the HW |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
unsigned int n_slice_buf_ids; |
||||
|
||||
/**
|
||||
* Size of pre-allocated slice_buf_ids |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
unsigned int slice_buf_ids_alloc; |
||||
|
||||
/**
|
||||
* Pointer to VASliceParameterBuffers |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
void *slice_params; |
||||
|
||||
/**
|
||||
* Size of a VASliceParameterBuffer element |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
unsigned int slice_param_size; |
||||
|
||||
/**
|
||||
* Size of pre-allocated slice_params |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
unsigned int slice_params_alloc; |
||||
|
||||
/**
|
||||
* Number of slices currently filled in |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
unsigned int slice_count; |
||||
|
||||
/**
|
||||
* Pointer to slice data buffer base |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
const uint8_t *slice_data; |
||||
|
||||
/**
|
||||
* Current size of slice data |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set by libavcodec |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t slice_data_size; |
||||
#endif |
||||
}; |
||||
|
||||
/* @} */ |
||||
|
||||
#endif /* FF_API_STRUCT_VAAPI_CONTEXT */ |
||||
|
||||
#endif /* AVCODEC_VAAPI_H */ |
@ -0,0 +1,230 @@ |
||||
/*
|
||||
* VDA HW acceleration |
||||
* |
||||
* copyright (c) 2011 Sebastien Zwickert |
||||
* |
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVCODEC_VDA_H |
||||
#define AVCODEC_VDA_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavc_codec_hwaccel_vda |
||||
* Public libavcodec VDA header. |
||||
*/ |
||||
|
||||
#include "libavcodec/avcodec.h" |
||||
|
||||
#include <stdint.h> |
||||
|
||||
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
|
||||
// http://openradar.appspot.com/8026390
|
||||
#undef __GNUC_STDC_INLINE__ |
||||
|
||||
#define Picture QuickdrawPicture |
||||
#include <VideoDecodeAcceleration/VDADecoder.h> |
||||
#undef Picture |
||||
|
||||
#include "libavcodec/version.h" |
||||
|
||||
// extra flags not defined in VDADecoder.h
|
||||
enum { |
||||
kVDADecodeInfo_Asynchronous = 1UL << 0, |
||||
kVDADecodeInfo_FrameDropped = 1UL << 1 |
||||
}; |
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vda VDA |
||||
* @ingroup lavc_codec_hwaccel |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* This structure is used to provide the necessary configurations and data |
||||
* to the VDA FFmpeg HWAccel implementation. |
||||
* |
||||
* The application must make it available as AVCodecContext.hwaccel_context. |
||||
*/ |
||||
struct vda_context { |
||||
/**
|
||||
* VDA decoder object. |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set/Unset by libavcodec. |
||||
*/ |
||||
VDADecoder decoder; |
||||
|
||||
/**
|
||||
* The Core Video pixel buffer that contains the current image data. |
||||
* |
||||
* encoding: unused |
||||
* decoding: Set by libavcodec. Unset by user. |
||||
*/ |
||||
CVPixelBufferRef cv_buffer; |
||||
|
||||
/**
|
||||
* Use the hardware decoder in synchronous mode. |
||||
* |
||||
* encoding: unused |
||||
* decoding: Set by user. |
||||
*/ |
||||
int use_sync_decoding; |
||||
|
||||
/**
|
||||
* The frame width. |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set/Unset by user. |
||||
*/ |
||||
int width; |
||||
|
||||
/**
|
||||
* The frame height. |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set/Unset by user. |
||||
*/ |
||||
int height; |
||||
|
||||
/**
|
||||
* The frame format. |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set/Unset by user. |
||||
*/ |
||||
int format; |
||||
|
||||
/**
|
||||
* The pixel format for output image buffers. |
||||
* |
||||
* - encoding: unused |
||||
* - decoding: Set/Unset by user. |
||||
*/ |
||||
OSType cv_pix_fmt_type; |
||||
|
||||
/**
|
||||
* unused |
||||
*/ |
||||
uint8_t *priv_bitstream; |
||||
|
||||
/**
|
||||
* unused |
||||
*/ |
||||
int priv_bitstream_size; |
||||
|
||||
/**
|
||||
* unused |
||||
*/ |
||||
int priv_allocated_size; |
||||
|
||||
/**
|
||||
* Use av_buffer to manage buffer. |
||||
* When the flag is set, the CVPixelBuffers returned by the decoder will |
||||
* be released automatically, so you have to retain them if necessary. |
||||
* Not setting this flag may cause memory leak. |
||||
* |
||||
* encoding: unused |
||||
* decoding: Set by user. |
||||
*/ |
||||
int use_ref_buffer; |
||||
}; |
||||
|
||||
/** Create the video decoder. */ |
||||
int ff_vda_create_decoder(struct vda_context *vda_ctx, |
||||
uint8_t *extradata, |
||||
int extradata_size); |
||||
|
||||
/** Destroy the video decoder. */ |
||||
int ff_vda_destroy_decoder(struct vda_context *vda_ctx); |
||||
|
||||
/**
|
||||
* This struct holds all the information that needs to be passed |
||||
* between the caller and libavcodec for initializing VDA decoding. |
||||
* Its size is not a part of the public ABI, it must be allocated with |
||||
* av_vda_alloc_context() and freed with av_free(). |
||||
*/ |
||||
typedef struct AVVDAContext { |
||||
/**
|
||||
* VDA decoder object. Created and freed by the caller. |
||||
*/ |
||||
VDADecoder decoder; |
||||
|
||||
/**
|
||||
* The output callback that must be passed to VDADecoderCreate. |
||||
* Set by av_vda_alloc_context(). |
||||
*/ |
||||
VDADecoderOutputCallback output_callback; |
||||
|
||||
/**
|
||||
* CVPixelBuffer Format Type that VDA will use for decoded frames; set by |
||||
* the caller. |
||||
*/ |
||||
OSType cv_pix_fmt_type; |
||||
} AVVDAContext; |
||||
|
||||
/**
|
||||
* Allocate and initialize a VDA context. |
||||
* |
||||
* This function should be called from the get_format() callback when the caller |
||||
* selects the AV_PIX_FMT_VDA format. The caller must then create the decoder |
||||
* object (using the output callback provided by libavcodec) that will be used |
||||
* for VDA-accelerated decoding. |
||||
* |
||||
* When decoding with VDA is finished, the caller must destroy the decoder |
||||
* object and free the VDA context using av_free(). |
||||
* |
||||
* @return the newly allocated context or NULL on failure |
||||
*/ |
||||
AVVDAContext *av_vda_alloc_context(void); |
||||
|
||||
/**
|
||||
* This is a convenience function that creates and sets up the VDA context using |
||||
* an internal implementation. |
||||
* |
||||
* @param avctx the corresponding codec context |
||||
* |
||||
* @return >= 0 on success, a negative AVERROR code on failure |
||||
*/ |
||||
int av_vda_default_init(AVCodecContext *avctx); |
||||
|
||||
/**
|
||||
* This is a convenience function that creates and sets up the VDA context using |
||||
* an internal implementation. |
||||
* |
||||
* @param avctx the corresponding codec context |
||||
* @param vdactx the VDA context to use |
||||
* |
||||
* @return >= 0 on success, a negative AVERROR code on failure |
||||
*/ |
||||
int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx); |
||||
|
||||
/**
|
||||
* This function must be called to free the VDA context initialized with |
||||
* av_vda_default_init(). |
||||
* |
||||
* @param avctx the corresponding codec context |
||||
*/ |
||||
void av_vda_default_free(AVCodecContext *avctx); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVCODEC_VDA_H */ |
@ -1,52 +0,0 @@ |
||||
/*
|
||||
* 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_VERSION_MAJOR_H |
||||
#define AVCODEC_VERSION_MAJOR_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup libavc |
||||
* Libavcodec version macros. |
||||
*/ |
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 60 |
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
* |
||||
* @note, when bumping the major version it is recommended to manually |
||||
* disable each FF_API_* in its own commit instead of disabling them all |
||||
* at once through the bump. This improves the git bisect-ability of the change. |
||||
*/ |
||||
|
||||
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
#define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
|
||||
// reminder to remove CrystalHD decoders on next major bump
|
||||
#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) |
||||
|
||||
#endif /* AVCODEC_VERSION_MAJOR_H */ |
@ -1,38 +0,0 @@ |
||||
/*
|
||||
* Version macros. |
||||
* |
||||
* 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 AVFILTER_VERSION_MAJOR_H |
||||
#define AVFILTER_VERSION_MAJOR_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavfi |
||||
* Libavfilter version macros |
||||
*/ |
||||
|
||||
#define LIBAVFILTER_VERSION_MAJOR 9 |
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
*/ |
||||
|
||||
#endif /* AVFILTER_VERSION_MAJOR_H */ |
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@ |
||||
/*
|
||||
* Version macros. |
||||
* |
||||
* 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_VERSION_MAJOR_H |
||||
#define AVFORMAT_VERSION_MAJOR_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup libavf |
||||
* Libavformat version macros |
||||
*/ |
||||
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 60 |
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
* |
||||
* @note, when bumping the major version it is recommended to manually |
||||
* disable each FF_API_* in its own commit instead of disabling them all |
||||
* at once through the bump. This improves the git bisect-ability of the change. |
||||
* |
||||
*/ |
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61) |
||||
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 61) |
||||
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 61) |
||||
#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61) |
||||
|
||||
|
||||
#define FF_API_R_FRAME_RATE 1 |
||||
|
||||
#endif /* AVFORMAT_VERSION_MAJOR_H */ |
@ -1,72 +0,0 @@ |
||||
/*
|
||||
* Copyright (c) 2023 Jan Ekström <jeebjp@gmail.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_AMBIENT_VIEWING_ENVIRONMENT_H |
||||
#define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H |
||||
|
||||
#include <stddef.h> |
||||
#include "frame.h" |
||||
#include "rational.h" |
||||
|
||||
/**
|
||||
* Ambient viewing environment metadata as defined by H.274. The values are |
||||
* saved in AVRationals so that they keep their exactness, while allowing for |
||||
* easy access to a double value with f.ex. av_q2d. |
||||
* |
||||
* @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and |
||||
* it must be allocated using av_ambient_viewing_environment_alloc. |
||||
*/ |
||||
typedef struct AVAmbientViewingEnvironment { |
||||
/**
|
||||
* Environmental illuminance of the ambient viewing environment in lux. |
||||
*/ |
||||
AVRational ambient_illuminance; |
||||
|
||||
/**
|
||||
* Normalized x chromaticity coordinate of the environmental ambient light |
||||
* in the nominal viewing environment according to the CIE 1931 definition |
||||
* of x and y as specified in ISO/CIE 11664-1. |
||||
*/ |
||||
AVRational ambient_light_x; |
||||
|
||||
/**
|
||||
* Normalized y chromaticity coordinate of the environmental ambient light |
||||
* in the nominal viewing environment according to the CIE 1931 definition |
||||
* of x and y as specified in ISO/CIE 11664-1. |
||||
*/ |
||||
AVRational ambient_light_y; |
||||
} AVAmbientViewingEnvironment; |
||||
|
||||
/**
|
||||
* Allocate an AVAmbientViewingEnvironment structure. |
||||
* |
||||
* @return the newly allocated struct or NULL on failure |
||||
*/ |
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* Allocate and add an AVAmbientViewingEnvironment structure to an existing |
||||
* AVFrame as side data. |
||||
* |
||||
* @return the newly allocated struct, or NULL on failure |
||||
*/ |
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame); |
||||
|
||||
#endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */ |
@ -1,150 +0,0 @@ |
||||
/*
|
||||
* Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com> |
||||
* Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com> |
||||
* Copyright (c) 2023 Leo Izen <leo.izen@gmail.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_CSP_H |
||||
#define AVUTIL_CSP_H |
||||
|
||||
#include "pixfmt.h" |
||||
#include "rational.h" |
||||
|
||||
/**
|
||||
* @file |
||||
* Colorspace value utility functions for libavutil. |
||||
* @ingroup lavu_math_csp |
||||
* @author Ronald S. Bultje <rsbultje@gmail.com> |
||||
* @author Leo Izen <leo.izen@gmail.com> |
||||
* @author Kevin Wheatley <kevin.j.wheatley@gmail.com> |
||||
*/ |
||||
|
||||
/**
|
||||
* @defgroup lavu_math_csp Colorspace Utility |
||||
* @ingroup lavu_math |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Struct containing luma coefficients to be used for RGB to YUV/YCoCg, or similar |
||||
* calculations. |
||||
*/ |
||||
typedef struct AVLumaCoefficients { |
||||
AVRational cr, cg, cb; |
||||
} AVLumaCoefficients; |
||||
|
||||
/**
|
||||
* Struct containing chromaticity x and y values for the standard CIE 1931 |
||||
* chromaticity definition. |
||||
*/ |
||||
typedef struct AVCIExy { |
||||
AVRational x, y; |
||||
} AVCIExy; |
||||
|
||||
/**
|
||||
* Struct defining the red, green, and blue primary locations in terms of CIE |
||||
* 1931 chromaticity x and y. |
||||
*/ |
||||
typedef struct AVPrimaryCoefficients { |
||||
AVCIExy r, g, b; |
||||
} AVPrimaryCoefficients; |
||||
|
||||
/**
|
||||
* Struct defining white point location in terms of CIE 1931 chromaticity x |
||||
* and y. |
||||
*/ |
||||
typedef AVCIExy AVWhitepointCoefficients; |
||||
|
||||
/**
|
||||
* Struct that contains both white point location and primaries location, providing |
||||
* the complete description of a color gamut. |
||||
*/ |
||||
typedef struct AVColorPrimariesDesc { |
||||
AVWhitepointCoefficients wp; |
||||
AVPrimaryCoefficients prim; |
||||
} AVColorPrimariesDesc; |
||||
|
||||
/**
|
||||
* Function pointer representing a double -> double transfer function that performs |
||||
* an EOTF transfer inversion. This function outputs linear light. |
||||
*/ |
||||
typedef double (*av_csp_trc_function)(double); |
||||
|
||||
/**
|
||||
* Retrieves the Luma coefficients necessary to construct a conversion matrix |
||||
* from an enum constant describing the colorspace. |
||||
* @param csp An enum constant indicating YUV or similar colorspace. |
||||
* @return The Luma coefficients associated with that colorspace, or NULL |
||||
* if the constant is unknown to libavutil. |
||||
*/ |
||||
const AVLumaCoefficients *av_csp_luma_coeffs_from_avcsp(enum AVColorSpace csp); |
||||
|
||||
/**
|
||||
* Retrieves a complete gamut description from an enum constant describing the |
||||
* color primaries. |
||||
* @param prm An enum constant indicating primaries |
||||
* @return A description of the colorspace gamut associated with that enum |
||||
* constant, or NULL if the constant is unknown to libavutil. |
||||
*/ |
||||
const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries prm); |
||||
|
||||
/**
|
||||
* Detects which enum AVColorPrimaries constant corresponds to the given complete |
||||
* gamut description. |
||||
* @see enum AVColorPrimaries |
||||
* @param prm A description of the colorspace gamut |
||||
* @return The enum constant associated with this gamut, or |
||||
* AVCOL_PRI_UNSPECIFIED if no clear match can be idenitified. |
||||
*/ |
||||
enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm); |
||||
|
||||
/**
|
||||
* Determine a suitable 'gamma' value to match the supplied |
||||
* AVColorTransferCharacteristic. |
||||
* |
||||
* See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html)
|
||||
* |
||||
* This function returns the gamma exponent for the OETF. For example, sRGB is approximated |
||||
* by gamma 2.2, not by gamma 0.45455. |
||||
* |
||||
* @return Will return an approximation to the simple gamma function matching |
||||
* the supplied Transfer Characteristic, Will return 0.0 for any |
||||
* we cannot reasonably match against. |
||||
*/ |
||||
double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc); |
||||
|
||||
/**
|
||||
* Determine the function needed to apply the given |
||||
* AVColorTransferCharacteristic to linear input. |
||||
* |
||||
* The function returned should expect a nominal domain and range of [0.0-1.0] |
||||
* values outside of this range maybe valid depending on the chosen |
||||
* characteristic function. |
||||
* |
||||
* @return Will return pointer to the function matching the |
||||
* supplied Transfer Characteristic. If unspecified will |
||||
* return NULL: |
||||
*/ |
||||
av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_CSP_H */ |
@ -1,108 +0,0 @@ |
||||
/*
|
||||
* 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_DETECTION_BBOX_H |
||||
#define AVUTIL_DETECTION_BBOX_H |
||||
|
||||
#include "rational.h" |
||||
#include "avassert.h" |
||||
#include "frame.h" |
||||
|
||||
typedef struct AVDetectionBBox { |
||||
/**
|
||||
* Distance in pixels from the left/top edge of the frame, |
||||
* together with width and height, defining the bounding box. |
||||
*/ |
||||
int x; |
||||
int y; |
||||
int w; |
||||
int h; |
||||
|
||||
#define AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE 64 |
||||
|
||||
/**
|
||||
* Detect result with confidence |
||||
*/ |
||||
char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]; |
||||
AVRational detect_confidence; |
||||
|
||||
/**
|
||||
* At most 4 classifications based on the detected bounding box. |
||||
* For example, we can get max 4 different attributes with 4 different |
||||
* DNN models on one bounding box. |
||||
* classify_count is zero if no classification. |
||||
*/ |
||||
#define AV_NUM_DETECTION_BBOX_CLASSIFY 4 |
||||
uint32_t classify_count; |
||||
char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE]; |
||||
AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY]; |
||||
} AVDetectionBBox; |
||||
|
||||
typedef struct AVDetectionBBoxHeader { |
||||
/**
|
||||
* Information about how the bounding box is generated. |
||||
* for example, the DNN model name. |
||||
*/ |
||||
char source[256]; |
||||
|
||||
/**
|
||||
* Number of bounding boxes in the array. |
||||
*/ |
||||
uint32_t nb_bboxes; |
||||
|
||||
/**
|
||||
* Offset in bytes from the beginning of this structure at which |
||||
* the array of bounding boxes starts. |
||||
*/ |
||||
size_t bboxes_offset; |
||||
|
||||
/**
|
||||
* Size of each bounding box in bytes. |
||||
*/ |
||||
size_t bbox_size; |
||||
} AVDetectionBBoxHeader; |
||||
|
||||
/*
|
||||
* Get the bounding box at the specified {@code idx}. Must be between 0 and nb_bboxes. |
||||
*/ |
||||
static av_always_inline AVDetectionBBox * |
||||
av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx) |
||||
{ |
||||
av_assert0(idx < header->nb_bboxes); |
||||
return (AVDetectionBBox *)((uint8_t *)header + header->bboxes_offset + |
||||
idx * header->bbox_size); |
||||
} |
||||
|
||||
/**
|
||||
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes} |
||||
* AVDetectionBBox, and initializes the variables. |
||||
* Can be freed with a normal av_free() call. |
||||
* |
||||
* @param nb_bboxes number of AVDetectionBBox structures to allocate |
||||
* @param out_size if non-NULL, the size in bytes of the resulting data array is |
||||
* written here. |
||||
*/ |
||||
AVDetectionBBoxHeader *av_detection_bbox_alloc(uint32_t nb_bboxes, size_t *out_size); |
||||
|
||||
/**
|
||||
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes} |
||||
* AVDetectionBBox, in the given AVFrame {@code frame} as AVFrameSideData of type |
||||
* AV_FRAME_DATA_DETECTION_BBOXES and initializes the variables. |
||||
*/ |
||||
AVDetectionBBoxHeader *av_detection_bbox_create_side_data(AVFrame *frame, uint32_t nb_bboxes); |
||||
#endif |
@ -1,236 +0,0 @@ |
||||
/*
|
||||
* Copyright (c) 2020 Vacing Fang <vacingfang@tencent.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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* DOVI configuration |
||||
*/ |
||||
|
||||
|
||||
#ifndef AVUTIL_DOVI_META_H |
||||
#define AVUTIL_DOVI_META_H |
||||
|
||||
#include <stdint.h> |
||||
#include <stddef.h> |
||||
#include "rational.h" |
||||
|
||||
/*
|
||||
* DOVI configuration |
||||
* ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2 |
||||
dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2 |
||||
* @code |
||||
* uint8_t dv_version_major, the major version number that the stream complies with |
||||
* uint8_t dv_version_minor, the minor version number that the stream complies with |
||||
* uint8_t dv_profile, the Dolby Vision profile |
||||
* uint8_t dv_level, the Dolby Vision level |
||||
* uint8_t rpu_present_flag |
||||
* uint8_t el_present_flag |
||||
* uint8_t bl_present_flag |
||||
* uint8_t dv_bl_signal_compatibility_id |
||||
* @endcode |
||||
* |
||||
* @note The struct must be allocated with av_dovi_alloc() and |
||||
* its size is not a part of the public ABI. |
||||
*/ |
||||
typedef struct AVDOVIDecoderConfigurationRecord { |
||||
uint8_t dv_version_major; |
||||
uint8_t dv_version_minor; |
||||
uint8_t dv_profile; |
||||
uint8_t dv_level; |
||||
uint8_t rpu_present_flag; |
||||
uint8_t el_present_flag; |
||||
uint8_t bl_present_flag; |
||||
uint8_t dv_bl_signal_compatibility_id; |
||||
} AVDOVIDecoderConfigurationRecord; |
||||
|
||||
/**
|
||||
* Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its |
||||
* fields to default values. |
||||
* |
||||
* @return the newly allocated struct or NULL on failure |
||||
*/ |
||||
AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* Dolby Vision RPU data header. |
||||
* |
||||
* @note sizeof(AVDOVIRpuDataHeader) is not part of the public ABI. |
||||
*/ |
||||
typedef struct AVDOVIRpuDataHeader { |
||||
uint8_t rpu_type; |
||||
uint16_t rpu_format; |
||||
uint8_t vdr_rpu_profile; |
||||
uint8_t vdr_rpu_level; |
||||
uint8_t chroma_resampling_explicit_filter_flag; |
||||
uint8_t coef_data_type; /* informative, lavc always converts to fixed */ |
||||
uint8_t coef_log2_denom; |
||||
uint8_t vdr_rpu_normalized_idc; |
||||
uint8_t bl_video_full_range_flag; |
||||
uint8_t bl_bit_depth; /* [8, 16] */ |
||||
uint8_t el_bit_depth; /* [8, 16] */ |
||||
uint8_t vdr_bit_depth; /* [8, 16] */ |
||||
uint8_t spatial_resampling_filter_flag; |
||||
uint8_t el_spatial_resampling_filter_flag; |
||||
uint8_t disable_residual_flag; |
||||
} AVDOVIRpuDataHeader; |
||||
|
||||
enum AVDOVIMappingMethod { |
||||
AV_DOVI_MAPPING_POLYNOMIAL = 0, |
||||
AV_DOVI_MAPPING_MMR = 1, |
||||
}; |
||||
|
||||
/**
|
||||
* Coefficients of a piece-wise function. The pieces of the function span the |
||||
* value ranges between two adjacent pivot values. |
||||
*/ |
||||
#define AV_DOVI_MAX_PIECES 8 |
||||
typedef struct AVDOVIReshapingCurve { |
||||
uint8_t num_pivots; /* [2, 9] */ |
||||
uint16_t pivots[AV_DOVI_MAX_PIECES + 1]; /* sorted ascending */ |
||||
enum AVDOVIMappingMethod mapping_idc[AV_DOVI_MAX_PIECES]; |
||||
/* AV_DOVI_MAPPING_POLYNOMIAL */ |
||||
uint8_t poly_order[AV_DOVI_MAX_PIECES]; /* [1, 2] */ |
||||
int64_t poly_coef[AV_DOVI_MAX_PIECES][3]; /* x^0, x^1, x^2 */ |
||||
/* AV_DOVI_MAPPING_MMR */ |
||||
uint8_t mmr_order[AV_DOVI_MAX_PIECES]; /* [1, 3] */ |
||||
int64_t mmr_constant[AV_DOVI_MAX_PIECES]; |
||||
int64_t mmr_coef[AV_DOVI_MAX_PIECES][3/* order - 1 */][7]; |
||||
} AVDOVIReshapingCurve; |
||||
|
||||
enum AVDOVINLQMethod { |
||||
AV_DOVI_NLQ_NONE = -1, |
||||
AV_DOVI_NLQ_LINEAR_DZ = 0, |
||||
}; |
||||
|
||||
/**
|
||||
* Coefficients of the non-linear inverse quantization. For the interpretation |
||||
* of these, see ETSI GS CCM 001. |
||||
*/ |
||||
typedef struct AVDOVINLQParams { |
||||
uint16_t nlq_offset; |
||||
uint64_t vdr_in_max; |
||||
/* AV_DOVI_NLQ_LINEAR_DZ */ |
||||
uint64_t linear_deadzone_slope; |
||||
uint64_t linear_deadzone_threshold; |
||||
} AVDOVINLQParams; |
||||
|
||||
/**
|
||||
* Dolby Vision RPU data mapping parameters. |
||||
* |
||||
* @note sizeof(AVDOVIDataMapping) is not part of the public ABI. |
||||
*/ |
||||
typedef struct AVDOVIDataMapping { |
||||
uint8_t vdr_rpu_id; |
||||
uint8_t mapping_color_space; |
||||
uint8_t mapping_chroma_format_idc; |
||||
AVDOVIReshapingCurve curves[3]; /* per component */ |
||||
|
||||
/* Non-linear inverse quantization */ |
||||
enum AVDOVINLQMethod nlq_method_idc; |
||||
uint32_t num_x_partitions; |
||||
uint32_t num_y_partitions; |
||||
AVDOVINLQParams nlq[3]; /* per component */ |
||||
} AVDOVIDataMapping; |
||||
|
||||
/**
|
||||
* Dolby Vision RPU colorspace metadata parameters. |
||||
* |
||||
* @note sizeof(AVDOVIColorMetadata) is not part of the public ABI. |
||||
*/ |
||||
typedef struct AVDOVIColorMetadata { |
||||
uint8_t dm_metadata_id; |
||||
uint8_t scene_refresh_flag; |
||||
|
||||
/**
|
||||
* Coefficients of the custom Dolby Vision IPT-PQ matrices. These are to be |
||||
* used instead of the matrices indicated by the frame's colorspace tags. |
||||
* The output of rgb_to_lms_matrix is to be fed into a BT.2020 LMS->RGB |
||||
* matrix based on a Hunt-Pointer-Estevez transform, but without any |
||||
* crosstalk. (See the definition of the ICtCp colorspace for more |
||||
* information.) |
||||
*/ |
||||
AVRational ycc_to_rgb_matrix[9]; /* before PQ linearization */ |
||||
AVRational ycc_to_rgb_offset[3]; /* input offset of neutral value */ |
||||
AVRational rgb_to_lms_matrix[9]; /* after PQ linearization */ |
||||
|
||||
/**
|
||||
* Extra signal metadata (see Dolby patents for more info). |
||||
*/ |
||||
uint16_t signal_eotf; |
||||
uint16_t signal_eotf_param0; |
||||
uint16_t signal_eotf_param1; |
||||
uint32_t signal_eotf_param2; |
||||
uint8_t signal_bit_depth; |
||||
uint8_t signal_color_space; |
||||
uint8_t signal_chroma_format; |
||||
uint8_t signal_full_range_flag; /* [0, 3] */ |
||||
uint16_t source_min_pq; |
||||
uint16_t source_max_pq; |
||||
uint16_t source_diagonal; |
||||
} AVDOVIColorMetadata; |
||||
|
||||
/**
|
||||
* Combined struct representing a combination of header, mapping and color |
||||
* metadata, for attaching to frames as side data. |
||||
* |
||||
* @note The struct must be allocated with av_dovi_metadata_alloc() and |
||||
* its size is not a part of the public ABI. |
||||
*/ |
||||
|
||||
typedef struct AVDOVIMetadata { |
||||
/**
|
||||
* Offset in bytes from the beginning of this structure at which the |
||||
* respective structs start. |
||||
*/ |
||||
size_t header_offset; /* AVDOVIRpuDataHeader */ |
||||
size_t mapping_offset; /* AVDOVIDataMapping */ |
||||
size_t color_offset; /* AVDOVIColorMetadata */ |
||||
} AVDOVIMetadata; |
||||
|
||||
static av_always_inline AVDOVIRpuDataHeader * |
||||
av_dovi_get_header(const AVDOVIMetadata *data) |
||||
{ |
||||
return (AVDOVIRpuDataHeader *)((uint8_t *) data + data->header_offset); |
||||
} |
||||
|
||||
static av_always_inline AVDOVIDataMapping * |
||||
av_dovi_get_mapping(const AVDOVIMetadata *data) |
||||
{ |
||||
return (AVDOVIDataMapping *)((uint8_t *) data + data->mapping_offset); |
||||
} |
||||
|
||||
static av_always_inline AVDOVIColorMetadata * |
||||
av_dovi_get_color(const AVDOVIMetadata *data) |
||||
{ |
||||
return (AVDOVIColorMetadata *)((uint8_t *) data + data->color_offset); |
||||
} |
||||
|
||||
/**
|
||||
* Allocate an AVDOVIMetadata structure and initialize its |
||||
* fields to default values. |
||||
* |
||||
* @param size If this parameter is non-NULL, the size in bytes of the |
||||
* allocated struct will be written here on success |
||||
* |
||||
* @return the newly allocated struct or NULL on failure |
||||
*/ |
||||
AVDOVIMetadata *av_dovi_metadata_alloc(size_t *size); |
||||
|
||||
#endif /* AVUTIL_DOVI_META_H */ |
@ -1,205 +0,0 @@ |
||||
/**
|
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_ENCRYPTION_INFO_H |
||||
#define AVUTIL_ENCRYPTION_INFO_H |
||||
|
||||
#include <stddef.h> |
||||
#include <stdint.h> |
||||
|
||||
typedef struct AVSubsampleEncryptionInfo { |
||||
/** The number of bytes that are clear. */ |
||||
unsigned int bytes_of_clear_data; |
||||
|
||||
/**
|
||||
* The number of bytes that are protected. If using pattern encryption, |
||||
* the pattern applies to only the protected bytes; if not using pattern |
||||
* encryption, all these bytes are encrypted. |
||||
*/ |
||||
unsigned int bytes_of_protected_data; |
||||
} AVSubsampleEncryptionInfo; |
||||
|
||||
/**
|
||||
* This describes encryption info for a packet. This contains frame-specific |
||||
* info for how to decrypt the packet before passing it to the decoder. |
||||
* |
||||
* The size of this struct is not part of the public ABI. |
||||
*/ |
||||
typedef struct AVEncryptionInfo { |
||||
/** The fourcc encryption scheme, in big-endian byte order. */ |
||||
uint32_t scheme; |
||||
|
||||
/**
|
||||
* Only used for pattern encryption. This is the number of 16-byte blocks |
||||
* that are encrypted. |
||||
*/ |
||||
uint32_t crypt_byte_block; |
||||
|
||||
/**
|
||||
* Only used for pattern encryption. This is the number of 16-byte blocks |
||||
* that are clear. |
||||
*/ |
||||
uint32_t skip_byte_block; |
||||
|
||||
/**
|
||||
* The ID of the key used to encrypt the packet. This should always be |
||||
* 16 bytes long, but may be changed in the future. |
||||
*/ |
||||
uint8_t *key_id; |
||||
uint32_t key_id_size; |
||||
|
||||
/**
|
||||
* The initialization vector. This may have been zero-filled to be the |
||||
* correct block size. This should always be 16 bytes long, but may be |
||||
* changed in the future. |
||||
*/ |
||||
uint8_t *iv; |
||||
uint32_t iv_size; |
||||
|
||||
/**
|
||||
* An array of subsample encryption info specifying how parts of the sample |
||||
* are encrypted. If there are no subsamples, then the whole sample is |
||||
* encrypted. |
||||
*/ |
||||
AVSubsampleEncryptionInfo *subsamples; |
||||
uint32_t subsample_count; |
||||
} AVEncryptionInfo; |
||||
|
||||
/**
|
||||
* This describes info used to initialize an encryption key system. |
||||
* |
||||
* The size of this struct is not part of the public ABI. |
||||
*/ |
||||
typedef struct AVEncryptionInitInfo { |
||||
/**
|
||||
* A unique identifier for the key system this is for, can be NULL if it |
||||
* is not known. This should always be 16 bytes, but may change in the |
||||
* future. |
||||
*/ |
||||
uint8_t* system_id; |
||||
uint32_t system_id_size; |
||||
|
||||
/**
|
||||
* An array of key IDs this initialization data is for. All IDs are the |
||||
* same length. Can be NULL if there are no known key IDs. |
||||
*/ |
||||
uint8_t** key_ids; |
||||
/** The number of key IDs. */ |
||||
uint32_t num_key_ids; |
||||
/**
|
||||
* The number of bytes in each key ID. This should always be 16, but may |
||||
* change in the future. |
||||
*/ |
||||
uint32_t key_id_size; |
||||
|
||||
/**
|
||||
* Key-system specific initialization data. This data is copied directly |
||||
* from the file and the format depends on the specific key system. This |
||||
* can be NULL if there is no initialization data; in that case, there |
||||
* will be at least one key ID. |
||||
*/ |
||||
uint8_t* data; |
||||
uint32_t data_size; |
||||
|
||||
/**
|
||||
* An optional pointer to the next initialization info in the list. |
||||
*/ |
||||
struct AVEncryptionInitInfo *next; |
||||
} AVEncryptionInitInfo; |
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInfo structure and sub-pointers to hold the given |
||||
* number of subsamples. This will allocate pointers for the key ID, IV, |
||||
* and subsample entries, set the size members, and zero-initialize the rest. |
||||
* |
||||
* @param subsample_count The number of subsamples. |
||||
* @param key_id_size The number of bytes in the key ID, should be 16. |
||||
* @param iv_size The number of bytes in the IV, should be 16. |
||||
* |
||||
* @return The new AVEncryptionInfo structure, or NULL on error. |
||||
*/ |
||||
AVEncryptionInfo *av_encryption_info_alloc(uint32_t subsample_count, uint32_t key_id_size, uint32_t iv_size); |
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInfo structure with a copy of the given data. |
||||
* @return The new AVEncryptionInfo structure, or NULL on error. |
||||
*/ |
||||
AVEncryptionInfo *av_encryption_info_clone(const AVEncryptionInfo *info); |
||||
|
||||
/**
|
||||
* Frees the given encryption info object. This MUST NOT be used to free the |
||||
* side-data data pointer, that should use normal side-data methods. |
||||
*/ |
||||
void av_encryption_info_free(AVEncryptionInfo *info); |
||||
|
||||
/**
|
||||
* Creates a copy of the AVEncryptionInfo that is contained in the given side |
||||
* data. The resulting object should be passed to av_encryption_info_free() |
||||
* when done. |
||||
* |
||||
* @return The new AVEncryptionInfo structure, or NULL on error. |
||||
*/ |
||||
AVEncryptionInfo *av_encryption_info_get_side_data(const uint8_t *side_data, size_t side_data_size); |
||||
|
||||
/**
|
||||
* Allocates and initializes side data that holds a copy of the given encryption |
||||
* info. The resulting pointer should be either freed using av_free or given |
||||
* to av_packet_add_side_data(). |
||||
* |
||||
* @return The new side-data pointer, or NULL. |
||||
*/ |
||||
uint8_t *av_encryption_info_add_side_data( |
||||
const AVEncryptionInfo *info, size_t *side_data_size); |
||||
|
||||
|
||||
/**
|
||||
* Allocates an AVEncryptionInitInfo structure and sub-pointers to hold the |
||||
* given sizes. This will allocate pointers and set all the fields. |
||||
* |
||||
* @return The new AVEncryptionInitInfo structure, or NULL on error. |
||||
*/ |
||||
AVEncryptionInitInfo *av_encryption_init_info_alloc( |
||||
uint32_t system_id_size, uint32_t num_key_ids, uint32_t key_id_size, uint32_t data_size); |
||||
|
||||
/**
|
||||
* Frees the given encryption init info object. This MUST NOT be used to free |
||||
* the side-data data pointer, that should use normal side-data methods. |
||||
*/ |
||||
void av_encryption_init_info_free(AVEncryptionInitInfo* info); |
||||
|
||||
/**
|
||||
* Creates a copy of the AVEncryptionInitInfo that is contained in the given |
||||
* side data. The resulting object should be passed to |
||||
* av_encryption_init_info_free() when done. |
||||
* |
||||
* @return The new AVEncryptionInitInfo structure, or NULL on error. |
||||
*/ |
||||
AVEncryptionInitInfo *av_encryption_init_info_get_side_data( |
||||
const uint8_t* side_data, size_t side_data_size); |
||||
|
||||
/**
|
||||
* Allocates and initializes side data that holds a copy of the given encryption |
||||
* init info. The resulting pointer should be either freed using av_free or |
||||
* given to av_packet_add_side_data(). |
||||
* |
||||
* @return The new side-data pointer, or NULL. |
||||
*/ |
||||
uint8_t *av_encryption_init_info_add_side_data( |
||||
const AVEncryptionInitInfo *info, size_t *side_data_size); |
||||
|
||||
#endif /* AVUTIL_ENCRYPTION_INFO_H */ |
@ -1,5 +1,5 @@ |
||||
/* Automatically generated by version.sh, do not manually edit! */ |
||||
#ifndef AVUTIL_FFVERSION_H |
||||
#define AVUTIL_FFVERSION_H |
||||
#define FFMPEG_VERSION "6.0" |
||||
#define FFMPEG_VERSION "3.4.8" |
||||
#endif /* AVUTIL_FFVERSION_H */ |
||||
|
@ -1,260 +0,0 @@ |
||||
/*
|
||||
* 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_FILM_GRAIN_PARAMS_H |
||||
#define AVUTIL_FILM_GRAIN_PARAMS_H |
||||
|
||||
#include "frame.h" |
||||
|
||||
enum AVFilmGrainParamsType { |
||||
AV_FILM_GRAIN_PARAMS_NONE = 0, |
||||
|
||||
/**
|
||||
* The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom) |
||||
*/ |
||||
AV_FILM_GRAIN_PARAMS_AV1, |
||||
|
||||
/**
|
||||
* The union is valid when interpreted as AVFilmGrainH274Params (codec.h274) |
||||
*/ |
||||
AV_FILM_GRAIN_PARAMS_H274, |
||||
}; |
||||
|
||||
/**
|
||||
* This structure describes how to handle film grain synthesis for AOM codecs. |
||||
* |
||||
* @note The struct must be allocated as part of AVFilmGrainParams using |
||||
* av_film_grain_params_alloc(). Its size is not a part of the public ABI. |
||||
*/ |
||||
typedef struct AVFilmGrainAOMParams { |
||||
/**
|
||||
* Number of points, and the scale and value for each point of the |
||||
* piecewise linear scaling function for the uma plane. |
||||
*/ |
||||
int num_y_points; |
||||
uint8_t y_points[14][2 /* value, scaling */]; |
||||
|
||||
/**
|
||||
* Signals whether to derive the chroma scaling function from the luma. |
||||
* Not equivalent to copying the luma values and scales. |
||||
*/ |
||||
int chroma_scaling_from_luma; |
||||
|
||||
/**
|
||||
* If chroma_scaling_from_luma is set to 0, signals the chroma scaling |
||||
* function parameters. |
||||
*/ |
||||
int num_uv_points[2 /* cb, cr */]; |
||||
uint8_t uv_points[2 /* cb, cr */][10][2 /* value, scaling */]; |
||||
|
||||
/**
|
||||
* Specifies the shift applied to the chroma components. For AV1, its within |
||||
* [8; 11] and determines the range and quantization of the film grain. |
||||
*/ |
||||
int scaling_shift; |
||||
|
||||
/**
|
||||
* Specifies the auto-regression lag. |
||||
*/ |
||||
int ar_coeff_lag; |
||||
|
||||
/**
|
||||
* Luma auto-regression coefficients. The number of coefficients is given by |
||||
* 2 * ar_coeff_lag * (ar_coeff_lag + 1). |
||||
*/ |
||||
int8_t ar_coeffs_y[24]; |
||||
|
||||
/**
|
||||
* Chroma auto-regression coefficients. The number of coefficients is given by |
||||
* 2 * ar_coeff_lag * (ar_coeff_lag + 1) + !!num_y_points. |
||||
*/ |
||||
int8_t ar_coeffs_uv[2 /* cb, cr */][25]; |
||||
|
||||
/**
|
||||
* Specifies the range of the auto-regressive coefficients. Values of 6, |
||||
* 7, 8 and so on represent a range of [-2, 2), [-1, 1), [-0.5, 0.5) and |
||||
* so on. For AV1 must be between 6 and 9. |
||||
*/ |
||||
int ar_coeff_shift; |
||||
|
||||
/**
|
||||
* Signals the down shift applied to the generated gaussian numbers during |
||||
* synthesis. |
||||
*/ |
||||
int grain_scale_shift; |
||||
|
||||
/**
|
||||
* Specifies the luma/chroma multipliers for the index to the component |
||||
* scaling function. |
||||
*/ |
||||
int uv_mult[2 /* cb, cr */]; |
||||
int uv_mult_luma[2 /* cb, cr */]; |
||||
|
||||
/**
|
||||
* Offset used for component scaling function. For AV1 its a 9-bit value |
||||
* with a range [-256, 255] |
||||
*/ |
||||
int uv_offset[2 /* cb, cr */]; |
||||
|
||||
/**
|
||||
* Signals whether to overlap film grain blocks. |
||||
*/ |
||||
int overlap_flag; |
||||
|
||||
/**
|
||||
* Signals to clip to limited color levels after film grain application. |
||||
*/ |
||||
int limit_output_range; |
||||
} AVFilmGrainAOMParams; |
||||
|
||||
/**
|
||||
* This structure describes how to handle film grain synthesis for codecs using |
||||
* the ITU-T H.274 Versatile suplemental enhancement information message. |
||||
* |
||||
* @note The struct must be allocated as part of AVFilmGrainParams using |
||||
* av_film_grain_params_alloc(). Its size is not a part of the public ABI. |
||||
*/ |
||||
typedef struct AVFilmGrainH274Params { |
||||
/**
|
||||
* Specifies the film grain simulation mode. |
||||
* 0 = Frequency filtering, 1 = Auto-regression |
||||
*/ |
||||
int model_id; |
||||
|
||||
/**
|
||||
* Specifies the bit depth used for the luma component. |
||||
*/ |
||||
int bit_depth_luma; |
||||
|
||||
/**
|
||||
* Specifies the bit depth used for the chroma components. |
||||
*/ |
||||
int bit_depth_chroma; |
||||
|
||||
enum AVColorRange color_range; |
||||
enum AVColorPrimaries color_primaries; |
||||
enum AVColorTransferCharacteristic color_trc; |
||||
enum AVColorSpace color_space; |
||||
|
||||
/**
|
||||
* Specifies the blending mode used to blend the simulated film grain |
||||
* with the decoded images. |
||||
* |
||||
* 0 = Additive, 1 = Multiplicative |
||||
*/ |
||||
int blending_mode_id; |
||||
|
||||
/**
|
||||
* Specifies a scale factor used in the film grain characterization equations. |
||||
*/ |
||||
int log2_scale_factor; |
||||
|
||||
/**
|
||||
* Indicates if the modelling of film grain for a given component is present. |
||||
*/ |
||||
int component_model_present[3 /* y, cb, cr */]; |
||||
|
||||
/**
|
||||
* Specifies the number of intensity intervals for which a specific set of |
||||
* model values has been estimated, with a range of [1, 256]. |
||||
*/ |
||||
uint16_t num_intensity_intervals[3 /* y, cb, cr */]; |
||||
|
||||
/**
|
||||
* Specifies the number of model values present for each intensity interval |
||||
* in which the film grain has been modelled, with a range of [1, 6]. |
||||
*/ |
||||
uint8_t num_model_values[3 /* y, cb, cr */]; |
||||
|
||||
/**
|
||||
* Specifies the lower ounds of each intensity interval for whichthe set of |
||||
* model values applies for the component. |
||||
*/ |
||||
uint8_t intensity_interval_lower_bound[3 /* y, cb, cr */][256 /* intensity interval */]; |
||||
|
||||
/**
|
||||
* Specifies the upper bound of each intensity interval for which the set of |
||||
* model values applies for the component. |
||||
*/ |
||||
uint8_t intensity_interval_upper_bound[3 /* y, cb, cr */][256 /* intensity interval */]; |
||||
|
||||
/**
|
||||
* Specifies the model values for the component for each intensity interval. |
||||
* - When model_id == 0, the following applies: |
||||
* For comp_model_value[y], the range of values is [0, 2^bit_depth_luma - 1] |
||||
* For comp_model_value[cb..cr], the range of values is [0, 2^bit_depth_chroma - 1] |
||||
* - Otherwise, the following applies: |
||||
* For comp_model_value[y], the range of values is [-2^(bit_depth_luma - 1), 2^(bit_depth_luma - 1) - 1] |
||||
* For comp_model_value[cb..cr], the range of values is [-2^(bit_depth_chroma - 1), 2^(bit_depth_chroma - 1) - 1] |
||||
*/ |
||||
int16_t comp_model_value[3 /* y, cb, cr */][256 /* intensity interval */][6 /* model value */]; |
||||
} AVFilmGrainH274Params; |
||||
|
||||
/**
|
||||
* This structure describes how to handle film grain synthesis in video |
||||
* for specific codecs. Must be present on every frame where film grain is |
||||
* meant to be synthesised for correct presentation. |
||||
* |
||||
* @note The struct must be allocated with av_film_grain_params_alloc() and |
||||
* its size is not a part of the public ABI. |
||||
*/ |
||||
typedef struct AVFilmGrainParams { |
||||
/**
|
||||
* Specifies the codec for which this structure is valid. |
||||
*/ |
||||
enum AVFilmGrainParamsType type; |
||||
|
||||
/**
|
||||
* Seed to use for the synthesis process, if the codec allows for it. |
||||
* |
||||
* @note For H.264, this refers to `pic_offset` as defined in |
||||
* SMPTE RDD 5-2006. |
||||
*/ |
||||
uint64_t seed; |
||||
|
||||
/**
|
||||
* Additional fields may be added both here and in any structure included. |
||||
* If a codec's film grain structure differs slightly over another |
||||
* codec's, fields within may change meaning depending on the type. |
||||
*/ |
||||
union { |
||||
AVFilmGrainAOMParams aom; |
||||
AVFilmGrainH274Params h274; |
||||
} codec; |
||||
} AVFilmGrainParams; |
||||
|
||||
/**
|
||||
* Allocate an AVFilmGrainParams structure and set its fields to |
||||
* default values. The resulting struct can be freed using av_freep(). |
||||
* If size is not NULL it will be set to the number of bytes allocated. |
||||
* |
||||
* @return An AVFilmGrainParams filled with default values or NULL |
||||
* on failure. |
||||
*/ |
||||
AVFilmGrainParams *av_film_grain_params_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* Allocate a complete AVFilmGrainParams and add it to the frame. |
||||
* |
||||
* @param frame The frame which side data is added to. |
||||
* |
||||
* @return The AVFilmGrainParams structure to be filled by caller. |
||||
*/ |
||||
AVFilmGrainParams *av_film_grain_params_create_side_data(AVFrame *frame); |
||||
|
||||
#endif /* AVUTIL_FILM_GRAIN_PARAMS_H */ |
@ -1,343 +0,0 @@ |
||||
/*
|
||||
* Copyright (c) 2018 Mohammad Izadi <moh.izadi at gmail.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_HDR_DYNAMIC_METADATA_H |
||||
#define AVUTIL_HDR_DYNAMIC_METADATA_H |
||||
|
||||
#include "frame.h" |
||||
#include "rational.h" |
||||
|
||||
/**
|
||||
* Option for overlapping elliptical pixel selectors in an image. |
||||
*/ |
||||
enum AVHDRPlusOverlapProcessOption { |
||||
AV_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0, |
||||
AV_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1, |
||||
}; |
||||
|
||||
/**
|
||||
* Represents the percentile at a specific percentage in |
||||
* a distribution. |
||||
*/ |
||||
typedef struct AVHDRPlusPercentile { |
||||
/**
|
||||
* The percentage value corresponding to a specific percentile linearized |
||||
* RGB value in the processing window in the scene. The value shall be in |
||||
* the range of 0 to100, inclusive. |
||||
*/ |
||||
uint8_t percentage; |
||||
|
||||
/**
|
||||
* The linearized maxRGB value at a specific percentile in the processing |
||||
* window in the scene. The value shall be in the range of 0 to 1, inclusive |
||||
* and in multiples of 0.00001. |
||||
*/ |
||||
AVRational percentile; |
||||
} AVHDRPlusPercentile; |
||||
|
||||
/**
|
||||
* Color transform parameters at a processing window in a dynamic metadata for |
||||
* SMPTE 2094-40. |
||||
*/ |
||||
typedef struct AVHDRPlusColorTransformParams { |
||||
/**
|
||||
* The relative x coordinate of the top left pixel of the processing |
||||
* window. The value shall be in the range of 0 and 1, inclusive and |
||||
* in multiples of 1/(width of Picture - 1). The value 1 corresponds |
||||
* to the absolute coordinate of width of Picture - 1. The value for |
||||
* first processing window shall be 0. |
||||
*/ |
||||
AVRational window_upper_left_corner_x; |
||||
|
||||
/**
|
||||
* The relative y coordinate of the top left pixel of the processing |
||||
* window. The value shall be in the range of 0 and 1, inclusive and |
||||
* in multiples of 1/(height of Picture - 1). The value 1 corresponds |
||||
* to the absolute coordinate of height of Picture - 1. The value for |
||||
* first processing window shall be 0. |
||||
*/ |
||||
AVRational window_upper_left_corner_y; |
||||
|
||||
/**
|
||||
* The relative x coordinate of the bottom right pixel of the processing |
||||
* window. The value shall be in the range of 0 and 1, inclusive and |
||||
* in multiples of 1/(width of Picture - 1). The value 1 corresponds |
||||
* to the absolute coordinate of width of Picture - 1. The value for |
||||
* first processing window shall be 1. |
||||
*/ |
||||
AVRational window_lower_right_corner_x; |
||||
|
||||
/**
|
||||
* The relative y coordinate of the bottom right pixel of the processing |
||||
* window. The value shall be in the range of 0 and 1, inclusive and |
||||
* in multiples of 1/(height of Picture - 1). The value 1 corresponds |
||||
* to the absolute coordinate of height of Picture - 1. The value for |
||||
* first processing window shall be 1. |
||||
*/ |
||||
AVRational window_lower_right_corner_y; |
||||
|
||||
/**
|
||||
* The x coordinate of the center position of the concentric internal and |
||||
* external ellipses of the elliptical pixel selector in the processing |
||||
* window. The value shall be in the range of 0 to (width of Picture - 1), |
||||
* inclusive and in multiples of 1 pixel. |
||||
*/ |
||||
uint16_t center_of_ellipse_x; |
||||
|
||||
/**
|
||||
* The y coordinate of the center position of the concentric internal and |
||||
* external ellipses of the elliptical pixel selector in the processing |
||||
* window. The value shall be in the range of 0 to (height of Picture - 1), |
||||
* inclusive and in multiples of 1 pixel. |
||||
*/ |
||||
uint16_t center_of_ellipse_y; |
||||
|
||||
/**
|
||||
* The clockwise rotation angle in degree of arc with respect to the |
||||
* positive direction of the x-axis of the concentric internal and external |
||||
* ellipses of the elliptical pixel selector in the processing window. The |
||||
* value shall be in the range of 0 to 180, inclusive and in multiples of 1. |
||||
*/ |
||||
uint8_t rotation_angle; |
||||
|
||||
/**
|
||||
* The semi-major axis value of the internal ellipse of the elliptical pixel |
||||
* selector in amount of pixels in the processing window. The value shall be |
||||
* in the range of 1 to 65535, inclusive and in multiples of 1 pixel. |
||||
*/ |
||||
uint16_t semimajor_axis_internal_ellipse; |
||||
|
||||
/**
|
||||
* The semi-major axis value of the external ellipse of the elliptical pixel |
||||
* selector in amount of pixels in the processing window. The value |
||||
* shall not be less than semimajor_axis_internal_ellipse of the current |
||||
* processing window. The value shall be in the range of 1 to 65535, |
||||
* inclusive and in multiples of 1 pixel. |
||||
*/ |
||||
uint16_t semimajor_axis_external_ellipse; |
||||
|
||||
/**
|
||||
* The semi-minor axis value of the external ellipse of the elliptical pixel |
||||
* selector in amount of pixels in the processing window. The value shall be |
||||
* in the range of 1 to 65535, inclusive and in multiples of 1 pixel. |
||||
*/ |
||||
uint16_t semiminor_axis_external_ellipse; |
||||
|
||||
/**
|
||||
* Overlap process option indicates one of the two methods of combining |
||||
* rendered pixels in the processing window in an image with at least one |
||||
* elliptical pixel selector. For overlapping elliptical pixel selectors |
||||
* in an image, overlap_process_option shall have the same value. |
||||
*/ |
||||
enum AVHDRPlusOverlapProcessOption overlap_process_option; |
||||
|
||||
/**
|
||||
* The maximum of the color components of linearized RGB values in the |
||||
* processing window in the scene. The values should be in the range of 0 to |
||||
* 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ], and |
||||
* maxscl[ 2 ] are corresponding to R, G, B color components respectively. |
||||
*/ |
||||
AVRational maxscl[3]; |
||||
|
||||
/**
|
||||
* The average of linearized maxRGB values in the processing window in the |
||||
* scene. The value should be in the range of 0 to 1, inclusive and in |
||||
* multiples of 0.00001. |
||||
*/ |
||||
AVRational average_maxrgb; |
||||
|
||||
/**
|
||||
* The number of linearized maxRGB values at given percentiles in the |
||||
* processing window in the scene. The maximum value shall be 15. |
||||
*/ |
||||
uint8_t num_distribution_maxrgb_percentiles; |
||||
|
||||
/**
|
||||
* The linearized maxRGB values at given percentiles in the |
||||
* processing window in the scene. |
||||
*/ |
||||
AVHDRPlusPercentile distribution_maxrgb[15]; |
||||
|
||||
/**
|
||||
* The fraction of selected pixels in the image that contains the brightest |
||||
* pixel in the scene. The value shall be in the range of 0 to 1, inclusive |
||||
* and in multiples of 0.001. |
||||
*/ |
||||
AVRational fraction_bright_pixels; |
||||
|
||||
/**
|
||||
* This flag indicates that the metadata for the tone mapping function in |
||||
* the processing window is present (for value of 1). |
||||
*/ |
||||
uint8_t tone_mapping_flag; |
||||
|
||||
/**
|
||||
* The x coordinate of the separation point between the linear part and the |
||||
* curved part of the tone mapping function. The value shall be in the range |
||||
* of 0 to 1, excluding 0 and in multiples of 1/4095. |
||||
*/ |
||||
AVRational knee_point_x; |
||||
|
||||
/**
|
||||
* The y coordinate of the separation point between the linear part and the |
||||
* curved part of the tone mapping function. The value shall be in the range |
||||
* of 0 to 1, excluding 0 and in multiples of 1/4095. |
||||
*/ |
||||
AVRational knee_point_y; |
||||
|
||||
/**
|
||||
* The number of the intermediate anchor parameters of the tone mapping |
||||
* function in the processing window. The maximum value shall be 15. |
||||
*/ |
||||
uint8_t num_bezier_curve_anchors; |
||||
|
||||
/**
|
||||
* The intermediate anchor parameters of the tone mapping function in the |
||||
* processing window in the scene. The values should be in the range of 0 |
||||
* to 1, inclusive and in multiples of 1/1023. |
||||
*/ |
||||
AVRational bezier_curve_anchors[15]; |
||||
|
||||
/**
|
||||
* This flag shall be equal to 0 in bitstreams conforming to this version of |
||||
* this Specification. Other values are reserved for future use. |
||||
*/ |
||||
uint8_t color_saturation_mapping_flag; |
||||
|
||||
/**
|
||||
* The color saturation gain in the processing window in the scene. The |
||||
* value shall be in the range of 0 to 63/8, inclusive and in multiples of |
||||
* 1/8. The default value shall be 1. |
||||
*/ |
||||
AVRational color_saturation_weight; |
||||
} AVHDRPlusColorTransformParams; |
||||
|
||||
/**
|
||||
* This struct represents dynamic metadata for color volume transform - |
||||
* application 4 of SMPTE 2094-40:2016 standard. |
||||
* |
||||
* To be used as payload of a AVFrameSideData or AVPacketSideData with the |
||||
* appropriate type. |
||||
* |
||||
* @note The struct should be allocated with |
||||
* av_dynamic_hdr_plus_alloc() and its size is not a part of |
||||
* the public ABI. |
||||
*/ |
||||
typedef struct AVDynamicHDRPlus { |
||||
/**
|
||||
* Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5. |
||||
*/ |
||||
uint8_t itu_t_t35_country_code; |
||||
|
||||
/**
|
||||
* Application version in the application defining document in ST-2094 |
||||
* suite. The value shall be set to 0. |
||||
*/ |
||||
uint8_t application_version; |
||||
|
||||
/**
|
||||
* The number of processing windows. The value shall be in the range |
||||
* of 1 to 3, inclusive. |
||||
*/ |
||||
uint8_t num_windows; |
||||
|
||||
/**
|
||||
* The color transform parameters for every processing window. |
||||
*/ |
||||
AVHDRPlusColorTransformParams params[3]; |
||||
|
||||
/**
|
||||
* The nominal maximum display luminance of the targeted system display, |
||||
* in units of 0.0001 candelas per square metre. The value shall be in |
||||
* the range of 0 to 10000, inclusive. |
||||
*/ |
||||
AVRational targeted_system_display_maximum_luminance; |
||||
|
||||
/**
|
||||
* This flag shall be equal to 0 in bit streams conforming to this version |
||||
* of this Specification. The value 1 is reserved for future use. |
||||
*/ |
||||
uint8_t targeted_system_display_actual_peak_luminance_flag; |
||||
|
||||
/**
|
||||
* The number of rows in the targeted system_display_actual_peak_luminance |
||||
* array. The value shall be in the range of 2 to 25, inclusive. |
||||
*/ |
||||
uint8_t num_rows_targeted_system_display_actual_peak_luminance; |
||||
|
||||
/**
|
||||
* The number of columns in the |
||||
* targeted_system_display_actual_peak_luminance array. The value shall be |
||||
* in the range of 2 to 25, inclusive. |
||||
*/ |
||||
uint8_t num_cols_targeted_system_display_actual_peak_luminance; |
||||
|
||||
/**
|
||||
* The normalized actual peak luminance of the targeted system display. The |
||||
* values should be in the range of 0 to 1, inclusive and in multiples of |
||||
* 1/15. |
||||
*/ |
||||
AVRational targeted_system_display_actual_peak_luminance[25][25]; |
||||
|
||||
/**
|
||||
* This flag shall be equal to 0 in bitstreams conforming to this version of |
||||
* this Specification. The value 1 is reserved for future use. |
||||
*/ |
||||
uint8_t mastering_display_actual_peak_luminance_flag; |
||||
|
||||
/**
|
||||
* The number of rows in the mastering_display_actual_peak_luminance array. |
||||
* The value shall be in the range of 2 to 25, inclusive. |
||||
*/ |
||||
uint8_t num_rows_mastering_display_actual_peak_luminance; |
||||
|
||||
/**
|
||||
* The number of columns in the mastering_display_actual_peak_luminance |
||||
* array. The value shall be in the range of 2 to 25, inclusive. |
||||
*/ |
||||
uint8_t num_cols_mastering_display_actual_peak_luminance; |
||||
|
||||
/**
|
||||
* The normalized actual peak luminance of the mastering display used for |
||||
* mastering the image essence. The values should be in the range of 0 to 1, |
||||
* inclusive and in multiples of 1/15. |
||||
*/ |
||||
AVRational mastering_display_actual_peak_luminance[25][25]; |
||||
} AVDynamicHDRPlus; |
||||
|
||||
/**
|
||||
* Allocate an AVDynamicHDRPlus structure and set its fields to |
||||
* default values. The resulting struct can be freed using av_freep(). |
||||
* |
||||
* @return An AVDynamicHDRPlus filled with default values or NULL |
||||
* on failure. |
||||
*/ |
||||
AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* Allocate a complete AVDynamicHDRPlus and add it to the frame. |
||||
* @param frame The frame which side data is added to. |
||||
* |
||||
* @return The AVDynamicHDRPlus structure to be filled by caller or NULL |
||||
* on failure. |
||||
*/ |
||||
AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame); |
||||
|
||||
#endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */ |
@ -1,285 +0,0 @@ |
||||
/*
|
||||
* Copyright (c) 2021 Limin Wang <lance.lmwang at gmail.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_HDR_DYNAMIC_VIVID_METADATA_H |
||||
#define AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H |
||||
|
||||
#include "frame.h" |
||||
#include "rational.h" |
||||
|
||||
/**
|
||||
* Color tone mapping parameters at a processing window in a dynamic metadata for |
||||
* CUVA 005.1:2021. |
||||
*/ |
||||
typedef struct AVHDRVividColorToneMappingParams { |
||||
/**
|
||||
* The nominal maximum display luminance of the targeted system display, |
||||
* in multiples of 1.0/4095 candelas per square metre. The value shall be in |
||||
* the range of 0.0 to 1.0, inclusive. |
||||
*/ |
||||
AVRational targeted_system_display_maximum_luminance; |
||||
|
||||
/**
|
||||
* This flag indicates that transfer the base paramter(for value of 1) |
||||
*/ |
||||
int base_enable_flag; |
||||
|
||||
/**
|
||||
* base_param_m_p in the base parameter, |
||||
* in multiples of 1.0/16383. The value shall be in |
||||
* the range of 0.0 to 1.0, inclusive. |
||||
*/ |
||||
AVRational base_param_m_p; |
||||
|
||||
/**
|
||||
* base_param_m_m in the base parameter, |
||||
* in multiples of 1.0/10. The value shall be in |
||||
* the range of 0.0 to 6.3, inclusive. |
||||
*/ |
||||
AVRational base_param_m_m; |
||||
|
||||
/**
|
||||
* base_param_m_a in the base parameter, |
||||
* in multiples of 1.0/1023. The value shall be in |
||||
* the range of 0.0 to 1.0 inclusive. |
||||
*/ |
||||
AVRational base_param_m_a; |
||||
|
||||
/**
|
||||
* base_param_m_b in the base parameter, |
||||
* in multiples of 1/1023. The value shall be in |
||||
* the range of 0.0 to 1.0, inclusive. |
||||
*/ |
||||
AVRational base_param_m_b; |
||||
|
||||
/**
|
||||
* base_param_m_n in the base parameter, |
||||
* in multiples of 1.0/10. The value shall be in |
||||
* the range of 0.0 to 6.3, inclusive. |
||||
*/ |
||||
AVRational base_param_m_n; |
||||
|
||||
/**
|
||||
* indicates k1_0 in the base parameter, |
||||
* base_param_k1 <= 1: k1_0 = base_param_k1 |
||||
* base_param_k1 > 1: reserved |
||||
*/ |
||||
int base_param_k1; |
||||
|
||||
/**
|
||||
* indicates k2_0 in the base parameter, |
||||
* base_param_k2 <= 1: k2_0 = base_param_k2 |
||||
* base_param_k2 > 1: reserved |
||||
*/ |
||||
int base_param_k2; |
||||
|
||||
/**
|
||||
* indicates k3_0 in the base parameter, |
||||
* base_param_k3 == 1: k3_0 = base_param_k3 |
||||
* base_param_k3 == 2: k3_0 = maximum_maxrgb |
||||
* base_param_k3 > 2: reserved |
||||
*/ |
||||
int base_param_k3; |
||||
|
||||
/**
|
||||
* This flag indicates that delta mode of base paramter(for value of 1) |
||||
*/ |
||||
int base_param_Delta_enable_mode; |
||||
|
||||
/**
|
||||
* base_param_Delta in the base parameter, |
||||
* in multiples of 1.0/127. The value shall be in |
||||
* the range of 0.0 to 1.0, inclusive. |
||||
*/ |
||||
AVRational base_param_Delta; |
||||
|
||||
/**
|
||||
* indicates 3Spline_enable_flag in the base parameter, |
||||
* This flag indicates that transfer three Spline of base paramter(for value of 1) |
||||
*/ |
||||
int three_Spline_enable_flag; |
||||
|
||||
/**
|
||||
* The number of three Spline. The value shall be in the range |
||||
* of 1 to 2, inclusive. |
||||
*/ |
||||
int three_Spline_num; |
||||
|
||||
/**
|
||||
* The mode of three Spline. the value shall be in the range |
||||
* of 0 to 3, inclusive. |
||||
*/ |
||||
int three_Spline_TH_mode; |
||||
|
||||
/**
|
||||
* three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive |
||||
* and in multiples of 1.0/255. |
||||
* |
||||
*/ |
||||
AVRational three_Spline_TH_enable_MB; |
||||
|
||||
/**
|
||||
* 3Spline_TH_enable of three Spline. |
||||
* The value shall be in the range of 0.0 to 1.0, inclusive. |
||||
* and in multiples of 1.0/4095. |
||||
*/ |
||||
AVRational three_Spline_TH_enable; |
||||
|
||||
/**
|
||||
* 3Spline_TH_Delta1 of three Spline. |
||||
* The value shall be in the range of 0.0 to 0.25, inclusive, |
||||
* and in multiples of 0.25/1023. |
||||
*/ |
||||
AVRational three_Spline_TH_Delta1; |
||||
|
||||
/**
|
||||
* 3Spline_TH_Delta2 of three Spline. |
||||
* The value shall be in the range of 0.0 to 0.25, inclusive, |
||||
* and in multiples of 0.25/1023. |
||||
*/ |
||||
AVRational three_Spline_TH_Delta2; |
||||
|
||||
/**
|
||||
* 3Spline_enable_Strength of three Spline. |
||||
* The value shall be in the range of 0.0 to 1.0, inclusive, |
||||
* and in multiples of 1.0/255. |
||||
*/ |
||||
AVRational three_Spline_enable_Strength; |
||||
} AVHDRVividColorToneMappingParams; |
||||
|
||||
|
||||
/**
|
||||
* Color transform parameters at a processing window in a dynamic metadata for |
||||
* CUVA 005.1:2021. |
||||
*/ |
||||
typedef struct AVHDRVividColorTransformParams { |
||||
/**
|
||||
* Indicates the minimum brightness of the displayed content. |
||||
* The values should be in the range of 0.0 to 1.0, |
||||
* inclusive and in multiples of 1/4095. |
||||
*/ |
||||
AVRational minimum_maxrgb; |
||||
|
||||
/**
|
||||
* Indicates the average brightness of the displayed content. |
||||
* The values should be in the range of 0.0 to 1.0, |
||||
* inclusive and in multiples of 1/4095. |
||||
*/ |
||||
AVRational average_maxrgb; |
||||
|
||||
/**
|
||||
* Indicates the variance brightness of the displayed content. |
||||
* The values should be in the range of 0.0 to 1.0, |
||||
* inclusive and in multiples of 1/4095. |
||||
*/ |
||||
AVRational variance_maxrgb; |
||||
|
||||
/**
|
||||
* Indicates the maximum brightness of the displayed content. |
||||
* The values should be in the range of 0.0 to 1.0, inclusive |
||||
* and in multiples of 1/4095. |
||||
*/ |
||||
AVRational maximum_maxrgb; |
||||
|
||||
/**
|
||||
* This flag indicates that the metadata for the tone mapping function in |
||||
* the processing window is present (for value of 1). |
||||
*/ |
||||
int tone_mapping_mode_flag; |
||||
|
||||
/**
|
||||
* The number of tone mapping param. The value shall be in the range |
||||
* of 1 to 2, inclusive. |
||||
*/ |
||||
int tone_mapping_param_num; |
||||
|
||||
/**
|
||||
* The color tone mapping parameters. |
||||
*/ |
||||
AVHDRVividColorToneMappingParams tm_params[2]; |
||||
|
||||
/**
|
||||
* This flag indicates that the metadata for the color saturation mapping in |
||||
* the processing window is present (for value of 1). |
||||
*/ |
||||
int color_saturation_mapping_flag; |
||||
|
||||
/**
|
||||
* The number of color saturation param. The value shall be in the range |
||||
* of 0 to 7, inclusive. |
||||
*/ |
||||
int color_saturation_num; |
||||
|
||||
/**
|
||||
* Indicates the color correction strength parameter. |
||||
* The values should be in the range of 0.0 to 2.0, inclusive |
||||
* and in multiples of 1/128. |
||||
*/ |
||||
AVRational color_saturation_gain[8]; |
||||
} AVHDRVividColorTransformParams; |
||||
|
||||
/**
|
||||
* This struct represents dynamic metadata for color volume transform - |
||||
* CUVA 005.1:2021 standard |
||||
* |
||||
* To be used as payload of a AVFrameSideData or AVPacketSideData with the |
||||
* appropriate type. |
||||
* |
||||
* @note The struct should be allocated with |
||||
* av_dynamic_hdr_vivid_alloc() and its size is not a part of |
||||
* the public ABI. |
||||
*/ |
||||
typedef struct AVDynamicHDRVivid { |
||||
/**
|
||||
* The system start code. The value shall be set to 0x01. |
||||
*/ |
||||
uint8_t system_start_code; |
||||
|
||||
/**
|
||||
* The number of processing windows. The value shall be set to 0x01 |
||||
* if the system_start_code is 0x01. |
||||
*/ |
||||
uint8_t num_windows; |
||||
|
||||
/**
|
||||
* The color transform parameters for every processing window. |
||||
*/ |
||||
AVHDRVividColorTransformParams params[3]; |
||||
} AVDynamicHDRVivid; |
||||
|
||||
/**
|
||||
* Allocate an AVDynamicHDRVivid structure and set its fields to |
||||
* default values. The resulting struct can be freed using av_freep(). |
||||
* |
||||
* @return An AVDynamicHDRVivid filled with default values or NULL |
||||
* on failure. |
||||
*/ |
||||
AVDynamicHDRVivid *av_dynamic_hdr_vivid_alloc(size_t *size); |
||||
|
||||
/**
|
||||
* Allocate a complete AVDynamicHDRVivid and add it to the frame. |
||||
* @param frame The frame which side data is added to. |
||||
* |
||||
* @return The AVDynamicHDRVivid structure to be filled by caller or NULL |
||||
* on failure. |
||||
*/ |
||||
AVDynamicHDRVivid *av_dynamic_hdr_vivid_create_side_data(AVFrame *frame); |
||||
|
||||
#endif /* AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H */ |
@ -1,61 +0,0 @@ |
||||
/*
|
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_MEDIACODEC_H |
||||
#define AVUTIL_HWCONTEXT_MEDIACODEC_H |
||||
|
||||
/**
|
||||
* MediaCodec details. |
||||
* |
||||
* Allocated as AVHWDeviceContext.hwctx |
||||
*/ |
||||
typedef struct AVMediaCodecDeviceContext { |
||||
/**
|
||||
* android/view/Surface handle, to be filled by the user. |
||||
* |
||||
* This is the default surface used by decoders on this device. |
||||
*/ |
||||
void *surface; |
||||
|
||||
/**
|
||||
* Pointer to ANativeWindow. |
||||
* |
||||
* It both surface and native_window is NULL, try to create it |
||||
* automatically if create_window is true and OS support |
||||
* createPersistentInputSurface. |
||||
* |
||||
* It can be used as output surface for decoder and input surface for |
||||
* encoder. |
||||
*/ |
||||
void *native_window; |
||||
|
||||
/**
|
||||
* Enable createPersistentInputSurface automatically. |
||||
* |
||||
* Disabled by default. |
||||
* |
||||
* It can be enabled by setting this flag directly, or by setting |
||||
* AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key. |
||||
* The second method is useful for ffmpeg cmdline, e.g., we can enable it |
||||
* via: |
||||
* -init_hw_device mediacodec=mediacodec,create_window=1 |
||||
*/ |
||||
int create_window; |
||||
} AVMediaCodecDeviceContext; |
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */ |
@ -1,100 +0,0 @@ |
||||
/*
|
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_OPENCL_H |
||||
#define AVUTIL_HWCONTEXT_OPENCL_H |
||||
|
||||
#ifdef __APPLE__ |
||||
#include <OpenCL/cl.h> |
||||
#else |
||||
#include <CL/cl.h> |
||||
#endif |
||||
|
||||
#include "frame.h" |
||||
|
||||
/**
|
||||
* @file |
||||
* API-specific header for AV_HWDEVICE_TYPE_OPENCL. |
||||
* |
||||
* Pools allocated internally are always dynamic, and are primarily intended |
||||
* to be used in OpenCL-only cases. If interoperation is required, it is |
||||
* typically required to allocate frames in the other API and then map the |
||||
* frames context to OpenCL with av_hwframe_ctx_create_derived(). |
||||
*/ |
||||
|
||||
/**
|
||||
* OpenCL frame descriptor for pool allocation. |
||||
* |
||||
* In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs |
||||
* with the data pointer pointing at an object of this type describing the |
||||
* planes of the frame. |
||||
*/ |
||||
typedef struct AVOpenCLFrameDescriptor { |
||||
/**
|
||||
* Number of planes in the frame. |
||||
*/ |
||||
int nb_planes; |
||||
/**
|
||||
* OpenCL image2d objects for each plane of the frame. |
||||
*/ |
||||
cl_mem planes[AV_NUM_DATA_POINTERS]; |
||||
} AVOpenCLFrameDescriptor; |
||||
|
||||
/**
|
||||
* OpenCL device details. |
||||
* |
||||
* Allocated as AVHWDeviceContext.hwctx |
||||
*/ |
||||
typedef struct AVOpenCLDeviceContext { |
||||
/**
|
||||
* The primary device ID of the device. If multiple OpenCL devices |
||||
* are associated with the context then this is the one which will |
||||
* be used for all operations internal to FFmpeg. |
||||
*/ |
||||
cl_device_id device_id; |
||||
/**
|
||||
* The OpenCL context which will contain all operations and frames on |
||||
* this device. |
||||
*/ |
||||
cl_context context; |
||||
/**
|
||||
* The default command queue for this device, which will be used by all |
||||
* frames contexts which do not have their own command queue. If not |
||||
* intialised by the user, a default queue will be created on the |
||||
* primary device. |
||||
*/ |
||||
cl_command_queue command_queue; |
||||
} AVOpenCLDeviceContext; |
||||
|
||||
/**
|
||||
* OpenCL-specific data associated with a frame pool. |
||||
* |
||||
* Allocated as AVHWFramesContext.hwctx. |
||||
*/ |
||||
typedef struct AVOpenCLFramesContext { |
||||
/**
|
||||
* The command queue used for internal asynchronous operations on this |
||||
* device (av_hwframe_transfer_data(), av_hwframe_map()). |
||||
* |
||||
* If this is not set, the command queue from the associated device is |
||||
* used instead. |
||||
*/ |
||||
cl_command_queue command_queue; |
||||
} AVOpenCLFramesContext; |
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_OPENCL_H */ |
@ -1,281 +0,0 @@ |
||||
/*
|
||||
* This file is part of FFmpeg. |
||||
* |
||||
* FFmpeg is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* FFmpeg is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with FFmpeg; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_HWCONTEXT_VULKAN_H |
||||
#define AVUTIL_HWCONTEXT_VULKAN_H |
||||
|
||||
#if defined(_WIN32) && !defined(VK_USE_PLATFORM_WIN32_KHR) |
||||
#define VK_USE_PLATFORM_WIN32_KHR |
||||
#endif |
||||
#include <vulkan/vulkan.h> |
||||
|
||||
#include "pixfmt.h" |
||||
#include "frame.h" |
||||
|
||||
/**
|
||||
* @file |
||||
* API-specific header for AV_HWDEVICE_TYPE_VULKAN. |
||||
* |
||||
* For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs |
||||
* with the data pointer set to an AVVkFrame. |
||||
*/ |
||||
|
||||
/**
|
||||
* Main Vulkan context, allocated as AVHWDeviceContext.hwctx. |
||||
* All of these can be set before init to change what the context uses |
||||
*/ |
||||
typedef struct AVVulkanDeviceContext { |
||||
/**
|
||||
* Custom memory allocator, else NULL |
||||
*/ |
||||
const VkAllocationCallbacks *alloc; |
||||
|
||||
/**
|
||||
* Pointer to the instance-provided vkGetInstanceProcAddr loading function. |
||||
* If NULL, will pick either libvulkan or libvolk, depending on libavutil's |
||||
* compilation settings, and set this field. |
||||
*/ |
||||
PFN_vkGetInstanceProcAddr get_proc_addr; |
||||
|
||||
/**
|
||||
* Vulkan instance. Must be at least version 1.2. |
||||
*/ |
||||
VkInstance inst; |
||||
|
||||
/**
|
||||
* Physical device |
||||
*/ |
||||
VkPhysicalDevice phys_dev; |
||||
|
||||
/**
|
||||
* Active device |
||||
*/ |
||||
VkDevice act_dev; |
||||
|
||||
/**
|
||||
* This structure should be set to the set of features that present and enabled |
||||
* during device creation. When a device is created by FFmpeg, it will default to |
||||
* enabling all that are present of the shaderImageGatherExtended, |
||||
* fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features. |
||||
*/ |
||||
VkPhysicalDeviceFeatures2 device_features; |
||||
|
||||
/**
|
||||
* Enabled instance extensions. |
||||
* If supplying your own device context, set this to an array of strings, with |
||||
* each entry containing the specified Vulkan extension string to enable. |
||||
* Duplicates are possible and accepted. |
||||
* If no extensions are enabled, set these fields to NULL, and 0 respectively. |
||||
*/ |
||||
const char * const *enabled_inst_extensions; |
||||
int nb_enabled_inst_extensions; |
||||
|
||||
/**
|
||||
* Enabled device extensions. By default, VK_KHR_external_memory_fd, |
||||
* VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier, |
||||
* VK_KHR_external_semaphore_fd and VK_EXT_external_memory_host are enabled if found. |
||||
* If supplying your own device context, these fields takes the same format as |
||||
* the above fields, with the same conditions that duplicates are possible |
||||
* and accepted, and that NULL and 0 respectively means no extensions are enabled. |
||||
*/ |
||||
const char * const *enabled_dev_extensions; |
||||
int nb_enabled_dev_extensions; |
||||
|
||||
/**
|
||||
* Queue family index for graphics operations, and the number of queues |
||||
* enabled for it. If unavaiable, will be set to -1. Not required. |
||||
* av_hwdevice_create() will attempt to find a dedicated queue for each |
||||
* queue family, or pick the one with the least unrelated flags set. |
||||
* Queue indices here may overlap if a queue has to share capabilities. |
||||
*/ |
||||
int queue_family_index; |
||||
int nb_graphics_queues; |
||||
|
||||
/**
|
||||
* Queue family index for transfer operations and the number of queues |
||||
* enabled. Required. |
||||
*/ |
||||
int queue_family_tx_index; |
||||
int nb_tx_queues; |
||||
|
||||
/**
|
||||
* Queue family index for compute operations and the number of queues |
||||
* enabled. Required. |
||||
*/ |
||||
int queue_family_comp_index; |
||||
int nb_comp_queues; |
||||
|
||||
/**
|
||||
* Queue family index for video encode ops, and the amount of queues enabled. |
||||
* If the device doesn't support such, queue_family_encode_index will be -1. |
||||
* Not required. |
||||
*/ |
||||
int queue_family_encode_index; |
||||
int nb_encode_queues; |
||||
|
||||
/**
|
||||
* Queue family index for video decode ops, and the amount of queues enabled. |
||||
* If the device doesn't support such, queue_family_decode_index will be -1. |
||||
* Not required. |
||||
*/ |
||||
int queue_family_decode_index; |
||||
int nb_decode_queues; |
||||
} AVVulkanDeviceContext; |
||||
|
||||
/**
|
||||
* Defines the behaviour of frame allocation. |
||||
*/ |
||||
typedef enum AVVkFrameFlags { |
||||
/* Unless this flag is set, autodetected flags will be OR'd based on the
|
||||
* device and tiling during av_hwframe_ctx_init(). */ |
||||
AV_VK_FRAME_FLAG_NONE = (1ULL << 0), |
||||
|
||||
/* Image planes will be allocated in a single VkDeviceMemory, rather
|
||||
* than as per-plane VkDeviceMemory allocations. Required for exporting |
||||
* to VAAPI on Intel devices. */ |
||||
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1), |
||||
} AVVkFrameFlags; |
||||
|
||||
/**
|
||||
* Allocated as AVHWFramesContext.hwctx, used to set pool-specific options |
||||
*/ |
||||
typedef struct AVVulkanFramesContext { |
||||
/**
|
||||
* Controls the tiling of allocated frames. If left as optimal tiling, |
||||
* then during av_hwframe_ctx_init() will decide based on whether the device |
||||
* supports DRM modifiers, or if the linear_images flag is set, otherwise |
||||
* will allocate optimally-tiled images. |
||||
*/ |
||||
VkImageTiling tiling; |
||||
|
||||
/**
|
||||
* Defines extra usage of output frames. If left as 0, the following bits |
||||
* are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE. |
||||
*/ |
||||
VkImageUsageFlagBits usage; |
||||
|
||||
/**
|
||||
* Extension data for image creation. |
||||
* If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain, |
||||
* and the device supports DRM modifiers, then images will be allocated |
||||
* with the specific requested DRM modifiers. |
||||
* Additional structures may be added at av_hwframe_ctx_init() time, |
||||
* which will be freed automatically on uninit(), so users need only free |
||||
* any structures they've allocated themselves. |
||||
*/ |
||||
void *create_pnext; |
||||
|
||||
/**
|
||||
* Extension data for memory allocation. Must have as many entries as |
||||
* the number of planes of the sw_format. |
||||
* This will be chained to VkExportMemoryAllocateInfo, which is used |
||||
* to make all pool images exportable to other APIs if the necessary |
||||
* extensions are present in enabled_dev_extensions. |
||||
*/ |
||||
void *alloc_pnext[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* A combination of AVVkFrameFlags. Unless AV_VK_FRAME_FLAG_NONE is set, |
||||
* autodetected flags will be OR'd based on the device and tiling during |
||||
* av_hwframe_ctx_init(). |
||||
*/ |
||||
AVVkFrameFlags flags; |
||||
} AVVulkanFramesContext; |
||||
|
||||
/*
|
||||
* Frame structure, the VkFormat of the image will always match |
||||
* the pool's sw_format. |
||||
* All frames, imported or allocated, will be created with the |
||||
* VK_IMAGE_CREATE_ALIAS_BIT flag set, so the memory may be aliased if needed. |
||||
* |
||||
* If all queue family indices in the device context are the same, |
||||
* images will be created with the EXCLUSIVE sharing mode. Otherwise, all images |
||||
* will be created using the CONCURRENT sharing mode. |
||||
* |
||||
* @note the size of this structure is not part of the ABI, to allocate |
||||
* you must use @av_vk_frame_alloc(). |
||||
*/ |
||||
typedef struct AVVkFrame { |
||||
/**
|
||||
* Vulkan images to which the memory is bound to. |
||||
*/ |
||||
VkImage img[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* The same tiling must be used for all images in the frame. |
||||
*/ |
||||
VkImageTiling tiling; |
||||
|
||||
/**
|
||||
* Memory backing the images. Could be less than the amount of planes, |
||||
* in which case the offset value will indicate the binding offset of |
||||
* each plane in the memory. |
||||
*/ |
||||
VkDeviceMemory mem[AV_NUM_DATA_POINTERS]; |
||||
size_t size[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* OR'd flags for all memory allocated |
||||
*/ |
||||
VkMemoryPropertyFlagBits flags; |
||||
|
||||
/**
|
||||
* Updated after every barrier |
||||
*/ |
||||
VkAccessFlagBits access[AV_NUM_DATA_POINTERS]; |
||||
VkImageLayout layout[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* Synchronization timeline semaphores, one for each sw_format plane. |
||||
* Must not be freed manually. Must be waited on at every submission using |
||||
* the value in sem_value, and must be signalled at every submission, |
||||
* using an incremented value. |
||||
*/ |
||||
VkSemaphore sem[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* Up to date semaphore value at which each image becomes accessible. |
||||
* Clients must wait on this value when submitting a command queue, |
||||
* and increment it when signalling. |
||||
*/ |
||||
uint64_t sem_value[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* Internal data. |
||||
*/ |
||||
struct AVVkFrameInternal *internal; |
||||
|
||||
/**
|
||||
* Describes the binding offset of each plane to the VkDeviceMemory. |
||||
*/ |
||||
ptrdiff_t offset[AV_NUM_DATA_POINTERS]; |
||||
} AVVkFrame; |
||||
|
||||
/**
|
||||
* Allocates a single AVVkFrame and initializes everything as 0. |
||||
* @note Must be freed via av_free() |
||||
*/ |
||||
AVVkFrame *av_vk_frame_alloc(void); |
||||
|
||||
/**
|
||||
* Returns the format of each image up to the number of planes for a given sw_format. |
||||
* Returns NULL on unsupported formats. |
||||
*/ |
||||
const VkFormat *av_vkfmt_from_pixfmt(enum AVPixelFormat p); |
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_VULKAN_H */ |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue