Loading...
Searching...
No Matches
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 AVFormatContext * | fmt_ctx = NULL
static AVCodecContext * | video_dec_ctx = NULL
static AVCodecContext * | audio_dec_ctx
static int | width
static int | height
static enum AVPixelFormat | pix_fmt
static AVStream * | video_stream = NULL
static AVStream * | audio_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 AVFrame * | frame = NULL
static AVPacket * | pkt = NULL
static int | video_frame_count = 0
static int | audio_frame_count = 0

## Function Documentation

## output_video_frame()

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()

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()

int decode_packet | ( | AVCodecContext * | dec,
|  | const AVPacket * | pkt )

static

Examples
  demux_decode.c, extract_mvs.c, and qsv_decode.c.

Definition at line 110 of file demux_decode.c.

Referenced by main().

## open_codec_context()

int open_codec_context | ( | int * | stream_idx,
|  | AVCodecContext ** | dec_ctx,
|  | AVFormatContext * | fmt_ctx,
|  | enum AVMediaType | type )

static

Examples
  demux_decode.c, and extract_mvs.c.

Definition at line 146 of file demux_decode.c.

Referenced by main().

## get_format_from_sample_fmt()

int get_format_from_sample_fmt | ( | const char ** | fmt,
|  | enum AVSampleFormat | sample_fmt )

static

Definition at line 197 of file demux_decode.c.

## main()

int main | ( | int | argc,
|  | char ** | argv )

Definition at line 226 of file demux_decode.c.

## Variable Documentation

## fmt_ctx

AVFormatContext* fmt_ctx = NULL

static

Definition at line 38 of file demux_decode.c.

## video_dec_ctx

AVCodecContext* video_dec_ctx = NULL

static

Examples
  demux_decode.c, and extract_mvs.c.

Definition at line 39 of file demux_decode.c.

Referenced by decode_packet(), main(), and open_codec_context().

## 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, mux.c, scale_video.c, and vaapi_encode.c.

Definition at line 40 of file demux_decode.c.

Referenced by alloc_frame(), av_dv_codec_profile(), av_dv_codec_profile2(), 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_get_buffer_size(), av_image_get_linesize(), av_spherical_tile_bounds(), av_vdpau_get_surface_parameters(), avcodec_align_dimensions(), avcodec_align_dimensions2(), fill_yuv_image(), fill_yuv_image(), main(), main(), output_video_frame(), and set_hwframe_ctx().

## height

int height

static

Examples
  demux_decode.c, mux.c, scale_video.c, and vaapi_encode.c.

Definition at line 40 of file demux_decode.c.

Referenced by alloc_frame(), av_dv_codec_profile(), av_dv_codec_profile2(), av_image_copy(), av_image_copy2(), av_image_copy_plane(), av_image_copy_plane_uc_from(), 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_plane_sizes(), av_image_fill_pointers(), av_image_get_buffer_size(), av_spherical_tile_bounds(), av_vdpau_get_surface_parameters(), avcodec_align_dimensions(), avcodec_align_dimensions2(), fill_yuv_image(), fill_yuv_image(), main(), main(), output_video_frame(), set_hwframe_ctx(), and sws_normalizeVec().

## pix_fmt

enum AVPixelFormat pix_fmt

static

Examples
  demux_decode.c, mux.c, and transcode.c.

Definition at line 41 of file demux_decode.c.

Referenced by alloc_frame(), av_dv_codec_profile(), av_dv_codec_profile2(), av_get_pix_fmt_name(), av_get_pix_fmt_string(), 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_map_videotoolbox_format_from_pixfmt(), av_map_videotoolbox_format_from_pixfmt2(), av_pix_fmt_count_planes(), av_pix_fmt_desc_get(), av_pix_fmt_get_chroma_sub_sample(), av_pix_fmt_swap_endianness(), avcodec_pix_fmt_to_codec_tag(), main(), output_video_frame(), sws_isSupportedEndiannessConversion(), sws_isSupportedInput(), and sws_isSupportedOutput().

## video_stream

AVStream* video_stream = NULL

static

Examples
  demux_decode.c, extract_mvs.c, hw_decode.c, qsv_transcode.c, and vaapi_transcode.c.

Definition at line 42 of file demux_decode.c.

Referenced by encode_write(), main(), main(), open_codec_context(), open_input_file(), and open_input_file().

## audio_stream

