Commit Graph

959 Commits

Author SHA1 Message Date
Marton Balint
f1214ad5d9 ffplay: fix indentation after last commit
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-22 16:17:50 +01:00
Marton Balint
076fc75bdb ffplay: do not preallocate video texture
Since the uploads happen in the main display function, it does not matter much.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-22 16:17:50 +01:00
Nicolas George
448f2972f9 ffplay: use buffersink accessors. 2017-01-12 14:06:16 +01:00
Ganesh Ajjanagadde
7b557bf63f ffplay: add startup volume option
Fixes Ticket 5389.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@alum.mit.edu>
2016-12-25 12:51:21 -08:00
Marton Balint
1f3910262e ffplay: fix sws_scale possible out of bounds array access
As I used simple RGBA formats for subtitles and for the video texture if
avfilter is disabled I kind of assumed that sws_scale won't access data
pointers and strides above index 0, but apparently that is not the case.

Fixes Coverity CID 1396737, 1396738, 1396739, 1396740.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-12-10 23:22:11 +01:00
Marton Balint
28d87899e3 ffplay: allow fallback to software renderer
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-11-20 23:38:06 +01:00
Marton Balint
58af48f1c3 ffplay: add support for negative RGBA linesize
This fixes the crash reported in ticket #5947.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-11-20 23:38:06 +01:00
Hendrik Leppkes
6f74e3cde6 Merge commit 'beb62dac629603eb074a44c44389c230b5caac7c'
* commit 'beb62dac629603eb074a44c44389c230b5caac7c':
  Use AVFrame.pts instead of deprecated pkt_pts.

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:16:36 +02:00
Marton Balint
4fdcd2f188 ffplay: remove unused viddec_width/viddec_height
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-10-02 15:40:29 +02:00
Marton Balint
d14b240ecf ffplay: use decoder avctx for decoded subtitle width/height
Fixes ticket #5873.

Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-10-02 15:40:04 +02:00
Marton Balint
9c5fab5ed4 ffplay: add SDL2 support
This commit also drops SDL1 support for ffplay.

Tested-by: James Almer <jamrial@gmail.com> (Windows, mingw-w64)
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-09-24 16:50:40 +01:00
Hendrik Leppkes
3bf142c773 cmdutils: remove the current working directory from the DLL search path on win32
Reviewed-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-08 18:36:55 +02:00
Michael Niedermayer
6cd9a8b67a ffplay: Fix invalid array index
Found-by: Thomas Guilbert <tguilbert@google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-03 16:09:03 +02:00
Timo Rothenpieler
1bd9fb6de5 ffplay: Fix usage of private lavfi API
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 12:53:01 +02:00
Clément Bœsch
8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Marton Balint
e32857f30e ffplay: ensure that we buffer at least 1 second of content
In order to do that, we keep track of the total duration of packets in a packet
queue.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-19 23:35:22 +02:00
Marton Balint
8594a8fbf9 ffplay: factorize checking if a stream needs additional packets
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-19 23:35:22 +02:00
Marton Balint
37d201aad9 ffplay: simplify display code
And get rid of frame_queue_prev.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-05-31 00:33:50 +02:00
Marton Balint
215a2d7678 ffplay: force setting alsa buffer size
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-05-07 17:18:26 +02:00
Marton Balint
ee94b1a50a ffplay: convert to codecpar
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-04-12 23:41:15 +02:00
Marton Balint
a07934d51b ffplay: fix silence insertion on error or pause
Insertion of silence was a bit broken since
df34b70098 because the info whether or not the
source buffer supposed to be silence must be kept between callbacks. Failing to
do so causes rogue samples from the last buffer to be presented, I guess even a
crash can occur under some circumstances.

This patch uses a NULL audio_buf to keep the silence state across audio
callbacks.

Reviewed-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-04-04 23:24:58 +02:00
Lukasz Marek
df34b70098 ffplay: remove redundant silence buffer
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2016-03-22 00:04:21 +01:00
Michael Niedermayer
7916f04b89 ffplay: Remove "&& 0" from already disabled debug code
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-20 11:22:53 +01:00
Vittorio Gambaletta (VittGam)
4590811fc2 ffplay: update docs after previous changes in ffplay mouse behaviour
Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-20 21:23:03 +01:00
Vittorio Gambaletta (VittGam)
acd37069ae ffplay: toggle full screen when double-clicking the video window with the left mouse button
Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.

Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-19 23:15:30 +01:00
Vittorio Gambaletta (VittGam)
cde4b99f47 ffplay: seek only when pressing the right mouse button on the video window
Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-19 23:15:23 +01:00
Michael Niedermayer
3c6781b48a Revert "ffplay: Fix auto insertion point of rotation filter"
Revert requested by Balint Marton <cus@passwd.hu>

See: [FFmpeg-devel] ffplay: insertion point of the auto rotation filter - Github ticket #141

This reverts commit 9cc1e644f3.
2015-12-28 03:44:31 +01:00
Ganesh Ajjanagadde
f16e4a0857 ffplay: replace rint by lrint
avoids the float to integer cast, and is slightly superior in terms of
rounding ("Dutch/Gauss rounding").

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-25 13:11:09 -08:00
wanzhang
9cc1e644f3 ffplay: Fix auto insertion point of rotation filter
Fixes watermark rotation for videos using auto rotation

