Libav
|
#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/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 "libswscale/swscale.h"
#include "libavresample/avresample.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.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 | VideoState |
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 |
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 (AVPicture *dst, const AVSubtitleRect *rect, int imgw, int imgh) |
static void | free_subpicture (SubPicture *sp) |
static void | video_image_display (VideoState *is) |
static int | audio_write_get_buf_size (VideoState *is) |
static int | compute_mod (int a, int b) |
static void | video_audio_display (VideoState *s) |
static int | video_open (VideoState *is) |
static void | video_display (VideoState *is) |
static int | refresh_thread (void *opaque) |
static double | get_audio_clock (VideoState *is) |
static double | get_video_clock (VideoState *is) |
static double | get_external_clock (VideoState *is) |
static double | get_master_clock (VideoState *is) |
static void | stream_seek (VideoState *is, int64_t pos, int64_t rel, int seek_by_bytes) |
static void | stream_pause (VideoState *is) |
static double | compute_target_time (double frame_current_pts, VideoState *is) |
static void | video_refresh_timer (void *opaque) |
static void | stream_close (VideoState *is) |
static void | do_exit (void) |
static void | alloc_picture (void *opaque) |
static int | queue_picture (VideoState *is, AVFrame *src_frame, double pts, int64_t pos) |
static int | output_picture2 (VideoState *is, AVFrame *src_frame, double pts1, int64_t pos) |
static int | get_video_frame (VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt) |
static int | video_thread (void *arg) |
static int | subtitle_thread (void *arg) |
static void | update_sample_display (VideoState *is, short *samples, int samples_size) |
static int | synchronize_audio (VideoState *is, short *samples, int samples_size1, double pts) |
static int | audio_decode_frame (VideoState *is, double *pts_ptr) |
static void | sdl_audio_callback (void *opaque, Uint8 *stream, int len) |
static int | stream_component_open (VideoState *is, int stream_index) |
static void | stream_component_close (VideoState *is, int stream_index) |
static int | decode_interrupt_cb (void *ctx) |
static int | decode_thread (void *arg) |
static VideoState * | stream_open (const char *filename, AVInputFormat *iformat) |
static void | stream_cycle_channel (VideoState *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 (VideoState *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 AVInputFormat * | file_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 | autoexit |
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 int | is_full_screen |
static VideoState * | cur_stream |
static int64_t | audio_callback_time |
static AVPacket | flush_pkt |
static SDL_Surface * | screen |
static VideoState * | global_video_state |
static const OptionDef | options [] |
#define MAX_QUEUE_SIZE (15 * 1024 * 1024) |
Definition at line 64 of file avplay.c.
Referenced by decode_thread().
#define MIN_AUDIOQ_SIZE (20 * 16 * 1024) |
Definition at line 65 of file avplay.c.
Referenced by decode_thread().
#define MIN_FRAMES 5 |
Definition at line 66 of file avplay.c.
Referenced by decode_thread().
#define SDL_AUDIO_BUFFER_SIZE 1024 |
Definition at line 70 of file avplay.c.
Referenced by stream_component_open().
#define AV_SYNC_THRESHOLD 0.01 |
Definition at line 73 of file avplay.c.
Referenced by compute_target_time().
#define AV_NOSYNC_THRESHOLD 10.0 |
Definition at line 75 of file avplay.c.
Referenced by compute_target_time(), and synchronize_audio().
#define FRAME_SKIP_FACTOR 0.05 |
Definition at line 77 of file avplay.c.
Referenced by queue_picture(), and video_refresh_timer().
#define SAMPLE_CORRECTION_PERCENT_MAX 10 |
Definition at line 80 of file avplay.c.
Referenced by synchronize_audio().
#define AUDIO_DIFF_AVG_NB 20 |
Definition at line 83 of file avplay.c.
Referenced by stream_component_open(), and synchronize_audio().
#define SAMPLE_ARRAY_SIZE (2 * 65536) |
Definition at line 86 of file avplay.c.
Referenced by update_sample_display(), and video_audio_display().
#define VIDEO_PICTURE_QUEUE_SIZE 2 |
Definition at line 99 of file avplay.c.
Referenced by get_video_frame(), queue_picture(), stream_close(), toggle_full_screen(), and video_refresh_timer().
#define SUBPICTURE_QUEUE_SIZE 4 |
Definition at line 100 of file avplay.c.
Referenced by subtitle_thread(), and video_refresh_timer().
#define FF_ALLOC_EVENT (SDL_USEREVENT) |
Definition at line 276 of file avplay.c.
Referenced by event_loop(), and queue_picture().
#define FF_REFRESH_EVENT (SDL_USEREVENT + 1) |
Definition at line 277 of file avplay.c.
Referenced by event_loop(), and refresh_thread().
#define FF_QUIT_EVENT (SDL_USEREVENT + 2) |
Definition at line 278 of file avplay.c.
Referenced by decode_thread(), and event_loop().
#define ALPHA_BLEND | ( | a, | |
oldp, | |||
newp, | |||
s | |||
) | ((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s)) |
Definition at line 407 of file avplay.c.
Referenced by blend_subrect().
#define YUVA_IN | ( | y, | |
u, | |||
v, | |||
a, | |||
s, | |||
pal | |||
) |
Definition at line 419 of file avplay.c.
Referenced by blend_subrect().
#define YUVA_OUT | ( | d, | |
y, | |||
u, | |||
v, | |||
a | |||
) |
Definition at line 428 of file avplay.c.
Referenced by subtitle_thread().
#define BPP 1 |
Definition at line 434 of file avplay.c.
Referenced by blend_subrect().
anonymous enum |
|
static |
Definition at line 317 of file avplay.c.
Referenced by decode_thread(), and packet_queue_init().
|
static |
Definition at line 285 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 293 of file avplay.c.
Referenced by decode_thread(), and packet_queue_end().
|
static |
Definition at line 310 of file avplay.c.
Referenced by stream_component_close().
|
static |
Definition at line 349 of file avplay.c.
Referenced by stream_component_close().
|
static |
Definition at line 361 of file avplay.c.
Referenced by audio_decode_frame(), get_video_frame(), and subtitle_thread().
|
inlinestatic |
Definition at line 396 of file avplay.c.
Referenced by decode_cabac_luma_residual(), decode_cabac_residual_internal(), decode_cabac_residual_nondc(), decode_luma_residual(), ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), fill_decode_caches(), fill_filter_caches_inter(), h264_er_decode_mb(), hl_decode_mb(), hl_decode_mb_444(), pred_pskip_motion(), pred_spatial_direct_motion(), pred_temp_direct_motion(), rv34_decode_inter_macroblock(), rv34_decode_inter_mb_header(), rv34_decode_intra_macroblock(), rv34_decode_intra_mb_header(), rv34_output_intra(), svq3_mc_dir(), toggle_audio_display(), video_audio_display(), write_back_motion(), and ZERO8x2().
|
static |
Definition at line 436 of file avplay.c.
Referenced by video_image_display().
|
static |
Definition at line 636 of file avplay.c.
Referenced by video_refresh_timer().
|
static |
Definition at line 641 of file avplay.c.
Referenced by video_display().
|
static |
Definition at line 720 of file avplay.c.
Referenced by get_audio_clock(), and video_audio_display().
|
inlinestatic |
Definition at line 725 of file avplay.c.
Referenced by video_audio_display().
|
static |
Definition at line 734 of file avplay.c.
Referenced by video_display().
|
static |
Definition at line 874 of file avplay.c.
Referenced by event_loop(), toggle_full_screen(), and video_display().
|
static |
Definition at line 926 of file avplay.c.
Referenced by video_refresh_timer().
|
static |
Definition at line 936 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 953 of file avplay.c.
Referenced by get_master_clock(), synchronize_audio(), and video_refresh_timer().
|
static |
Definition at line 970 of file avplay.c.
Referenced by compute_target_time(), get_master_clock(), and video_refresh_timer().
|
static |
Definition at line 980 of file avplay.c.
Referenced by get_master_clock().
|
static |
Definition at line 988 of file avplay.c.
Referenced by compute_target_time(), event_loop(), seek_chapter(), synchronize_audio(), and video_refresh_timer().
|
static |
Definition at line 1009 of file avplay.c.
Referenced by decode_thread(), event_loop(), and seek_chapter().
|
static |
Definition at line 1022 of file avplay.c.
Referenced by step_to_next_frame(), toggle_pause(), and video_thread().
|
static |
Definition at line 1034 of file avplay.c.
Referenced by queue_picture().
Definition at line 1075 of file avplay.c.
Referenced by event_loop().
|
static |
Definition at line 1244 of file avplay.c.
Referenced by alloc_picture(), and event_loop().
Definition at line 1261 of file avplay.c.
Referenced by event_loop().
|
static |
Definition at line 1301 of file avplay.c.
Referenced by output_picture2().
|
static |
Definition at line 1418 of file avplay.c.
Referenced by video_thread().
|
static |
Definition at line 1443 of file avplay.c.
Referenced by video_thread().
|
static |
Definition at line 1569 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 1669 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 1739 of file avplay.c.
Referenced by sdl_audio_callback().
|
static |
Definition at line 1759 of file avplay.c.
Referenced by sdl_audio_callback().
|
static |
Definition at line 1833 of file avplay.c.
Referenced by sdl_audio_callback().
Definition at line 1990 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 2025 of file avplay.c.
Referenced by decode_thread(), and stream_cycle_channel().
|
static |
Definition at line 2135 of file avplay.c.
Referenced by decode_thread(), and stream_cycle_channel().
|
static |
Definition at line 2221 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 2227 of file avplay.c.
Referenced by stream_open().
|
static |
|
static |
Definition at line 2515 of file avplay.c.
Referenced by event_loop().
Definition at line 2565 of file avplay.c.
Referenced by event_loop().
Definition at line 2577 of file avplay.c.
Referenced by event_loop().
Definition at line 2584 of file avplay.c.
Referenced by event_loop().
Definition at line 2594 of file avplay.c.
Referenced by event_loop().
|
static |
Definition at line 2606 of file avplay.c.
Referenced by event_loop().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2893 of file avplay.c.
Referenced by main(), and 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().
const char program_name[] = "avplay" |
program name, defined by the program for show_version().
Definition at line 61 of file avplay.c.
Referenced by main(), and show_usage().
const int program_birth_year = 2003 |
program birth year, defined by the program for show_banner()
|
static |
Definition at line 88 of file avplay.c.
Referenced by queue_picture().
|
static |
Definition at line 227 of file avplay.c.
Referenced by open_input_file().
|
static |
Definition at line 228 of file avplay.c.
Referenced by main(), opt_input_file(), and video_open().
|
static |
Definition at line 229 of file avplay.c.
Referenced by video_open().
|
static |
Definition at line 230 of file avplay.c.
Referenced by main(), and video_open().
|
static |
Definition at line 231 of file avplay.c.
Referenced by main(), and video_open().
|
static |
Definition at line 232 of file avplay.c.
Referenced by event_loop(), opt_width(), and video_open().
|
static |
Definition at line 233 of file avplay.c.
Referenced by event_loop(), opt_height(), and video_open().
|
static |
Definition at line 234 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 235 of file avplay.c.
Referenced by decode_thread(), and main().
|
static |
Definition at line 236 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 241 of file avplay.c.
Referenced by decode_thread(), and event_loop().
|
static |
Definition at line 242 of file avplay.c.
Referenced by decode_thread(), main(), and video_refresh_timer().
|
static |
Definition at line 243 of file avplay.c.
Referenced by decode_thread(), do_exit(), and video_refresh_timer().
|
static |
Definition at line 244 of file avplay.c.
Referenced by opt_sync(), and stream_open().
|
static |
Definition at line 245 of file avplay.c.
Referenced by add_fragment(), asf_read_stream_properties(), copy_chapters(), decode_thread(), do_streamcopy(), gxf_seek(), main(), opt_seek(), poll_filter(), rm_read_header(), skeleton_header(), and update_stream_timings().
|
static |
Definition at line 246 of file avplay.c.
Referenced by add_fragment(), append_entry(), asf_write_header1(), asf_write_packet(), avpriv_vorbis_parse_frame(), celt_decode_allocation(), celt_decode_band(), compute_pkt_fields(), dca_parse(), decode_thread(), estimate_timings_from_bit_rate(), estimate_timings_from_pts(), ff_ass_add_rect(), hls_read_header(), hls_read_seek(), hls_window(), init_common(), ism_flush(), libvorbis_encode_frame(), main(), matroska_parse_block(), matroska_parse_frame(), mkv_write_ass_blocks(), mkv_write_packet_internal(), mkv_write_srt_blocks(), mov_flush_fragment(), mov_read_ctts(), mov_read_elst(), mov_read_stts(), mov_write_ctts_tag(), mov_write_edts_tag(), mov_write_stts_tag(), mov_write_tkhd_tag(), nsv_parse_NSVf_header(), opt_duration(), parse_playlist(), qdm2_decode_fft_packets(), qdm2_fft_decode_tones(), qdm2_fft_init_coefficient(), read_braindead_odml_indx(), read_frame(), rm_read_header(), rv10_write_header(), smjpeg_read_header(), srt_get_duration(), update_initial_durations(), update_stream_timings(), vorbis_packet(), and write_manifest().
|
static |
Definition at line 247 of file avplay.c.
Referenced by adpcm_compress_trellis(), adpcm_ima_expand_nibble(), adpcm_ima_qt_compress_sample(), adpcm_ima_qt_expand_nibble(), adpcm_swf_decode(), av_read_image_line(), av_write_image_line(), build_requant_tab(), combine_fft(), dec_gain(), decode_coeffs(), decode_plane(), decode_subframe(), encode_residual_ch(), eval_lpcenv_or_interp(), ff_gen_search(), ff_gen_syncpoint_search(), fic_idct(), filter_frame(), fraps2_decode_plane(), h264_filter_mb_fast_internal(), init_pass2(), inter_recon(), interpolate(), intra_recon(), is_mv_diff_gt_3(), loco_decode_plane(), loco_predict(), mangle_rgb_planes(), restore_median(), restore_median_il(), restore_rgb_planes(), rv30_weak_loop_filter(), rv40_loop_filter_strength(), rv40_strong_loop_filter(), rv40_weak_loop_filter(), sbr_qmf_synthesis(), search_for_quantizers_faac(), step_to_next_frame(), toggle_pause(), twiddle(), video_thread(), vorbis_residue_decode_internal(), and yuv2rgb_full_X_c_template().
|
static |
Definition at line 248 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 249 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 250 of file avplay.c.
Referenced by av_read_frame(), and decode_thread().
|
static |
Definition at line 251 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 252 of file avplay.c.
Referenced by decode_chunks(), and stream_component_open().
|
static |
Definition at line 253 of file avplay.c.
Referenced by mpv_decode_mb_internal(), and stream_component_open().
|
static |
Definition at line 254 of file avplay.c.
Referenced by stream_component_open(), and update_context_from_user().
|
static |
Definition at line 255 of file avplay.c.
Referenced by stream_component_open().
|
static |
Definition at line 256 of file avplay.c.
Referenced by get_video_frame().
|
static |
Definition at line 257 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 258 of file avplay.c.
Referenced by event_loop().
|
static |
Definition at line 259 of file avplay.c.
Referenced by event_loop().
|
static |
Definition at line 260 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 261 of file avplay.c.
Referenced by video_refresh_timer().
|
static |
Definition at line 262 of file avplay.c.
Referenced by decode_thread().
|
static |
Definition at line 264 of file avplay.c.
Referenced by refresh_thread().
|
static |
Definition at line 270 of file avplay.c.
Referenced by toggle_full_screen(), and video_open().
|
static |
|
static |
Definition at line 272 of file avplay.c.
Referenced by sdl_audio_callback(), and video_audio_display().
|
static |
Definition at line 274 of file avplay.c.
Referenced by parse_packet().
|
static |
Definition at line 280 of file avplay.c.
Referenced by alloc_picture(), event_loop(), toggle_audio_display(), video_audio_display(), video_display(), video_open(), x11grab_draw_region_win(), x11grab_read_header(), x11grab_read_packet(), and x11grab_region_win_init().
|
static |