Libav
Data Structures | Macros | Enumerations | Functions | Variables
avplay.c File Reference
#include "config.h"
#include <inttypes.h>
#include <math.h>
#include <limits.h>
#include <stdint.h>
#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
#include "libavutil/display.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/dict.h"
#include "libavutil/parseutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/time.h"
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libavresample/avresample.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/buffersink.h"
#include "libavfilter/buffersrc.h"
#include "cmdutils.h"
#include <SDL.h>
#include <SDL_thread.h>
#include <assert.h>
#include "cmdutils_common_opts.h"

Go to the source code of this file.

Data Structures

struct  PacketQueue
 
struct  VideoPicture
 
struct  SubPicture
 
struct  PlayerState
 

Macros

#define MAX_QUEUE_SIZE   (15 * 1024 * 1024)
 
#define MIN_AUDIOQ_SIZE   (20 * 16 * 1024)
 
#define MIN_FRAMES   5
 
#define SDL_AUDIO_BUFFER_SIZE   1024
 
#define AV_SYNC_THRESHOLD   0.01
 
#define AV_NOSYNC_THRESHOLD   10.0
 
#define FRAME_SKIP_FACTOR   0.05
 
#define SAMPLE_CORRECTION_PERCENT_MAX   10
 
#define AUDIO_DIFF_AVG_NB   20
 
#define SAMPLE_ARRAY_SIZE   (2 * 65536)
 
#define VIDEO_PICTURE_QUEUE_SIZE   2
 
#define SUBPICTURE_QUEUE_SIZE   4
 
#define FF_ALLOC_EVENT   (SDL_USEREVENT)
 
#define FF_REFRESH_EVENT   (SDL_USEREVENT + 1)
 
#define FF_QUIT_EVENT   (SDL_USEREVENT + 2)
 
#define ALPHA_BLEND(a, oldp, newp, s)   ((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s))
 
#define RGBA_IN(r, g, b, a, s)
 
#define YUVA_IN(y, u, v, a, s, pal)
 
#define YUVA_OUT(d, y, u, v, a)
 
#define BPP   1
 
#define INSERT_FILT(name, arg)
 
#define OFF(x)   offsetof(PlayerState, x)
 

Enumerations

enum  { AV_SYNC_AUDIO_MASTER, AV_SYNC_VIDEO_MASTER, AV_SYNC_EXTERNAL_CLOCK }
 

Functions

static int packet_queue_put (PacketQueue *q, AVPacket *pkt)
 
static void packet_queue_init (PacketQueue *q)
 
static void packet_queue_flush (PacketQueue *q)
 
static void packet_queue_end (PacketQueue *q)
 
static void packet_queue_abort (PacketQueue *q)
 
static int packet_queue_get (PacketQueue *q, AVPacket *pkt, int block)
 
static void fill_rectangle (SDL_Surface *screen, int x, int y, int w, int h, int color)
 
static void blend_subrect (uint8_t *dst[4], uint16_t dst_linesize[4], const AVSubtitleRect *rect, int imgw, int imgh)
 
static void free_subpicture (SubPicture *sp)
 
static void video_image_display (PlayerState *is)
 
static int audio_write_get_buf_size (PlayerState *is)
 
static int compute_mod (int a, int b)
 
static void video_audio_display (PlayerState *s)
 
static int video_open (PlayerState *is)
 
static void video_display (PlayerState *is)
 
static int refresh_thread (void *opaque)
 
static double get_audio_clock (PlayerState *is)
 
static double get_video_clock (PlayerState *is)
 
static double get_external_clock (PlayerState *is)
 
static double get_master_clock (PlayerState *is)
 
static void stream_seek (PlayerState *is, int64_t pos, int64_t rel, int seek_by_bytes)
 
static void stream_pause (PlayerState *is)
 
static double compute_target_time (double frame_current_pts, PlayerState *is)
 
static void video_refresh_timer (void *opaque)
 
