Commit Graph

89 Commits

Author SHA1 Message Date
Diego Biurrun
041caf1a63 avplay: Exit by default at the end of playback
This is the expected behavior shared by all other cli multimedia players.

Bug-Id: 732
2014-09-06 16:52:59 +02:00
Gabriel Dume
f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Martin Storsjö
cf280ed004 avplay: Handle pixel aspect ratio properly
This was broken (left half-implemented) in 354468fc12.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-07-08 21:14:43 +03:00
Anton Khirnov
b36bc81cca avplay: add support for seeking to chapter marks 2014-02-10 11:23:01 +01:00
Anton Khirnov
84f131921f avplay: do not call avcodec_get_frame_defaults().
avcodec_decode_audio4() will reset the frame itself.
2013-12-11 20:39:55 +01:00
Anton Khirnov
eb891b3114 Replace all uses of avcodec_free_frame with av_frame_free(). 2013-12-11 20:39:54 +01:00
Diego Biurrun
8f8bc92365 Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
Anton Khirnov
5b9c3b4505 Replace all instances of avcodec_alloc_frame() with av_frame_alloc(). 2013-11-16 12:44:20 +01:00
Anton Khirnov
fae753af70 avplay: drop -vismv option which does not do anything anymore 2013-10-31 20:22:22 +01:00
Diego Biurrun
03039f4c8c miscellaneous typo fixes 2013-07-25 19:43:32 +02:00
Luca Barbato
26a44143ef avplay: remove a warning
Set the data field in the flush_pkt to the pointer to the actual packet.
The field needs to contain a valid unique pointer, no read nor writes
are ever made to it.
2013-04-27 10:51:28 +02:00
Anton Khirnov
fa2a34cd40 lavfi: change the filter registering system to match the other libraries
Removes an arbitrary hardcoded limit on the number of filters.
2013-04-11 20:44:03 +02:00
Anton Khirnov
38f0c0781a lavfi: merge avfiltergraph.h into avfilter.h
We do not support using filters without AVFilterGraph in practice
anyway, so there is no point in pretending we do.
2013-04-11 20:33:33 +02:00
Anton Khirnov
e5c32d6da7 avplay: remove the -debug option.
It just shadows the corresponding AVOption and prevents using named
constants.
2013-03-19 11:12:13 +01:00
Vittorio Giovara
2eaa3663fd avplay: enable only when SDL 1.2 is found
SDL 2 is API incompatible.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-03-09 14:33:54 +01:00
Anton Khirnov
354468fc12 avplay: switch to new refcounted frames API
Remove now unused cmdutils get_buffer() implementation.
2013-03-08 07:40:59 +01:00
Vladimir Pantelic
db0a943266 avplay: apply the stream sample_aspect_ratio to decoded video frames
If there is a sample_aspect_ratio in the stream, then apply it to every
decoded frame in the same way as avconv does. This also makes sure that
the avfilter chain has access to the aspect ratio.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Anton Khirnov
e2718e7a70 avplay: Do not use removed av_get_int()
Fixes build with lavfi disabled.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-29 10:52:23 +01:00
Justin Ruggles
6304f78edf avplay: support mid-stream sample rate changes
Resample to the rate that was configured in SDL.
2012-10-13 00:19:00 -04:00
Justin Ruggles
f5962229bf avplay: use audio parameters from the decoded frame instead of AVCodecContext 2012-10-13 00:18:48 -04:00
Diego Biurrun
c1ef30a6ba De-doxygenize some top-level files 2012-10-12 20:56:54 +02:00
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Anton Khirnov
e7ba5b1de0 lavr: change the type of the data buffers to uint8_t**.
This is more consistent with what the rest of Libav does.

This breaks API.
2012-10-05 13:49:44 +02:00
Diego Elio Pettenò
5e3f9979fa Use atexit() instead of defining a custom exit_program() interface. 2012-10-01 17:17:42 -04:00
Anton Khirnov
11d1ca4b2c Use avcodec_free_frame() to free AVFrames. 2012-09-24 12:31:25 +02:00
Anton Khirnov
0e8dccb79b avplay: get rid of ugly casts in the options table 2012-09-11 09:19:03 +02:00
Anton Khirnov
4e82cbb629 avplay: fix prototypes for option callbacks.
They have been wrong since 11d957fbd8
2012-09-11 09:18:57 +02:00
Anton Khirnov
f9fada2704 avconv: split printing "main options" into global and per-file. 2012-08-19 19:23:43 +02:00
Anton Khirnov
a3ad68d36c cmdutils: extend -h to allow printing codec details. 2012-08-19 19:22:08 +02:00
Anton Khirnov
7c5012127f cmdutils: change semantics of show_help_options() and document it.
Currently it takes a mask and value, such that options for which
(flags & mask) == value.

