Commit f485214f authored by Clément Stenac's avatar Clément Stenac

For consistency, remove references to vlc from libvlc

Also, make it clearer what is shared and instance-specific

So,
libvlc_t ==> libvlc_global_t
vlc_t ==> libvlc_int_t (internal instance)

p_object->p_libvlc ==> p_object->p_libvlc_globale
p_object->p_vlc ==> p_object->p_libvlc

VLC_OBJECT_VLC ==> VLC_OBJECT_LIBVLC

And by the way, there is some cleanup required :) (ie, some things are created in the global object instead of the instance-specific one)
parent 1bcf33ab
......@@ -33,7 +33,7 @@ extern "C" {
struct libvlc_instance_t
{
vlc_t *p_vlc;
libvlc_int_t *p_libvlc_int;
playlist_t *p_playlist;
vlm_t *p_vlm;
int i_vlc_id;
......
......@@ -23,13 +23,13 @@
*****************************************************************************/
/*****************************************************************************
* libvlc_t (global variable)
* libvlc_global_data_t (global variable)
*****************************************************************************
* This structure has an unique instance, statically allocated in main and
* never accessed from the outside. It store once-initialized data such as
* never accessed from the outside. It stores once-initialized data such as
* the CPU capabilities or the global lock.
*****************************************************************************/
struct libvlc_t
struct libvlc_global_data_t
{
VLC_COMMON_MEMBERS
......@@ -48,13 +48,13 @@ struct libvlc_t
module_bank_t * p_module_bank; ///< The module bank
vlc_bool_t b_stats; ///< Should we collect stats
vlc_bool_t b_stats; ///< Should we collect stats
/* Timers handling */
vlc_mutex_t timer_lock; ///< Lock to protect timers
int i_timers; ///< Number of timers
counter_t **pp_timers; ///< Array of all timers
vlc_mutex_t timer_lock; ///< Lock to protect timers
int i_timers; ///< Number of timers
counter_t **pp_timers; ///< Array of all timers
intf_thread_t *p_probe; ///< Devices prober
intf_thread_t *p_probe; ///< Devices prober
/* Arch-specific variables */
#if !defined( WIN32 )
......@@ -78,11 +78,11 @@ struct libvlc_t
};
/*****************************************************************************
* vlc_t, p_vlc
* libvlc_internal_instance_t
*****************************************************************************
* This structure is a LibVLC instance.
* This structure is a LibVLC instance, for use by libvlc core and plugins
*****************************************************************************/
struct vlc_t
struct libvlc_int_t
{
VLC_COMMON_MEMBERS
......
......@@ -199,8 +199,8 @@ typedef uint32_t vlc_fourcc_t;
*****************************************************************************/
/* Internal types */
typedef struct libvlc_t libvlc_t;
typedef struct vlc_t vlc_t;
typedef struct libvlc_global_data_t libvlc_global_data_t;
typedef struct libvlc_int_t libvlc_int_t;
typedef struct variable_t variable_t;
typedef struct date_t date_t;
typedef struct dict_entry_t dict_entry_t;
......@@ -521,8 +521,8 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
variable_t * p_vars; \
\
/* Stuff related to the libvlc structure */ \
libvlc_t * p_libvlc; /**< root of all evil */ \
vlc_t * p_vlc; /**< (root of all evil) - 1 */ \
libvlc_global_data_t *p_libvlc_global; /**< root of all evil */ \
libvlc_int_t *p_libvlc; /**< (root of all evil) - 1 */ \
\
volatile int i_refcount; /**< usage count */ \
vlc_object_t * p_parent; /**< our parent */ \
......
......@@ -33,7 +33,7 @@
/* Object types */
#define VLC_OBJECT_ROOT (-1)
#define VLC_OBJECT_VLC (-2)
#define VLC_OBJECT_LIBVLC (-2)
#define VLC_OBJECT_MODULE (-3)
#define VLC_OBJECT_INTF (-4)
#define VLC_OBJECT_PLAYLIST (-5)
......@@ -99,7 +99,7 @@ VLC_EXPORT( void, __vlc_object_yield, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) );
VLC_EXPORT( libvlc_int_t *, vlc_current_object, ( int ) );
/*}@*/
......
......@@ -447,7 +447,7 @@ struct module_symbols_t
void *__stats_CounterGet_deprecated;
input_thread_t * (*__input_CreateThread2_inner) (vlc_object_t *, input_item_t *, char *);
void *stats_HandlerDestroy_deprecated;
vlc_t * (*vlc_current_object_inner) (int);
libvlc_int_t * (*vlc_current_object_inner) (int);
void (*__var_OptionParse_inner) (vlc_object_t *, const char *);
void *__stats_TimerDumpAll_deprecated;
void (*__stats_TimerDump_inner) (vlc_object_t*, unsigned int);
......@@ -511,7 +511,7 @@ struct module_symbols_t
void (*playlist_NodeDump_inner) (playlist_t *p_playlist, playlist_item_t *p_item, int i_level);
void *__intf_UserOkayCancel_deprecated;
int (*__intf_UserStringInput_inner) (vlc_object_t*, const char*, const char*, char **);
void (*playlist_NodesCreateForSD_inner) (playlist_t *, char *, playlist_item_t **, playlist_item_t **);
void *playlist_NodesCreateForSD_deprecated;
vlc_bool_t (*input_AddSubtitles_inner) (input_thread_t *, char *, vlc_bool_t);
counter_t * (*__stats_CounterCreate_inner) (vlc_object_t*, int, int);
void *stats_TimerClean_deprecated;
......@@ -536,6 +536,7 @@ struct module_symbols_t
int (*net_SetDSCP_inner) (int fd, uint8_t dscp);
void (*vout_EnableFilter_inner) (vout_thread_t *, char *,vlc_bool_t , vlc_bool_t);
void (*aout_EnableFilter_inner) (vlc_object_t *, const char *, vlc_bool_t);
void (*playlist_NodesPairCreate_inner) (playlist_t *, char *, playlist_item_t **, playlist_item_t **, vlc_bool_t);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -987,7 +988,6 @@ struct module_symbols_t
# define playlist_DeleteFromItemId (p_symbols)->playlist_DeleteFromItemId_inner
# define playlist_NodeDump (p_symbols)->playlist_NodeDump_inner
# define __intf_UserStringInput (p_symbols)->__intf_UserStringInput_inner
# define playlist_NodesCreateForSD (p_symbols)->playlist_NodesCreateForSD_inner
# define input_AddSubtitles (p_symbols)->input_AddSubtitles_inner
# define __stats_CounterCreate (p_symbols)->__stats_CounterCreate_inner
# define __stats_TimersClean (p_symbols)->__stats_TimersClean_inner
......@@ -1007,6 +1007,7 @@ struct module_symbols_t
# define net_SetDSCP (p_symbols)->net_SetDSCP_inner
# define vout_EnableFilter (p_symbols)->vout_EnableFilter_inner
# define aout_EnableFilter (p_symbols)->aout_EnableFilter_inner
# define playlist_NodesPairCreate (p_symbols)->playlist_NodesPairCreate_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1461,7 +1462,6 @@ struct module_symbols_t
((p_symbols)->playlist_DeleteFromItemId_inner) = playlist_DeleteFromItemId; \
((p_symbols)->playlist_NodeDump_inner) = playlist_NodeDump; \
((p_symbols)->__intf_UserStringInput_inner) = __intf_UserStringInput; \
((p_symbols)->playlist_NodesCreateForSD_inner) = playlist_NodesCreateForSD; \
((p_symbols)->input_AddSubtitles_inner) = input_AddSubtitles; \
((p_symbols)->__stats_CounterCreate_inner) = __stats_CounterCreate; \
((p_symbols)->__stats_TimersClean_inner) = __stats_TimersClean; \
......@@ -1481,6 +1481,7 @@ struct module_symbols_t
((p_symbols)->net_SetDSCP_inner) = net_SetDSCP; \
((p_symbols)->vout_EnableFilter_inner) = vout_EnableFilter; \
((p_symbols)->aout_EnableFilter_inner) = aout_EnableFilter; \
((p_symbols)->playlist_NodesPairCreate_inner) = playlist_NodesPairCreate; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__playlist_ItemNew_deprecated = NULL; \
(p_symbols)->__playlist_ItemCopy_deprecated = NULL; \
......@@ -1524,6 +1525,7 @@ struct module_symbols_t
(p_symbols)->playlist_PlaylistAddExt_deprecated = NULL; \
(p_symbols)->playlist_PlaylistAddInput_deprecated = NULL; \
(p_symbols)->__intf_UserOkayCancel_deprecated = NULL; \
(p_symbols)->playlist_NodesCreateForSD_deprecated = NULL; \
(p_symbols)->stats_TimerClean_deprecated = NULL; \
(p_symbols)->stats_TimersClean_deprecated = NULL; \
(p_symbols)->__intf_IntfProgressUpdate_deprecated = NULL; \
......
......@@ -111,7 +111,7 @@ struct update_mirror_t
*/
struct update_t
{
vlc_t *p_vlc;
libvlc_int_t *p_libvlc;
vlc_mutex_t lock;
......
......@@ -1614,7 +1614,7 @@ static block_t *ReadCompressed( access_t *p_access )
}
sample.p_sample->GetPointer( &p_data );
p_access->p_vlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
p_access->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
sample.p_sample->Release();
/* The caller got what he wanted */
......@@ -1703,7 +1703,7 @@ static int Demux( demux_t *p_demux )
#endif
p_block = block_New( p_demux, i_data_size );
p_demux->p_vlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
p_demux->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
p_block->i_pts = p_block->i_dts = i_pts;
sample.p_sample->Release();
......
......@@ -1219,7 +1219,7 @@ static int EventThread( vlc_object_t *p_this )
p_ev->b_still = VLC_FALSE;
/* catch all key event */
var_AddCallback( p_ev->p_vlc, "key-pressed", EventKey, p_ev );
var_AddCallback( p_ev->p_libvlc, "key-pressed", EventKey, p_ev );
/* main loop */
while( !p_ev->b_die )
......@@ -1232,11 +1232,11 @@ static int EventThread( vlc_object_t *p_this )
pci_t *pci = dvdnav_get_current_nav_pci( p_sys->dvdnav );
vlc_value_t valk;
struct hotkey *p_hotkeys = p_ev->p_vlc->p_hotkeys;
struct hotkey *p_hotkeys = p_ev->p_libvlc->p_hotkeys;
int i, i_action = -1;
vlc_mutex_lock( &p_ev->lock );
var_Get( p_ev->p_vlc, "key-pressed", &valk );
var_Get( p_ev->p_libvlc, "key-pressed", &valk );
for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
{
if( p_hotkeys[i].i_key == valk.i_int )
......@@ -1340,7 +1340,7 @@ static int EventThread( vlc_object_t *p_this )
var_DelCallback( p_vout, "mouse-clicked", EventMouse, p_ev );
vlc_object_release( p_vout );
}
var_DelCallback( p_ev->p_vlc, "key-pressed", EventKey, p_ev );
var_DelCallback( p_ev->p_libvlc, "key-pressed", EventKey, p_ev );
vlc_mutex_destroy( &p_ev->lock );
......
......@@ -163,7 +163,7 @@ static int Open( vlc_object_t *p_this )
{
/* This is incomplete : we should also support the ~cmassiot/
* syntax. */
asprintf( &psz, "%s/%s", p_access->p_vlc->psz_homedir, psz_name + 2 );
asprintf( &psz, "%s/%s", p_access->p_libvlc->psz_homedir, psz_name + 2 );
free( psz_name );
psz_name = psz;
}
......
......@@ -216,7 +216,7 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
p_block->i_buffer = i_buffer;
p_block->p_buffer = p_buffer;
p_block->pf_release = CaptureBlockRelease;
p_block->p_manager = VLC_OBJECT( p_demux->p_vlc );
p_block->p_manager = VLC_OBJECT( p_demux->p_libvlc );
p_block->p_sys->hbmp = hbmp;
return p_block;
......
......@@ -63,7 +63,7 @@ int VCDOpenIntf ( vlc_object_t *p_this )
p_intf->pf_run = RunIntf;
var_AddCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
var_AddCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
p_intf->p_sys->m_still_time = 0;
p_intf->p_sys->b_infinite_still = 0;
p_intf->p_sys->b_still = 0;
......@@ -77,7 +77,7 @@ int VCDOpenIntf ( vlc_object_t *p_this )
void VCDCloseIntf ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
var_DelCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
var_DelCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
/* Destroy structure */
free( p_intf->p_sys );
......@@ -159,12 +159,12 @@ RunIntf( intf_thread_t *p_intf )
{
vlc_value_t val;
int i, i_action = -1;
struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys;
struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
p_intf->p_sys->b_key_pressed = VLC_FALSE;
/* Find action triggered by hotkey (if any) */
var_Get( p_intf->p_vlc, "key-pressed", &val );
var_Get( p_intf->p_libvlc, "key-pressed", &val );
dbg_print( INPUT_DBG_EVENT, "Key pressed %d", val.i_int );
......
......@@ -151,14 +151,14 @@ static int Open( vlc_object_t *p_this )
if( *psz == '\0' )
{
free( psz );
if( p_access->p_vlc->psz_homedir )
psz = strdup( p_access->p_vlc->psz_homedir );
if( p_access->p_libvlc->psz_homedir )
psz = strdup( p_access->p_libvlc->psz_homedir );
}
p_sys->psz_path = psz;
msg_Dbg( p_access, "Record access filter path %s", psz );
/* catch all key event */
var_AddCallback( p_access->p_vlc, "key-pressed", EventKey, p_access );
var_AddCallback( p_access->p_libvlc, "key-pressed", EventKey, p_access );
return VLC_SUCCESS;
}
......@@ -171,7 +171,7 @@ static void Close( vlc_object_t *p_this )
access_t *p_access = (access_t*)p_this;
access_sys_t *p_sys = p_access->p_sys;
var_DelCallback( p_access->p_vlc, "key-pressed", EventKey, p_access );
var_DelCallback( p_access->p_libvlc, "key-pressed", EventKey, p_access );
if( p_sys->f )
{
......@@ -277,7 +277,7 @@ static int EventKey( vlc_object_t *p_this, char const *psz_var,
access_t *p_access = p_data;
access_sys_t *p_sys = p_access->p_sys;
struct hotkey *p_hotkeys = p_access->p_vlc->p_hotkeys;
struct hotkey *p_hotkeys = p_access->p_libvlc->p_hotkeys;
int i_action = -1, i;
for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
......
......@@ -98,15 +98,15 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* Copy the S/PDIF headers. */
if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
{
p_filter->p_vlc->pf_memcpy( p_out, p_sync_be, 6 );
p_filter->p_libvlc->pf_memcpy( p_out, p_sync_be, 6 );
p_out[4] = p_in[5] & 0x7; /* bsmod */
p_out[6] = (i_frame_size >> 4) & 0xff;
p_out[7] = (i_frame_size << 4) & 0xff;
p_filter->p_vlc->pf_memcpy( &p_out[8], p_in, i_frame_size * 2 );
p_filter->p_libvlc->pf_memcpy( &p_out[8], p_in, i_frame_size * 2 );
}
else
{
p_filter->p_vlc->pf_memcpy( p_out, p_sync_le, 6 );
p_filter->p_libvlc->pf_memcpy( p_out, p_sync_le, 6 );
p_out[5] = p_in[5] & 0x7; /* bsmod */
p_out[6] = (i_frame_size << 4) & 0xff;
p_out[7] = (i_frame_size >> 4) & 0xff;
......@@ -122,7 +122,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
#endif
}
p_filter->p_vlc->pf_memset( p_out + 8 + i_frame_size * 2, 0,
p_filter->p_libvlc->pf_memset( p_out + 8 + i_frame_size * 2, 0,
AOUT_SPDIF_SIZE - i_frame_size * 2 - 8 );
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
......
......@@ -134,7 +134,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
/* Backup frame */
p_filter->p_vlc->pf_memcpy( p_filter->p_sys->p_buf + p_in_buf->i_nb_bytes *
p_filter->p_libvlc->pf_memcpy( p_filter->p_sys->p_buf + p_in_buf->i_nb_bytes *
p_filter->p_sys->i_frames, p_in_buf->p_buffer,
p_in_buf->i_nb_bytes );
......@@ -169,14 +169,14 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* Copy the S/PDIF headers. */
if( p_filter->output.i_format == VLC_FOURCC('s','p','d','b') )
{
p_filter->p_vlc->pf_memcpy( p_out, p_sync_be, 6 );
p_filter->p_libvlc->pf_memcpy( p_out, p_sync_be, 6 );
p_out[5] = i_ac5_spdif_type;
p_out[6] = (( i_length ) >> 5 ) & 0xFF;
p_out[7] = ( i_length << 3 ) & 0xFF;
}
else
{
p_filter->p_vlc->pf_memcpy( p_out, p_sync_le, 6 );
p_filter->p_libvlc->pf_memcpy( p_out, p_sync_le, 6 );
p_out[4] = i_ac5_spdif_type;
p_out[6] = ( i_length << 3 ) & 0xFF;
p_out[7] = (( i_length ) >> 5 ) & 0xFF;
......@@ -205,12 +205,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
else
{
p_filter->p_vlc->pf_memcpy( p_out + 8, p_in, i_length );
p_filter->p_libvlc->pf_memcpy( p_out + 8, p_in, i_length );
}
if( i_fz > i_length + 8 )
{
p_filter->p_vlc->pf_memset( p_out + 8 + i_length, 0,
p_filter->p_libvlc->pf_memset( p_out + 8 + i_length, 0,
i_fz - i_length - 8 );
}
}
......
......@@ -199,7 +199,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
break;
case 1:
p_filter->p_vlc->pf_memcpy( p_samples, p_left,
p_filter->p_libvlc->pf_memcpy( p_samples, p_left,
i_samples * sizeof(mad_fixed_t) );
break;
......@@ -313,7 +313,7 @@ static int OpenFilter( vlc_object_t *p_this )
mad_synth_init( &p_sys->mad_synth );
mad_stream_options( &p_sys->mad_stream, MAD_OPTION_IGNORECRC );
if( p_this->p_libvlc->i_cpu & CPU_CAPABILITY_FPU )
if( p_this->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU )
p_filter->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
else
p_filter->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
......
......@@ -244,11 +244,11 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* Copy all our samples in p_in */
if( p_filter->p_sys->i_old_wing )
{
p_aout->p_vlc->pf_memcpy( p_in, p_filter->p_sys->p_buf,
p_aout->p_libvlc->pf_memcpy( p_in, p_filter->p_sys->p_buf,
p_filter->p_sys->i_old_wing * 2 *
p_filter->input.i_bytes_per_frame );
}
p_aout->p_vlc->pf_memcpy( p_in + p_filter->p_sys->i_old_wing * 2 *
p_aout->p_libvlc->pf_memcpy( p_in + p_filter->p_sys->i_old_wing * 2 *
i_nb_channels, p_in_buf->p_buffer,
p_in_buf->i_nb_samples *
p_filter->input.i_bytes_per_frame );
......
......@@ -174,7 +174,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
return;
}
p_aout->p_vlc->pf_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
p_aout->p_libvlc->pf_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
/* Take care of the previous input sample (if any) */
if( !p_filter->b_continuity )
......
......@@ -97,7 +97,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
{
/* For whatever reason the buffer allocator decided to allocate
* a new buffer. Currently, this never happens. */
p_aout->p_vlc->pf_memcpy( p_out_buf->p_buffer, p_in_buf->p_buffer,
p_aout->p_libvlc->pf_memcpy( p_out_buf->p_buffer, p_in_buf->p_buffer,
__MIN(i_out_nb, i_in_nb) * i_sample_bytes );
}
......
......@@ -112,7 +112,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
return;
}
p_aout->p_vlc->pf_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
p_aout->p_libvlc->pf_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
for( i_out = i_out_nb ; i_out-- ; )
{
......
......@@ -102,7 +102,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
aout_buffer_t * p_old_buffer;
if ( i_available_bytes > 0 )
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_available_bytes );
p_aout->p_libvlc->pf_memcpy( p_out, p_in, i_available_bytes );
i_nb_bytes -= i_available_bytes;
p_out += i_available_bytes;
......@@ -119,7 +119,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
else
{
if ( i_nb_bytes > 0 )
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_nb_bytes );
p_aout->p_libvlc->pf_memcpy( p_out, p_in, i_nb_bytes );
p_input->p_first_byte_to_mix = p_in + i_nb_bytes;
break;
}
......
......@@ -358,7 +358,7 @@ static int Open( vlc_object_t *p_this )
/* Choose the linear PCM format (read the comment above about FPU
and float32) */
if( p_aout->p_libvlc->i_cpu & CPU_CAPABILITY_FPU )
if( p_aout->p_libvlc_global->i_cpu & CPU_CAPABILITY_FPU )
{
i_vlc_pcm_format = VLC_FOURCC('f','l','3','2');
i_snd_pcm_format = SND_PCM_FORMAT_FLOAT;
......
......@@ -185,9 +185,9 @@ static int Open( vlc_object_t * p_this )
aout_FormatPrint( p_aout, "VLC is looking for:", (audio_sample_format_t *)&p_aout->output.output );
/* Persistent device variable */
if( var_Type( p_aout->p_vlc, "macosx-audio-device" ) == 0 )
if( var_Type( p_aout->p_libvlc, "macosx-audio-device" ) == 0 )
{
var_Create( p_aout->p_vlc, "macosx-audio-device", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_aout->p_libvlc, "macosx-audio-device", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
}
/* Build a list of devices */
......@@ -1031,7 +1031,7 @@ static void Probe( aout_instance_t * p_aout )
}
/* If a device is already "preselected", then use this device */
var_Get( p_aout->p_vlc, "macosx-audio-device", &val );
var_Get( p_aout->p_libvlc, "macosx-audio-device", &val );
if( val.i_int > 0 )
{
var_Change( p_aout, "audio-device", VLC_VAR_SETDEFAULT, &val, NULL );
......@@ -1312,7 +1312,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
if( p_sys->i_total_bytes > 0 )
{
i_mData_bytes = __MIN( p_sys->i_total_bytes - p_sys->i_read_bytes, ioData->mBuffers[0].mDataByteSize );
p_aout->p_vlc->pf_memcpy( ioData->mBuffers[0].mData, &p_sys->p_remainder_buffer[p_sys->i_read_bytes], i_mData_bytes );
p_aout->p_libvlc->pf_memcpy( ioData->mBuffers[0].mData, &p_sys->p_remainder_buffer[p_sys->i_read_bytes], i_mData_bytes );
p_sys->i_read_bytes += i_mData_bytes;
current_date += (mtime_t) ( (mtime_t) 1000000 / p_aout->output.output.i_rate ) *
( i_mData_bytes / 4 / aout_FormatNbChannels( &p_aout->output.output ) ); // 4 is fl32 specific
......@@ -1331,13 +1331,13 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
{
uint32_t i_second_mData_bytes = __MIN( p_buffer->i_nb_bytes, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
p_aout->p_vlc->pf_memcpy( (uint8_t *)ioData->mBuffers[0].mData + i_mData_bytes, p_buffer->p_buffer, i_second_mData_bytes );
p_aout->p_libvlc->pf_memcpy( (uint8_t *)ioData->mBuffers[0].mData + i_mData_bytes, p_buffer->p_buffer, i_second_mData_bytes );
i_mData_bytes += i_second_mData_bytes;
if( i_mData_bytes >= ioData->mBuffers[0].mDataByteSize )
{
p_sys->i_total_bytes = p_buffer->i_nb_bytes - i_second_mData_bytes;
p_aout->p_vlc->pf_memcpy( p_sys->p_remainder_buffer, &p_buffer->p_buffer[i_second_mData_bytes], p_sys->i_total_bytes );
p_aout->p_libvlc->pf_memcpy( p_sys->p_remainder_buffer, &p_buffer->p_buffer[i_second_mData_bytes], p_sys->i_total_bytes );
}
else
{
......@@ -1349,7 +1349,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
}
else
{
p_aout->p_vlc->pf_memset( (uint8_t *)ioData->mBuffers[0].mData +i_mData_bytes, 0, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
p_aout->p_libvlc->pf_memset( (uint8_t *)ioData->mBuffers[0].mData +i_mData_bytes, 0, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
i_mData_bytes += ioData->mBuffers[0].mDataByteSize - i_mData_bytes;
}
}
......@@ -1391,13 +1391,13 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
msg_Warn( p_aout, "bytesize: %d nb_bytes: %d", (int)BUFFER.mDataByteSize, (int)p_buffer->i_nb_bytes );
/* move data into output data buffer */
p_aout->p_vlc->pf_memcpy( BUFFER.mData,
p_aout->p_libvlc->pf_memcpy( BUFFER.mData,
p_buffer->p_buffer, p_buffer->i_nb_bytes );
aout_BufferFree( p_buffer );
}
else
{
p_aout->p_vlc->pf_memset( BUFFER.mData, 0, BUFFER.mDataByteSize );
p_aout->p_libvlc->pf_memset( BUFFER.mData, 0, BUFFER.mDataByteSize );
}
#undef BUFFER
......@@ -1460,7 +1460,7 @@ static int AudioDeviceCallback( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
aout_instance_t *p_aout = (aout_instance_t *)p_this;
var_Set( p_aout->p_vlc, "macosx-audio-device", new_val );
var_Set( p_aout->p_libvlc, "macosx-audio-device", new_val );
msg_Dbg( p_aout, "Set Device: %#x", new_val.i_int );
return aout_ChannelsRestart( p_this, psz_variable, old_val, new_val, param );
}
......
......@@ -965,7 +965,7 @@ static int FillBuffer( aout_instance_t *p_aout, int i_frame,
p_sys->i_bits_per_sample );
}
p_aout->p_vlc->pf_memcpy( p_write_position, p_buffer->p_buffer,
p_aout->p_libvlc->pf_memcpy( p_write_position, p_buffer->p_buffer,
l_bytes1 );
aout_BufferFree( p_buffer );
}
......
......@@ -165,7 +165,7 @@ static int Open( vlc_object_t * p_this )
p_aout->output.pf_play = Play;
aout_VolumeSoftInit( p_aout );
i_volume = config_GetInt( p_aout->p_vlc, "volume" );
i_volume = config_GetInt( p_aout->p_libvlc, "volume" );
pPlayer->SetVolume( (u32)__MIN( i_volume * 64, 0xFFFF ) );
/* Create thread and wait for its readiness. */
......@@ -235,7 +235,7 @@ static int Thread( aout_instance_t * p_aout )
#define i p_sys->nNextBufferIndex
if( p_buffer == NULL )
{
p_aout->p_vlc->pf_memset( p_sys->ppBuffers[ i ], 0,
p_aout->p_libvlc->pf_memset( p_sys->ppBuffers[ i ], 0,
p_sys->nBufferSize );
}
else
......
......@@ -145,7 +145,7 @@ static int paCallback( const void *inputBuffer, void *outputBuffer,
p_sys->i_channels, p_sys->pi_chan_table,
p_sys->i_bits_per_sample );
}
p_aout->p_vlc->pf_memcpy( outputBuffer, p_buffer->p_buffer,
p_aout->p_libvlc->pf_memcpy( outputBuffer, p_buffer->p_buffer,
framesPerBuffer * p_sys->i_sample_size );
/* aout_BufferFree may be dangereous here, but then so is
* aout_OutputNextBuffer (calls aout_BufferFree internally).
......@@ -158,7 +158,7 @@ static int paCallback( const void *inputBuffer, void *outputBuffer,
else
/* Audio output buffer shortage -> stop the fill process and wait */
{
p_aout->p_vlc->pf_memset( outputBuffer, 0,
p_aout->p_libvlc->pf_memset( outputBuffer, 0,
framesPerBuffer * p_sys->i_sample_size );
}
return 0;
......
......@@ -258,12 +258,12 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
if ( p_buffer != NULL )
{
p_aout->p_vlc->pf_memcpy( p_stream, p_buffer->p_buffer, i_len );
p_aout->p_libvlc->pf_memcpy( p_stream, p_buffer->p_buffer, i_len );
aout_BufferFree( p_buffer );
}
else
{
p_aout->p_vlc->pf_memset( p_stream, 0, i_len );
p_aout->p_libvlc->pf_memset( p_stream, 0, i_len );
}
}
......@@ -119,18 +119,18 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
p_intf->pf_run = RunIntf;
var_AddCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
var_AddCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
/* we also need to add the callback for "mouse-clicked", but do that later
* when we've found a p_vout */
var_Create( p_intf->p_vlc, "browse-go-back", VLC_VAR_VOID );
var_AddCallback( p_intf->p_vlc, "browse-go-back",
var_Create( p_intf->p_libvlc, "browse-go-back", VLC_VAR_VOID );
var_AddCallback( p_intf->p_libvlc, "browse-go-back",
GoBackCallback, p_intf );
var_Create( p_intf->p_vlc, "browse-go-forward", VLC_VAR_VOID );
var_AddCallback( p_intf->p_vlc, "browse-go-forward",
var_Create( p_intf->p_libvlc, "browse-go-forward", VLC_VAR_VOID );
var_AddCallback( p_intf->p_libvlc, "browse-go-forward",
GoForwardCallback, p_intf );
var_Create( p_intf->p_vlc, "browse-follow-anchor", VLC_VAR_VOID );
var_AddCallback( p_intf->p_vlc, "browse-follow-anchor",
var_Create( p_intf->p_libvlc, "browse-follow-anchor", VLC_VAR_VOID );
var_AddCallback( p_intf->p_libvlc, "browse-follow-anchor",
FollowAnchorCallback, p_intf );
return( 0 );
......@@ -157,7 +157,7 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
vlc_object_release( p_vout );
}
var_DelCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
var_DelCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
vlc_object_release( p_intf->p_sys->p_cmml_decoder );
......@@ -216,10 +216,10 @@ static void RunIntf( intf_thread_t *p_intf )
{
vlc_value_t val;