static void player_close (PlayerState *is)
 
static void do_exit (void)
 
static void alloc_picture (void *opaque)
 
static int queue_picture (PlayerState *is, AVFrame *src_frame, double pts, int64_t pos)
 
static int output_picture2 (PlayerState *is, AVFrame *src_frame, double pts1, int64_t pos)
 
static int get_video_frame (PlayerState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
 
static int configure_video_filters (AVFilterGraph *graph, PlayerState *is, const char *vfilters)
 
static int video_thread (void *arg)
 
static int subtitle_thread (void *arg)
 
static void update_sample_display (PlayerState *is, short *samples, int samples_size)
 
static int synchronize_audio (PlayerState *is, short *samples, int samples_size1, double pts)
 
static int audio_decode_frame (PlayerState *is, double *pts_ptr)
 
static void sdl_audio_callback (void *opaque, Uint8 *stream, int len)
 
static AVCodecfind_codec_or_die (const char *name, enum AVMediaType type)
 
static AVCodecchoose_decoder (PlayerState *is, AVFormatContext *ic, AVStream *st)
 
static int stream_component_open (PlayerState *is, int stream_index)
 
static void stream_component_close (PlayerState *is, int stream_index)
 
static int decode_interrupt_cb (void *ctx)
 
static void stream_close (PlayerState *is)
 
static int stream_setup (PlayerState *is)
 
static int decode_thread (void *arg)
 
static int stream_open (PlayerState *is, const char *filename, AVInputFormat *iformat)
 
static void stream_cycle_channel (PlayerState *is, int codec_type)
 
static void toggle_full_screen (void)
 
static void toggle_pause (void)
 
static void step_to_next_frame (void)
 
static void toggle_audio_display (void)
 
static void seek_chapter (PlayerState *is, int incr)
 
static void event_loop (void)
 
static int opt_frame_size (void *optctx, const char *opt, const char *arg)
 
static int opt_width (void *optctx, const char *opt, const char *arg)
 
static int opt_height (void *optctx, const char *opt, const char *arg)
 
static int opt_format (void *optctx, const char *opt, const char *arg)
 
static int opt_frame_pix_fmt (void *optctx, const char *opt, const char *arg)
 
static int opt_sync (void *optctx, const char *opt, const char *arg)
 
static int opt_seek (void *optctx, const char *opt, const char *arg)
 
static int opt_duration (void *optctx, const char *opt, const char *arg)
 
static void show_usage (void)
 
void show_help_default (const char *opt, const char *arg)
 Per-avtool specific help handler. More...
 
static void opt_input_file (void *optctx, const char *filename)
 
int main (int argc, char **argv)
 

Variables

const char program_name [] = "avplay"
 program name, defined by the program for show_version(). More...
 
const int program_birth_year = 2003
 program birth year, defined by the program for show_banner() More...
 
static int64_t sws_flags = SWS_BICUBIC
 
static AVInputFormatfile_iformat
 
static const char * input_filename
 
static const char * window_title
 
static int fs_screen_width
 
static int fs_screen_height
 
static int screen_width = 0
 
static int screen_height = 0
 
static int audio_disable
 
static int video_disable
 
static int wanted_stream [AVMEDIA_TYPE_NB]
 
static int seek_by_bytes = -1
 
static int display_disable
 
static int show_status = 1
 
static int av_sync_type = AV_SYNC_AUDIO_MASTER
 
static int64_t start_time = AV_NOPTS_VALUE
 
static int64_t duration = AV_NOPTS_VALUE
 
static int step = 0
 
static int workaround_bugs = 1
 
static int fast = 0
 
static int genpts = 0
 
static int idct = FF_IDCT_AUTO
 
static enum AVDiscard skip_frame = AVDISCARD_DEFAULT
 
static enum AVDiscard skip_idct = AVDISCARD_DEFAULT
 
static enum AVDiscard skip_loop_filter = AVDISCARD_DEFAULT
 
static int error_concealment = 3
 
static int decoder_reorder_pts = -1
 
static int noautoexit
 
static int exit_on_keydown
 
static int exit_on_mousedown
 
static int loop = 1
 
static int framedrop = 1
 
static int infinite_buffer = 0
 
static int rdftspeed = 20
 
static char * vfilters = NULL
 
static int autorotate = 1
 
static int is_full_screen
 
static PlayerState player_state
 
static PlayerStateplayer = &player_state
 
static int64_t audio_callback_time
 
static AVPacket flush_pkt
 
static SDL_Surface * screen
 
static PlayerStateglobal_video_state
 
static const OptionDef options []
 

Macro Definition Documentation

◆ MAX_QUEUE_SIZE

#define MAX_QUEUE_SIZE   (15 * 1024 * 1024)

Definition at line 62 of file avplay.c.

Referenced by decode_thread().

◆ MIN_AUDIOQ_SIZE

#define MIN_AUDIOQ_SIZE   (20 * 16 * 1024)

Definition at line 63 of file avplay.c.

Referenced by decode_thread().

◆ MIN_FRAMES

#define MIN_FRAMES   5

Definition at line 64 of file avplay.c.

Referenced by decode_thread().

◆ SDL_AUDIO_BUFFER_SIZE

#define SDL_AUDIO_BUFFER_SIZE   1024

Definition at line 68 of file avplay.c.

Referenced by stream_component_open().

◆ AV_SYNC_THRESHOLD

#define AV_SYNC_THRESHOLD   0.01

Definition at line 71 of file avplay.c.

Referenced by compute_target_time().

◆ AV_NOSYNC_THRESHOLD

#define AV_NOSYNC_THRESHOLD   10.0

Definition at line 73 of file avplay.c.

Referenced by compute_target_time(), and synchronize_audio().

◆ FRAME_SKIP_FACTOR

#define FRAME_SKIP_FACTOR   0.05

Definition at line 75 of file avplay.c.

Referenced by queue_picture(), and video_refresh_timer().

◆ SAMPLE_CORRECTION_PERCENT_MAX

#define SAMPLE_CORRECTION_PERCENT_MAX   10

Definition at line 78 of file avplay.c.

Referenced by synchronize_audio().

◆ AUDIO_DIFF_AVG_NB

#define AUDIO_DIFF_AVG_NB   20

Definition at line 81 of file avplay.c.

Referenced by stream_component_open(), and synchronize_audio().

◆ SAMPLE_ARRAY_SIZE

#define SAMPLE_ARRAY_SIZE   (2 * 65536)

Definition at line 84 of file avplay.c.

Referenced by update_sample_display(), and video_audio_display().

◆ VIDEO_PICTURE_QUEUE_SIZE

#define VIDEO_PICTURE_QUEUE_SIZE   2

◆ SUBPICTURE_QUEUE_SIZE

#define SUBPICTURE_QUEUE_SIZE   4

Definition at line 98 of file avplay.c.

Referenced by subtitle_thread(), and video_refresh_timer().

◆ FF_ALLOC_EVENT

#define FF_ALLOC_EVENT   (SDL_USEREVENT)

Definition at line 276 of file avplay.c.

Referenced by event_loop(), and queue_picture().

◆ FF_REFRESH_EVENT

#define FF_REFRESH_EVENT   (SDL_USEREVENT + 1)

Definition at line 277 of file avplay.c.

Referenced by event_loop(), and refresh_thread().

◆ FF_QUIT_EVENT

#define FF_QUIT_EVENT   (SDL_USEREVENT + 2)

Definition at line 278 of file avplay.c.

Referenced by decode_thread(), and event_loop().

◆ ALPHA_BLEND

#define ALPHA_BLEND (   a,
  oldp,
  newp,
 
)    ((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s))

