Commit Graph

648 Commits

Author SHA1 Message Date
Rémi Denis-Courmont a2476d06e2 sout: remove sout_instance_t for real
(also sout_cfg_t)
2021-07-15 17:23:03 +00:00
Rémi Denis-Courmont 3e55700963 sout: remove sout_instance_t indirection
This just wraps a sout_stream_t. We get more flexibility by using
sout_stream_t directly.
2021-07-15 17:23:03 +00:00
Rémi Denis-Courmont f32f289264 Rationalise not found error codes
We don't need 4 different codes for essentially the same thing, which
is that a certain thing could not be found.
2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont dd20ace531 Rename VLC_EBADVAR to VLC_EINVAL 2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont aebb111024 Introduce VLC_ENOTSUP error code
Better than VLC_EGENERIC when something is understood to be unsupported
on the local system.
2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont 2e4165c0cc Introduce VLC_EACCES error code
EACCES means that an operation is not possible in the current state.

This is not to be confused with EPERM meaning that the user does not
have the necessary credentials. Also compare HTTP results 401 and 403.

Also compare with EINVAL (VLC_EBARVAR) meaning that operating is not
possible because the value of a parameter is invalid.
2021-07-14 14:53:16 +00:00
Steve Lhomme c3748d50f4 common: don't use [static] in C++ code
This is a C99 thing.
2021-07-12 08:33:35 +02:00
Hugo Beauzée-Luyssen 626a5d9a16 vlc_common: Provide an unreachable() implementation for MSVC 2021-01-25 18:43:41 +01:00
Romain Vimont 93f9591d9f vlc_common: remove old playlist typedefs
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2020-11-12 15:08:03 +01:00
Marvin Scholz 828fafb3d9 src: remove old md5 API 2020-04-16 12:06:12 +02:00
Marvin Scholz d18cd34a49 vlc_common: move decoder_synchro_t to synchro.h 2020-03-26 09:13:49 +01:00
Marvin Scholz dff305c34b vlc_common: add vlc_align helper 2020-03-24 18:50:15 +01:00
Thomas Guillem c2a4de8137 input: make the input_source_t struct public
But continue to hide its definition and usage. It will just be used to passed
from demuxers to the display es_out that will actually use it.
2020-02-28 20:29:35 +01:00
Steve Lhomme a9e0b1124e vlc_common: fix swab() calls on win32 that don't use const on source pointer 2019-07-19 15:19:16 +02:00
Thomas Guillem 9dc34b4205 input: hide input_thread_t 2019-06-03 16:15:55 +02:00
Rémi Denis-Courmont 32bc2c18cf misc: remove unused vlc_error_string() 2019-05-28 19:56:08 +03:00
Steve Lhomme 16040ccb7a do not use tchar.h in VLC
We don't include tchar.h anymore, nor TCHAR, nor the *tcs* APIs. Using any of
these will fail to compile if tchar.h is not included. In MinGW it's never
included through other headers.

We don't need _UNICODE either which is specific to tchar.h.
2019-04-03 10:28:50 +02:00
Rémi Denis-Courmont 3e8986472a Rename vlc_error() to vlc_error_string()
As a sort of VLC equivalent for strerror(), it is tempting to call it
vlc_strerror()... but that is already taken for converting actual
standard error codes to strings.
2019-03-04 22:02:35 +02:00
Thomas Guillem 599ad7a13d vlc_common: implement VLC_WEAK for MACH-O 2019-01-22 18:28:53 +01:00
Thomas Guillem 8443136fd7 vlc_common: don't use doc inline comments for defines
Otherwise, the comment is included on every doc that mention these defines.
2018-10-19 12:09:54 +02:00
Romain Vimont 983c43f059 vlc_vector: add helpers for vectors
Add a new API for handling general-purpose vectors, intended to replace
ARRAY_*.

Like ARRAY_*, it provides macros to handle a dynamic array generic
over the type of its items.

