core: add player API

This API will replace the usage of input_thread_t from interface modules. The
player implementation continue to use input_thread_t in private. The goal is to
hide the input_thread_t API when every modules are switched to the player API.

TODO (all need to be fixed, for VLC 4.0):

 - Gapless: API is complete but not implemented (the player can play several
   medias in a row, but without gapless).
 - Position callbacks: still using the input_thread_t position that is really
   imprecise (notified every 250ms minimum, and sometime more, depending on
   pf_demux implementation).
 - Seek/discontinuity callbacks: when seeking, the player can still send
   position of the requested position, the actual position or the next position
   to come. This leads to UI inconsistency.
 - OSD messages should be display from input callbacks but it's not possible
   now since you can't know if the event come from the user or from the core.
This commit is contained in:
Thomas Guillem 2018-04-09 14:23:36 +02:00
parent 82260d0153
commit a80c78fc2a
7 changed files with 6501 additions and 0 deletions

6
PLAYER_TODO.txt Normal file
View File

@ -0,0 +1,6 @@
- Remove input/control.c (move remaining implementation to player.c)
- Remove bookmark handling from input
- Remove INPUT_GET_VOUTS/INPUT_GET_AOUT
- Remove INPUT_GET_FULL_TITLE_INFO and priv->*title
- http cookies jar
- Seek callback

2761
include/vlc_player.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -79,6 +79,7 @@ src/input/input.c
src/input/input_internal.h
src/input/item.c
src/input/meta.c
src/input/player.c
src/input/stream.c
src/input/stream.h
src/input/stream_memory.c

View File

@ -77,6 +77,7 @@ pluginsinclude_HEADERS = \
../include/vlc_picture_fifo.h \
../include/vlc_picture_pool.h \
../include/vlc_playlist_legacy.h \
../include/vlc_player.h \
../include/vlc_plugin.h \
../include/vlc_probe.h \
../include/vlc_rand.h \
@ -242,6 +243,8 @@ libvlccore_la_SOURCES = \
input/es_out.c \
input/es_out_timeshift.c \
input/input.c \
input/player.c \
input/player.h \
input/info.h \
input/meta.c \
clock/input_clock.h \

3585
src/input/player.c Normal file

File diff suppressed because it is too large Load Diff

35
src/input/player.h Normal file
View File

@ -0,0 +1,35 @@
/*****************************************************************************
* player.h: Player internal interface
*****************************************************************************
* Copyright © 2018 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_PLAYER_INTERNAL_H
#define VLC_PLAYER_INTERNAL_H
#include <vlc_player.h>
/**
* Assert that the player mutex is locked.
*
* This is exposed in this internal header because the playlist and its
* associated player share the lock to avoid lock-order inversion issues.
*/
void
vlc_player_assert_locked(vlc_player_t *player);
#endif

View File

@ -793,3 +793,113 @@ vlc_thumbnailer_RequestByTime
vlc_thumbnailer_RequestByPos
vlc_thumbnailer_Cancel
vlc_thumbnailer_Release
vlc_player_AddAssociatedMedia
vlc_player_AddListener
vlc_player_aout_AddListener
vlc_player_aout_EnableFilter
vlc_player_aout_GetVolume
vlc_player_aout_Hold
vlc_player_aout_IncrementVolume
vlc_player_aout_IsMuted
vlc_player_aout_Mute
vlc_player_aout_RemoveListener
vlc_player_aout_SetVolume
vlc_player_ChangeRate
vlc_player_CondWait
vlc_player_DisplayPosition
vlc_player_DecrementRate
vlc_player_Delete
vlc_player_GetAudioDelay
vlc_player_GetCapabilities
vlc_player_GetCurrentMedia
vlc_player_GetError
vlc_player_GetLength
vlc_player_GetPosition
vlc_player_GetProgram
vlc_player_GetProgramAt
vlc_player_GetProgramCount
vlc_player_GetRate
vlc_player_GetRenderer
vlc_player_GetSelectedChapterIdx
vlc_player_GetSelectedTitleIdx
vlc_player_GetSignal
vlc_player_GetState
vlc_player_GetStatistics
vlc_player_GetSubtitleDelay
vlc_player_GetTeletextPage
vlc_player_GetTime
vlc_player_GetTitleList
vlc_player_GetTrack
vlc_player_GetTrackAt
vlc_player_GetTrackCount
vlc_player_HasTeletextMenu
vlc_player_IncrementRate
vlc_player_InvalidateNextMedia
vlc_player_IsRecording
vlc_player_IsTeletextEnabled
vlc_player_IsTeletextTransparent
vlc_player_IsTrackCategoryEnabled
vlc_player_Lock
vlc_player_Navigate
vlc_player_New
vlc_player_NextVideoFrame
vlc_player_Pause
vlc_player_program_Delete
vlc_player_program_Dup
vlc_player_RemoveListener
vlc_player_RestartTrack
vlc_player_Resume
vlc_player_SeekByPos
vlc_player_SeekByTime
vlc_player_SelectChapter
vlc_player_SelectChapterIdx
vlc_player_SelectDefaultTrack
vlc_player_SelectNextChapter
vlc_player_SelectNextTitle
vlc_player_SelectNextTrack
vlc_player_SelectNextProgram
vlc_player_SelectPrevChapter
vlc_player_SelectPrevTitle
vlc_player_SelectPrevTrack
vlc_player_SelectPrevProgram
vlc_player_SelectProgram
vlc_player_SelectTeletextPage
vlc_player_SelectTitle
vlc_player_SelectTitleIdx
vlc_player_SelectTrack
vlc_player_SetAssociatedSubsFPS
vlc_player_SetAtoBLoop
vlc_player_SetAudioDelay
vlc_player_SetCurrentMedia
vlc_player_SetMediaStoppedAction
vlc_player_SetRecordingEnabled
vlc_player_SetRenderer
vlc_player_SetStartPaused
vlc_player_SetSubtitleDelay
vlc_player_SetSubtitleSync
vlc_player_SetTeletextEnabled
vlc_player_SetTeletextTransparency
vlc_player_SetTrackCategoryEnabled
vlc_player_Start
vlc_player_Stop
vlc_player_title_list_GetAt
vlc_player_title_list_GetCount
vlc_player_title_list_Hold
vlc_player_title_list_Release
vlc_player_track_Delete
vlc_player_track_Dup
vlc_player_Unlock
vlc_player_UnselectTrack
vlc_player_UpdateViewpoint
vlc_player_vout_AddListener
vlc_player_vout_GetFilter
vlc_player_vout_Hold
vlc_player_vout_HoldAll
vlc_player_vout_IsFullscreen
vlc_player_vout_IsWallpaperModeEnabled
vlc_player_vout_OSDMessage
vlc_player_vout_RemoveListener
vlc_player_vout_SetFilter
vlc_player_vout_SetFullscreen
vlc_player_vout_SetWallpaperModeEnabled
vlc_player_vout_Snapshot