1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00
Commit Graph

60971 Commits

Author SHA1 Message Date
Rémi Denis-Courmont
ed69f1dcc8 oldrc: use input "state" variable instead of b_dead 2015-06-05 22:33:09 +03:00
Rémi Denis-Courmont
2772acfee7 lib: use input "state" variable instead of b_dead 2015-06-05 22:25:58 +03:00
Rémi Denis-Courmont
239fcbc3c4 playlist: use input "state" variable instead of b_dead 2015-06-05 22:22:20 +03:00
Rémi Denis-Courmont
af922d5e6c input: remove input_thread_t.b_error 2015-06-05 22:18:18 +03:00
Rémi Denis-Courmont
3b6780d314 input: remove input_thread_t.b_eof 2015-06-05 22:08:04 +03:00
Rémi Denis-Courmont
35f50bdc35 podcast: use input "state" variable instead of b_eof/b_error 2015-06-05 22:07:43 +03:00
Rémi Denis-Courmont
72b8c9e5a5 vlm: use input "state" variable instead of b_eof/b_error 2015-06-05 22:05:28 +03:00
Rémi Denis-Courmont
f20f1ca79c playlist: remove redundant call to input_Stop()
The input is already stopped if it has reached end or error.
2015-06-05 21:58:53 +03:00
Rémi Denis-Courmont
8e662f5903 input: remove redundant END_S code
After each and every MainLoop() call is a call to End(), which
inconditionally sets the input state to END_S.
2015-06-05 21:54:16 +03:00
Felix Paul Kühne
1e2a57c3c5 iOS vout: fix runtime exception (closes #14800) 2015-06-05 17:07:34 +02:00
KO Myung-Hun
5520cd1f37 access_output_file: fix compilation on OS/2
-----
  CC       access_output/file.lo
access_output/file.c: In function 'Open':
access_output/file.c:288:9: error: implicit declaration of function 'setmode' [-Werror=implicit-function-declaration]
         setmode (STDOUT_FILENO, O_BINARY);
         ^
cc1.exe: some warnings being treated as errors
make.exe[4]: *** [access_output/file.lo] Error 1
-----

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:44:36 +02:00
KO Myung-Hun
0e1ed1b53a vlc-wrapper: disable on OS/2
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:42:40 +02:00
Julian Scheel
4e8c81f922 mmal/deinterlace: Avoid overflows on buffer calculation
Use signed variables for calculating the buffers to be sent to the component
as negative values may occur.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:39:14 +02:00
Julian Scheel
3146706d51 mmal: Reduce buffer count to 30
Save some memory by allocating fewer buffers. This is still not optimal, but
close to where we can get with the current implementation.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:39:14 +02:00
Julian Scheel
a9f5941b5f mmal/codec: Use default input buffer count
As we use packetized input we normally don't need more than a handful of input
buffers. Using the default of mmal, which is 20, seems absolutely sufficient.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:39:14 +02:00
Julian Scheel
2d8c51b930 mmal/codec: Implement full flush
To be able to handle seeking properly we need to do a full decoder flush on a
discontinuity. As flushing the in- and output ports alone would not cause the
codecs internal state to be reset we have to disable the ports, reconfigure
and reenable. To ensure the flushing is synchronous the input buffers in
transit are now tracked as well.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:39:14 +02:00
Julian Scheel
2d7881198e mmal/codec: Silence build warnings
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:39:14 +02:00
Julian Scheel
146fcb56e3 mmal: Use zerocopy ports for opaque mode
When running in opaque mode the mmal codec, deinterlace and vout must be used
together, so it is known that all pictures in use are allocated by the mmal
vout and contain an associated mmal_buffer_header. This allows us to enable
the zerocopy feature of mmal, which allocates shared memory between GPU and
CPU for holding the buffer payloads. Albeit the payloads are just small opaque
handles that reference the GPU side pictures it saves a little bit of
performance, because less VCHIQ transfers are required.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:03 +02:00
Julian Scheel
190ebeb4e5 mmal/vout: Use port bound pool allocation
Using mmal_port_pool_allocate/destroy adds some extra safety on maintaining
the pool lifecycle in relation to the component lifecycle. Furthermore it is a
prerequisite to use zerocopy mode for ports.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:03 +02:00
Julian Scheel
b2cf46dd22 mmal/deinterlace: Free unusable buffers
If the input port returns a buffer which has no picture attached to it it
would be leaked. While this in fact should not happen it seems sane to at
least release the buffer and spit a warning in case it does happen.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:03 +02:00
Julian Scheel
c92f24312c mmal/deinterlace: Do not filter the same picture twice
If the same picture, containing the same buffer header without being
re-acquired in the meantime, is sent to image_fx twice it will portentially
cause a double free within the mmal core as it destroys the internal
refcounting. Use the same guarding mechanism which is already in place in
mmal/vout to ensure this is not happening at any point.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:03 +02:00
Julian Scheel
974e13d7b3 mmal/deinterlace: Do not use local buffer pools
The mmal deinterlace filter does currently support the mmal opaque encoding
only and thus must be used together with mmal vout and mmal codec. This
ensures that pictures being used contain valid mmal buffer headers in the
picture_sys. Using them instead of locally allocated buffer headers simplifies
the code and avoids error-prone dangling with the data attached to the buffer
headers. Furthermore it is a prerequisite to enable zerocopy on the buffer
ports, which can even be a good thing when using opaque buffers.
If at some point in time the image_fx component in mmal will be fixed to also
support I420 input we may reintroduce them for operating this filter
independently from mmal codec and vout.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:03 +02:00
Julian Scheel
f9dde8b809 mmal/codec: Do not use local buffer pool in opaque mode
When running in opaque mode the codec must be used together with the mmal
vout. In this case each picture contains a mmal_buffer_header within the
picture_sys_t. That buffer header can be used instead of locally allocated
headers with the advantage of reducing complexity and avoiding possibly
error-prone mangling of buffer headers. Furthermore it is a prerequisite to
enable zero_copy mode on the ports.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
21f3373a3f mmal/codec: Rename mmal-zerocopy option to mmal-opaque
The option named mmal-zerocopy until now is used to configure the codec to
generate pictures with MMAL_ENCODING_OPAQUE which in fact is a fake payload
format that just contains handles for pictures allocated on the GPU side.
While this in effect causes a zerocopy mode of pixel data the naming is
potentially misleading because mmal supports another mode called zero_copy. In
this mode the GPU and CPU use shared buffers via the vc_sm kernel module, so
that the buffer data is actually accessible from userspace but no copies are
required when transferring from or to mmal components.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
3c0019d062 mmal/deinterlace: Rework to use pictures from vout pool
The reason for having a local picture pool within the deinterlace filter has
been that the mmal core did not allow to initialise the image_fx filter with
less than 20 output buffers. This limitation was removed from the mmal core,
so that it is possible to operate with as less as 2 output buffers, which
makes it possible to use pictures acquired from the core video output pool.
Besides being much more conformant to VLC core design this also avoids some
possible issues with buffer ownership and component lifecycle of the mmal
components.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
51fed80a4c mmal/deinterlace: Release picture if unable to process
When an input picture can not be handled due to lack of resources we need to
free it to avoid a picture leak.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
8bd0fc0425 mmal/deinterlace: Clear data from buffer header before release
The data attached to the output port headers is not owned by the deinterlace
filter but by the vout and only temporarily attached to the codecs buffers. To
avoid refcount issues within the mmal core clear the data field before
releasing the buffers.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
5011389fe8 mmal/codec: Do not disable ports for flushing
It is safe to flush enabled ports, so avoid unnecessary delays by disabling
and enabling the ports.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
45a463bf2c mmal/codec: Clear data from buffer header before release
The data attached to the output port headers is not owned by the codec but by
the vout and only temporarily attached to the codecs buffers. To avoid
refcount issues within the mmal core clear the data field before releasing the
buffers.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
2698e5893c mmal/codec: Try to apply fmt changes without disabling port
Depending on what parts of the format have changed it can be possible to apply
the changes without resetting the whole port. As this saves some time try to
make use of it.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:02 +02:00
Julian Scheel
88f9688b96 mmal/vout: Use fixed binding of mmal buffer to picture
Instead of dynamically allocating a mmal buffer from the mmal buffer pool use
a fixed binding, where the same mmal buffer is used for the whole pictures
lifecycle. This avoids some overhead on picture allocation and simplifies the
code. As the mmal buffer pool is allocated in exactly the same size as the vlc
picture pool there is no drawback doing it this way.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:35:01 +02:00
Julian Scheel
e142409740 mmal/vout: Do not wait for picture in non-opaque mode
When not running in opaque mode the buffer headed over for rendering is only
returned when the following buffer isrendered or the component is disabled. So
in this case waiting for the buffer to be returned immediately deadlocks the
rendering. As all buffers get immediately flushed on stop it is safe to skip
this wait for non-opaque usecase.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:05 +02:00
Julian Scheel
73a216048d mmal: Use atomic operations for refcounting
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:05 +02:00
Julian Scheel
228fcee627 mmal/deinterlace: Don't send buffers to disabled port
If the port is disabled it would refuse buffers with an error anyway. Avoid
this by not sending them when the port is disabled.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:05 +02:00
Julian Scheel
dd33e6f11d mmal/deinterlace: Fix locking
The locking was incomplete and partly just wrong.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:05 +02:00
Julian Scheel
43fa8e7893 mmal/deinterlace: Simplify flushing
It is not required to disable mmal ports before flushing them.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:05 +02:00
Julian Scheel
47c81c46c9 mmal/codec: Improve locking
Only lock when really needed. To do this feeding the mmal port with buffers is
done from one place only now.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:04 +02:00
Julian Scheel
de2115b5d2 mmal/codec: Don't send buffers to disabled ports
If a port is not enabled sending any buffers to it will cause an error, so
just don't try it.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:04 +02:00
Julian Scheel
620303f6b6 mmal: Add missing header include guards
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-06-05 15:34:04 +02:00
Jean-Baptiste Kempf
626d7ef2d9 RTSP: fix off-by-one buffer overflow
Close #14820
2015-06-05 15:25:11 +02:00
Rafaël Carré
ba6e587ac1 ncurses: fix breakage 2015-06-05 11:16:05 +02:00
Rémi Denis-Courmont
729adddade input: deprecate b_dead, b_eof and b_error
Those values are writable by the input thread, and thus inaccessible
to other threads. Any remaining use of those (in VLM, podcast and
interfaces notably) is an undefined memory access, a bug.
2015-06-05 00:09:00 +03:00
Rémi Denis-Courmont
eb4eb47850 gui: remove useless checks for input_thread_t.b_dead and b_eof
The input thread sends events. There is no point in checking manually
since the input thread functions aresafe to "use" so long as the caller
has a reference to the input thread (regardless of the input thread
being dead or at EOF). Also the value of those flags can change
asynchronously (outside the input thread) so the checks were racy.
2015-06-05 00:05:35 +03:00
Rémi Denis-Courmont
bfd85b0760 ncurses: do not store the input thread
This avoids undefined access to input_thread_t.b_dead.
2015-06-04 23:53:48 +03:00
Rémi Denis-Courmont
5885e88a76 oldrc: fix reading from standard input 2015-06-04 23:38:05 +03:00
Rémi Denis-Courmont
bd6ddfddd6 dvb: remove dead busy loop 2015-06-04 20:12:55 +03:00
Rémi Denis-Courmont
f4293e7462 dshow: remove dead code 2015-06-04 20:08:05 +03:00
Rémi Denis-Courmont
d08a9136c6 dshow: remove redundant loop and vlc_object_alive() call
The caller (i.e. the buffer stream_t) will call the function again if
NULL is returned (assuming !b_error and !b_eof).
2015-06-04 20:04:12 +03:00
Rémi Denis-Courmont
1ef2e1594a http: remove useless vlc_object_alive() calls
The net_* and vlc_tls_* functions will return errors.
2015-06-04 19:52:36 +03:00
Thomas Guillem
e12376a1cc mediacodec: specify NDK or JNI in description 2015-06-04 13:17:01 +02:00