AVStream * audio_stream = NULL

static

Examples
  demux_decode.c.

Definition at line 42 of file demux_decode.c.

Referenced by main().

## src_filename

const char* src_filename = NULL

static

Examples
  demux_decode.c, and extract_mvs.c.

Definition at line 43 of file demux_decode.c.

Referenced by main(), open_codec_context(), 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, and extract_mvs.c.

Definition at line 53 of file demux_decode.c.

Referenced by main(), and open_codec_context().

## 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

Examples
  decode_audio.c, decode_filter_audio.c, decode_filter_video.c, decode_video.c, demux_decode.c, encode_audio.c, encode_video.c, extract_mvs.c, filter_audio.c, hw_decode.c, mux.c, qsv_decode.c, qsv_transcode.c, transcode.c, transcode_aac.c, vaapi_encode.c, and vaapi_transcode.c.

Definition at line 54 of file demux_decode.c.

Referenced by alloc_audio_frame(), alloc_frame(), av_ambient_viewing_environment_create_side_data(), av_buffersink_get_frame(), av_buffersink_get_frame_flags(), av_buffersink_get_samples(), av_buffersrc_add_frame(), av_buffersrc_add_frame_flags(), av_buffersrc_write_frame(), av_content_light_metadata_create_side_data(), av_detection_bbox_create_side_data(), av_downmix_info_update_side_data(), av_dv_frame_profile(), av_dynamic_hdr_plus_create_side_data(), av_dynamic_hdr_vivid_create_side_data(), av_film_grain_params_create_side_data(), av_film_grain_params_select(), av_frame_apply_cropping(), av_frame_free(), av_frame_get_buffer(), av_frame_get_plane_buffer(), av_frame_get_side_data(), av_frame_is_writable(), av_frame_make_writable(), av_frame_new_side_data(), av_frame_new_side_data_from_buf(), av_frame_remove_side_data(), av_frame_unref(), av_guess_frame_rate(), av_guess_sample_aspect_ratio(), av_hwframe_get_buffer(), av_interleaved_write_uncoded_frame(), av_mastering_display_metadata_create_side_data(), av_stereo3d_create_side_data(), av_video_enc_params_create_side_data(), av_video_hint_create_side_data(), av_write_uncoded_frame(), avcodec_default_get_buffer2(), avcodec_fill_audio_frame(), avcodec_receive_frame(), avcodec_receive_frame_flags(), avcodec_send_frame(), dec_enc(), dec_enc(), decode(), decode(), decode_audio_frame(), decode_packet(), decode_packet(), decode_packet(), decode_write(), display_frame(), encode(), encode(), encode_audio_frame(), encode_write(), encode_write(), encode_write(), filter_encode_write_frame(), get_audio_frame(), get_input(), init_input_frame(), init_output_frame(), main(), main(), output_audio_frame(), output_video_frame(), print_frame(), process_output(), sws_test_frame(), write_audio_frame(), and write_frame().

## pkt

AVPacket* pkt = NULL

static

Examples
  decode_audio.c, decode_video.c, demux_decode.c, encode_audio.c, encode_video.c, extract_mvs.c, mux.c, qsv_decode.c, qsv_transcode.c, remux.c, and vaapi_transcode.c.

Definition at line 55 of file demux_decode.c.

Referenced by av_append_packet(), av_bsf_receive_packet(), av_bsf_send_packet(), av_get_packet(), av_grow_packet(), av_interleaved_write_frame(), av_new_packet(), av_packet_add_side_data(), av_packet_free(), av_packet_free_side_data(), av_packet_from_data(), av_packet_get_side_data(), av_packet_make_refcounted(), av_packet_make_writable(), av_packet_new_side_data(), av_packet_rescale_ts(), av_packet_shrink_side_data(), av_packet_unref(), av_pkt_dump2(), av_pkt_dump_log2(), av_read_frame(), av_shrink_packet(), av_smpte_436m_anc_append(), av_write_frame(), avcodec_default_get_encode_buffer(), dec_enc(), dec_enc(), decode(), decode(), decode_packet(), decode_packet(), decode_packet(), encode(), encode(), log_packet(), log_packet(), main(), and write_frame().

## video_frame_count

int video_frame_count = 0

static

Examples
  demux_decode.c, and extract_mvs.c.

Definition at line 56 of file demux_decode.c.

Referenced by decode_packet(), and 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 output_audio_frame().