Change it to take required flags and forbidden flags instead. This is
shorter and simpler to understand.
2012-08-19 19:21:35 +02:00
Anton Khirnov
dc4c24a3d3 avtools: move some newlines to show_help_options().
Don't require every caller to supply them.
2012-08-19 19:21:03 +02:00
Anton Khirnov
f617135bc9 avtools: fix show_foo() signatures.
show_foo() functions are declared as void show_foo(void), but called as
int show_foo(const char*, const char*).
2012-08-19 19:07:43 +02:00
Konstantin Pavlov
1a4b556786 avplay: fix build with lavfi disabled.
Issue introduced in 67339f6e.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-08-08 11:14:10 +02:00
Anton Khirnov
02ac7311c8 lavfi: use avfilter_unref_bufferp() where appropriate. 2012-07-22 09:14:05 +02:00
Justin Ruggles
8ca08066fc lavr: Use AV_SAMPLE_FMT_NONE to auto-select the internal sample format
Also make this the default value.
2012-07-08 15:22:11 -04:00
Anton Khirnov
2696789c52 avplay: update input filter pointer when the filtergraph is reset.
Fixes an invalid read on size change.
2012-07-05 13:15:36 +02:00
Martin Storsjö
296d0da8bd avplay: Add an option for not limiting the input buffer size
For reading from normal files on disk, the queue limits for
demuxed data work fine, but for reading data from realtime
streams, they mean we're not reading from the input stream
at all once the queue limit has been reached. For TCP streams,
this means that writing to the socket from the peer side blocks
(potentially leading to the peer dropping data), and for UDP
streams it means that our kernel might drop data.

For some protocols/servers, the server initially sends a
large burst with data to fill client side buffers, but once
filled, we should keep reading to avoid dropping data.

For all realtime streams, it IMO makes sense to just buffer
as much as we get (rather in buffers in avplay.c than in
OS level buffers). With this option set, the input thread
should always be blocking waiting for more input data,
never sleeping waiting for the decoder to consume data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-04 11:11:08 +03:00
Luca Barbato
906f9dce85 avplay: fix write on freed memory for rawvideo
Do not assume avpacket and the decoded frames are independent.

To be absolutely sure and not sprinkle av_free_packet around the code
the call had been placed before getting the frame and on the error path.
2012-07-03 15:35:51 +02:00
Martin Storsjö
d3ed1c9571 cmdutils: Pass the actual chosen encoder to filter_codec_opts
This allows passing the right options to encoders when there's more
than one encoder for a certain codec id.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-30 15:44:10 +03:00
Mans Rullgard
896bb0d742 Replace usleep() calls with av_usleep()
This reduces the dependency on unistd.h which is not available
on all systems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-22 17:15:36 +01:00
Diego Biurrun
d246c18ea6 Avoid C99 variable declarations within for statements.
We generally do not declare variables within for statements and
there are compilers that choke on such constructs.
2012-06-14 23:36:04 +02:00
Anton Khirnov
67339f6eb4 avplay: use buffersrc instead of custom input filter.
We do not allow user filters, so avtools shouldn't use them either.

It also allows to reuse buffer management code from avconv, thus
reducing duplication.
2012-06-05 09:36:10 +02:00
Anton Khirnov
ac71230902 lavfi: add video buffer sink, and use it in avtools
Also add the public interface libavfilter/buffersink.h.

Based on a commit by Stefano Sabatini.
2012-05-09 08:59:37 +02:00
Justin Ruggles
85e5b866dc avplay: properly close/reopen AVAudioResampleContext on channel layout change
fixes Bug#280
2012-05-07 12:42:32 -04:00
Justin Ruggles
f1ffb01ee9 avplay: use libavresample for sample format conversion and channel mixing
SDL only supports s16 sample format and a limited number of channel layouts.
Some versions of SDL on some systems support 4-channel and 6-channel output,
but it's safer overall to downmix any layout with more than 2 channels to
stereo.
2012-05-01 13:38:23 -04:00
Mans Rullgard
2bcbd98459 Remove lowres video decoding
This feature is complex, of questionable utility, and slows down
normal decoding.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-21 18:56:19 +01:00
Luca Barbato
6943fb47d3 avplay: update get_buffer to be inline with avconv
The buffer must have its dimension, pixel format and aspect ratio
set.
2012-04-16 15:12:03 -07:00
Anton Khirnov
b7327887ea avconv: get output pixel format from lavfi.
This way we don't require a clearly defined corresponding input stream.

The result for the xwd test changes because rgb24 is now chosen instead
of bgra.
2012-04-15 20:22:36 +02:00
Stefano Sabatini
91d3cbe0fd avfiltergraph: make the AVFilterInOut alloc/free API public
This is required for letting applications to create and destroy
AVFilterInOut structs in a convenient way.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-04-14 09:25:46 +02:00
Alex Converse
e1ce756844 avplay: Don't free video filters string until the end of decoding.
av_freep()ing inside configure_video_filters() leaves a dangling
reference in the calling code, and the filter string is needed again when
reconfiguring video filters for a size change.
2012-04-11 10:24:01 -07:00