#include "libavutil/avstring.h"
#include "libavutil/integer.h"
#include "libavutil/crc.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "dsputil.h"
#include "opt.h"
#include "imgconvert.h"
#include "audioconvert.h"
#include "libxvid_internal.h"
#include "internal.h"
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
#include <float.h>
#include <fcntl.h>
Go to the source code of this file.
Data Structures | |
struct | InternalBuffer |
struct | VideoFrameSizeAbbr |
struct | VideoFrameRateAbbr |
Defines | |
#define | _XOPEN_SOURCE 600 |
#define | INTERNAL_BUFFER_SIZE 32 |
#define | SANE_NB_CHANNELS 128U |
#define | LICENSE_PREFIX "libavcodec license: " |
Functions | |
void * | av_fast_realloc (void *ptr, unsigned int *size, unsigned int min_size) |
Reallocates the given block if it is not large enough, otherwise it does nothing. | |
void | av_fast_malloc (void *ptr, unsigned int *size, unsigned int min_size) |
Allocates a buffer, reusing the given one if large enough. | |
AVCodec * | av_codec_next (AVCodec *c) |
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec after c, or NULL if c is the last one. | |
void | avcodec_register (AVCodec *codec) |
Register the codec codec and initialize libavcodec. | |
void | register_avcodec (AVCodec *codec) |
unsigned | avcodec_get_edge_width (void) |
Returns the amount of padding in pixels which the get_buffer callback must provide around the edge of the image for codecs which do not have the CODEC_FLAG_EMU_EDGE flag. | |
void | avcodec_set_dimensions (AVCodecContext *s, int width, int height) |
void | avcodec_align_dimensions2 (AVCodecContext *s, int *width, int *height, int linesize_align[4]) |
Modifies width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. | |
void | avcodec_align_dimensions (AVCodecContext *s, int *width, int *height) |
Modifies width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. | |
int | avcodec_check_dimensions (void *av_log_ctx, unsigned int w, unsigned int h) |
Checks if the given dimension of a picture is valid, meaning that all bytes of the picture can be addressed with a signed int. | |
int | avcodec_default_get_buffer (AVCodecContext *s, AVFrame *pic) |
void | avcodec_default_release_buffer (AVCodecContext *s, AVFrame *pic) |
int | avcodec_default_reget_buffer (AVCodecContext *s, AVFrame *pic) |
int | avcodec_default_execute (AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size) |
int | avcodec_default_execute2 (AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count) |
enum PixelFormat | avcodec_default_get_format (struct AVCodecContext *s, const enum PixelFormat *fmt) |
void | avcodec_get_frame_defaults (AVFrame *pic) |
Sets the fields of the given AVFrame to default values. | |
AVFrame * | avcodec_alloc_frame (void) |
Allocates an AVFrame and sets its fields to default values. | |
int attribute_align_arg | avcodec_open (AVCodecContext *avctx, AVCodec *codec) |
Initializes the AVCodecContext to use the given AVCodec. | |
int attribute_align_arg | avcodec_encode_audio (AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) |
Encodes an audio frame from samples into buf. | |
int attribute_align_arg | avcodec_encode_video (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict) |
Encodes a video frame from pict into buf. | |
int | avcodec_encode_subtitle (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub) |
int attribute_align_arg | avcodec_decode_video (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const uint8_t *buf, int buf_size) |
Decodes a video frame from buf into picture. | |
int attribute_align_arg | avcodec_decode_video2 (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) |
Decodes the video frame of size avpkt->size from avpkt->data into picture. | |
int attribute_align_arg | avcodec_decode_audio2 (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size) |
Decodes an audio frame from buf into samples. | |
int attribute_align_arg | avcodec_decode_audio3 (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) |
Decodes the audio frame of size avpkt->size from avpkt->data into samples. | |
int | avcodec_decode_subtitle (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size) |
int | avcodec_decode_subtitle2 (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) |
Decodes a subtitle message. | |
av_cold int | avcodec_close (AVCodecContext *avctx) |
AVCodec * | avcodec_find_encoder (enum CodecID id) |
Finds a registered encoder with a matching codec ID. | |
AVCodec * | avcodec_find_encoder_by_name (const char *name) |
Finds a registered encoder with the specified name. | |
AVCodec * | avcodec_find_decoder (enum CodecID id) |
Finds a registered decoder with a matching codec ID. | |
AVCodec * | avcodec_find_decoder_by_name (const char *name) |
Finds a registered decoder with the specified name. | |
static int | get_bit_rate (AVCodecContext *ctx) |
void | avcodec_string (char *buf, int buf_size, AVCodecContext *enc, int encode) |
unsigned | avcodec_version (void) |
Returns the LIBAVCODEC_VERSION_INT constant. | |
const char * | avcodec_configuration (void) |
Returns the libavcodec build-time configuration. | |
const char * | avcodec_license (void) |
Returns the libavcodec license. | |
void | avcodec_init (void) |
Initializes libavcodec. | |
void | avcodec_flush_buffers (AVCodecContext *avctx) |
Flush buffers, should be called when seeking or when switching to a different stream. | |
void | avcodec_default_free_buffers (AVCodecContext *s) |
char | av_get_pict_type_char (int pict_type) |
Returns a single letter to describe the given picture type pict_type. | |
int | av_get_bits_per_sample (enum CodecID codec_id) |
Returns codec bits per sample. | |
int | av_get_bits_per_sample_format (enum SampleFormat sample_fmt) |
Returns sample format bits per sample. | |
int | avcodec_thread_init (AVCodecContext *s, int thread_count) |
unsigned int | av_xiphlacing (unsigned char *s, unsigned int v) |
Encodes extradata length to a buffer. | |
int | av_tempfile (char *prefix, char **filename) |
int | av_parse_video_frame_size (int *width_ptr, int *height_ptr, const char *str) |
Parses str and put in width_ptr and height_ptr the detected values. | |
int | av_parse_video_frame_rate (AVRational *frame_rate, const char *arg) |
Parses str and put in frame_rate the detected values. | |
int | ff_match_2uint16 (const uint16_t(*tab)[2], int size, int a, int b) |
Return the index into tab at which {a,b} match elements {[0],[1]} of tab. | |
void | av_log_missing_feature (void *avc, const char *feature, int want_sample) |
Logs a generic warning message about a missing feature. | |
void | av_log_ask_for_sample (void *avc, const char *msg) |
Logs a generic warning message asking for a sample. | |
void | av_register_hwaccel (AVHWAccel *hwaccel) |
Registers the hardware accelerator hwaccel. | |
AVHWAccel * | av_hwaccel_next (AVHWAccel *hwaccel) |
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL, returns the next registered hardware accelerator after hwaccel, or NULL if hwaccel is the last one. | |
AVHWAccel * | ff_find_hwaccel (enum CodecID codec_id, enum PixelFormat pix_fmt) |
Returns the hardware accelerated codec for codec codec_id and pixel format pix_fmt. | |
int | av_lockmgr_register (int(*cb)(void **mutex, enum AVLockOp op)) |
Register a user provided lock manager supporting the operations specified by AVLockOp. | |
Variables | |
static int volatile | entangled_thread_counter = 0 |
int(* | ff_lockmgr_cb )(void **mutex, enum AVLockOp op) |
static void * | codec_mutex |
static AVCodec * | first_avcodec = NULL |
static const VideoFrameSizeAbbr | video_frame_size_abbrs [] |
static const VideoFrameRateAbbr | video_frame_rate_abbrs [] |
static AVHWAccel * | first_hwaccel = NULL |
Definition in file utils.c.
#define INTERNAL_BUFFER_SIZE 32 |
Definition at line 125 of file utils.c.
Referenced by avcodec_default_free_buffers(), and avcodec_default_get_buffer().
#define LICENSE_PREFIX "libavcodec license: " |
Referenced by avcodec_license(), avdevice_license(), avfilter_license(), avformat_license(), avutil_license(), postproc_license(), and swscale_license().
#define SANE_NB_CHANNELS 128U |
Referenced by avcodec_open().
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec after c, or NULL if c is the last one.
Definition at line 82 of file utils.c.
Referenced by show_codecs().
void av_fast_malloc | ( | void * | ptr, | |
unsigned int * | size, | |||
unsigned int | min_size | |||
) |
Allocates a buffer, reusing the given one if large enough.
Contrary to av_fast_realloc the current buffer contents might not be preserved and on error the old buffer is freed, thus no special handling to avoid memleaks is necessary.
ptr | pointer to pointer to already allocated buffer, overwritten with pointer to new buffer | |
size | size of the buffer *ptr points to | |
min_size | minimum size of *ptr buffer after returning, *ptr will be NULL and *size 0 if an error occurred. |
Definition at line 68 of file utils.c.
Referenced by decode_frame(), decode_i_frame(), decode_p_frame(), do_audio_out(), ff_h263_decode_frame(), ff_h264_decode_nal(), ljpeg_decode_rgb_scan(), mimic_decode_frame(), mp_decode_frame(), parse_picture_segment(), spdif_write_packet(), and tqi_decode_frame().
void* av_fast_realloc | ( | void * | ptr, | |
unsigned int * | size, | |||
unsigned int | min_size | |||
) |
Reallocates the given block if it is not large enough, otherwise it does nothing.
Definition at line 54 of file utils.c.
Referenced by allocate_buffers(), av_add_index_entry(), avcodec_default_get_buffer(), commit_slices(), decode_frame(), dirac_combine_frame(), ff_combine_frame(), ff_vaapi_alloc_slice(), ff_vdpau_add_data_chunk(), flac_decode_frame(), get_stats(), read_frame(), read_header(), and shorten_decode_frame().
int av_get_bits_per_sample | ( | enum CodecID | codec_id | ) |
Returns codec bits per sample.
[in] | codec_id | the codec |
Definition at line 985 of file utils.c.
Referenced by aiff_write_header(), au_read_packet(), av_find_stream_info(), av_write_header(), do_audio_out(), ff_alsa_open(), ff_audio_interleave_init(), get_aiff_header(), get_audio_frame_size(), get_bit_rate(), gxf_packet(), mkv_write_tracks(), mov_get_codec_tag(), mov_read_stsd(), mov_write_audio_tag(), mov_write_header(), mxf_write_generic_sound_common(), pcm_decode_frame(), pcm_encode_frame(), pcm_encode_init(), show_stream(), and voc_get_packet().
int av_get_bits_per_sample_format | ( | enum SampleFormat | sample_fmt | ) |
Returns sample format bits per sample.
[in] | sample_fmt | the sample format |
Definition at line 1030 of file utils.c.
Referenced by audio_decode_frame(), av_audio_resample_init(), decode_frame(), do_audio_out(), mkv_write_tracks(), output_packet(), and qdm2_decode_frame().
char av_get_pict_type_char | ( | int | pict_type | ) |
Returns a single letter to describe the given picture type pict_type.
[in] | pict_type | the picture type |
Definition at line 972 of file utils.c.
Referenced by decode_slice_header(), do_video_stats(), ff_flv_decode_picture_header(), ff_h263_show_pict_info(), ff_h264_decode_mb_cavlc(), ff_rate_estimate_qscale(), output_picture2(), and svq3_decode_frame().
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL, returns the next registered hardware accelerator after hwaccel, or NULL if hwaccel is the last one.
Definition at line 1268 of file utils.c.
Referenced by ff_find_hwaccel().
int av_lockmgr_register | ( | int(*)(void **mutex, enum AVLockOp op) | cb | ) |
Register a user provided lock manager supporting the operations specified by AVLockOp.
mutex points to a (void *) where the lockmgr should store/get a pointer to a user allocated mutex. It's NULL upon AV_LOCK_CREATE and != NULL for all other ops.
cb | User defined callback. Note: FFmpeg may invoke calls to this callback during the call to av_lockmgr_register(). Thus, the application must be prepared to handle that. If cb is set to NULL the lockmgr will be unregistered. Also note that during unregistration the previously registered lockmgr callback may also be invoked. |
void av_log_ask_for_sample | ( | void * | avc, | |
const char * | msg | |||
) |
Logs a generic warning message asking for a sample.
This function is intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) only, and would normally not be used by applications.
[in] | avc | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct |
[in] | msg | string containing an optional message, or NULL if no message |
Definition at line 1248 of file utils.c.
Referenced by av_log_missing_feature(), decode_channel_transform(), decode_frame(), decode_init(), decode_subframe(), determine_bitrate(), read_header(), and save_bits().
void av_log_missing_feature | ( | void * | avc, | |
const char * | feature, | |||
int | want_sample | |||
) |
Logs a generic warning message about a missing feature.
This function is intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) only, and would normally not be used by applications.
[in] | avc | a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct |
[in] | feature | string containing the name of the missing feature |
[in] | want_sample | indicates if samples are wanted which exhibit this feature. If want_sample is non-zero, additional verbage will be added to the log message which tells the user how to report samples to the development mailing list. |
Definition at line 1236 of file utils.c.
Referenced by aac_adtstoasc_filter(), amrnb_decode_frame(), asfrtp_parse_packet(), decode_audio_block(), decode_ga_specific_config(), decode_ics(), decode_ics_info(), decode_subframe(), ff_adts_decode_extradata(), ff_eac3_parse_header(), parse_adts_frame_header(), read_sbr_extension(), and synth_superframe().
int av_parse_video_frame_rate | ( | AVRational * | frame_rate, | |
const char * | str | |||
) |
Parses str and put in frame_rate the detected values.
[in] | str | the string to parse: it has to be a string in the format <frame_rate_num>/<frame_rate_den>, a float number or a valid video rate abbreviation |
[in,out] | frame_rate | pointer to the AVRational which will contain the detected frame rate |
Definition at line 1192 of file utils.c.
Referenced by opt_frame_rate(), parse_ffconfig(), and parse_frame_rate().
int av_parse_video_frame_size | ( | int * | width_ptr, | |
int * | height_ptr, | |||
const char * | str | |||
) |
Parses str and put in width_ptr and height_ptr the detected values.
[in] | str | the string to parse: it has to be a string in the format <width>x<height> or a valid video frame size abbreviation. |
[in,out] | width_ptr | pointer to the variable which will contain the detected frame width value |
[in,out] | height_ptr | pointer to the variable which will contain the detected frame height value |
Definition at line 1164 of file utils.c.
Referenced by opt_frame_size(), parse_ffconfig(), and parse_image_size().
void av_register_hwaccel | ( | AVHWAccel * | hwaccel | ) |
int av_tempfile | ( | char * | prefix, | |
char ** | filename | |||
) |
Definition at line 1072 of file utils.c.
Referenced by ff_xvid_rate_control_init(), and xvid_encode_init().
unsigned int av_xiphlacing | ( | unsigned char * | s, | |
unsigned int | v | |||
) |
Encodes extradata length to a buffer.
Used by xiph codecs.
s | buffer to write to; must be at least (v/255+1) bytes long | |
v | size of extradata in bytes |
Definition at line 1053 of file utils.c.
Referenced by fixup_vorbis_headers(), oggvorbis_encode_init(), parse_packed_headers(), and put_main_header().
void avcodec_align_dimensions | ( | AVCodecContext * | s, | |
int * | width, | |||
int * | height | |||
) |
Modifies width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding.
May only be used if a codec with CODEC_CAP_DR1 has been opened. If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased according to avcodec_get_edge_width() before.
void avcodec_align_dimensions2 | ( | AVCodecContext * | s, | |
int * | width, | |||
int * | height, | |||
int | linesize_align[4] | |||
) |
Modifies width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i].
May only be used if a codec with CODEC_CAP_DR1 has been opened. If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased according to avcodec_get_edge_width() before.
Definition at line 127 of file utils.c.
Referenced by avcodec_align_dimensions(), and avcodec_default_get_buffer().
AVFrame* avcodec_alloc_frame | ( | void | ) |
Allocates an AVFrame and sets its fields to default values.
The resulting struct can be deallocated by simply calling av_free().
Definition at line 452 of file utils.c.
Referenced by aac_encode_init(), AC3_encode_init(), adx_encode_init(), alac_encode_init(), alloc_picture(), decode_init(), encode_init(), Faac_encode_init(), flac_encode_init(), g726_init(), libgsm_init(), MP3lame_encode_init(), MPA_encode_init(), oggvorbis_encode_init(), pcm_encode_init(), roq_dpcm_encode_init(), video_decode_example(), video_encode_example(), video_thread(), vorbis_encode_init(), and vp8_init().
int avcodec_check_dimensions | ( | void * | av_log_ctx, | |
unsigned int | w, | |||
unsigned int | h | |||
) |
Checks if the given dimension of a picture is valid, meaning that all bytes of the picture can be addressed with a signed int.
[in] | w | Width of the picture. |
[in] | h | Height of the picture. |
Definition at line 222 of file utils.c.
Referenced by avcodec_decode_video2(), avcodec_default_get_buffer(), avcodec_encode_video(), avcodec_open(), avpicture_fill(), avpicture_get_size(), cmv_decode_frame(), codec_reinit(), decode_frame(), decode_init(), dnxhd_decode_frame(), ff_dirac_parse_sequence_header(), ff_flv_decode_picture_header(), ff_h264_decode_seq_parameter_set(), ff_mjpeg_decode_sof(), ff_pnm_decode_header(), gif_decode_frame(), grab_read_header(), iv_decode_frame(), libdirac_decode_frame(), libopenjpeg_decode_frame(), libschroedinger_handle_first_access_unit(), MPV_common_init(), pcx_decode_frame(), ptx_decode_frame(), qtrle_encode_init(), rv20_decode_picture_header(), rv40_parse_slice_header(), sunrast_decode_frame(), tgv_decode_frame(), tiff_decode_tag(), txd_decode_frame(), v4l2_read_header(), vp8_decode(), vqa_decode_init(), and yop_decode_init().
av_cold int avcodec_close | ( | AVCodecContext * | avctx | ) |
Definition at line 692 of file utils.c.
Referenced by audio_decode_example(), audio_encode_example(), av_find_stream_info(), close_audio(), close_connection(), close_video(), estimate_best_b_count(), stream_component_close(), video_decode_example(), and video_encode_example().
const char* avcodec_configuration | ( | void | ) |
Returns the libavcodec build-time configuration.
Definition at line 925 of file utils.c.
Referenced by show_banner().
int attribute_align_arg avcodec_decode_audio2 | ( | AVCodecContext * | avctx, | |
int16_t * | samples, | |||
int * | frame_size_ptr, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) |
Decodes an audio frame from buf into samples.
Wrapper function which calls avcodec_decode_audio3.
avctx | the codec context | |
[out] | samples | the output buffer |
[in,out] | frame_size_ptr | the output buffer size in bytes |
[in] | buf | the input buffer |
[in] | buf_size | the input buffer size in bytes |
int attribute_align_arg avcodec_decode_audio3 | ( | AVCodecContext * | avctx, | |
int16_t * | samples, | |||
int * | frame_size_ptr, | |||
AVPacket * | avpkt | |||
) |
Decodes the audio frame of size avpkt->size from avpkt->data into samples.
Some decoders may support multiple frames in a single AVPacket, such decoders would then just decode the first frame. In this case, avcodec_decode_audio3 has to be called again with an AVPacket that contains the remaining data in order to decode the second frame etc. If no frame could be outputted, frame_size_ptr is zero. Otherwise, it is the decompressed frame size in bytes.
The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.
The end of the input buffer avpkt->data should be set to 0 to ensure that no overreading happens for damaged MPEG streams.
avctx | the codec context | |
[out] | samples | the output buffer, sample type in avctx->sample_fmt |
[in,out] | frame_size_ptr | the output buffer size in bytes |
[in] | avpkt | The input AVPacket containing the input buffer. You can create such packet with av_init_packet() and by then setting data and size, some decoders might in addition need other fields. All decoders are designed to use the least fields possible though. |
Definition at line 638 of file utils.c.
Referenced by audio_decode_example(), audio_decode_frame(), avcodec_decode_audio2(), output_packet(), and try_decode_frame().
int avcodec_decode_subtitle | ( | AVCodecContext * | avctx, | |
AVSubtitle * | sub, | |||
int * | got_sub_ptr, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) |
int avcodec_decode_subtitle2 | ( | AVCodecContext * | avctx, | |
AVSubtitle * | sub, | |||
int * | got_sub_ptr, | |||
AVPacket * | avpkt | |||
) |
Decodes a subtitle message.
Returns a negative value on error, otherwise returns the number of bytes used. If no subtitle could be decompressed, got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub.
avctx | the codec context | |
[out] | sub | The AVSubtitle in which the decoded subtitle will be stored. |
[in,out] | got_sub_ptr | Zero if no subtitle could be decompressed, otherwise, it is nonzero. |
[in] | avpkt | The input AVPacket containing the input buffer. |
Definition at line 679 of file utils.c.
Referenced by avcodec_decode_subtitle(), output_packet(), and subtitle_thread().
int attribute_align_arg avcodec_decode_video | ( | AVCodecContext * | avctx, | |
AVFrame * | picture, | |||
int * | got_picture_ptr, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) |
Decodes a video frame from buf into picture.
Wrapper function which calls avcodec_decode_video2.
avctx | the codec context | |
[out] | picture | The AVFrame in which the decoded video frame will be stored. |
[in] | buf | the input buffer |
[in] | buf_size | the size of the input buffer in bytes |
[in,out] | got_picture_ptr | Zero if no frame could be decompressed, otherwise, it is nonzero. |
int attribute_align_arg avcodec_decode_video2 | ( | AVCodecContext * | avctx, | |
AVFrame * | picture, | |||
int * | got_picture_ptr, | |||
AVPacket * | avpkt | |||
) |
Decodes the video frame of size avpkt->size from avpkt->data into picture.
Some decoders may support multiple frames in a single AVPacket, such decoders would then just decode the first frame.
The end of the input buffer buf should be set to 0 to ensure that no overreading happens for damaged MPEG streams.
avctx | the codec context | |
[out] | picture | The AVFrame in which the decoded video frame will be stored. Use avcodec_alloc_frame to get an AVFrame, the codec will allocate memory for the actual bitmap. |
[in] | avpkt | The input AVpacket containing the input buffer. You can create such packet with av_init_packet() and by then setting data and size, some decoders might in addition need other fields like flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least fields possible. |
[in,out] | got_picture_ptr | Zero if no frame could be decompressed, otherwise, it is nonzero. |
Definition at line 601 of file utils.c.
Referenced by avcodec_decode_video(), get_video_frame(), output_packet(), try_decode_frame(), and video_decode_example().
int avcodec_default_execute | ( | AVCodecContext * | c, | |
int(*)(AVCodecContext *c2, void *arg2) | func, | |||
void * | arg, | |||
int * | ret, | |||
int | count, | |||
int | size | |||
) |
int avcodec_default_execute2 | ( | AVCodecContext * | c, | |
int(*)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr) | func, | |||
void * | arg, | |||
int * | ret, | |||
int | count | |||
) |
void avcodec_default_free_buffers | ( | AVCodecContext * | s | ) |
int avcodec_default_get_buffer | ( | AVCodecContext * | s, | |
AVFrame * | pic | |||
) |
enum PixelFormat avcodec_default_get_format | ( | struct AVCodecContext * | s, | |
const enum PixelFormat * | fmt | |||
) |
int avcodec_default_reget_buffer | ( | AVCodecContext * | s, | |
AVFrame * | pic | |||
) |
void avcodec_default_release_buffer | ( | AVCodecContext * | s, | |
AVFrame * | pic | |||
) |
int attribute_align_arg avcodec_encode_audio | ( | AVCodecContext * | avctx, | |
uint8_t * | buf, | |||
int | buf_size, | |||
const short * | samples | |||
) |
Encodes an audio frame from samples into buf.
avctx | the codec context | |
[out] | buf | the output buffer |
[in] | buf_size | the output buffer size |
[in] | samples | the input buffer containing the samples The number of samples read from this buffer is frame_size*channels, both of which are defined in avctx. For PCM audio the number of samples read from samples is equal to buf_size * input_sample_size / output_sample_size. |
Definition at line 536 of file utils.c.
Referenced by audio_encode_example(), do_audio_out(), output_packet(), and write_audio_frame().
int avcodec_encode_subtitle | ( | AVCodecContext * | avctx, | |
uint8_t * | buf, | |||
int | buf_size, | |||
const AVSubtitle * | sub | |||
) |
int attribute_align_arg avcodec_encode_video | ( | AVCodecContext * | avctx, | |
uint8_t * | buf, | |||
int | buf_size, | |||
const AVFrame * | pict | |||
) |
Encodes a video frame from pict into buf.
The input picture should be stored using a specific format, namely avctx.pix_fmt.
avctx | the codec context | |
[out] | buf | the output buffer for the bitstream of encoded frame |
[in] | buf_size | the size of the output buffer in bytes |
[in] | pict | the input picture to encode |
Definition at line 551 of file utils.c.
Referenced by do_video_out(), estimate_best_b_count(), output_packet(), video_encode_example(), and write_video_frame().
Finds a registered decoder with a matching codec ID.
id | CodecID of the requested decoder |
Definition at line 755 of file utils.c.
Referenced by audio_decode_example(), av_find_stream_info(), av_transcode(), avcodec_string(), find_codec_or_die(), open_input_file(), open_parser(), sdp_parse_rtpmap(), stream_component_open(), try_decode_frame(), and video_decode_example().
AVCodec* avcodec_find_decoder_by_name | ( | const char * | name | ) |
Finds a registered decoder with the specified name.
name | name of the requested decoder |
Definition at line 767 of file utils.c.
Referenced by find_codec_or_die(), and opt_input_file().
Finds a registered encoder with a matching codec ID.
id | CodecID of the requested encoder |
Definition at line 725 of file utils.c.
Referenced by asf_write_header1(), audio_encode_example(), av_transcode(), avcodec_string(), compute_status(), estimate_best_b_count(), find_codec_or_die(), new_audio_stream(), new_video_stream(), open_audio(), open_video(), read_ffserver_streams(), and video_encode_example().
AVCodec* avcodec_find_encoder_by_name | ( | const char * | name | ) |
Finds a registered encoder with the specified name.
name | name of the requested encoder |
Definition at line 741 of file utils.c.
Referenced by find_codec_or_die(), new_audio_stream(), new_subtitle_stream(), new_video_stream(), opt_audio_codec(), and opt_video_codec().
void avcodec_flush_buffers | ( | AVCodecContext * | avctx | ) |
Flush buffers, should be called when seeking or when switching to a different stream.
Definition at line 947 of file utils.c.
Referenced by audio_decode_frame(), get_video_frame(), and subtitle_thread().
unsigned avcodec_get_edge_width | ( | void | ) |
void avcodec_get_frame_defaults | ( | AVFrame * | pic | ) |
Sets the fields of the given AVFrame to default values.
pic | The AVFrame of which the fields should be set to default values. |
Definition at line 445 of file utils.c.
Referenced by av_transcode(), avcodec_alloc_frame(), bmp_decode_init(), bmp_encode_init(), cdg_init_frame(), decode_init(), do_video_out(), encode_init(), estimate_best_b_count(), ff_pnm_init(), gif_decode_init(), MPV_common_init(), output_packet(), pcx_encode_init(), pcx_init(), png_dec_init(), png_enc_init(), ptx_init(), sgi_init(), sunrast_init(), targa_encode_init(), targa_init(), tiff_init(), try_decode_frame(), and txd_init().
void avcodec_init | ( | void | ) |
Initializes libavcodec.
Definition at line 936 of file utils.c.
Referenced by avcodec_register(), and main().
const char* avcodec_license | ( | void | ) |
int attribute_align_arg avcodec_open | ( | AVCodecContext * | avctx, | |
AVCodec * | codec | |||
) |
Initializes the AVCodecContext to use the given AVCodec.
Prior to using this function the context has to be allocated.
The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for retrieving a codec.
avcodec_register_all(); codec = avcodec_find_decoder(CODEC_ID_H264); if (!codec) exit(1); context = avcodec_alloc_context(); if (avcodec_open(context, codec) < 0) exit(1);
avctx | The context which will be set up to use the given codec. | |
codec | The codec to use within the context. |
Definition at line 462 of file utils.c.
Referenced by audio_decode_example(), audio_encode_example(), av_find_stream_info(), av_transcode(), estimate_best_b_count(), open_audio(), open_input_file(), open_parser(), open_video(), stream_component_open(), try_decode_frame(), video_decode_example(), and video_encode_example().
void avcodec_register | ( | AVCodec * | codec | ) |
Register the codec codec and initialize libavcodec.
Definition at line 87 of file utils.c.
Referenced by register_avcodec().
void avcodec_set_dimensions | ( | AVCodecContext * | s, | |
int | width, | |||
int | height | |||
) |
Definition at line 109 of file utils.c.
Referenced by av_mpeg4_decode_header(), avcodec_open(), cmv_process_header(), decode_frame(), decode_slice_header(), dnxhd_decode_frame(), ff_dirac_parse_sequence_header(), ff_h263_decode_frame(), ff_mjpeg_decode_sof(), gif_decode_frame(), h261_decode_frame(), iv_decode_frame(), libopenjpeg_decode_frame(), mpeg_decode_postinit(), mpegvideo_extract_headers(), pcx_decode_frame(), ptx_decode_frame(), rv20_decode_picture_header(), rv34_decode_slice(), sunrast_decode_frame(), svq1_decode_frame(), tgq_decode_frame(), tgv_decode_frame(), theora_header(), tiff_decode_tag(), tqi_decode_frame(), txd_decode_frame(), vp5_parse_header(), vp6_parse_header(), and vp8_decode().
void avcodec_string | ( | char * | buf, | |
int | buf_size, | |||
AVCodecContext * | enc, | |||
int | encode | |||
) |
Definition at line 804 of file utils.c.
Referenced by av_find_stream_info(), and dump_stream_format().
int avcodec_thread_init | ( | AVCodecContext * | s, | |
int | thread_count | |||
) |
unsigned avcodec_version | ( | void | ) |
AVHWAccel* ff_find_hwaccel | ( | enum CodecID | codec_id, | |
enum PixelFormat | pix_fmt | |||
) |
Returns the hardware accelerated codec for codec codec_id and pixel format pix_fmt.
codec_id | the codec to match | |
pix_fmt | the pixel format to match |
Definition at line 1273 of file utils.c.
Referenced by decode_slice_header(), ff_h263_decode_init(), vc1_decode_init(), and vcr2_init_sequence().
int ff_match_2uint16 | ( | const uint16_t(*) | tab[2], | |
int | size, | |||
int | a, | |||
int | b | |||
) |
Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
If there is no such matching pair then size is returned.
Definition at line 1230 of file utils.c.
Referenced by h263_encode_picture_header(), MPV_encode_init(), and svq1_write_header().
static int get_bit_rate | ( | AVCodecContext * | ctx | ) | [static] |
void register_avcodec | ( | AVCodec * | codec | ) |
void* codec_mutex [static] |
Definition at line 52 of file utils.c.
Referenced by av_lockmgr_register(), avcodec_close(), and avcodec_open().
int volatile entangled_thread_counter = 0 [static] |
int(* ff_lockmgr_cb)(void **mutex, enum AVLockOp op) |
Referenced by av_lockmgr_register(), avcodec_close(), and avcodec_open().
AVCodec* first_avcodec = NULL [static] |
AVHWAccel* first_hwaccel = NULL [static] |
const VideoFrameRateAbbr video_frame_rate_abbrs[] [static] |
const VideoFrameSizeAbbr video_frame_size_abbrs[] [static] |