FFmpeg
|
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/frame.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/samplefmt.h"
#include "avcodec.h"
#include "encode.h"
#include "frame_thread_encoder.h"
#include "internal.h"
Go to the source code of this file.
int ff_alloc_packet2 | ( | AVCodecContext * | avctx, |
AVPacket * | avpkt, | ||
int64_t | size, | ||
int64_t | min_size | ||
) |
Check AVPacket size and/or allocate data.
Encoders supporting AVCodec.encode2() can use this as a convenience to ensure the output packet data is large enough, whether provided by the user or allocated in this function.
avctx | the AVCodecContext of the encoder |
avpkt | the AVPacket If avpkt->data is already set, avpkt->size is checked to ensure it is large enough. If avpkt->data is NULL, a new buffer is allocated. avpkt->size is set to the specified size. All other AVPacket fields will be reset with av_init_packet(). |
size | the minimum required packet size |
min_size | This is a hint to the allocation algorithm, which indicates to what minimal size the caller might later shrink the packet to. Encoders often allocate packets which are larger than the amount of data that is written into them as the exact amount is not known at the time of allocation. min_size represents the size a packet might be shrunk to by the caller. Can be set to 0. setting this roughly correctly allows the allocation code to choose between several allocation strategies to improve speed slightly. |
Definition at line 33 of file encode.c.
Referenced by a64multi_encode_frame(), aac_encode_frame(), adx_encode_frame(), alac_encode_frame(), amr_wb_encode_frame(), aptx_encode_frame(), avui_encode_frame(), bmp_encode_frame(), cfhd_encode_frame(), cinepak_encode_frame(), cng_encode_frame(), dnxhd_encode_picture(), dvvideo_encode_frame(), encode_apng(), encode_frame(), encode_nals(), encode_picture_ls(), encode_png(), encode_superframe(), ff_ac3_encode_frame_common_end(), ff_mpv_encode_picture(), ffat_encode(), fits_encode_frame(), flac_encode_frame(), flashsv2_encode_frame(), flashsv_encode_frame(), g723_1_encode_frame(), gif_encode_frame(), hap_encode(), ilbc_encode_frame(), libcodec2_encode(), libgsm_encode_frame(), libkvazaar_encode(), libopenjpeg_encode_frame(), libopus_encode(), libshine_encode_frame(), libvorbis_encode_frame(), libwebp_anim_encode_frame(), libwebp_encode_frame(), libx265_encode_frame(), ljpeg_encode_frame(), magy_encode_frame(), mlp_encode_frame(), mp3lame_encode_frame(), MPA_encode_frame(), omx_encode_frame(), opus_encode_frame(), pam_encode_frame(), pcm_dvd_encode_frame(), pcm_encode_frame(), pcx_encode_frame(), pnm_encode_frame(), prores_encode_frame(), qtrle_encode_frame(), ra144_encode_frame(), raw_encode(), roq_dpcm_encode_frame(), roq_encode_frame(), rpza_encode_frame(), s302m_encode2_frame(), sbc_encode_frame(), storeframe(), sunrast_encode_frame(), svc_encode_frame(), svq1_encode_frame(), targa_encode_frame(), tta_encode_frame(), twolame_encode_frame(), utvideo_encode_frame(), v308_encode_frame(), v408_encode_frame(), v410_encode_frame(), vorbis_encode_frame(), vtenc_cm_to_avpacket(), wavpack_encode_frame(), XAVS_frame(), xbm_encode_frame(), xface_encode_frame(), xvid_encode_frame(), xwd_encode_frame(), y41p_encode_frame(), and yuv4_encode_frame().
int ff_get_encode_buffer | ( | AVCodecContext * | avctx, |
AVPacket * | avpkt, | ||
int64_t | size, | ||
int | flags | ||
) |
Get a buffer for a packet.
This is a wrapper around AVCodecContext.get_encode_buffer() and should be used instead calling get_encode_buffer() directly.
Definition at line 82 of file encode.c.
Referenced by amf_copy_buffer(), librav1e_receive_packet(), mf_sample_to_avpacket(), process_output_surface(), and vaapi_encode_output().
|
static |
Pad last frame with silence.
Definition at line 115 of file encode.c.
Referenced by encode_send_frame_internal().
int ff_encode_get_frame | ( | AVCodecContext * | avctx, |
AVFrame * | frame | ||
) |
Called by encoders to get the next frame for encoding.
frame | An empty frame to be filled with data. |
Definition at line 160 of file encode.c.
Referenced by eb_receive_packet(), encode_simple_internal(), ff_amf_receive_packet(), ff_nvenc_receive_packet(), ff_vaapi_encode_receive_packet(), librav1e_receive_packet(), mf_receive_packet(), and v4l2_receive_packet().
|
static |
Definition at line 175 of file encode.c.
Referenced by encode_simple_receive_packet().
|
static |
Definition at line 270 of file encode.c.
Referenced by encode_receive_packet_internal().
|
static |
Definition at line 283 of file encode.c.
Referenced by avcodec_receive_packet(), and avcodec_send_frame().
|
static |
Definition at line 317 of file encode.c.
Referenced by avcodec_send_frame().
|
static |
Definition at line 417 of file encode.c.
Referenced by avcodec_encode_audio2(), and avcodec_encode_video2().
int ff_encode_preinit | ( | AVCodecContext * | avctx | ) |
Definition at line 527 of file encode.c.
Referenced by avcodec_open2().