Commit c67934b0 authored by Thomas Guillem's avatar Thomas Guillem

remove vlc_playlist_legacy

parent 376d2b56
......@@ -91,8 +91,6 @@ VLC_API int intf_Create( libvlc_int_t *, const char * );
VLC_API void libvlc_Quit( libvlc_int_t * );
VLC_API playlist_t *pl_Get( struct intf_thread_t *intf );
/**
* Recover the main playlist from an interface module
*
......@@ -101,12 +99,6 @@ VLC_API playlist_t *pl_Get( struct intf_thread_t *intf );
VLC_API vlc_playlist_t *
vlc_intf_GetMainPlaylist(intf_thread_t *intf);
/**
* Retrieves the current input thread from the playlist.
* @note The returned object must be released with input_Release().
*/
#define pl_CurrentInput(intf) (playlist_CurrentInput(pl_Get(intf)))
/**
* @ingroup messages
* @{
......
This diff is collapsed.
......@@ -36,7 +36,6 @@
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_playlist_legacy.h> /* For the preparser */
#include <vlc_url.h>
#include <vlc_thumbnailer.h>
......
......@@ -29,8 +29,6 @@
#include <vlc/vlc.h>
#include <vlc_playlist_legacy.h>
#include <assert.h>
void libvlc_playlist_play( libvlc_instance_t *p_instance )
......
......@@ -28,7 +28,6 @@
#include "components/epg/EPGWidget.hpp"
#include "components/epg/EPGItem.hpp"
#include <vlc_playlist_legacy.h>
#include <QVBoxLayout>
#include <QSplitter>
......
......@@ -35,7 +35,6 @@ include/vlc_tick.h
include/vlc_network.h
include/vlc_objects.h
include/vlc_pgpkey.h
include/vlc_playlist_legacy.h
include/vlc_plugin.h
include/vlc_rand.h
include/vlc_services_discovery.h
......@@ -123,15 +122,6 @@ src/network/rootbind.c
src/network/tcp.c
src/network/tls.c
src/network/udp.c
src/playlist_legacy/control.c
src/playlist_legacy/engine.c
src/playlist_legacy/item.c
src/playlist_legacy/loadsave.c
src/playlist_legacy/playlist_internal.h
src/playlist_legacy/search.c
src/playlist_legacy/sort.c
src/playlist_legacy/thread.c
src/playlist_legacy/tree.c
src/stream_output/sap.c
src/stream_output/sdp.c
src/stream_output/stream_output.c
......
......@@ -77,7 +77,6 @@ pluginsinclude_HEADERS = \
../include/vlc_picture.h \
../include/vlc_picture_fifo.h \
../include/vlc_picture_pool.h \
../include/vlc_playlist_legacy.h \
../include/vlc_player.h \
../include/vlc_playlist.h \
../include/vlc_playlist_export.h \
......@@ -222,18 +221,6 @@ libvlccore_la_SOURCES = \
modules/textdomain.c \
interface/dialog.c \
interface/interface.c \
playlist_legacy/playlist_internal.h \
playlist_legacy/aout.c \
playlist_legacy/thread.c \
playlist_legacy/control.c \
playlist_legacy/engine.c \
playlist_legacy/sort.c \
playlist_legacy/loadsave.c \
playlist_legacy/tree.c \
playlist_legacy/item.c \
playlist_legacy/search.c \
playlist_legacy/services_discovery.c \
playlist_legacy/renderer.c \
playlist/content.c \
playlist/content.h \
playlist/control.c \
......
......@@ -15,7 +15,7 @@ cat libvlccore.sym | grep -v \
-e '^image_' -e '^block_' -e '^picture_' -e '^subpicture_' \
-e '^es_format' -e '^[asv]out_' -e '^spu_' -e '^filter_' \
-e '^video_format_' \
-e '^playlist_' -e '^services_discovery_' -e '^intf_' \
-e '^services_discovery_' -e '^intf_' \
-e '^dialog_' -e '^update_' -e '^addons\?_' -e '^fingerprinter_' \
-e '^text_style_' -e '^text_segment_' \
-e '^net_' -e '^httpd_' \
......@@ -24,7 +24,6 @@ cat libvlccore.sym | grep -v \
-e '^us_' -e '^utf8_' -e '^xml_' -e '^GetLang_' \
-e '^m\(date\|sleep\|wait\)$' -e '^[A-Z][a-z]*Charset$' -e 'MD5$' \
-e '^NTPtime64$' -e '^secstotimestr$' \
-e '^pl_Get' \
&& exit 1
echo "None found."
......@@ -28,7 +28,6 @@
#include <assert.h>
#include <vlc_common.h>
#include <vlc_playlist_legacy.h>
#include <vlc_url.h>
#include <vlc_arrays.h>
#include <vlc_modules.h>
......
......@@ -41,45 +41,14 @@
#include <vlc_common.h>
#include <vlc_modules.h>
#include <vlc_interface.h>
#include <vlc_playlist_legacy.h>
#include <vlc_playlist.h>
#include "libvlc.h"
#include "playlist_legacy/playlist_internal.h"
#include "../lib/libvlc_internal.h"
#include "input/player.h"
static int AddIntfCallback( vlc_object_t *, char const *,
vlc_value_t , vlc_value_t , void * );
/* This lock ensures that the playlist is created only once (per instance). It
* also protects the list of running interfaces against concurrent access,
* either to add or remove an interface.
*
* However, it does NOT protect from destruction of the playlist by
* intf_DestroyAll(). Instead, care must be taken that intf_Create() and any
* other function that depends on the playlist is only called BEFORE
* intf_DestroyAll() has the possibility to destroy all interfaces.
*/
static vlc_mutex_t old_playlist_lock = VLC_STATIC_MUTEX;
static playlist_t *old_playlist = NULL;
/**
* Creates the playlist if necessary, and return a pointer to it.
* @note The playlist is not reference-counted. So the pointer is only valid
* until intf_DestroyAll() destroys interfaces.
*/
playlist_t *pl_Get( struct intf_thread_t *intf )
{
assert( intf );
vlc_mutex_lock(&old_playlist_lock);
if (old_playlist == NULL)
old_playlist = playlist_Create(VLC_OBJECT(intf));
vlc_mutex_unlock(&old_playlist_lock);
return old_playlist;
}
static void
PlaylistConfigureFromVariables(vlc_playlist_t *playlist, vlc_object_t *obj)
{
......@@ -325,11 +294,6 @@ void intf_DestroyAll(libvlc_int_t *libvlc)
vlc_mutex_lock(&priv->lock);
}
vlc_mutex_unlock(&priv->lock);
vlc_mutex_lock(&old_playlist_lock);
if (old_playlist)
playlist_Destroy(old_playlist);
vlc_mutex_unlock(&old_playlist_lock);
}
/* Following functions are local */
......
......@@ -35,7 +35,6 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_cpu.h>
#include <vlc_playlist_legacy.h>
#include "libvlc.h"
#include "modules/modules.h"
......
......@@ -51,7 +51,6 @@
#include "config/vlc_getopt.h"
#include <vlc_playlist_legacy.h>
#include <vlc_playlist.h>
#include <vlc_interface.h>
......@@ -67,7 +66,6 @@
#include <vlc_thumbnailer.h>
#include "libvlc.h"
#include "playlist_legacy/playlist_internal.h"
#include <vlc_vlm.h>
......
......@@ -336,46 +336,6 @@ picture_pool_Wait
picture_Reset
picture_Setup
plane_CopyPixels
pl_Get
playlist_Add
playlist_AddExt
playlist_AddInput
playlist_Locked
playlist_ChildSearchName
playlist_Clear
playlist_Control
playlist_CurrentInput
playlist_CurrentInputLocked
playlist_CurrentPlayingItem
playlist_Deactivate
playlist_Export
playlist_GetNodeDuration
playlist_Import
playlist_IsServicesDiscoveryLoaded
playlist_ItemGetById
playlist_ItemGetByInput
playlist_LiveSearchUpdate
playlist_Lock
playlist_NodeAddCopy
playlist_NodeAddInput
playlist_NodeCreate
playlist_NodeDelete
playlist_RecursiveNodeSort
playlist_ServicesDiscoveryAdd
playlist_ServicesDiscoveryControl
playlist_ServicesDiscoveryRemove
playlist_Status
playlist_TreeMove
playlist_TreeMoveMany
playlist_Unlock
playlist_GetAout
playlist_EnableAudioFilter
playlist_VolumeGet
playlist_VolumeSet
playlist_VolumeUp
playlist_MuteSet
playlist_MuteGet
playlist_SetRenderer
sdp_AddAttribute
sdp_AddMedia
secstotimestr
......
/*****************************************************************************
* aout.c: audio output controls for the VLC playlist
*****************************************************************************
* Copyright (C) 2002-2012 VLC authors and VideoLAN
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <math.h>
#include <vlc_common.h>
#include <vlc_aout.h>
#include <vlc_playlist_legacy.h>
#include "../audio_output/aout_internal.h"
#include "playlist_internal.h"
audio_output_t *playlist_GetAout(playlist_t *pl)
{
/* NOTE: it is assumed that the input resource exists. In practice,
* the playlist must have been activated. This is automatic when calling
* pl_Get(). FIXME: input resources are deleted at deactivation, this can
* be too early. */
playlist_private_t *sys = pl_priv(pl);
return input_resource_HoldAout(sys->p_input_resource);
}
float playlist_VolumeGet (playlist_t *pl)
{
float volume = -1.f;
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
{
volume = aout_VolumeGet (aout);
aout_Release(aout);
}
return volume;
}
int playlist_VolumeSet (playlist_t *pl, float vol)
{
int ret = -1;
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
{
ret = aout_VolumeSet (aout, vol);
aout_Release(aout);
}
return ret;
}
/**
* Raises the volume.
* \param value how much to increase (> 0) or decrease (< 0) the volume
* \param volp if non-NULL, will contain contain the resulting volume
*/
int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
{
int ret = -1;
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
{
ret = aout_VolumeUpdate (aout, value, volp);
aout_Release(aout);
}
return ret;
}
int playlist_MuteGet (playlist_t *pl)
{
int mute = -1;
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
{
mute = aout_MuteGet (aout);
aout_Release(aout);
}
return mute;
}
int playlist_MuteSet (playlist_t *pl, bool mute)
{
int ret = -1;
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
{
ret = aout_MuteSet (aout, mute);
aout_Release(aout);
}
return ret;
}
void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add)
{
audio_output_t *aout = playlist_GetAout (pl);
if (aout)
{
aout_EnableFilter(aout, name, add);
aout_Release(aout);
}
}
/*****************************************************************************
* control.c : Handle control of the playlist & running through it
*****************************************************************************
* Copyright (C) 1999-2004 VLC authors and VideoLAN
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
*
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include "vlc_playlist_legacy.h"
#include "playlist_internal.h"
#include <assert.h>
/*****************************************************************************
* Playlist control
*****************************************************************************/
void playlist_Lock( playlist_t *pl )
{
vlc_mutex_lock( &pl_priv(pl)->lock );
}
void playlist_Unlock( playlist_t *pl )
{
vlc_mutex_unlock( &pl_priv(pl)->lock );
}
bool playlist_Locked( const playlist_t *pl )
{
return vlc_mutex_marked( &pl_priv(pl)->lock );
}
static void playlist_vaControl( playlist_t *p_playlist, int i_query,
bool locked, va_list args )
{
PL_LOCK_IF( !locked );
if( pl_priv(p_playlist)->killed )
;
else
switch( i_query )
{
case PLAYLIST_STOP:
pl_priv(p_playlist)->request.b_request = true;
pl_priv(p_playlist)->request.p_item = NULL;
pl_priv(p_playlist)->request.p_node = NULL;
break;
// Node can be null, it will keep the same. Use with care ...
// Item null = take the first child of node
case PLAYLIST_VIEWPLAY:
{
playlist_item_t *p_node = va_arg( args, playlist_item_t * );
playlist_item_t *p_item = va_arg( args, playlist_item_t * );
assert( locked || (p_item == NULL && p_node == NULL) );
if ( p_node == NULL )
{
p_node = get_current_status_node( p_playlist );
assert( p_node );
}
pl_priv(p_playlist)->request.i_skip = 0;
pl_priv(p_playlist)->request.b_request = true;
pl_priv(p_playlist)->request.p_node = p_node;
pl_priv(p_playlist)->request.p_item = p_item;
if( p_item && var_GetBool( p_playlist, "random" ) )
pl_priv(p_playlist)->b_reset_currently_playing = true;
break;
}
case PLAYLIST_PLAY:
if( pl_priv(p_playlist)->p_input == NULL )
{
pl_priv(p_playlist)->request.b_request = true;
pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
pl_priv(p_playlist)->request.i_skip = 0;
}
else
var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
break;
case PLAYLIST_TOGGLE_PAUSE:
if( pl_priv(p_playlist)->p_input == NULL )
{
pl_priv(p_playlist)->request.b_request = true;
pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
pl_priv(p_playlist)->request.i_skip = 0;
}
else
if( var_GetInteger( pl_priv(p_playlist)->p_input, "state" ) == PAUSE_S )
var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
else
var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S );
break;
case PLAYLIST_SKIP:
pl_priv(p_playlist)->request.p_node = get_current_status_node( p_playlist );
pl_priv(p_playlist)->request.p_item = get_current_status_item( p_playlist );
pl_priv(p_playlist)->request.i_skip = va_arg( args, int );
pl_priv(p_playlist)->request.b_request = true;
break;
case PLAYLIST_PAUSE:
if( pl_priv(p_playlist)->p_input == NULL )
break;
var_SetInteger( pl_priv(p_playlist)->p_input, "state", PAUSE_S );
break;
case PLAYLIST_RESUME:
if( pl_priv(p_playlist)->p_input == NULL )
break;
var_SetInteger( pl_priv(p_playlist)->p_input, "state", PLAYING_S );
break;
}
vlc_cond_signal( &pl_priv(p_playlist)->signal );
PL_UNLOCK_IF( !locked );
}
void playlist_Control( playlist_t *p_playlist, int query, int locked, ... )
{
va_list args;
va_start( args, locked );
playlist_vaControl( p_playlist, query, (bool)locked, args );
va_end( args );
}
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* loadsave.c : Playlist loading / saving functions
*****************************************************************************
* Copyright (C) 1999-2004 VLC authors and VideoLAN
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <vlc_common.h>
#include <vlc_playlist_legacy.h>
#include <vlc_events.h>
#include "playlist_internal.h"
#include "config/configuration.h"
#include <vlc_fs.h>
#include <vlc_url.h>
#include <vlc_modules.h>
int playlist_Export( playlist_t * p_playlist, const char *psz_filename,
const char *psz_type )
{
(void) p_playlist; (void) psz_filename; (void) psz_type;
return VLC_EGENERIC;
}
int playlist_Import( playlist_t *p_playlist, const char *psz_file )
{
input_item_t *p_input;
char *psz_uri = vlc_path2uri( psz_file, NULL );
if( psz_uri == NULL )
return VLC_EGENERIC;
p_input = input_item_New( psz_uri, psz_file );
free( psz_uri );
playlist_AddInput( p_playlist, p_input, false );
vlc_object_t *dummy = vlc_object_create( p_playlist, sizeof (*dummy) );
var_Create( dummy, "meta-file", VLC_VAR_VOID );
int ret = input_Read( dummy, p_input, NULL, NULL );
vlc_object_delete(dummy);
return ret;
}
/*****************************************************************************
* playlist_internal.h : Playlist internals
*****************************************************************************
* Copyright (C) 1999-2008 VLC authors and VideoLAN
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
*
* 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 __LIBVLC_PLAYLIST_INTERNAL_H
# define __LIBVLC_PLAYLIST_INTERNAL_H 1
/**
* \defgroup playlist_internals VLC playlist internals
* \ingroup playlist_legacy
*
* @{
* \file
* VLC playlist internal interface
*/
#include "input/input_interface.h"
#include <assert.h>
#include "preparser/preparser.h"
void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
typedef struct playlist_private_t
{
playlist_t public_data;
void *input_tree; /**< Search tree for input item
to playlist item mapping */
void *id_tree; /**< Search tree for item ID to item mapping */
struct vlc_list sds;
input_thread_t * p_input; /**< the input thread associated
* with the current item */
input_resource_t * p_input_resource; /**< input resources */
vlc_renderer_item_t *p_renderer;
struct {
/* Current status. These fields are readonly, only the playlist
* main loop can touch it*/
playlist_item_t * p_item; /**< Currently playing/active item */
playlist_item_t * p_node; /**< Current node to play from */
} status;
struct {
/* Request. Use this to give orders to the playlist main loop */
playlist_item_t * p_node; /**< requested node to play from */
playlist_item_t * p_item; /**< requested item to play in the node */
int i_skip; /**< Number of items to skip */
bool b_request;/**< Set to true by the requester
The playlist sets it back to false
when processing the request */
bool input_dead; /**< Set when input has finished. */
} request;
vlc_thread_t thread; /**< engine thread */
vlc_mutex_t lock; /**< dah big playlist global lock */
vlc_cond_t signal; /**< wakes up the playlist engine thread */
bool killed; /**< playlist is shutting down */
bool cork_effective; /**< Corked while actively playing */
int i_last_playlist_id; /**< Last id to an item */
bool b_reset_currently_playing; /** Reset current item array */
bool b_tree; /**< Display as a tree */
bool b_preparse; /**< Preparse items */
} playlist_private_t;
#define pl_priv( pl ) container_of(pl, playlist_private_t, public_data)
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* Creation/Deletion */
playlist_t *playlist_Create( vlc_object_t * );
void playlist_Destroy( playlist_t * );
void playlist_Activate( playlist_t * );
/* */
playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
input_item_t *p_input );
/* Engine */
playlist_item_t * get_current_status_item( playlist_t * p_playlist);
playlist_item_t * get_current_status_node( playlist_t * p_playlist );
void set_current_status_item( playlist_t *, playlist_item_t * );
void set_current_status_node( playlist_t *, playlist_item_t * );
/**********************************************************************
* Item management
**********************************************************************/
void playlist_SendAddNotify( playlist_t *p_playlist, playlist_item_t *item );
int playlist_InsertInputItemTree ( playlist_t *,
playlist_item_t *, input_item_node_t *, int, bool );
void playlist_AddSubtree(playlist_t *, input_item_t *, input_item_node_t *);
/* Tree walking */
int playlist_NodeInsert(playlist_item_t*, playlist_item_t *, int);
/**
* Flags for playlist_NodeDeleteExplicit
* \defgroup playlist_NodeDeleteExplicit_flags
* @{
**/
#define PLAYLIST_DELETE_FORCE 0x01 /**< delete node even if read-only */
#define PLAYLIST_DELETE_STOP_IF_CURRENT 0x02 /**< stop playlist playback if
node is currently the one
played */
/** @} */
/**
* Delete a node with explicit semantics
*
* This function acts like \ref playlist_NodeDelete with the advantage of the
* caller being able control some of the semantics of the function.
*
* \ref p_playlist the playlist where the node is to be deleted
* \ref p_node the node to delete
* \ref flags a bitfield consisting of \ref playlist_NodeDeleteExplicit_flags
**/
void playlist_NodeDeleteExplicit(playlist_t*, playlist_item_t*,
int flags);