本文整理汇总了C++中TAB_APPEND函数的典型用法代码示例。如果您正苦于以下问题:C++ TAB_APPEND函数的具体用法?C++ TAB_APPEND怎么用?C++ TAB_APPEND使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TAB_APPEND函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: libvlc_vlm_add_vod
void libvlc_vlm_add_vod( libvlc_instance_t *p_instance, char *psz_name,
char *psz_input, int i_options,
char **ppsz_options, int b_enabled,
char *psz_mux, libvlc_exception_t *p_exception )
{
#ifdef ENABLE_VLM
vlm_t *p_vlm;
vlm_media_t m;
int n;
VLM(p_vlm);
vlm_media_Init( &m );
m.psz_name = strdup( psz_name );
m.b_enabled = b_enabled;
m.b_vod = true;
m.vod.psz_mux = psz_mux ? strdup( psz_mux ) : NULL;
if( psz_input )
TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
for( n = 0; n < i_options; n++ )
TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
vlm_media_Clean( &m );
if( n )
libvlc_exception_raise( p_exception, "Media %s creation failed", psz_name );
#else
libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
return VLC_EGENERIC;
#endif
}
示例2: libvlc_vlm_add_broadcast
void libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance,
const char *psz_name,
const char *psz_input,
const char *psz_output, int i_options,
const char * const *ppsz_options,
int b_enabled, int b_loop,
libvlc_exception_t *p_exception )
{
vlm_t *p_vlm;
vlm_media_t m;
int n;
VLM(p_vlm);
vlm_media_Init( &m );
m.psz_name = strdup( psz_name );
m.b_enabled = b_enabled;
m.b_vod = false;
m.broadcast.b_loop = b_loop;
if( psz_input )
TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
if( psz_output )
m.psz_output = strdup( psz_output );
for( n = 0; n < i_options; n++ )
TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
vlm_media_Clean( &m );
if( n )
{
libvlc_exception_raise( p_exception );
libvlc_printerr( "Media %s creation failed", psz_name );
}
}
示例3: libvlc_vlm_add_vod
int libvlc_vlm_add_vod( libvlc_instance_t *p_instance, const char *psz_name,
const char *psz_input, int i_options,
const char * const *ppsz_options, int b_enabled,
const char *psz_mux )
{
vlm_t *p_vlm;
vlm_media_t m;
int n;
VLM_RET(p_vlm, -1);
vlm_media_Init( &m );
m.psz_name = strdup( psz_name );
m.b_enabled = b_enabled;
m.b_vod = true;
m.vod.psz_mux = psz_mux ? strdup( psz_mux ) : NULL;
if( psz_input )
TAB_APPEND( m.i_input, m.ppsz_input, strdup(psz_input) );
for( n = 0; n < i_options; n++ )
TAB_APPEND( m.i_option, m.ppsz_option, strdup(ppsz_options[n]) );
n = vlm_Control( p_vlm, VLM_ADD_MEDIA, &m, NULL );
vlm_media_Clean( &m );
if( n )
{
libvlc_printerr( "Media %s creation failed", psz_name );
return -1;
}
return 0;
}
示例4: VCDLIDs
/*****************************************************************************
VCDLIDs: Reads the LIST IDs from the LOT.
*****************************************************************************/
static bool
VCDLIDs( access_t * p_access )
{
vcdplayer_t *p_vcdplayer = (vcdplayer_t *) p_access->p_sys;
input_title_t *t;
unsigned int i_lid, i_title;
p_vcdplayer->i_lids = vcdinfo_get_num_LIDs(p_vcdplayer->vcd);
p_vcdplayer->i_lid = VCDINFO_INVALID_ENTRY;
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL),
"LIDs: %d", p_vcdplayer->i_lids);
if ( 0 == p_vcdplayer->i_lids ) return false;
if (vcdinfo_read_psd (p_vcdplayer->vcd)) {
vcdinfo_visit_lot (p_vcdplayer->vcd, false);
#ifdef FIXED
/*
We need to change libvcdinfo to be more robust when there are
problems reading the extended PSD. Given that area-highlighting and
selection features in the extended PSD haven't been implemented,
it's best then to not try to read this at all.
*/
if (vcdinfo_get_psd_x_size(p_vcdplayer->vcd))
vcdinfo_visit_lot (p_vcdplayer->vcd, true);
#endif
}
/* Set up LIDs Navigation Menu */
t = vlc_input_title_New();
t->b_menu = true;
t->psz_name = strdup( "LIDs" );
i_title = p_vcdplayer->i_tracks;
for( i_lid = 1 ; i_lid <= p_vcdplayer->i_lids ; i_lid++ )
{
char psz_lid[100];
seekpoint_t *s = vlc_seekpoint_New();
snprintf( psz_lid, sizeof(psz_lid), "%s %02d", _("LID"), i_lid );
s->i_byte_offset = 0; /* A lid doesn't have an offset
size associated with it */
s->psz_name = strdup(psz_lid);
TAB_APPEND( t->i_seekpoint, t->seekpoint, s );
}
#ifdef DYNAMICALLY_ALLOCATED
TAB_APPEND( p_vcdplayer->i_titles, p_vcdplayer->p_title, t );
#else
p_vcdplayer->p_title[p_vcdplayer->i_titles] = t;
p_vcdplayer->i_titles++;
#endif
return true;
}
示例5: msg_Err
/*****************************************************************************
* sout_MuxAddStream:
*****************************************************************************/
sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
{
sout_input_t *p_input;
if( !p_mux->b_add_stream_any_time && !p_mux->b_waiting_stream )
{
msg_Err( p_mux, "cannot add a new stream (unsupported while muxing "
"to this format). You can try increasing sout-mux-caching value" );
return NULL;
}
msg_Dbg( p_mux, "adding a new input" );
/* create a new sout input */
p_input = malloc( sizeof( sout_input_t ) );
if( !p_input )
return NULL;
p_input->p_fmt = p_fmt;
p_input->p_fifo = block_FifoNew();
p_input->p_sys = NULL;
TAB_APPEND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
if( p_mux->pf_addstream( p_mux, p_input ) < 0 )
{
msg_Err( p_mux, "cannot add this stream" );
TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
block_FifoRelease( p_input->p_fifo );
free( p_input );
return NULL;
}
return p_input;
}
示例6: malloc
/**
* Subscribe to the message queue.
* Whenever a message is emitted, a callback will be called.
* Callback invocation are serialized within a subscription.
*
* @param instance LibVLC instance to get messages from
* @param cb callback function
* @param opaque data for the callback function
* @return a subscription pointer, or NULL in case of failure
*/
msg_subscription_t *msg_Subscribe (libvlc_int_t *instance, msg_callback_t cb,
msg_cb_data_t *opaque)
{
msg_subscription_t *sub = malloc (sizeof (*sub));
if (sub == NULL)
return NULL;
sub->instance = instance;
sub->func = cb;
sub->opaque = opaque;
sub->begin = sub->end = sub->overruns = 0;
if (vlc_clone (&sub->thread, msg_thread, sub, VLC_THREAD_PRIORITY_LOW))
{
free (sub);
return NULL;
}
msg_bank_t *bank = libvlc_bank (instance);
vlc_mutex_lock (&bank->lock);
TAB_APPEND (bank->i_sub, bank->pp_sub, sub);
vlc_mutex_unlock (&bank->lock);
return sub;
}
示例7: AddCallback
static void AddCallback( vlc_object_t *p_this, const char *psz_name,
callback_entry_t entry, vlc_callback_type_t i_type )
{
variable_t *p_var;
assert( p_this );
vlc_object_internals_t *p_priv = vlc_internals( p_this );
p_var = Lookup( p_this, psz_name );
if( p_var == NULL )
{
vlc_mutex_unlock( &p_priv->var_lock );
msg_Err( p_this, "cannot add callback %p to nonexistent variable '%s'",
entry.p_callback, psz_name );
return;
}
WaitUnused( p_this, p_var );
callback_table_t *p_table;
if (i_type == vlc_value_callback)
p_table = &p_var->value_callbacks;
else
p_table = &p_var->list_callbacks;
TAB_APPEND(p_table->i_entries, p_table->p_entries, entry);
vlc_mutex_unlock( &p_priv->var_lock );
}
示例8: Control
/*****************************************************************************
* Control: services discrovery control
****************************************************************************/
static int Control( services_discovery_t *p_sd, int i_command, va_list args )
{
services_discovery_sys_t *p_sys = p_sd->p_sys;
switch( i_command )
{
case SD_CMD_SEARCH:
{
const char *psz_query = va_arg( args, const char * );
vlc_mutex_lock( &p_sys->lock );
TAB_APPEND( p_sys->i_query, p_sys->ppsz_query, strdup( psz_query ) );
vlc_cond_signal( &p_sys->cond );
vlc_mutex_unlock( &p_sys->lock );
break;
}
case SD_CMD_DESCRIPTOR:
{
services_discovery_descriptor_t *p_desc = va_arg( args,
services_discovery_descriptor_t * );
return FillDescriptor( p_sd, p_desc );
}
}
return VLC_SUCCESS;
}
示例9: VCDEntryPoints
/*****************************************************************************
VCDEntryPoints: Reads the information about the entry points on the disc
and initializes area information with that.
Before calling this track information should have been read in.
*****************************************************************************/
static bool
VCDEntryPoints( access_t * p_access )
{
if (!p_access || !p_access->p_sys) return false;
vcdplayer_t *p_vcdplayer = (vcdplayer_t *) p_access->p_sys;
const unsigned int i_entries = vcdinfo_get_num_entries(p_vcdplayer->vcd);
const track_t i_last_track
= cdio_get_num_tracks(vcdinfo_get_cd_image(p_vcdplayer->vcd))
+ cdio_get_first_track_num(vcdinfo_get_cd_image(p_vcdplayer->vcd));
unsigned int i;
if (0 == i_entries) {
LOG_ERR ("no entires found -- something is wrong" );
return false;
}
p_vcdplayer->p_entries = malloc( sizeof( lsn_t ) * i_entries );
if( p_vcdplayer->p_entries == NULL )
{
LOG_ERR ("not enough memory for entry points treatment" );
return false;
}
p_vcdplayer->i_entries = i_entries;
for( i = 0 ; i < i_entries ; i++ )
{
const track_t i_track = vcdinfo_get_track(p_vcdplayer->vcd, i);
if( i_track <= i_last_track )
{
seekpoint_t *s = vlc_seekpoint_New();
char psz_entry[100];
snprintf(psz_entry, sizeof(psz_entry), "%s %02d", _("Entry"), i );
p_vcdplayer->p_entries[i] =
vcdinfo_get_entry_lsn(p_vcdplayer->vcd, i);
s->psz_name = strdup(psz_entry);
s->i_byte_offset = (p_vcdplayer->p_entries[i]
- vcdinfo_get_track_lsn(p_vcdplayer->vcd,i_track))
* M2F2_SECTOR_SIZE;
dbg_print( INPUT_DBG_MRL, "%s, lsn %d, byte_offset %"PRId64"",
s->psz_name, p_vcdplayer->p_entries[i],
s->i_byte_offset);
TAB_APPEND( p_vcdplayer->p_title[i_track-1]->i_seekpoint,
p_vcdplayer->p_title[i_track-1]->seekpoint, s );
} else
msg_Warn( p_access, "wrong track number found in entry points" );
}
p_vcdplayer->b_valid_ep = true;
return true;
}
示例10: vlc_epg_AddEvent
bool vlc_epg_AddEvent( vlc_epg_t *p_epg, vlc_epg_event_t *p_evt )
{
ssize_t i_pos = -1;
/* Insertions are supposed in sequential order first */
if( p_epg->i_event )
{
if( p_epg->pp_event[0]->i_start > p_evt->i_start )
{
i_pos = 0;
}
else if ( p_epg->pp_event[p_epg->i_event - 1]->i_start >= p_evt->i_start )
{
/* Do bisect search lower start time entry */
size_t i_lower = 0;
size_t i_upper = p_epg->i_event - 1;
while( i_lower < i_upper )
{
size_t i_split = ( i_lower + i_upper ) / 2;
vlc_epg_event_t *p_cur = p_epg->pp_event[i_split];
if( p_cur->i_start < p_evt->i_start )
{
i_lower = i_split + 1;
}
else if ( p_cur->i_start >= p_evt->i_start )
{
i_upper = i_split;
}
}
i_pos = i_lower;
}
}
if( i_pos != -1 )
{
/* There can be only one event at same time */
if( p_epg->pp_event[i_pos]->i_start == p_evt->i_start )
{
vlc_epg_event_Delete( p_epg->pp_event[i_pos] );
if( p_epg->p_current == p_epg->pp_event[i_pos] )
p_epg->p_current = p_evt;
p_epg->pp_event[i_pos] = p_evt;
return true;
}
else
{
TAB_INSERT( p_epg->i_event, p_epg->pp_event, p_evt, i_pos );
}
}
else
TAB_APPEND( p_epg->i_event, p_epg->pp_event, p_evt );
return true;
}
示例11: EntryPoints
/*****************************************************************************
* EntryPoints: Reads the information about the entry points on the disc.
*****************************************************************************/
static int EntryPoints( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
uint8_t sector[VCD_DATA_SIZE];
entries_sect_t entries;
int i_nb;
/* Read the entry point sector */
if( ioctl_ReadSectors( VLC_OBJECT(p_access), p_sys->vcddev,
VCD_ENTRIES_SECTOR, sector, 1, VCD_TYPE ) < 0 )
{
msg_Err( p_access, "could not read entry points sector" );
return VLC_EGENERIC;
}
memcpy( &entries, sector, CD_SECTOR_SIZE );
i_nb = GetWBE( &entries.i_entries_nb );
if( i_nb > 500 )
{
msg_Err( p_access, "invalid entry points number" );
return VLC_EGENERIC;
}
if( strncmp( entries.psz_id, "ENTRYVCD", sizeof( entries.psz_id ) ) &&
strncmp( entries.psz_id, "ENTRYSVD", sizeof( entries.psz_id ) ) )
{
msg_Err( p_access, "unrecognized entry points format" );
return VLC_EGENERIC;
}
for( int i = 0; i < i_nb; i++ )
{
const int i_title = BCD_TO_BIN(entries.entry[i].i_track) - 2;
const int i_sector =
(MSF_TO_LBA2( BCD_TO_BIN( entries.entry[i].msf.minute ),
BCD_TO_BIN( entries.entry[i].msf.second ),
BCD_TO_BIN( entries.entry[i].msf.frame ) ));
seekpoint_t *s;
if( i_title < 0 ) continue; /* Should not occur */
if( i_title >= p_sys->i_titles ) continue;
msg_Dbg( p_access, "Entry[%d] title=%d sector=%d",
i, i_title, i_sector );
s = vlc_seekpoint_New();
s->i_byte_offset = (i_sector - p_sys->p_sectors[i_title+1]) *
VCD_DATA_SIZE;
TAB_APPEND( p_sys->title[i_title]->i_seekpoint,
p_sys->title[i_title]->seekpoint, s );
}
return VLC_SUCCESS;
}
示例12: Add
/*****************************************************************************
* Add:
*****************************************************************************/
static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_sys_t *id;
int i_stream, i_valid_streams = 0;
id = malloc( sizeof( sout_stream_id_sys_t ) );
if( !id )
return NULL;
TAB_INIT( id->i_nb_ids, id->pp_ids );
msg_Dbg( p_stream, "duplicated a new stream codec=%4.4s (es=%d group=%d)",
(char*)&p_fmt->i_codec, p_fmt->i_id, p_fmt->i_group );
for( i_stream = 0; i_stream < p_sys->i_nb_streams; i_stream++ )
{
void *id_new = NULL;
if( ESSelected( p_fmt, p_sys->ppsz_select[i_stream] ) )
{
sout_stream_t *out = p_sys->pp_streams[i_stream];
id_new = (void*)sout_StreamIdAdd( out, p_fmt );
if( id_new )
{
msg_Dbg( p_stream, " - added for output %d", i_stream );
i_valid_streams++;
}
else
{
msg_Dbg( p_stream, " - failed for output %d", i_stream );
}
}
else
{
msg_Dbg( p_stream, " - ignored for output %d", i_stream );
}
/* Append failed attempts as well to keep track of which pp_id
* belongs to which duplicated stream */
TAB_APPEND( id->i_nb_ids, id->pp_ids, id_new );
}
if( i_valid_streams <= 0 )
{
Del( p_stream, id );
return NULL;
}
return id;
}
示例13: Add
static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
sout_stream_id_t *p_es = malloc( sizeof(sout_stream_id_t) );
p_es->fmt = *p_fmt;
p_es->id = NULL;
p_es->i_last = VLC_TS_INVALID;
p_es->b_error = false;
TAB_APPEND( p_sys->i_es_num, p_sys->pp_es, p_es );
return p_es;
}
示例14: VCDSegments
/*****************************************************************************
* VCDSegments: Reads the information about the segments the disc.
*****************************************************************************/
static bool
VCDSegments( access_t * p_access )
{
vcdplayer_t *p_vcdplayer = (vcdplayer_t *) p_access->p_sys;
unsigned int i;
input_title_t *t;
p_vcdplayer->i_segments = vcdinfo_get_num_segments(p_vcdplayer->vcd);
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_MRL),
"Segments: %d", p_vcdplayer->i_segments);
if ( 0 == p_vcdplayer->i_segments ) return false;
t = p_vcdplayer->p_title[p_vcdplayer->i_titles] = vlc_input_title_New();
p_vcdplayer->i_titles++;
t->i_size = 0; /* Not sure Segments have a size associated */
t->psz_name = strdup(_("Segments"));
/* We have one additional segment allocated so we can get the size
by subtracting seg[i+1] - seg[i].
*/
p_vcdplayer->p_segments=malloc(sizeof(lsn_t)*(p_vcdplayer->i_segments+1));
if( p_vcdplayer->p_segments == NULL )
{
LOG_ERR ("not enough memory for segment treatment" );
return false;
}
for( i = 0 ; i < p_vcdplayer->i_segments ; i++ )
{
char psz_segment[100];
seekpoint_t *s = vlc_seekpoint_New();
p_vcdplayer->p_segments[i] = vcdinfo_get_seg_lsn(p_vcdplayer->vcd, i);
snprintf( psz_segment, sizeof(psz_segment), "%s %02d", _("Segment"),
i );
s->i_byte_offset = 0; /* Not sure what this would mean here */
s->psz_name = strdup(psz_segment);
TAB_APPEND( t->i_seekpoint, t->seekpoint, s );
}
p_vcdplayer->p_segments[p_vcdplayer->i_segments] =
p_vcdplayer->p_segments[p_vcdplayer->i_segments-1]+
vcdinfo_get_seg_sector_count(p_vcdplayer->vcd,
p_vcdplayer->i_segments-1);
return true;
}
示例15: malloc
/** rtsp must be locked */
static
rtsp_session_t *RtspClientNew( rtsp_stream_t *rtsp )
{
rtsp_session_t *s = malloc( sizeof( *s ) );
if( s == NULL )
return NULL;
s->stream = rtsp;
vlc_rand_bytes (&s->id, sizeof (s->id));
s->trackc = 0;
s->trackv = NULL;
TAB_APPEND( rtsp->sessionc, rtsp->sessionv, s );
return s;
}