Definition at line 403 of file avplay.c.

Referenced by blend_subrect().

◆ RGBA_IN

#define RGBA_IN (   r,
  g,
  b,
  a,
 
)
Value:
{\
unsigned int v = ((const uint32_t *)(s))[0];\
a = (v >> 24) & 0xff;\
r = (v >> 16) & 0xff;\
g = (v >> 8) & 0xff;\
b = v & 0xff;\
}

Definition at line 406 of file avplay.c.

Referenced by subtitle_thread().

◆ YUVA_IN

#define YUVA_IN (   y,
  u,
  v,
  a,
  s,
  pal 
)
Value:
{\
unsigned int val = ((const uint32_t *)(pal))[*(const uint8_t*)(s)];\
a = (val >> 24) & 0xff;\
y = (val >> 16) & 0xff;\
u = (val >> 8) & 0xff;\
v = val & 0xff;\
}
uint8_t

Definition at line 415 of file avplay.c.

Referenced by blend_subrect().

◆ YUVA_OUT

#define YUVA_OUT (   d,
  y,
  u,
  v,
  a 
)
Value:
{\
((uint32_t *)(d))[0] = (a << 24) | (y << 16) | (u << 8) | v;\
}
#define u(width,...)

Definition at line 424 of file avplay.c.

Referenced by subtitle_thread().

