FFmpeg
Functions | Variables
demux_decode.c File Reference
#include <libavutil/imgutils.h>
#include <libavutil/samplefmt.h>
#include <libavutil/timestamp.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

Go to the source code of this file.

Functions

static int output_video_frame (AVFrame *frame)
 
static int output_audio_frame (AVFrame *frame)
 
static int decode_packet (AVCodecContext *dec, const AVPacket *pkt)
 
static int open_codec_context (int *stream_idx, AVCodecContext **dec_ctx, AVFormatContext *fmt_ctx, enum AVMediaType type)
 
static int get_format_from_sample_fmt (const char **fmt, enum AVSampleFormat sample_fmt)
 
int main (int argc, char **argv)
 

Variables

static AVFormatContextfmt_ctx = NULL
 
static AVCodecContextvideo_dec_ctx = NULL
 
static AVCodecContextaudio_dec_ctx
 
static int width
 
static int height
 
static enum AVPixelFormat pix_fmt
 
static AVStreamvideo_stream = NULL
 
static AVStreamaudio_stream = NULL
 
static const char * src_filename = NULL
 
static const char * video_dst_filename = NULL
 
static const char * audio_dst_filename = NULL
 
static FILE * video_dst_file = NULL
 
static FILE * audio_dst_file = NULL
 
static uint8_t * video_dst_data [4] = {NULL}
 
static int video_dst_linesize [4]
 
static int video_dst_bufsize
 
static int video_stream_idx = -1
 
static int audio_stream_idx = -1
 
static AVFrameframe = NULL
 
static AVPacketpkt = NULL
 
static int video_frame_count = 0
 
static int audio_frame_count = 0
 

Function Documentation

◆ output_video_frame()

static int output_video_frame ( AVFrame frame)
static
Examples
demux_decode.c.

Definition at line 59 of file demux_decode.c.

Referenced by decode_packet().

◆ output_audio_frame()

static int output_audio_frame ( AVFrame frame)
static
Examples
demux_decode.c.

Definition at line 90 of file demux_decode.c.

Referenced by decode_packet().

◆ decode_packet()

static int decode_packet ( AVCodecContext dec,
const AVPacket pkt 
)
static
Examples
demux_decode.c.

Definition at line 110 of file demux_decode.c.

Referenced by main().

◆ open_codec_context()

static int open_codec_context ( int *  stream_idx,
AVCodecContext **  dec_ctx,
AVFormatContext fmt_ctx,
enum AVMediaType  type 
)
static
Examples
demux_decode.c.

Definition at line 146 of file demux_decode.c.

Referenced by main().

◆ get_format_from_sample_fmt()

static int get_format_from_sample_fmt ( const char **  fmt,
enum AVSampleFormat  sample_fmt 
)
static
Examples
demux_decode.c.

Definition at line 197 of file demux_decode.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)
Examples
demux_decode.c.

Definition at line 226 of file demux_decode.c.

Variable Documentation

◆ fmt_ctx

AVFormatContext* fmt_ctx = NULL
static
Examples
demux_decode.c.

Definition at line 38 of file demux_decode.c.

Referenced by main(), and open_codec_context().

◆ video_dec_ctx

AVCodecContext* video_dec_ctx = NULL
static
Examples
demux_decode.c.

Definition at line 39 of file demux_decode.c.

Referenced by main().

◆ audio_dec_ctx

AVCodecContext * audio_dec_ctx
static
Examples
demux_decode.c.

Definition at line 39 of file demux_decode.c.

Referenced by main(), and output_audio_frame().

◆ width

int width
static
Examples
demux_decode.c.

Definition at line 40 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ height

int height
static
Examples
demux_decode.c.

Definition at line 40 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ pix_fmt

enum AVPixelFormat pix_fmt
static
Examples
demux_decode.c, and mux.c.

Definition at line 41 of file demux_decode.c.