Contrary to ARRAY_*:
 - it does not abort on allocation failure (but reports the error);
 - it uses size_t instead of int to store the capacity and the size;
 - it checks for overflows on reallocation.

For illustration purpose, embedding a vector of input_item_t* in a
struct looks like:

    struct playlist {
        struct VLC_VECTOR(input_item_t *) items;
        // ...
    };

The main features (with names inspired by std::vector from C++ and
std::vec::Vec from Rust) are:
 - void vlc_vector_init(pv)
      init the vector (use VLC_VECTOR_INITIALIZER for static init)
 - void vlc_vector_destroy(pv)
      destroy the vector and release any associated resources
 - void vlc_vector_clear(pv)
      remove all items from the vector
 - vec.size
      read the size of the vector
 - vec.data[i]
      access the i_th item
 - bool vlc_vector_push(pv, item)
      push an item to the end of the vector
 - bool vlc_vector_push_all(pv, items, count)
      push serveral items to the end of the vector
 - bool vlc_vector_insert(pv, index, item)
      insert an item at index
 - bool vlc_vector_insert_all(pv, index, items, count)
      insert several items at index
 - void vlc_vector_move(pv, index, target)
      move an item to target
 - void vlc_vector_move_all(pv, index, count, target)
      move a slice of items to target
 - void vlc_vector_remove(pv, index)
      remove an item
 - void vlc_vector_remove_slice(pv, index, count)
      remove a slice of items
 - void vlc_vector_swap_remove(pv, index)
      remove an item in O(1) without preserving ordering
 - bool vlc_vector_reserve(pv, mincap)
      increase the capacity of the vector in advance
 - void vlc_vector_shrink_to_fit(pv)
      resize the vector to its actual size
 - void vlc_vector_index_of(pv, index, pidx)
      find the index of an item (returns the result in *pidx)
 - vlc_vector_foreach(item, pv)
      a for-each loop

It uses an exponential growth policy for both increasing and decreasing
the size. As a consequence, the amortized complexity of
vlc_vector_push() is O(1).

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-10-18 13:12:22 +02:00
Thomas Guillem 7e719ff464 es_out: add a new ES track identifier
Add the vlc_es_id_t structure representing an ES track ID.

This new struct will be used to select/unselect/restart tracks.

Users will receive this new struct from input thread event callbacks. They will
be able to hold/release it (and use it even after the track is terminated by
the es_out).

ES Tracks will still be selectable via their i_id (for TS cases) and legacy
track selection via "video-es"/"audio-es"/"spu-es" is still functional.

ES tracks of the input item will now keep the same fmt.i_id than the demuxer
one.

The fmt of the ES events will now keep the decoder codec. The original codec
from the demuxer is still available via fmt.i_original_fourcc.
2018-09-03 17:04:04 +02:00
Hugo Beauzée-Luyssen ee525e65e7 vlc_common.h: Remove unused xcalloc() 2018-08-22 11:41:16 +02:00
Hugo Beauzée-Luyssen 244e4b9daf vlc_common.h: Remove tabs 2018-08-21 11:57:26 +02:00
Rémi Denis-Courmont c85147a421 include: do not issue assertions in external plug-ins 2018-07-02 21:45:54 +03:00
Steve Lhomme a6149e2c1e include: rename vlc_mtime.h to vlc_tick.h 2018-06-22 13:26:57 +02:00
Steve Lhomme b8d32c7cc0 include: move vlc_tick_t in vlc_mtime.h 2018-06-22 13:26:57 +02:00
Steve Lhomme ff56c92a5e rename mtime_t to vlc_tick_t
Keep a copy of vlc_tick_tfor backward compatibility.
2018-06-22 13:19:24 +02:00
Rémi Denis-Courmont 2d14f88ea3 include: remove vlc_list_t 2018-06-10 13:08:44 +03:00
Rémi Denis-Courmont 13c6d120d7 Remove vlc_value_t.p_list 2018-06-10 13:08:44 +03:00
Rémi Denis-Courmont 8349b1a82a modules: constify vlc_gettext()
The returned string is actually not modifiable. We have no obligations
to reproduce the deficient prototype of the standard gettext().
2018-06-10 13:08:44 +03:00
Romain Vimont 35dd7a8f18 core: remove global picture_sys_t typedef
Replace picture_sys_t* by void* in picture_resource_t, and remove its
typedef in vlc_common.h (for ODR).