◆ BPP

#define BPP   1

Definition at line 430 of file avplay.c.

Referenced by blend_subrect().

◆ INSERT_FILT

#define INSERT_FILT (   name,
  arg 
)
Value:
do { \
AVFilterContext *filt_ctx; \
\
ret = avfilter_graph_create_filter(&filt_ctx, \
"avplay_" name, arg, NULL, graph); \
if (ret < 0) \
return ret; \
\
ret = avfilter_link(filt_ctx, 0, last_filter, 0); \
if (ret < 0) \
return ret; \
\
last_filter = filt_ctx; \
} while (0)
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.
Definition: avfilter.c:77
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
Definition: avfilter.c:299
const char * name
Definition: qsvenc.c:44
NULL
Definition: eval.c:55

Referenced by configure_video_filters().

◆ OFF

#define OFF (   x)    offsetof(PlayerState, x)

Definition at line 2916 of file avplay.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AV_SYNC_AUDIO_MASTER 
AV_SYNC_VIDEO_MASTER 
AV_SYNC_EXTERNAL_CLOCK 

Definition at line 118 of file avplay.c.

Function Documentation

◆ packet_queue_put()

static int packet_queue_put ( PacketQueue q,
AVPacket pkt 
)
static

Definition at line 317 of file avplay.c.

Referenced by decode_thread(), and packet_queue_init().

◆ packet_queue_init()

static void packet_queue_init ( PacketQueue q)
static

Definition at line 285 of file avplay.c.

Referenced by stream_component_open().

◆ packet_queue_flush()

static void packet_queue_flush ( PacketQueue q)
static

Definition at line 293 of file avplay.c.

Referenced by decode_thread(), and packet_queue_end().

◆ packet_queue_end()

static void packet_queue_end ( PacketQueue q)
static

Definition at line 310 of file avplay.c.

Referenced by stream_component_close().

◆ packet_queue_abort()

static void packet_queue_abort ( PacketQueue q)
static

Definition at line 345 of file avplay.c.

Referenced by stream_component_close().

◆ packet_queue_get()

static int packet_queue_get ( PacketQueue q,
AVPacket pkt,
int  block 
)
static

Definition at line 357 of file avplay.c.

Referenced by audio_decode_frame(), get_video_frame(), and subtitle_thread().

◆ fill_rectangle()

static void fill_rectangle ( SDL_Surface *  screen,
int  x,
int  y,
int  w,
int  h,
int  color 
)
inlinestatic

◆ blend_subrect()

static void blend_subrect ( uint8_t dst[4],
uint16_t  dst_linesize[4],
const AVSubtitleRect rect,
int  imgw,
int  imgh 
)
static

