summaryrefslogtreecommitdiff
path: root/ffplay.c
Commit message (Collapse)AuthorAge
* ffplay: add frame drop statisticsMarton Balint2011-10-24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffplay: consider estimated time of filter in early frame dropMarton Balint2011-10-24
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffplay: reimplement early frame dropMarton Balint2011-10-24
| | | | | | | | | | | | | | | | | | This patch reimplements early frame drop, it is now based on the current difference between the master clock and the video clock, and the pts of the current and the last displayed (or skipped) frame. If the frame to be added to the queue is late after decoding, then we drop it early because later we would drop it anyway (unless it is the only frame in the picture queue). The current approach has only one downside that I know of, it does not handle well when the filters are changing significantly the pts of the frames, because we compare pts values from filtered and unfiltered frames. We also start using the pictq_mutex to ensure consistent video_current_pts, video_current_pts_drift, frame_last_pts, frame_last_dropped_pts and frame_last_dropped_pos values. Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-10-23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: id3v2: fix doxy comment - 'machine byte order' makes no sense on char arrays VC1: restore mistakenly removed code twinvq: check output buffer size before decoding twinvq: return an error when the packet size is too small lavf: export some forgotten symbols with non-av prefixes. swscale: update altivec yuv2planeX asm to new per-plane API. swscale: make yuv2yuvX_10_sse2/avx 8/9/16-bits aware. yuv2planeX10 SIMD swscale: decide whether to use yuv2plane1/X on a per-plane basis. swscale: reintroduce full precision in 16-bit output. Split up yuv2yuvX functions Split out yuv2yuv1 luma and chroma in order to make them generic DSP functions lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition lavc: translate non-flag-based er options into flag-based ef options at codec open add -err_filter AVOptions to access flag-based error recognition h264_weight: initialize "height" function argument properly. presets: spelling error in libvpx 1080p50_60 avplay: fix fullscreen behaviour with SDL 1.2.14 on Mac OS X Conflicts: ffplay.c libavformat/libavformat.v libswscale/swscale.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: reallocate SDL overlays for OSX when changing full screenMarton Balint2011-10-20
| | | | | | | | | | | | | | | | Fixes missing blue channel when switching from/to fullscren on OSX and libsdl 1.2.14. Fixes issue 548. Thanks for Jean First for the original patch and for testing. Signed-off-by: Marton Balint <cus@passwd.hu>
* | ffplay: avoid window resize crash on osx with libsdl 1.2.14Jean First2011-10-16
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | ffplay: add delay multiple times to frame_timer if it is less than current timeMarton Balint2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the picture queue is empty, or when the calculated delay is 0, frame_timer is not increased but we are still displaying the old frame. When we eventually get a frame, where the computed delay is positive, so we don't need to drop any more frames, then it is best to update frame_timer to be as near as the current time as it can. This way we dont't have to wait several frames to add the necesarry delays to frame_timer to reach current time, therefore there are no extra frame drops after reaching a positive delay. Signed-off-by: Marton Balint <cus@passwd.hu>
* | ffplay: remove early frame drop functionalityMarton Balint2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current impementation of early frame drops (dropping frames before adding them to the picture queue) has multiple problems: Even after gettin A-V sync, the frame droping continues until VideoState->skip_frames reaches 1, which can take a lot of time causing useless additional frame drops and bad AV-sync. This issue can be easily triggered with for example changing the audio stream. Also video_refresh currenly does not handle early skipped frames in every case, for example if we skip a frame, then the last frame duration calculation will compute the duration of the sum of the skipped frame and the duration of the frame before that, and in compute_target_delay we may multiply this unusually big delay. Signed-off-by: Marton Balint <cus@passwd.hu>
* | ffplay: calculate target clock dynamically, make code more readableMarton Balint2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Since target clock is based on the current A-V delay, it is better calculate it when we actually need it rather than when we put a picture in the picture queue. The patch also makes a code a bit more readable by renaming some delay variables to duration, and converting compute_target_time to a delay calculating function which does not modify the state. Factoring out the iteration of the pictq to standalone function is also done in this patch. Signed-off-by: Marton Balint <cus@passwd.hu>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-10-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (31 commits) tiffenc: initialize forgotten avctx. avplay: free the active audio packet at exit. avplay: free rdft data used for spectrogram analysis. log.h: make AVClass a named struct fix ac3 encoder documentation vc1: more prettyprinting cosmetics vc1: prettyprint some tables vc1: K&R formatting cosmetics AVOptions: bump minor and add APIchanges entry. cmdutils/avtools: simplify show_help() by using av_opt_child_class_next() AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* Remove all uses of deprecated AVOptions API. AVOptions: add av_opt_next, deprecate av_next_option. AVOptions: add functions for evaluating option strings. AVOptions: split get_number(). AVOptions: add av_opt_get*, deprecate av_get*. AVOptions: add av_opt_set*(). AVOptions: add new API for enumerating children. rv34: move inverse transform functions to DSP context flvenc: Write the right metadata entry count ... Conflicts: avconv.c cmdutils.c doc/APIchanges ffplay.c ffprobe.c libavcodec/ac3dec.c libavcodec/h264.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mpeg12enc.c libavcodec/options.c libavdevice/libdc1394.c libavdevice/v4l2.c libavfilter/vf_drawtext.c libavformat/flvdec.c libavformat/mpegtsenc.c libavformat/options.c libavutil/avutil.h libavutil/opt.c libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: use libswresample instead of av_audio_convertMarton Balint2011-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously ffplay expected SDL_AudioOpen to provide the requested sample rate and channel number. This is no longer a requirement because this patch replaces the audio convert function with libswresample's swr_convert which is capable of handling different sample formats, sample rates and different number of channels and different channel layouts. The patch also removes the hardcoded 16bit samples assumption and uses av_get_bytes_per_sample almost everywhere. The only exceptions are the update_sample_display and video_audio_display functions, it seemed too much of a headache to make them generic. We also fix a tiny bug in sdl_audio_callback, we ensure that the number of bytes when we put silence in the buffer is a multiple of the frame size.
* | ffplay: use avctx->channels and avctx->freq before avcodec_open2 consistentlyMarton Balint2011-10-02
| |
* | ffplay: remove now unnecessary request_channels, we set it now with optionsMarton Balint2011-10-02
| |
* | ffplay: set request_channels to 2Michael Niedermayer2011-10-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: fix forgotten codec_name checksMichael Niedermayer2011-09-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: support -codec:avs to force a specific decoder implementationMichael Niedermayer2011-09-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-09-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (21 commits) fate: allow testing with libavfilter disabled x86: XOP/FMA4 CPU detection support ws_snd: misc cosmetic clean-ups ws_snd: remove the 2-bit ADPCM table and just subtract 2 instead. ws_snd: use memcpy() and memset() instead of loops ws_snd: use samples pointer for loop termination instead of a separate iterator variable. ws_snd: make sure number of channels is 1 ws_snd: add some checks to prevent buffer overread or overwrite. ws_snd: decode to AV_SAMPLE_FMT_U8 instead of S16. flacdec: fix buffer size checking in get_metadata_size() rtp: Simplify ff_rtp_get_payload_type rtpenc: Add a payload type private option rtp: Correct ff_rtp_get_payload_type documentation avconv: replace all fprintf() by av_log(). avconv: change av_log verbosity from ERROR to FATAL for fatal errors. cmdutils: replace fprintf() by av_log() avtools: parse loglevel before all the other options. oggdec: add support for Xiph's CELT codec sol: return error if av_get_packet() fails. cosmetics: reindent and pretty-print ... Conflicts: avconv.c cmdutils.c libavcodec/avcodec.h libavcodec/version.h libavformat/oggparsecelt.c libavformat/utils.c libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: fix order of operations for sdl audio open.Michael Niedermayer2011-09-24
| | | | | | | | | | | | Fixes Ticket149 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-09-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Add LATM demuxer avplay: flush audio decoder with empty packets at EOF if the decoder has CODEC_CAP_DELAY set. 8svx/iff: fix decoding of compressed stereo 8svx files. 8svx: log an error message if output buffer is too small 8svx: check packet size before reading the initial sample value. 8svx: output 8-bit samples instead of 16-bit. 8svx: split delta decoding into a separate function. mp4: Don't read an empty Decoder Config Descriptor fate.sh: Ignore errors from rm command during cleanup. fate.sh: Run git-pull in quiet mode to avoid console spam. Apple ProRes decoder rtmp: Make the input FLV parser handle data cut at any point rv34: Check for invalid slices offsets eval: test isnan(sqrt(-1)) instead of just sqrt(-1) Conflicts: Changelog libavcodec/8svx.c libavcodec/proresdec.c libavcodec/version.h libavformat/iff.c libavformat/version.h tests/ref/fate/eval Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: dont drop all frames if realtime decoding is impossibleMichael Niedermayer2011-09-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: remove thread command line option code, it is unneeded for -threads ↵Michael Niedermayer2011-09-13
| | | | | | | | | | | | X to work. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: move "thread emulation" warning to common codeMichael Niedermayer2011-09-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavfi: rename vsink_buffer.c to sink_buffer.c, and vsink_buffer.h to ↵Stefano Sabatini2011-09-06
| | | | | | | | | | | | | | | | buffersink.h This is done in order to clarify the non-video-specific nature of the buffersink code, as the result of the video/audio API unification of the previous commit, and for improving overall consistency.
* | lavfi: unify asink_buffer and vsink_buffer APIStefano Sabatini2011-09-06
| | | | | | | | | | | | | | | | | | The new API is more generic (no distinction between audio/video for pulling frames), and avoids code duplication. A backward compatibility layer is kept for avoiding tools ABI breaks (only for the video binary interface, audio interface was never used in the tools).
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-09-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavc: fix type for thread_type option avconv: move format to options context avconv: move limit_filesize to options context avconv: move start_time, recording_time and input_ts_offset to options context avconv: add a context for options. cmdutils: allow storing per-stream/chapter/.... options in a generic way cmdutils: split per-option code out of parse_options(). cmdutils: add support for caller-provided option context. cmdutils: declare only one pointer type in OptionDef cmdutils: move grow_array() from avconv to cmdutils. cmdutils: move exit_program() declaration to cmdutils from avconv http: Consider the stream as seekable if the reply contains Accept-Ranges: bytes nutenc: add namespace to the api facing functions Conflicts: avconv.c cmdutils.c cmdutils.h ffmpeg.c ffplay.c ffprobe.c ffserver.c libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-09-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: AVOptions: fix av_set_string3() doxy to match reality. cmdutils: get rid of dummy contexts for examining AVOptions. lavf,lavc,sws: add {avcodec,avformat,sws}_get_class() functions. AVOptions: add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find(). cpu detection: avoid a signed overflow Conflicts: avconv.c cmdutils.c doc/APIchanges ffmpeg.c libavcodec/options.c libavcodec/version.h libavformat/version.h libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Replace some commented-out debug printf() / av_log() messages with av_dlog().Diego Biurrun2011-09-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: fix a crash caused by aborting the video queueMarton Balint2011-08-26
| | | | | | | | | | | | | | | | If the video queue is aborted, we have to pop the pending ALLOC event or wait for the allocation to complete, because the current code assumes that VideoState->pictq_windex does not change until the allocation is complete. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: use lock manager callback to make libavcodec thread-safeMarton Balint2011-08-25
| | | | | | | | | | | | | | | | Altough ffplay is working pretty well without using a lock manager, it is still a multithreaded application calling libavcodec functions from multiple threads, so using a lock manager is probably a good idea. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: remove unnecessary if (cur_stream) checksMarton Balint2011-08-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: get rid of the global cur_stream variableMarton Balint2011-08-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: make step variable a member of the VideoState structMarton Balint2011-08-21
| | | | | | | | | | | | | | | | Getting rid of globals are generally a good thing. The patch also makes toggle_pause and step_to_next_frame use a function parameter instead of the global cur_stream variable. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: do not erase the content of vfiltersStefano Sabatini2011-08-17
| | | | | | | | | | | | | | This way the content of "vfilters" can be reused. For example when the frame size changes, the filterchain is reconfigured reusing again the vfilters value.
* | ffplay: increase log level of the message issued when the stream frame size ↵Stefano Sabatini2011-08-17
| | | | | | | | | | | | | | | | | | | | | | changes Use av_log(AV_LOG_LEVEL...) rather than av_dlog, the log is useful even for "normal" debugging, and consistent with what is done in ffmpeg. Also change the message to achieve better consistency with the corresponding ffmpeg message.
* | ffplay: in input_config_props(), prefer "s" over unnecessary "c" temporary ↵Stefano Sabatini2011-08-17
| | | | | | | | | | | | variable Sligthly improve readability, reduce redundancy.
* | ffplay: in input_config_props(), honour the SAR specified in the codec contextStefano Sabatini2011-08-17
| | | | | | | | | | | | | | | | | | | | Use the value specified in the codec context for setting the filterchain sample aspect ratio, when it is not specified in the stream context. Consistent with the ffmpeg behavior. Fix trac issue #398.
* | Fix compilation with --disable-avfilter.Carl Eugen Hoyos2011-08-16
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix NASM include directive dsputil_mmx: Honor HAVE_AMD3DNOW lavf,lavd: remove all usage of AVFormatParameters from demuxers. jack: add 'channels' private option. VC-1: fix reading of custom PAR. Remove redundant and dubious video codec detection by its extradata mpeg12: remove repeat-field code disabled since May 2002 patch checklist: suggest fate instead of regression tests Turn on resampling on sudden size change instead of bailing out during recode. avtools: reinitialise filter chain when input video stream changes dimensions Conflicts: Makefile avconv.c doc/developer.texi ffplay.c libavcodec/x86/dsputil_mmx.c libavdevice/libdc1394.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | ffplay: more precise audio clock based on current timeMarton Balint2011-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since SDL has no audio buffer fullness info, one can get a much precise audio clock based on the last time of the audio callback and the elapsed time since. To achieve this I introduced the audio_current_pts and audio_current_pts_drift variables (similar to video_current_pts and video_current_pts_drift) and calculate them in the end of the audio callback, when VideoState->audio_clock is already updated. The reference time I use is from the start of the audio callback, because this way the amount of time used for audio decoding is not interfereing with calculation. I also replaced the audio_write_get_buf_size function with a calculated variable because when the audio frame decoding is in progress audio_buf_size and audio_buf_index are not stable, so using them from other threads are not a good idea. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b2c087871dafc7d030b2d48457ddff597dfd4925'Michael Niedermayer2011-08-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2c087871dafc7d030b2d48457ddff597dfd4925': Move x86util.asm from libavcodec/ to libavutil/. Move x86inc.asm to libavutil/. APIchanges: note error_recognition in lavf lavf: add support for error_recognition, use it in avidec, and bump minor API version avconv: change semantics of -map avconv: get rid of new* options. cmdutils: allow precisely specifying a stream for AVOptions. configure: add missing CFLAGS to fix building on the HURD libx264: Include hint for possible values for configuring libx264 cmdutils: allow ':'-separated modifiers in option names. avconv: make -map_metadata work consistently with the other options avconv: remove deprecated options. avconv: make -map_chapters accept only the input file index. Make a copy of ffmpeg under a new name -- avconv. ffmpeg: add a warning stating that the program is deprecated. Add weighted motion compensation for RV40 B-frames RV3/4: calculate B-frame motion weights once per frame Move RV3/4-specific DSP functions into their own context mjpeg: propagate decode errors from ff_mjpeg_decode_sos and ff_mjpeg_decode_dqt h264: notice memory allocation failure Conflicts: .gitignore Makefile cmdutils.c configure doc/ffplay.texi doc/ffprobe.texi doc/ffserver.texi libavcodec/libx264.c libavformat/avformat.h libavformat/avidec.c libavformat/version.h tests/lavf-regression.sh tests/lavfi-regression.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | NoMerge commit '4d58e4cb4ca8e04317fecea432ea3272a445877c'Michael Niedermayer2011-08-10
|\| | | | | | | | | | | | | | | | | * commit '4d58e4cb4ca8e04317fecea432ea3272a445877c': Rename ffserver to avserver. Rename ffprobe to avprobe. Rename ffplay to avplay. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Rename ffplay to avplay.Anton Khirnov2011-08-09
| |
* | ffplay: pass frame durations clearly to video video_refreshMarton Balint2011-08-09
| | | | | | | | | | | | | | Previously the target clock of the next frame was calculated by using video_clock which is modified from another thread... Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Unbreak ffplay -s and ffplay -pix_fmt.Carl Eugen Hoyos2011-08-01
| |
* | ffplay: set input link sample aspect ratio in input_config_props()Stefano Sabatini2011-07-30
| | | | | | | | | | Allow sample_aspect_ratio information to be correctly propagated in the filterchain.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: h263dec: Propagate AV_LOG_ERRORs from slice decoding through frame decoding with sufficient error recognition x86: cabac: don't load/store context values in asm H.264: optimize CABAC x86 asm for Atom vp3/theora: flush after seek. doc/fftools-common-opts: wording fixes missing from the previous commit. doc: document using AVOptions in fftools. cmdutils: add codec_opts parameter to setup_find_stream_info_opts() cmdutils: clarify documentation for filter_codec_opts() cmdutils: clarify documentation for setup_find_stream_info_opts() lavf: add forgotten attribute_deprecated to av_find_stream_info() Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cmdutils: add codec_opts parameter to setup_find_stream_info_opts()Stefano Sabatini2011-07-28
| | | | | | | | | | | | Avoid brittle and obfuscating reference to a global. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: ffmpeg: fix some indentation ffmpeg: fix operation with --disable-avfilter simple_idct: remove disabled code motion_est: remove disabled code vc1: remove disabled code fate: separate lavf-mxf_d10 test from lavf-mxf cabac: Move code only used in the cabac test program to cabac.c. ffplay: warn that -pix_fmt is no longer working, suggest alternative ffplay: warn that -s is no longer working, suggest alternative lavf: rename enc variable in utils.c:has_codec_parameters() lavf: use designated initialisers for all (de)muxers. wav: remove a use of deprecated AV_METADATA_ macro rmdec: remove useless ap parameter from rm_read_header_old() dct-test: remove write-only variable des: fix #if conditional around P_shuffle Use LOCAL_ALIGNED in ff_check_alignment() Conflicts: ffmpeg.c libavformat/avidec.c libavformat/matroskaenc.c libavformat/mp3enc.c libavformat/oggenc.c libavformat/utils.c tests/ref/lavf/mxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ffplay: warn that -pix_fmt is no longer working, suggest alternativeStefano Sabatini2011-07-17
| | | | | | | | | | | | Also remove now unused variable. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * ffplay: warn that -s is no longer working, suggest alternativeStefano Sabatini2011-07-17
| | | | | | | | | | | | Also remove now unused variables. Signed-off-by: Anton Khirnov <anton@khirnov.net>