Closes #141
2015-12-25 02:10:48 +01:00
Marton Balint
c413d9e635 ffplay: remove existing AVPicture usage
It is deprecated.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-12-19 14:09:26 +01:00
Ganesh Ajjanagadde
65440916c1 ffplay: use hypot()
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-06 08:11:47 -05:00
Hendrik Leppkes
c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
Hendrik Leppkes
856b19d593 Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'
* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
  avformat: Always return ref-counted AVPacket

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:12:27 +01:00
Marton Balint
03037a4aad ffplay: use a separate struct for the rescaled YUVA AVSubtitle rectangles
Current code segfaults since the deprecation of AVSubtitleRect.pict because it
freed/realloced AVSubtitleRect.pict.data by itself.

The new code stores the generated YUVA AVSubtitle rectangles in their own
struct and keeps the original AVSubtitle structure untouched, because
overwriting it is considered invalid API usage.

Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-24 16:12:25 +02:00
Marton Balint
148418a2bc ffplay: eliminate stream_component_close forward declaration
No change in fuctionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-12 00:07:38 +02:00
Marton Balint
4ce75387cd ffplay: close streams and AVFormatContext in the main thread
To avoid race conditions.

Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-12 00:07:38 +02:00
Ganesh Ajjanagadde
4c2bfabc3a ffplay: use correct context for av_log
Recent commits c3e8de1c24 and
8dc6e92c3d used av_log incorrectly.
This fixes such usage.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-05 22:28:17 +02:00
Ganesh Ajjanagadde
b67c1ab58c ffplay: more robust condition variable creation
SDL_CreateCond can fail:
https://wiki.libsdl.org/SDL_CreateCond.
This patch makes creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-05 22:25:51 +02:00
Ganesh Ajjanagadde
4802b8368a ffplay: log SDL error messages
This logs the SDL error messages on failure of creation of SDL_CreateMutex,
SDL_CreateCond, and SDL_CreateThread.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-05 22:21:20 +02:00
Ganesh Ajjanagadde
7c6dd90eed ffplay: more robust mutex creation
SDL_CreateMutex can fail:
https://wiki.libsdl.org/SDL_CreateMutex.
This patch makes creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-05 00:16:42 +02:00
Ganesh Ajjanagadde
c3e8de1c24 ffplay: more robust thread creation
SDL_CreateThread can fail:
https://wiki.libsdl.org/SDL_CreateThread.
This patch makes thread creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-04 17:40:30 +02:00
Ganesh Ajjanagadde
8dc6e92c3d ffplay: more robust mutex, condition variable handling
SDL_CreateMutex and SDL_CreateCond can fail:
https://wiki.libsdl.org/SDL_CreateMutex.
This patch makes handling more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-10-03 17:43:24 +02:00
Ganesh Ajjanagadde
fd44892073 doc/ffplay, ffplay: add information regarding volume control
ffplay now supports dynamic volume control. This documents the supported
behavior.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-09-27 23:04:54 +02:00
Ganesh Ajjanagadde
f1a9583305 ffplay: add support for interactive volume control
This is a feature heavily inspired by the mpv player. At the moment, methods
for adjusting volume in ffplay are rather clumsy: either one needs to set it
system-wide, or one needs to set it via the volume filter.

This patch adds key bindings identical to the mpv defaults for muting/unmuting
and increasing/decreasing the volume interactively without any introduction of
external dependencies.

TODO: doc update, possible mouse button bindings (mpv has this).

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-09-27 23:04:53 +02:00
Ganesh Ajjanagadde
23acb982a3 ffplay: dynamically allocate filename buffer
filename was set to an arbitrary 1024 characters. ffplay would thus be unable to
play files whose name exceeds that arbitrary threshold.

This patch dynamically allocates and frees the filename buffer to remove such
limitations.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-09-27 01:38:46 +02:00
Ganesh Ajjanagadde
265b106b92 ffplay: introduce key repeats
Key repeats have been introduced simply because they improve usability in my
experience for volume, brightness, and other such controls by speeding up the
time taken to go from 0 to max intensity. As a side benefit, this enables rapid
seeking through a file via left/right keys.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-09-27 00:54:29 +02:00
Hendrik Leppkes
144fb06806 Remove left-over FF_API_AVFILTERBUFFER cruft 2015-09-05 16:27:19 +02:00
Ronald S. Bultje
2fb593dcb9 Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.
The amv one probably looks suspicious, but since it's an intra-only
codec, I couldn't possibly imagine what it would use the edge for,
and the vsynth fate result doesn't change, so it's probably OK.
2015-08-28 14:40:59 -04:00
Zhang Rui
92d378067e ffplay: remove unused include libavutil/colorspace.h
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-28 00:09:42 +02:00
Marton Balint
8628b06b31 ffplay: increase MIN_FRAMES to 25
FFplay was using a 5 frame packet buffer, this is not much (e.g. 200 ms for
25fps video), when HLS is requesting a new segment via HTTP, it may take longer
for the request to complete.

Should fix ticket #4720.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-08-09 23:58:03 +02:00