Definition at line 432 of file avplay.c.

Referenced by video_image_display().

◆ free_subpicture()

static void free_subpicture ( SubPicture sp)
static

Definition at line 634 of file avplay.c.

Referenced by video_refresh_timer().

◆ video_image_display()

static void video_image_display ( PlayerState is)
static

Definition at line 639 of file avplay.c.

Referenced by video_display().

◆ audio_write_get_buf_size()

static int audio_write_get_buf_size ( PlayerState is)
static

Definition at line 698 of file avplay.c.

Referenced by get_audio_clock(), and video_audio_display().

◆ compute_mod()

static int compute_mod ( int  a,
int  b 
)
inlinestatic

Definition at line 703 of file avplay.c.

Referenced by video_audio_display().

◆ video_audio_display()

static void video_audio_display ( PlayerState s)
static

Definition at line 712 of file avplay.c.

Referenced by video_display().

◆ video_open()

static int video_open ( PlayerState is)
static

Definition at line 852 of file avplay.c.

Referenced by event_loop(), toggle_full_screen(), and video_display().

◆ video_display()

static void video_display ( PlayerState is)
static

Definition at line 898 of file avplay.c.

Referenced by video_refresh_timer().

◆ refresh_thread()

static int refresh_thread ( void opaque)
static

Definition at line 908 of file avplay.c.

Referenced by stream_open().

◆ get_audio_clock()

static double get_audio_clock ( PlayerState is)
static

Definition at line 925 of file avplay.c.

Referenced by get_master_clock(), synchronize_audio(), and video_refresh_timer().

◆ get_video_clock()

static double get_video_clock ( PlayerState is)
static

Definition at line 942 of file avplay.c.

Referenced by compute_target_time(), get_master_clock(), and video_refresh_timer().

◆ get_external_clock()

static double get_external_clock ( PlayerState is)
static

Definition at line 952 of file avplay.c.

Referenced by get_master_clock().

◆ get_master_clock()

static double get_master_clock ( PlayerState is)
static

◆ stream_seek()

static void stream_seek ( PlayerState is,
int64_t  pos,
int64_t  rel,
int  seek_by_bytes 
)
static

Definition at line 981 of file avplay.c.

Referenced by decode_thread(), event_loop(), and seek_chapter().

◆ stream_pause()

static void stream_pause ( PlayerState is)
static

Definition at line 994 of file avplay.c.

Referenced by step_to_next_frame(), toggle_pause(), and video_thread().

◆ compute_target_time()

static double compute_target_time ( double  frame_current_pts,
PlayerState is 
)
static

Definition at line 1006 of file avplay.c.

Referenced by queue_picture().

◆ video_refresh_timer()

static void video_refresh_timer ( void opaque)
static

Definition at line 1047 of file avplay.c.

Referenced by event_loop().

◆ player_close()

static void player_close ( PlayerState is)
static

Definition at line 1188 of file avplay.c.

Referenced by do_exit().

◆ do_exit()

static void do_exit ( void  )
static

Definition at line 1212 of file avplay.c.

Referenced by alloc_picture(), and event_loop().

◆ alloc_picture()

static void alloc_picture ( void opaque)
static

Definition at line 1229 of file avplay.c.

Referenced by event_loop().

◆ queue_picture()

static int queue_picture ( PlayerState is,
AVFrame src_frame,
double  pts,
int64_t  pos 
)
static

Definition at line 1263 of file avplay.c.

Referenced by output_picture2().

◆ output_picture2()

static int output_picture2 ( PlayerState is,
AVFrame src_frame,
double  pts1,
int64_t  pos 
)
static

Definition at line 1352 of file avplay.c.

Referenced by video_thread().

◆ get_video_frame()

static int get_video_frame ( PlayerState is,
AVFrame frame,
int64_t *  pts,
AVPacket pkt 
)
static

