Commit c240692f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Common structure for VLC common object members, document

parent 70a05fb5
......@@ -411,47 +411,86 @@ typedef int ( * vlc_list_callback_t ) ( vlc_object_t *, /* variable's objec
#include "vlc_mtime.h"
#include "vlc_threads.h"
/*****************************************************************************
/**
* Common structure members
*****************************************************************************/
/* VLC_COMMON_MEMBERS : members common to all basic vlc objects */
#define VLC_COMMON_MEMBERS \
/** \name VLC_COMMON_MEMBERS \
* these members are common for all vlc objects \
*/ \
/**@{*/ \
const char *psz_object_type; \
\
/* Messages header */ \
char *psz_header; \
int i_flags; \
\
/* Object properties */ \
bool b_force; /**< set by the outside (eg. module_need()) */ \
\
/* Stuff related to the libvlc structure */ \
libvlc_int_t *p_libvlc; /**< (root of all evil) - 1 */ \
\
vlc_object_t * p_parent; /**< our parent */ \
\
/**@}*/ \
/* VLC_OBJECT: attempt at doing a clever cast */
#if VLC_GCC_VERSION(4,0)
/**
* VLC object common members
*
* Common public properties for all VLC objects.
* Object also have private properties maintained by the core, see
* \ref vlc_object_internals_t
*/
struct vlc_common_members
{
/** Object type name
*
* A constant string identifying the type of the object (for logging)
*/
const char *object_type;
/** Log messages header
*
* Human-readable header for log messages. This is not thread-safe and
* only used by VLM and Lua interfaces.
*/
char *header;
int flags;
/** Module probe flag
*
* A boolean during module probing when the probe is "forced".
* See \ref module_need().
*/
bool force;
/** LibVLC instance
*
* Root VLC object of the objects tree that this object belongs in.
*/
libvlc_int_t *libvlc;
/** Parent object
*
* The parent VLC object in the objects tree. For the root (the LibVLC
* instance) object, this is NULL.
*/
vlc_object_t *parent;
};
/**
* Backward compatibility macro
*/
#define VLC_COMMON_MEMBERS struct vlc_common_members obj;
/**
* Type-safe vlc_object_t cast
*
* This macro attempts to cast a pointer to a compound type to a
* \ref vlc_object_t pointer in a type-safe manner.
* It checks if the compound type actually starts with an embedded
* \ref vlc_object_t structure.
*/
#if !defined(__cplusplus) && (__STDC_VERSION__ >= 201112L)
# define VLC_OBJECT(x) \
_Generic((x)->obj, \
struct vlc_common_members: (vlc_object_t *)(&(x)->obj) \
)
#elif VLC_GCC_VERSION(4,0)
# ifndef __cplusplus
# define VLC_OBJECT( x ) \
__builtin_choose_expr( \
__builtin_offsetof(__typeof__(*(x)), psz_object_type), \
(void)0 /* screw you */, \
(vlc_object_t *)(x))
__builtin_types_compatible_p(__typeof__((x)->obj), struct vlc_common_members), \
(vlc_object_t *)(x), (void)0)
# else
# define VLC_OBJECT( x ) \
((vlc_object_t *)(x) \
+ 0 * __builtin_offsetof(__typeof__(*(x)), psz_object_type))
((vlc_object_t *)(&((x)->obj)) \
+ 0 * __builtin_offsetof(__typeof__(*(x)), obj.object_type))
# endif
#else
# define VLC_OBJECT( x ) ((vlc_object_t *)(x))
# define VLC_OBJECT( x ) ((vlc_object_t *)&(x)->obj)
#endif
/*****************************************************************************
......
......@@ -92,7 +92,7 @@ VLC_API void libvlc_Quit( libvlc_int_t * );
static inline playlist_t *pl_Get( struct intf_thread_t *intf )
{
return (playlist_t *)(intf->p_parent);
return (playlist_t *)(intf->obj.parent);
}
/**
......
......@@ -739,7 +739,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
* FIXME: It's unclear why we want to put this in public API, and why we
* want to expose it in such a limiting and ugly way.
*/
var_AddCallback(mp->p_libvlc, "snapshot-file", snapshot_was_taken, mp);
var_AddCallback(mp->obj.libvlc, "snapshot-file", snapshot_was_taken, mp);
libvlc_retain(instance);
return mp;
......@@ -773,7 +773,7 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
assert( p_mi );
/* Detach Callback from the main libvlc object */
var_DelCallback( p_mi->p_libvlc,
var_DelCallback( p_mi->obj.libvlc,
"snapshot-file", snapshot_was_taken, p_mi );
/* Detach callback from the media player / input manager object */
......
......@@ -118,10 +118,10 @@ static int FindVolumes(access_t *p_access, struct archive *p_archive, const char
break;
/* Probe URI */
int i_savedflags = p_access->i_flags;
p_access->i_flags |= OBJECT_FLAGS_NOINTERACT;
int i_savedflags = p_access->obj.flags;
p_access->obj.flags |= OBJECT_FLAGS_NOINTERACT;
stream_t *p_stream = stream_UrlNew(p_access, psz_newuri);
p_access->i_flags = i_savedflags;
p_access->obj.flags = i_savedflags;
if (p_stream)
{
ppsz_files[*pi_files] = psz_newuri;
......
......@@ -127,7 +127,7 @@ vlc_tls_t *vlc_https_connect(vlc_tls_creds_t *creds, const char *name,
if (port == 0)
port = 443;
int fd = vlc_tcp_connect(creds->p_parent, name, port);
int fd = vlc_tcp_connect(creds->obj.parent, name, port);
if (fd == -1)
return NULL;
......
......@@ -151,7 +151,7 @@ vlc_tls_t *vlc_https_connect_proxy(vlc_tls_creds_t *creds,
sock = vlc_https_connect(creds, url.psz_host, url.i_port, &ptwo);
else
if (!strcasecmp(url.psz_protocol, "http"))
sock = vlc_http_connect(creds ? creds->p_parent : NULL,
sock = vlc_http_connect(creds ? creds->obj.parent : NULL,
url.psz_host, url.i_port);
else
sock = NULL;
......
......@@ -162,7 +162,7 @@ nop:
msg_Info( p_demux, "command `quit'" );
p_demux->pf_demux = DemuxNoOp;
p_demux->pf_control = DemuxControl;
libvlc_Quit( p_demux->p_libvlc );
libvlc_Quit( p_demux->obj.libvlc );
return VLC_SUCCESS;
}
......
......@@ -394,10 +394,10 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file, unsigned int *pi_nbvol
if (!volume_mrl)
return VLC_SUCCESS;
const int s_flags = s->i_flags;
s->i_flags |= OBJECT_FLAGS_NOINTERACT;
const int s_flags = s->obj.flags;
s->obj.flags |= OBJECT_FLAGS_NOINTERACT;
vol = stream_UrlNew(s, volume_mrl);
s->i_flags = s_flags;
s->obj.flags = s_flags;
if (!vol) {
free(volume_mrl);
......
......@@ -139,8 +139,8 @@ static int Open( vlc_object_t *p_this )
p_filter->fmt_out.audio = p_filter->fmt_in.audio;
p_filter->pf_audio_filter = DoWork;
var_Create(p_filter->p_libvlc, "audiobargraph_v-alarm", VLC_VAR_BOOL);
var_Create(p_filter->p_libvlc, "audiobargraph_v-i_values", VLC_VAR_STRING);
var_Create(p_filter->obj.libvlc, "audiobargraph_v-alarm", VLC_VAR_BOOL);
var_Create(p_filter->obj.libvlc, "audiobargraph_v-i_values", VLC_VAR_STRING);
return VLC_SUCCESS;
}
......@@ -157,7 +157,7 @@ static void SendValues(filter_t *p_filter, float *value, int nbChannels)
}
//msg_Dbg(p_filter, "values: %s", message);
var_SetString(p_filter->p_libvlc, "audiobargraph_v-i_values", msg);
var_SetString(p_filter->obj.libvlc, "audiobargraph_v-i_values", msg);
}
/*****************************************************************************
......@@ -223,7 +223,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
sum = sqrtf(sum);
/* 5 - compare it to the threshold */
var_SetBool(p_filter->p_libvlc, "audiobargraph_v-alarm",
var_SetBool(p_filter->obj.libvlc, "audiobargraph_v-alarm",
sum < p_sys->alarm_threshold);
p_sys->lastAlarm = p_in_buf->i_pts;
......@@ -246,8 +246,8 @@ static void Close( vlc_object_t *p_this )
filter_t * p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
var_Destroy(p_filter->p_libvlc, "audiobargraph_v-i_values");
var_Destroy(p_filter->p_libvlc, "audiobargraph_v-alarm");
var_Destroy(p_filter->obj.libvlc, "audiobargraph_v-i_values");
var_Destroy(p_filter->obj.libvlc, "audiobargraph_v-alarm");
while (p_sys->first != NULL) {
ValueDate_t *current = p_sys->first;
......
......@@ -205,7 +205,7 @@ vlc_module_end ()
static int Open( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
float f_sample_rate = p_filter->fmt_in.audio.i_rate;
float f_num;
......@@ -270,7 +270,7 @@ static int Open( vlc_object_t *p_this )
static void Close( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t*)p_this;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
filter_sys_t *p_sys = p_filter->p_sys;
/* Remove our callbacks */
......
......@@ -282,7 +282,7 @@ static int EqzInit( filter_t *p_filter, int i_rate )
eqz_config_t cfg;
int i, ch;
vlc_value_t val1, val2, val3;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
int i_ret = VLC_ENOMEM;
bool b_vlcFreqs = var_InheritBool( p_aout, "equalizer-vlcfreqs" );
......@@ -451,7 +451,7 @@ static void EqzFilter( filter_t *p_filter, float *out, float *in,
static void EqzClean( filter_t *p_filter )
{
filter_sys_t *p_sys = p_filter->p_sys;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
var_DelCallback( p_aout, "equalizer-bands", BandsCallback, p_sys );
var_DelCallback( p_aout, "equalizer-preset", PresetCallback, p_sys );
......
......@@ -93,7 +93,7 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC;
}
p_sys->f_gain = var_InheritFloat( p_filter->p_parent, "gain-value" );
p_sys->f_gain = var_InheritFloat( p_filter->obj.parent, "gain-value" );
msg_Dbg( p_filter, "gain multiplier sets to %.2fx", p_sys->f_gain );
p_filter->fmt_out.audio = p_filter->fmt_in.audio;
......
......@@ -102,8 +102,10 @@ static int Open( vlc_object_t *p_this )
p_sys = p_filter->p_sys = malloc( sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
p_sys->i_nb = var_CreateGetInteger( p_filter->p_parent, "norm-buff-size" );
p_sys->f_max = var_CreateGetFloat( p_filter->p_parent, "norm-max-level" );
p_sys->i_nb = var_CreateGetInteger( p_filter->obj.parent,
"norm-buff-size" );
p_sys->f_max = var_CreateGetFloat( p_filter->obj.parent,
"norm-max-level" );
if( p_sys->f_max <= 0 ) p_sys->f_max = 0.01;
......@@ -184,7 +186,8 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
f_average = f_average / p_sys->i_nb;
/* Seuil arbitraire */
p_sys->f_max = var_GetFloat( p_filter->p_parent, "norm-max-level" );
p_sys->f_max = var_GetFloat( p_filter->obj.parent,
"norm-max-level" );
//fprintf(stderr,"Average %f, max %f\n", f_average, p_sys->f_max );
if( f_average > p_sys->f_max )
......
......@@ -132,7 +132,7 @@ static int Open( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
/* Allocate structure */
p_sys = p_filter->p_sys = (filter_sys_t*)malloc( sizeof( *p_sys ) );
......@@ -172,7 +172,7 @@ static void Close( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
vlc_object_t *p_aout = p_filter->p_parent;
vlc_object_t *p_aout = p_filter->obj.parent;
/* Delete the callbacks */
for(unsigned i=0;i<num_callbacks;++i)
......
......@@ -581,7 +581,7 @@ static int OpenEncoder( vlc_object_t *p_this )
int status;
if( p_enc->fmt_out.i_codec != VLC_CODEC_DAALA &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -1719,7 +1719,7 @@ static int OpenEncoder( vlc_object_t *p_this )
encoder_sys_t *p_sys;
if( ( p_enc->fmt_out.i_codec != VLC_CODEC_DVBS ) &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -669,7 +669,7 @@ static int OpenEncoder( vlc_object_t *p_this )
encoder_sys_t *p_sys;
if( p_enc->fmt_out.i_codec != VLC_CODEC_FLAC &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -53,7 +53,7 @@ vlc_module_end ()
static int OpenEncoder( vlc_object_t *p_this )
{
encoder_t *p_enc = (encoder_t *)p_this;
if( p_enc->fmt_out.i_codec != VLC_CODEC_R420 && !p_enc->b_force )
if( p_enc->fmt_out.i_codec != VLC_CODEC_R420 && !p_enc->obj.force )
return VLC_EGENERIC;
p_enc->pf_encode_video = Encode;
......
......@@ -1078,7 +1078,7 @@ static int OpenEncoder( vlc_object_t *p_this )
char *psz_tmp;
if( p_enc->fmt_out.i_codec != VLC_CODEC_DIRAC &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -957,7 +957,7 @@ static int OpenEncoder( vlc_object_t *p_this )
uint8_t *p_extra;
if( p_enc->fmt_out.i_codec != VLC_CODEC_SPEEX &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -60,7 +60,7 @@ static int Open( vlc_object_t *p_this )
break;
default:
if( !p_enc->b_force )
if( !p_enc->obj.force )
return VLC_EGENERIC;
p_enc->fmt_out.i_codec = VLC_CODEC_ITU_T140;
......
......@@ -677,7 +677,7 @@ static int OpenEncoder( vlc_object_t *p_this )
int status;
if( p_enc->fmt_out.i_codec != VLC_CODEC_THEORA &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -133,7 +133,7 @@ static int OpenEncoder( vlc_object_t *p_this )
if( p_enc->fmt_out.i_codec != VLC_CODEC_MP2 &&
p_enc->fmt_out.i_codec != VLC_CODEC_MPGA &&
p_enc->fmt_out.i_codec != VLC_FOURCC( 'm', 'p', '2', 'a' ) &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -754,7 +754,7 @@ static int OpenEncoder( vlc_object_t *p_this )
ogg_packet header[3];
if( p_enc->fmt_out.i_codec != VLC_CODEC_VORBIS &&
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -818,7 +818,7 @@ static int Open ( vlc_object_t *p_this )
#else
if( p_enc->fmt_out.i_codec != VLC_CODEC_H264 &&
#endif
!p_enc->b_force )
!p_enc->obj.force )
{
return VLC_EGENERIC;
}
......
......@@ -141,7 +141,7 @@ static int Open (vlc_object_t *p_this)
encoder_t *p_enc = (encoder_t *)p_this;
encoder_sys_t *p_sys;
if (p_enc->fmt_out.i_codec != VLC_CODEC_HEVC && !p_enc->b_force)
if (p_enc->fmt_out.i_codec != VLC_CODEC_HEVC && !p_enc->obj.force)
return VLC_EGENERIC;
p_enc->fmt_out.i_cat = VIDEO_ES;
......
......@@ -267,7 +267,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_level = var_CreateGetInteger( p_dec, "vbi-level" );
/* Listen for keys */
var_AddCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
var_AddCallback( p_dec->obj.libvlc, "key-pressed", EventKey, p_dec );
es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_CODEC_SPU );
if( p_sys->b_text )
......@@ -289,7 +289,7 @@ static void Close( vlc_object_t *p_this )
var_DelCallback( p_dec, "vbi-opaque", Opaque, p_sys );
var_DelCallback( p_dec, "vbi-page", RequestPage, p_sys );
var_DelCallback( p_dec->p_libvlc, "key-pressed", EventKey, p_dec );
var_DelCallback( p_dec->obj.libvlc, "key-pressed", EventKey, p_dec );
vlc_mutex_destroy( &p_sys->lock );
......
......@@ -261,14 +261,14 @@ MarshalSupportedUriSchemes( intf_thread_t *p_intf, DBusMessageIter *container )
DBUS_METHOD( Quit )
{ /* exits vlc */
REPLY_INIT;
libvlc_Quit(INTF->p_libvlc);
libvlc_Quit(INTF->obj.libvlc);
REPLY_SEND;
}
DBUS_METHOD( Raise )
{/* shows vlc's main window */
REPLY_INIT;
var_ToggleBool( INTF->p_libvlc, "intf-show" );
var_ToggleBool( INTF->obj.libvlc, "intf-show" );
REPLY_SEND;
}
......
......@@ -355,7 +355,7 @@ static void ProcessGesture( intf_thread_t *p_intf )
case GESTURE(DOWN,LEFT,NONE,NONE):
/* FIXME: Should close the vout!"*/
libvlc_Quit( p_intf->p_libvlc );
libvlc_Quit( p_intf->obj.libvlc );
break;
case GESTURE(DOWN,LEFT,UP,RIGHT):
......
......@@ -167,7 +167,7 @@ static void *Thread( void *p_data )
(LONG_PTR)p_intf );
/* Registering of Hotkeys */
for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
for( const struct hotkey *p_hotkey = p_intf->obj.libvlc->p_hotkeys;
p_hotkey->psz_action != NULL;
p_hotkey++ )
{
......@@ -266,7 +266,7 @@ static void *Thread( void *p_data )
DispatchMessage( &message );
/* Unregistering of Hotkeys */
for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
for( const struct hotkey *p_hotkey = p_intf->obj.libvlc->p_hotkeys;
p_hotkey->psz_action != NULL;
p_hotkey++ )
{
......@@ -311,7 +311,7 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
vlc_action_t action = vlc_GetActionId( psz_atomName );
if( action != ACTIONID_NONE )
{
var_SetInteger( p_intf->p_libvlc,
var_SetInteger( p_intf->obj.libvlc,
"key-action", action );
return 1;
}
......
......@@ -294,7 +294,7 @@ static bool Mapping( intf_thread_t *p_intf )
p_sys->p_map = NULL;
/* Registering of Hotkeys */
for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
for( const struct hotkey *p_hotkey = p_intf->obj.libvlc->p_hotkeys;
p_hotkey->psz_action != NULL;
p_hotkey++ )
{
......@@ -408,8 +408,8 @@ static void *Thread( void *p_data )
if( p_map->p_keys[j] == e->detail &&
p_map->i_modifier == e->state )
{
var_SetInteger( p_intf->p_libvlc, "global-key-pressed",
p_map->i_vlc );
var_SetInteger( p_intf->obj.libvlc,
"global-key-pressed", p_map->i_vlc );
goto done;
}
}
......
......@@ -112,7 +112,7 @@ static int Open( vlc_object_t *p_this )
p_sys->subtitle_delaybookmarks.i_time_audio = 0;
p_sys->subtitle_delaybookmarks.i_time_subtitle = 0;
var_AddCallback( p_intf->p_libvlc, "key-action", ActionEvent, p_intf );
var_AddCallback( p_intf->obj.libvlc, "key-action", ActionEvent, p_intf );
return VLC_SUCCESS;
}
......@@ -124,7 +124,7 @@ static void Close( vlc_object_t *p_this )
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback( p_intf->p_libvlc, "key-action", ActionEvent, p_intf );
var_DelCallback( p_intf->obj.libvlc, "key-action", ActionEvent, p_intf );
/* Destroy structure */
free( p_sys );
......@@ -154,7 +154,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{
/* Libvlc / interface actions */
case ACTIONID_QUIT:
libvlc_Quit( p_intf->p_libvlc );
libvlc_Quit( p_intf->obj.libvlc );
ClearChannels( p_intf, p_vout );
DisplayMessage( p_vout, _( "Quit" ) );
......@@ -162,13 +162,13 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
case ACTIONID_INTF_TOGGLE_FSC:
case ACTIONID_INTF_HIDE:
var_TriggerCallback( p_intf->p_libvlc, "intf-toggle-fscontrol" );
var_TriggerCallback( p_intf->obj.libvlc, "intf-toggle-fscontrol" );
break;
case ACTIONID_INTF_BOSS:
var_TriggerCallback( p_intf->p_libvlc, "intf-boss" );
var_TriggerCallback( p_intf->obj.libvlc, "intf-boss" );
break;
case ACTIONID_INTF_POPUP_MENU:
var_TriggerCallback( p_intf->p_libvlc, "intf-popupmenu" );
var_TriggerCallback( p_intf->obj.libvlc, "intf-popupmenu" );
break;
/* Playlist actions (including audio) */
......
......@@ -197,7 +197,7 @@ static void Process( intf_thread_t *p_intf )
{
vlc_action_t i_key = vlc_GetActionId( c );
if( i_key )
var_SetInteger( p_intf->p_libvlc, "key-action", i_key );
var_SetInteger( p_intf->obj.libvlc, "key-action", i_key );
else
msg_Err( p_intf, "Unknown hotkey '%s'", c );
}
......
......@@ -170,7 +170,7 @@ static void *Run( void *data )
free( p_intf->p_sys->psz_service );
/* Make sure we exit (In case other interfaces have been spawned) */
libvlc_Quit( p_intf->p_libvlc );
libvlc_Quit( p_intf->obj.libvlc );
return NULL;
}
......
......@@ -617,16 +617,16 @@ static void *Run( void *data )
psz_cmd, i_ret, vlc_error( i_ret ) );
}
/* Or maybe it's a global command */
else if( var_Type( p_intf->p_libvlc, psz_cmd ) & VLC_VAR_ISCOMMAND )
else if( var_Type( p_intf->obj.libvlc, psz_cmd ) & VLC_VAR_ISCOMMAND )
{
int i_ret = VLC_SUCCESS;
/* FIXME: it's a global command, but we should pass the
* local object as an argument, not p_intf->p_libvlc. */
if ((var_Type( p_intf->p_libvlc, psz_cmd) & VLC_VAR_CLASS) == VLC_VAR_VOID)
* local object as an argument, not p_intf->obj.libvlc. */
if ((var_Type( p_intf->obj.libvlc, psz_cmd) & VLC_VAR_CLASS) == VLC_VAR_VOID)
var_TriggerCallback( p_intf, psz_cmd );
else
i_ret = var_SetString( p_intf->p_libvlc, psz_cmd, psz_arg );
i_ret = var_SetString( p_intf->obj.libvlc, psz_cmd, psz_arg );
if( i_ret != 0 )
{
msg_rc( "%s: returned %i (%s)",
......@@ -714,7 +714,7 @@ static void *Run( void *data )
}
else if( !strcmp( psz_cmd, "key" ) || !strcmp( psz_cmd, "hotkey" ) )
{
var_SetInteger( p_intf->p_libvlc, "key-action",
var_SetInteger( p_intf->obj.libvlc, "key-action",
vlc_GetActionId( psz_arg ) );
}
else switch( psz_cmd[0] )
......@@ -987,7 +987,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else
{
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_JUMP_FORWARD_EXTRASHORT );
var_SetInteger( p_intf->obj.libvlc, "key-action", ACTIONID_JUMP_FORWARD_EXTRASHORT );
}
i_error = VLC_SUCCESS;
}
......@@ -1001,7 +1001,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else
{
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_JUMP_BACKWARD_EXTRASHORT );
var_SetInteger( p_intf->obj.libvlc, "key-action", ACTIONID_JUMP_BACKWARD_EXTRASHORT );
}
i_error = VLC_SUCCESS;
}
......@@ -1396,7 +1396,7 @@ static int Quit( vlc_object_t *p_this, char const *psz_cmd,
VLC_UNUSED(p_data); VLC_UNUSED(psz_cmd);
VLC_UNUSED(oldval); VLC_UNUSED(newval);
libvlc_Quit( p_this->p_libvlc );
libvlc_Quit( p_this->obj.libvlc );
return VLC_SUCCESS;
}
......
......@@ -66,11 +66,11 @@ bool DOMParser::parse (bool b)
if(!vlc_reader && !(vlc_reader = xml_ReaderCreate(stream, stream)))
return false;
const int i_flags = vlc_reader->i_flags;
const int i_flags = vlc_reader->obj.flags;
if(!b)
vlc_reader->i_flags |= OBJECT_FLAGS_QUIET;
vlc_reader->obj.flags |= OBJECT_FLAGS_QUIET;
root = processNode(b);
vlc_reader->i_flags = i_flags;
vlc_reader->obj.flags = i_flags;
if ( root == NULL )
return false;
......