This implies to use void* for private data in the vaapi.

See #17078 and #18033

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-04-30 17:10:14 +02:00
Romain Vimont ff2901aff3 core: remove global *_sys_t typedefs
Do not declare *_sys_t typedefs globally in vlc_common.h. Instead,
declare them locally in each module that provides a definition.

This paves the way to move C++ definitions into anonymous namespaces in
order to respect C++ ODR.

The picture_resource_t and sout_stream_id_sys_t typedefs will be handled
separately, since they require specific additional changes.

See #18033

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-04-30 14:20:50 +02:00
Kamil Rytarowski 7e9ef3d72b include: Rename the bswap functions to vlc_bswap
The bswap16, bswap32 and bswap64 functions are already present on NetBSD
and cannot be redefined in include/vlc_common.h as this causes fatal build
errors.

Rename these functions to vlc_bswap16, vlc_bswap32 and vlc_bswap64 and
keep them as they are without fallback to the NetBSD's libc one. These
functions are already small enough and we can bear with them as duplicates
on the gain of no extra ifdefs in the vlc_common.h public header.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-03-12 09:18:15 +01:00
Martin Storsjö 070fcc422e include: Don't use the gnu_printf format attribute with clang
Clang doesn't support this attribute yet.
2018-02-28 11:48:21 +02:00
Rémi Denis-Courmont 897703bb54 demux: make demux_t an alias of stream_t (refs #18504) 2018-02-26 21:54:15 +02:00
Rémi Denis-Courmont 924d56751b include: revector bit ops 2018-02-26 18:56:24 +02:00
Kamil Rytarowski ab23a02cc9 Rename popcount to vlc_popcount
This removes conflicts with the NetBSD headers and libc.
The conflicts caused fatal build errors.

No functional change intended for other Operating Systems.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2018-02-26 18:56:24 +02:00
Rémi Denis-Courmont 4d1b85c242 include: fix clz on pure ISO C compilers 2018-02-24 09:54:47 +02:00
Francois Cartegnie ccc3b13f18 fix build / c++ parity usage 2018-02-13 10:58:49 +01:00
Rémi Denis-Courmont 40b92a1446 Add VLC_WEAK wrapper 2018-02-12 19:31:50 +02:00
Rémi Denis-Courmont 417ed9eb80 include: layer the plugin API documentation 2018-02-11 21:55:42 +02:00
Rémi Denis-Courmont d4c9575d0b include: enable built-in bit operations on Clang 2018-02-11 15:08:23 +02:00
Rémi Denis-Courmont 5a743dcb69 include: document the function and prediction annotation 2018-02-11 15:05:01 +02:00
Rémi Denis-Courmont 1703087d96 clang: enable branch prediction as on GCC 2018-02-11 14:32:54 +02:00
Rémi Denis-Courmont e097fa0543 Add signed parity on GCC 2018-02-11 14:25:09 +02:00
Rémi Denis-Courmont d0d9c185fa Make C parity() handle all unsigned types 2018-02-11 13:15:20 +02:00
Rémi Denis-Courmont 0979f5a581 Make C popcount() handle all integer types 2018-02-11 13:15:20 +02:00
Rémi Denis-Courmont 9364337aac include: document generic integer functions 2018-02-11 13:15:20 +02:00
Rémi Denis-Courmont f96abe51ba Make ctz() handle all integer sizes 2018-02-11 13:15:20 +02:00