Definition at line 1377 of file avplay.c.

Referenced by video_thread().

◆ configure_video_filters()

static int configure_video_filters ( AVFilterGraph graph,
PlayerState is,
const char *  vfilters 
)
static

Definition at line 1435 of file avplay.c.

Referenced by video_thread().

◆ video_thread()

static int video_thread ( void arg)
static

Definition at line 1530 of file avplay.c.

Referenced by stream_component_open().

◆ subtitle_thread()

static int subtitle_thread ( void arg)
static

Definition at line 1631 of file avplay.c.

Referenced by stream_component_open().

◆ update_sample_display()

static void update_sample_display ( PlayerState is,
short *  samples,
int  samples_size 
)
static

Definition at line 1701 of file avplay.c.

Referenced by sdl_audio_callback().

◆ synchronize_audio()

static int synchronize_audio ( PlayerState is,
short *  samples,
int  samples_size1,
double  pts 
)
static

Definition at line 1721 of file avplay.c.

Referenced by sdl_audio_callback().

◆ audio_decode_frame()

static int audio_decode_frame ( PlayerState is,
double *  pts_ptr 
)
static

Definition at line 1795 of file avplay.c.

Referenced by sdl_audio_callback().

◆ sdl_audio_callback()

static void sdl_audio_callback ( void opaque,
Uint8 *  stream,
int  len 
)
static

Definition at line 1952 of file avplay.c.

Referenced by stream_component_open().

◆ find_codec_or_die()

static AVCodec* find_codec_or_die ( const char *  name,
enum AVMediaType  type 
)
static

Definition at line 1986 of file avplay.c.

Referenced by choose_decoder().

◆ choose_decoder()

static AVCodec* choose_decoder ( PlayerState is,
AVFormatContext ic,
AVStream st 
)
static

Definition at line 2011 of file avplay.c.

Referenced by stream_component_open(), and stream_setup().

◆ stream_component_open()

static int stream_component_open ( PlayerState is,
int  stream_index 
)
static

Definition at line 2033 of file avplay.c.

Referenced by stream_cycle_channel(), and stream_setup().

◆ stream_component_close()

static void stream_component_close ( PlayerState is,
int  stream_index 
)
static

Definition at line 2165 of file avplay.c.

Referenced by stream_close(), and stream_cycle_channel().

◆ decode_interrupt_cb()

static int decode_interrupt_cb ( void ctx)
static

Definition at line 2253 of file avplay.c.

Referenced by stream_setup().

◆ stream_close()

static void stream_close ( PlayerState is)
static

Definition at line 2258 of file avplay.c.

Referenced by decode_thread(), and main().

◆ stream_setup()

static int stream_setup ( PlayerState is)
static

Definition at line 2275 of file avplay.c.

Referenced by stream_open().

◆ decode_thread()

static int decode_thread ( void arg)
static

Definition at line 2409 of file avplay.c.

Referenced by stream_open().

◆ stream_open()

static int stream_open ( PlayerState is,
const char *  filename,
AVInputFormat iformat 
)
static

Definition at line 2545 of file avplay.c.

Referenced by main().

◆ stream_cycle_channel()

static void stream_cycle_channel ( PlayerState is,
int  codec_type 
)
static

Definition at line 2578 of file avplay.c.

Referenced by event_loop().

◆ toggle_full_screen()

static void toggle_full_screen ( void  )
static

Definition at line 2628 of file avplay.c.

Referenced by event_loop().

◆ toggle_pause()

static void toggle_pause ( void  )
static

Definition at line 2640 of file avplay.c.

Referenced by event_loop().

◆ step_to_next_frame()

static void step_to_next_frame ( void  )
static

Definition at line 2647 of file avplay.c.

Referenced by event_loop().

◆ toggle_audio_display()

static void toggle_audio_display ( void  )
static

Definition at line 2657 of file avplay.c.

Referenced by event_loop().

◆ seek_chapter()