Referenced by alloc_frame(), amf_encode_init_av1(), amf_encode_init_h264(), amf_encode_init_hevc(), amf_init_encoder(), av_dv_codec_profile(), av_dv_codec_profile2(), av_get_pix_fmt(), av_get_pix_fmt_name(), av_get_pix_fmt_string(), av_hwframe_ctx_init(), av_image_alloc(), av_image_check_size2(), av_image_copy(), av_image_copy2(), av_image_copy_to_buffer(), av_image_copy_uc_from(), av_image_fill_arrays(), av_image_fill_black(), av_image_fill_color(), av_image_fill_linesizes(), av_image_fill_plane_sizes(), av_image_fill_pointers(), av_image_get_buffer_size(), av_image_get_linesize(), av_pix_fmt_count_planes(), av_pix_fmt_desc_get(), av_pix_fmt_get_chroma_sub_sample(), av_pix_fmt_swap_endianness(), avi_write_header(), avpriv_set_systematic_pal2(), check_chrConvertRange(), check_image_fill(), check_image_fill_black(), check_image_pointers(), check_lumConvertRange(), compute_cmask(), convert_pix_fmt(), dc1394_read_common(), decode_frame_header(), device_try_init(), fbdev_read_header(), fbdev_write_header(), ff_fill_ayuv_map(), ff_fill_rgba_map(), ff_fmt_ff2v4l(), ff_h274_film_grain_params_supported(), ff_huffyuvdsp_init(), ff_huffyuvdsp_init_x86(), ff_huffyuvencdsp_init(), ff_huffyuvencdsp_init_x86(), ff_img_read_header(), ff_load_image(), ff_media_type_to_pix_fmt(), ff_pix_fmt_to_guid(), ff_put_bmp_header(), ff_vk_mt_is_np_rgb(), ff_vk_shader_rep_fmt(), fill_frameinfo_by_link(), get_pix_fmt_depth(), get_pix_fmt_internal(), get_pixel_format(), get_sw_pixel_format(), have_alpha_planar(), hevc_frame_start(), image_copy(), init(), is16BPS(), is32BPS(), isALPHA(), isAnyRGB(), isBayer(), isBayer16BPS(), isBE(), isBGRinInt(), isDataInHighBits(), isFloat(), isFloat16(), isGray(), isNBPS(), isPacked(), isPackedRGB(), isPlanar(), isPlanarRGB(), isPlanarYUV(), isRGB(), isRGBinInt(), isSemiPlanarYUV(), isSwappedChroma(), isYUV(), list_formats(), load_mask(), main(), map_chroma_format(), mf_encv_input_adjust(), mf_encv_input_score(), mpegvideo_extract_headers(), nvenc_map_buffer_format(), opencl_frames_get_constraints(), opengl_compile_shaders(), opengl_draw(), opengl_fill_color_map(), output_video_frame(), parse_pixel_format(), pix_fmt_map(), pix_fmt_match(), pixfmt_from_pixmap_format(), print_pix_fmt_fourccs(), qrencodesrc_query_formats(), qsv_decode_header(), qsv_decode_preinit(), qsv_process_data(), query_formats(), range_map(), rawvideo_read_header(), ser_read_header(), show_pix_fmts(), swf_read_packet(), sws_isSupportedEndiannessConversion(), sws_isSupportedInput(), sws_isSupportedOutput(), usePal(), v4l2_read_header(), vaapi_device_init(), vaapi_format_from_pix_fmt(), vaapi_frames_get_constraints(), vaapi_get_image_format(), vbn_decode_frame(), vdpau_transfer_data_from(), vdpau_transfer_data_to(), vulkan_decode_get_profile(), xwd_encode_frame(), and yuv4_read_header().

◆ video_stream

AVStream* video_stream = NULL
static

◆ audio_stream

AVStream * audio_stream = NULL
static
Examples
demux_decode.c.

Definition at line 42 of file demux_decode.c.

Referenced by event_loop(), main(), and yop_read_header().

◆ src_filename

const char* src_filename = NULL
static
Examples
demux_decode.c.

Definition at line 43 of file demux_decode.c.

Referenced by main(), and open_codec_context().

◆ video_dst_filename

const char* video_dst_filename = NULL
static
Examples
demux_decode.c.

Definition at line 44 of file demux_decode.c.

Referenced by main().

◆ audio_dst_filename

const char* audio_dst_filename = NULL
static
Examples
demux_decode.c.

Definition at line 45 of file demux_decode.c.

Referenced by main().

◆ video_dst_file

FILE* video_dst_file = NULL
static
Examples
demux_decode.c.

Definition at line 46 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ audio_dst_file

FILE* audio_dst_file = NULL
static
Examples
demux_decode.c.

Definition at line 47 of file demux_decode.c.

Referenced by main(), and output_audio_frame().

◆ video_dst_data

uint8_t* video_dst_data[4] = {NULL}
static
Examples
demux_decode.c.

Definition at line 49 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ video_dst_linesize

int video_dst_linesize[4]
static
Examples
demux_decode.c.

Definition at line 50 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ video_dst_bufsize

int video_dst_bufsize
static
Examples
demux_decode.c.

Definition at line 51 of file demux_decode.c.

Referenced by main(), and output_video_frame().

◆ video_stream_idx

int video_stream_idx = -1
static
Examples
demux_decode.c.

Definition at line 53 of file demux_decode.c.

Referenced by main().

◆ audio_stream_idx

int audio_stream_idx = -1
static
Examples
demux_decode.c.

Definition at line 53 of file demux_decode.c.

Referenced by main().

◆ frame

AVFrame* frame = NULL
static

Definition at line 54 of file demux_decode.c.

Referenced by decode_packet(), main(), output_audio_frame(), and output_video_frame().

◆ pkt

AVPacket* pkt = NULL
static

Definition at line 55 of file demux_decode.c.

Referenced by decode_packet(), and main().

◆ video_frame_count

int video_frame_count = 0
static
Examples
demux_decode.c.

Definition at line 56 of file demux_decode.c.

Referenced by output_video_frame().

◆ audio_frame_count

int audio_frame_count = 0
static
Examples
demux_decode.c.

Definition at line 57 of file demux_decode.c.

Referenced by fourxm_read_packet(), and output_audio_frame().