本文整理汇总了C++中pl_Get函数的典型用法代码示例。如果您正苦于以下问题:C++ pl_Get函数的具体用法?C++ pl_Get怎么用?C++ pl_Get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pl_Get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
/* Open Interface */
static int Open( vlc_object_t *p_this, bool isDialogProvider )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
#ifdef Q_WS_X11
if( !vlc_xlib_init( p_this ) )
return VLC_EGENERIC;
char *display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
Display *p_display = XOpenDisplay( x11_display );
if( !p_display )
{
msg_Err( p_intf, "Could not connect to X server" );
free (display);
return VLC_EGENERIC;
}
XCloseDisplay( p_display );
#else
char *display = NULL;
#endif
QMutexLocker locker (&lock);
if (busy)
{
msg_Err (p_this, "cannot start Qt4 multiple times");
free (display);
return VLC_EGENERIC;
}
/* Allocations of p_sys */
intf_sys_t *p_sys = p_intf->p_sys = new intf_sys_t;
p_intf->p_sys->b_isDialogProvider = isDialogProvider;
p_sys->p_mi = NULL;
p_sys->p_playlist = pl_Get( p_intf );
/* */
#ifdef Q_WS_X11
x11_display = display;
#endif
vlc_sem_init (&ready, 0);
if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
{
delete p_sys;
free (display);
return VLC_ENOMEM;
}
/* */
vlc_sem_wait (&ready);
vlc_sem_destroy (&ready);
busy = active = true;
if( !p_sys->b_isDialogProvider )
{
playlist_t *pl = pl_Get(p_this);
var_Create (pl, "qt4-iface", VLC_VAR_ADDRESS);
var_SetAddress (pl, "qt4-iface", p_this);
}
return VLC_SUCCESS;
}
示例2: Open
/*****************************************************************************
* Open: initialize and create stuff
*****************************************************************************/
static int Open(vlc_object_t *p_this)
{
intf_thread_t *p_intf = (intf_thread_t*) p_this;
intf_sys_t *p_sys = calloc(1, sizeof(intf_sys_t));
if (!p_sys)
return VLC_ENOMEM;
p_intf->p_sys = p_sys;
vlc_mutex_init(&p_sys->lock);
vlc_cond_init(&p_sys->wait);
if (vlc_clone(&p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW))
{
vlc_cond_destroy(&p_sys->wait);
vlc_mutex_destroy(&p_sys->lock);
free(p_sys);
return VLC_ENOMEM;
}
var_AddCallback(pl_Get(p_intf), "activity", ItemChange, p_intf);
return VLC_SUCCESS;
}
示例3: EP_SetMoviesoapP_Input
/* Sets Moviesoap::p_input */
static void* EP_SetMoviesoapP_Input(void *data)
{
// require Moviesoap::p_playlist
if (Moviesoap::p_playlist == NULL) {
playlist_t * p_playlist = pl_Get( Moviesoap::p_obj );
if (p_playlist) {
vlc_mutex_lock( &Moviesoap::lock );
Moviesoap::p_playlist = p_playlist;
vlc_mutex_unlock( &Moviesoap::lock );
} else {
return NULL;
}
}
// get p_input
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
if (p_input) {
// set Moviesoap::p_input
vlc_mutex_lock( &Moviesoap::lock );
Moviesoap::p_input = p_input;
vlc_mutex_unlock( &Moviesoap::lock );
// Add callback(s) to input thread
var_AddCallback( p_input, "position", InputCbPosition, NULL );
var_AddCallback( p_input, "time", InputCbTime, NULL );
var_AddCallback( p_input, "intf-event", InputCbGeneric, NULL );
var_AddCallback( p_input, "state", InputCbState, NULL );
// start filter object if one exists
if (Moviesoap::p_loadedFilter) Moviesoap::p_loadedFilter->Restart();
}
return p_input;
}
示例4: Open
// Initialize interface.
static int Open(vlc_object_t* p_this)
{
intf_thread_t* const p_intf = (intf_thread_t*)p_this;
// Limit to one instance.
if (FindWindow(L"CD Art Display IPC Class", L"VLC"))
{
p_intf->p_sys = NULL;
return VLC_SUCCESS;
}
OutputDebugString(L"VLC Open");
intf_sys_t* const p_sys = (intf_sys_t*)calloc(1, sizeof(intf_sys_t));
if (!p_sys)
{
return VLC_ENOMEM;
}
p_intf->p_sys = p_sys;
vlc_mutex_init(&p_sys->lock);
if (vlc_clone(&p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW))
{
vlc_mutex_destroy(&p_sys->lock);
free(p_sys);
p_intf->p_sys = NULL;
return VLC_ENOMEM;
}
var_AddCallback(pl_Get(p_intf->p_libvlc), "input-current", PlaylistEvent, p_intf);
return VLC_SUCCESS;
}
示例5: Close
/*****************************************************************************
* Close: destroy interface stuff
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
playlist_t *p_playlist = pl_Get( p_this );
input_thread_t *p_input = NULL;
var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
if( (p_input = playlist_CurrentInput( p_playlist )) )
{
var_DelCallback( p_input, "state", StateChange, p_intf );
vlc_object_release( p_input );
}
/* Clears the Presence message ... else it looks like we're still playing
* something although VLC (or the Telepathy plugin) is closed */
/* Do not check for VLC_ENOMEM as we're closing */
SendToTelepathy( p_intf, "" );
/* we won't use the DBus connection anymore */
dbus_connection_unref( p_intf->p_sys->p_conn );
/* Destroy structure */
free( p_intf->p_sys->psz_format );
free( p_intf->p_sys );
}
示例6: Close
/*****************************************************************************
* Close:
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
services_discovery_t *p_sd = ( services_discovery_t* )p_this;
services_discovery_sys_t *p_sys = p_sd->p_sys;
playlist_t *pl = pl_Get( p_this );
int i;
vlc_cancel (p_sys->thread);
vlc_join (p_sys->thread, NULL);
var_DelCallback( pl, "podcast-urls", UrlsChange, p_sys );
var_DelCallback( pl, "podcast-request", Request, p_sys );
vlc_cond_destroy( &p_sys->wait );
vlc_mutex_destroy( &p_sys->lock );
for( i = 0; i < p_sys->i_input; i++ )
{
input_thread_t *p_input = p_sd->p_sys->pp_input[i];
if( !p_input )
continue;
input_Stop( p_input, true );
input_Close( p_input );
p_sd->p_sys->pp_input[i] = NULL;
}
free( p_sd->p_sys->pp_input );
for( i = 0; i < p_sys->i_urls; i++ ) free( p_sys->ppsz_urls[i] );
free( p_sys->ppsz_urls );
for( i = 0; i < p_sys->i_items; i++ ) vlc_gc_decref( p_sys->pp_items[i] );
free( p_sys->pp_items );
free( p_sys->psz_request );
free( p_sys );
}
示例7: ServiceDispatch
static void WINAPI ServiceDispatch( DWORD numArgs, char **args )
{
(void)numArgs;
(void)args;
intf_thread_t *p_intf = (intf_thread_t *)p_global_intf;
intf_sys_t *p_sys = p_intf->p_sys;
char *psz_modules, *psz_parser;
/* We have to initialize the service-specific stuff */
memset( &p_sys->status, 0, sizeof(SERVICE_STATUS) );
p_sys->status.dwServiceType = SERVICE_WIN32;
p_sys->status.dwCurrentState = SERVICE_START_PENDING;
p_sys->status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
p_sys->hStatus =
RegisterServiceCtrlHandlerA( p_sys->psz_service, &ServiceCtrlHandler );
if( p_sys->hStatus == (SERVICE_STATUS_HANDLE)0 )
{
msg_Err( p_intf, "failed to register service control handler" );
return;
}
/*
* Load background interfaces
*/
psz_modules = var_InheritString( p_intf, "ntservice-extraintf" );
psz_parser = psz_modules;
while( psz_parser && *psz_parser )
{
char *psz_module, *psz_temp;
psz_module = psz_parser;
psz_parser = strchr( psz_module, ',' );
if( psz_parser )
{
*psz_parser = '\0';
psz_parser++;
}
if( asprintf( &psz_temp, "%s,none", psz_module ) != -1 )
{
/* Try to create the interface */
if( intf_Create( pl_Get(p_intf), psz_temp ) )
{
msg_Err( p_intf, "interface \"%s\" initialization failed",
psz_temp );
free( psz_temp );
continue;
}
free( psz_temp );
}
}
free( psz_modules );
/* Initialization complete - report running status */
p_sys->status.dwCurrentState = SERVICE_RUNNING;
p_sys->status.dwCheckPoint = 0;
p_sys->status.dwWaitHint = 0;
SetServiceStatus( p_sys->hStatus, &p_sys->status );
}
示例8: MarshalMetadata
static int
MarshalMetadata( intf_thread_t *p_intf, DBusMessageIter *container )
{
playlist_t *playlist = pl_Get( p_intf );
playlist_item_t *item;
int result = VLC_SUCCESS;
playlist_Lock( playlist );
item = playlist_CurrentPlayingItem( playlist );
if( item != NULL )
result = GetInputMeta( item, container );
else
{ // avoid breaking the type marshalling
DBusMessageIter a;
if( !dbus_message_iter_open_container( container, DBUS_TYPE_ARRAY,
"{sv}", &a ) ||
!dbus_message_iter_close_container( container, &a ) )
result = VLC_ENOMEM;
}
playlist_Unlock( playlist );
return result;
}
示例9: GetFilenames
/*****************************************************************************
* GetFilenames: parse command line options which are not flags
*****************************************************************************
* Parse command line for input files as well as their associated options.
* An option always follows its associated input and begins with a ":".
*****************************************************************************/
static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
const char *const args[] )
{
while( n > 0 )
{
/* Count the input options */
unsigned i_options = 0;
while( args[--n][0] == ':' )
{
i_options++;
if( n == 0 )
{
msg_Warn( p_vlc, "options %s without item", args[n] );
return; /* syntax!? */
}
}
char *mrl = NULL;
if( strstr( args[n], "://" ) == NULL )
{
mrl = vlc_path2uri( args[n], NULL );
if( !mrl )
continue;
}
playlist_AddExt( pl_Get( p_vlc ), (mrl != NULL) ? mrl : args[n], NULL,
PLAYLIST_INSERT, 0, -1, i_options,
( i_options ? &args[n + 1] : NULL ),
VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
free( mrl );
}
}
示例10: Activate
/*****************************************************************************
* Activate: initialize and create stuff
*****************************************************************************/
static int Activate( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t*)p_this;
intf_sys_t *p_sys;
DBusError error;
p_sys = p_intf->p_sys = (intf_sys_t *) calloc( 1, sizeof( intf_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
p_sys->i_cookie[FREEDESKTOP] = 0;
p_sys->i_cookie[GNOME] = 0;
p_sys->p_input = NULL;
dbus_error_init( &error );
/* connect privately to the session bus
* the connection will not be shared with other vlc modules which use dbus,
* thus avoiding a whole class of concurrency issues */
p_sys->p_conn = dbus_bus_get_private( DBUS_BUS_SESSION, &error );
if( !p_sys->p_conn )
{
msg_Err( p_this, "Failed to connect to the D-Bus session daemon: %s",
error.message );
dbus_error_free( &error );
free( p_sys );
return VLC_EGENERIC;
}
p_sys->p_playlist = pl_Get( p_intf );
var_AddCallback( p_sys->p_playlist, "item-current", InputChange, p_intf );
return VLC_SUCCESS;
}
示例11: Close
/*****************************************************************************
* Close: destroy interface stuff
*****************************************************************************/
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(pl_Get(p_intf), "activity", ItemChange, p_intf);
vlc_cancel(p_sys->thread);
vlc_join(p_sys->thread, NULL);
input_thread_t *p_input = pl_CurrentInput(p_intf);
if (p_input)
{
if (p_sys->b_state_cb)
var_DelCallback(p_input, "intf-event", PlayingChange, p_intf);
vlc_object_release(p_input);
}
int i;
for (i = 0; i < p_sys->i_songs; i++)
DeleteSong(&p_sys->p_queue[i]);
vlc_UrlClean(&p_sys->p_submit_url);
#if 0 //NOT USED
free(p_sys->psz_nowp_host);
free(p_sys->psz_nowp_file);
#endif
vlc_cond_destroy(&p_sys->wait);
vlc_mutex_destroy(&p_sys->lock);
free(p_sys);
}
示例12: Close
/*****************************************************************************
* Close: destroy interface stuff
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
playlist_t *p_playlist = pl_Get( p_this );
input_thread_t *p_input;
intf_thread_t *p_intf = ( intf_thread_t* ) p_this;
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback( p_playlist, "item-current", ItemChange, p_intf );
p_input = playlist_CurrentInput( p_playlist );
if ( p_input )
{
if( p_sys->b_state_cb )
var_DelCallback( p_input, "intf-event", PlayingChange, p_intf );
vlc_object_release( p_input );
}
int i;
for( i = 0; i < p_sys->i_songs; i++ )
DeleteSong( &p_sys->p_queue[i] );
free( p_sys->psz_submit_host );
free( p_sys->psz_submit_file );
#if 0 //NOT USED
free( p_sys->psz_nowp_host );
free( p_sys->psz_nowp_file );
#endif
vlc_cond_destroy( &p_sys->wait );
vlc_mutex_destroy( &p_sys->lock );
free( p_sys );
}
示例13: input_GetItem
void InputManager::requestArtUpdate( input_item_t *p_item )
{
bool b_current_item = false;
if ( !p_item && hasInput() )
{ /* default to current item */
p_item = input_GetItem( p_input );
b_current_item = true;
}
if ( p_item )
{
/* check if it has already been enqueued */
if ( p_item->p_meta )
{
int status = vlc_meta_GetStatus( p_item->p_meta );
if ( status & ( ITEM_ART_NOTFOUND|ITEM_ART_FETCHED ) )
return;
}
playlist_AskForArtEnqueue( pl_Get(p_intf), p_item );
/* No input will signal the cover art to update,
* let's do it ourself */
if ( b_current_item )
UpdateArt();
else
emit artChanged( p_item );
}
}
示例14: Close
/*****************************************************************************
* Close: destroy interface stuff
*****************************************************************************/
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;
vlc_cancel(p_sys->thread);
vlc_join(p_sys->thread, NULL);
var_DelCallback(pl_Get(p_intf), "input-current", ItemChange, p_intf);
if (p_sys->p_input != NULL)
{
var_DelCallback(p_sys->p_input, "intf-event", PlayingChange, p_intf);
vlc_object_release(p_sys->p_input);
}
int i;
for (i = 0; i < p_sys->i_songs; i++)
DeleteSong(&p_sys->p_queue[i]);
vlc_UrlClean(&p_sys->p_submit_url);
vlc_UrlClean(&p_sys->p_nowp_url);
vlc_cond_destroy(&p_sys->wait);
vlc_mutex_destroy(&p_sys->lock);
free(p_sys);
}
示例15: Open
/*****************************************************************************
* OpenIntf: initialize interface
*****************************************************************************/
static int Open ( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
/* Allocate instance and initialize some members */
intf_sys_t *p_sys = p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) ); // sunqueen modify
if( unlikely(p_sys == NULL) )
return VLC_ENOMEM;
// Configure the module
vlc_mutex_init( &p_sys->lock );
p_sys->p_input = NULL;
p_sys->p_vout = NULL;
p_sys->b_button_pressed = false;
p_sys->i_threshold = var_InheritInteger( p_intf, "gestures-threshold" );
// Choose the tight button to use
char *psz_button = var_InheritString( p_intf, "gestures-button" );
if( psz_button && !strcmp( psz_button, "left" ) )
p_sys->i_button_mask = 1;
else if( psz_button && !strcmp( psz_button, "middle" ) )
p_sys->i_button_mask = 2;
else // psz_button == "right"
p_sys->i_button_mask = 4;
free( psz_button );
p_sys->i_pattern = 0;
p_sys->i_num_gestures = 0;
var_AddCallback( pl_Get(p_intf), "input-current", PlaylistEvent, p_intf );
return VLC_SUCCESS;
}