static void seek_chapter ( PlayerState is,
int  incr 
)
static

Definition at line 2669 of file avplay.c.

Referenced by event_loop().

◆ event_loop()

static void event_loop ( void  )
static

Definition at line 2697 of file avplay.c.

Referenced by main().

◆ opt_frame_size()

static int opt_frame_size ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2853 of file avplay.c.

◆ opt_width()

static int opt_width ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2860 of file avplay.c.

◆ opt_height()

static int opt_height ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2866 of file avplay.c.

◆ opt_format()

static int opt_format ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2872 of file avplay.c.

◆ opt_frame_pix_fmt()

static int opt_frame_pix_fmt ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2882 of file avplay.c.

◆ opt_sync()

static int opt_sync ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2889 of file avplay.c.

◆ opt_seek()

static int opt_seek ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2904 of file avplay.c.

◆ opt_duration()

static int opt_duration ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2910 of file avplay.c.

◆ show_usage()

static void show_usage ( void  )
static

Definition at line 2963 of file avplay.c.

Referenced by main(), and show_help_default().

◆ show_help_default()

void show_help_default ( const char *  opt,
const char *  arg 
)

Per-avtool specific help handler.

Implemented in each avtool, called by show_help().

Definition at line 2970 of file avplay.c.

◆ opt_input_file()

static void opt_input_file ( void optctx,
const char *  filename 
)
static

Definition at line 2994 of file avplay.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 3007 of file avplay.c.

Variable Documentation

◆ program_name

const char program_name[] = "avplay"

program name, defined by the program for show_version().

Definition at line 59 of file avplay.c.

Referenced by main(), and show_usage().

◆ program_birth_year

const int program_birth_year = 2003

program birth year, defined by the program for show_banner()

Definition at line 60 of file avplay.c.

◆ sws_flags

int64_t sws_flags = SWS_BICUBIC
static

Definition at line 86 of file avplay.c.

Referenced by configure_video_filters().

◆ file_iformat

AVInputFormat* file_iformat
static

Definition at line 227 of file avplay.c.

Referenced by open_input_file().

◆ input_filename

const char* input_filename
static

Definition at line 228 of file avplay.c.

Referenced by main(), opt_input_file(), and video_open().

◆ window_title

const char* window_title
static

Definition at line 229 of file avplay.c.

Referenced by video_open().

◆ fs_screen_width

int fs_screen_width
static

Definition at line 230 of file avplay.c.

Referenced by main(), and video_open().

◆ fs_screen_height

int fs_screen_height
static

Definition at line 231 of file avplay.c.

Referenced by main(), and video_open().

◆ screen_width

int screen_width = 0
static

Definition at line 232 of file avplay.c.

Referenced by event_loop(), opt_width(), and video_open().

◆ screen_height

int screen_height = 0
static

Definition at line 233 of file avplay.c.

Referenced by event_loop(), opt_height(), and video_open().

◆ audio_disable

int audio_disable
static

Definition at line 234 of file avplay.c.

Referenced by stream_setup().

◆ video_disable

int video_disable
static

Definition at line 235 of file avplay.c.

Referenced by main(), and stream_setup().

◆ wanted_stream

int wanted_stream[AVMEDIA_TYPE_NB]
static
Initial value:

Definition at line 236 of file avplay.c.

Referenced by stream_setup().

◆ seek_by_bytes

int seek_by_bytes = -1
static

Definition at line 241 of file avplay.c.

Referenced by event_loop(), and stream_setup().

◆ display_disable

int display_disable
static

Definition at line 242 of file avplay.c.

Referenced by main(), stream_setup(), and video_refresh_timer().

◆ show_status

int show_status = 1
static

Definition at line 243 of file avplay.c.

Referenced by do_exit(), stream_setup(), and video_refresh_timer().

◆ av_sync_type

int av_sync_type = AV_SYNC_AUDIO_MASTER
static

