demux: mp4: set bitmap mask when possible
[vlc.git] / src / playlist / playlist.h
blob1090d2146b59e283625b4e8fc5477f87f276fb4b
1 /*****************************************************************************
2 * playlist/playlist.h
3 *****************************************************************************
4 * Copyright (C) 2018 VLC authors and VideoLAN
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
21 #ifndef VLC_PLAYLIST_NEW_INTERNAL_H
22 #define VLC_PLAYLIST_NEW_INTERNAL_H
24 #include <vlc_common.h>
25 #include <vlc_playlist.h>
26 #include <vlc_vector.h>
27 #include "../input/player.h"
28 #include "randomizer.h"
30 typedef struct input_item_t input_item_t;
32 #ifdef TEST_PLAYLIST
33 /* mock the player in tests */
34 # define vlc_player_New(a,b,c) (VLC_UNUSED(a), VLC_UNUSED(b), malloc(1))
35 # define vlc_player_Delete(p) free(p)
36 # define vlc_player_Lock(p) VLC_UNUSED(p)
37 # define vlc_player_Unlock(p) VLC_UNUSED(p)
38 # define vlc_player_AddListener(a,b,c) (VLC_UNUSED(b), malloc(1))
39 # define vlc_player_RemoveListener(a,b) free(b)
40 # define vlc_player_SetCurrentMedia(a,b) (VLC_UNUSED(b), VLC_SUCCESS)
41 # define vlc_player_InvalidateNextMedia(p) VLC_UNUSED(p)
42 # define vlc_player_vout_OSDMessage(p, fmt...) VLC_UNUSED(p)
43 #endif /* TEST_PLAYLIST */
45 typedef struct VLC_VECTOR(vlc_playlist_item_t *) playlist_item_vector_t;
47 struct vlc_playlist
49 vlc_player_t *player;
50 /* all remaining fields are protected by the lock of the player */
51 struct vlc_player_listener_id *player_listener;
52 playlist_item_vector_t items;
53 struct randomizer randomizer;
54 ssize_t current;
55 bool has_prev;
56 bool has_next;
57 struct vlc_list listeners; /**< list of vlc_playlist_listener_id.node */
58 enum vlc_playlist_playback_repeat repeat;
59 enum vlc_playlist_playback_order order;
62 static inline void
63 vlc_playlist_AssertLocked(vlc_playlist_t *playlist)
65 #ifdef TEST_PLAYLIST
66 /* disable vlc_assert_locked in tests since the symbol is not exported */
67 VLC_UNUSED(playlist);
68 #else
69 vlc_player_assert_locked(playlist->player);
70 #endif
73 #endif