Definition at line 244 of file avplay.c.

Referenced by opt_sync(), and stream_open().

◆ start_time

int64_t start_time = AV_NOPTS_VALUE
static

◆ duration

int64_t duration = AV_NOPTS_VALUE
static

Definition at line 246 of file avplay.c.

Referenced by decode_thread(), and opt_duration().

◆ step

int step = 0
static

◆ workaround_bugs

int workaround_bugs = 1
static

Definition at line 248 of file avplay.c.

Referenced by stream_component_open().

◆ fast

int fast = 0
static

Definition at line 249 of file avplay.c.

Referenced by stream_component_open().

◆ genpts

int genpts = 0
static

Definition at line 250 of file avplay.c.

Referenced by av_read_frame(), and stream_setup().

◆ idct

int idct = FF_IDCT_AUTO
static

Definition at line 251 of file avplay.c.

Referenced by check_idct(), check_luma_dc_wht(), and stream_component_open().

◆ skip_frame

enum AVDiscard skip_frame = AVDISCARD_DEFAULT
static

Definition at line 252 of file avplay.c.

Referenced by decode_chunks(), and stream_component_open().

◆ skip_idct

enum AVDiscard skip_idct = AVDISCARD_DEFAULT
static

Definition at line 253 of file avplay.c.

Referenced by mpv_decode_mb_internal(), and stream_component_open().

◆ skip_loop_filter

enum AVDiscard skip_loop_filter = AVDISCARD_DEFAULT
static

Definition at line 254 of file avplay.c.

Referenced by stream_component_open(), and update_context_from_user().

◆ error_concealment

int error_concealment = 3
static

Definition at line 255 of file avplay.c.

Referenced by stream_component_open().

◆ decoder_reorder_pts

int decoder_reorder_pts = -1
static

Definition at line 256 of file avplay.c.

Referenced by get_video_frame().

◆ noautoexit

int noautoexit
static

Definition at line 257 of file avplay.c.

Referenced by decode_thread().

◆ exit_on_keydown

int exit_on_keydown
static

Definition at line 258 of file avplay.c.

Referenced by event_loop().

◆ exit_on_mousedown

int exit_on_mousedown
static

Definition at line 259 of file avplay.c.

Referenced by event_loop().

◆ loop

int loop = 1
static

Definition at line 260 of file avplay.c.

Referenced by decode_thread(), and process_input().

◆ framedrop

int framedrop = 1
static

Definition at line 261 of file avplay.c.

Referenced by video_refresh_timer().

◆ infinite_buffer

int infinite_buffer = 0
static

Definition at line 262 of file avplay.c.

Referenced by decode_thread().

◆ rdftspeed

int rdftspeed = 20
static

Definition at line 264 of file avplay.c.

Referenced by refresh_thread().

◆ vfilters

char* vfilters = NULL
static

Definition at line 265 of file avplay.c.

Referenced by video_thread().

◆ autorotate

int autorotate = 1
static

Definition at line 266 of file avplay.c.

Referenced by add_input_streams(), and configure_video_filters().

◆ is_full_screen

int is_full_screen
static

Definition at line 269 of file avplay.c.

Referenced by toggle_full_screen(), and video_open().

◆ player_state

PlayerState player_state
static

Definition at line 270 of file avplay.c.

◆ player

PlayerState* player = &player_state
static

Definition at line 271 of file avplay.c.

◆ audio_callback_time

int64_t audio_callback_time
static

Definition at line 272 of file avplay.c.

Referenced by sdl_audio_callback(), and video_audio_display().

◆ flush_pkt

AVPacket flush_pkt
static

Definition at line 274 of file avplay.c.

Referenced by parse_packet().

◆ screen

SDL_Surface* screen
static

◆ global_video_state

PlayerState* global_video_state
static

Definition at line 2251 of file avplay.c.

◆ options

const OptionDef options[]
static

Definition at line 2917 of file avplay.c.