这篇教程C++ vlc_array_item_at_index函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vlc_array_item_at_index函数的典型用法代码示例。如果您正苦于以下问题:C++ vlc_array_item_at_index函数的具体用法?C++ vlc_array_item_at_index怎么用?C++ vlc_array_item_at_index使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vlc_array_item_at_index函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sms_Freevoid sms_Free( sms_stream_t *sms ){ if( sms->qlevels ) { for( int n = 0; n < vlc_array_count( sms->qlevels ); n++ ) { quality_level_t *qlevel = (quality_level_t *)vlc_array_item_at_index( sms->qlevels, n ); // sunqueen modify if( qlevel ) ql_Free( qlevel ); } vlc_array_destroy( sms->qlevels ); } if( sms->chunks ) { for( int n = 0; n < vlc_array_count( sms->chunks ); n++ ) { chunk_t *chunk = (chunk_t *)vlc_array_item_at_index( sms->chunks, n ); // sunqueen modify if( chunk) chunk_Free( chunk ); } vlc_array_destroy( sms->chunks ); } free( sms->name ); free( sms->url_template ); free( sms ); sms = NULL;}
开发者ID:WutongEdward,项目名称:vlc-2.1.4.32.subproject-2013,代码行数:27,
示例2: Close/***************************************************************************** * Close: *****************************************************************************/static void Close(vlc_object_t *p_this){ fingerprinter_thread_t *p_fingerprinter = (fingerprinter_thread_t*) p_this; fingerprinter_sys_t *p_sys = p_fingerprinter->p_sys; vlc_cancel( p_sys->thread ); vlc_join( p_sys->thread, NULL ); vlc_mutex_destroy( &p_sys->condwait.lock ); vlc_cond_destroy( &p_sys->condwait.wait ); for ( int i = 0; i < vlc_array_count( p_sys->incoming.queue ); i++ ) fingerprint_request_Delete( vlc_array_item_at_index( p_sys->incoming.queue, i ) ); vlc_array_destroy( p_sys->incoming.queue ); vlc_mutex_destroy( &p_sys->incoming.lock ); vlc_cond_destroy( &p_sys->incoming_queue_filled ); for ( int i = 0; i < vlc_array_count( p_sys->processing.queue ); i++ ) fingerprint_request_Delete( vlc_array_item_at_index( p_sys->processing.queue, i ) ); vlc_array_destroy( p_sys->processing.queue ); vlc_mutex_destroy( &p_sys->processing.lock ); for ( int i = 0; i < vlc_array_count( p_sys->results.queue ); i++ ) fingerprint_request_Delete( vlc_array_item_at_index( p_sys->results.queue, i ) ); vlc_array_destroy( p_sys->results.queue ); vlc_mutex_destroy( &p_sys->results.lock ); free( p_sys );}
开发者ID:Kubink,项目名称:vlc,代码行数:32,
示例3: stream_extractor_AttachParsedintstream_extractor_AttachParsed( stream_t** source, char const* data, char const** out_extra ){ vlc_array_t identifiers; if( mrl_FragmentSplit( &identifiers, out_extra, data ) ) return VLC_EGENERIC; size_t count = vlc_array_count( &identifiers ); size_t idx = 0; while( idx < count ) { char* id = vlc_array_item_at_index( &identifiers, idx ); if( vlc_stream_extractor_Attach( source, id, NULL ) ) break; ++idx; } for( size_t i = 0; i < count; ++i ) free( vlc_array_item_at_index( &identifiers, i ) ); vlc_array_clear( &identifiers ); return idx == count ? VLC_SUCCESS : VLC_EGENERIC;}
开发者ID:chouquette,项目名称:vlc,代码行数:28,
示例4: libvlc_event_detach/************************************************************************** * libvlc_event_detach (public) : * * Remove a callback for an event. **************************************************************************/void libvlc_event_detach( libvlc_event_manager_t *p_event_manager, libvlc_event_type_t event_type, libvlc_callback_t pf_callback, void *p_user_data ){ libvlc_event_listeners_group_t * listeners_group; libvlc_event_listener_t * listener; int i, j; bool found = false; vlc_mutex_lock( &p_event_manager->event_sending_lock ); vlc_mutex_lock( &p_event_manager->object_lock ); for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++) { listeners_group = vlc_array_item_at_index(&p_event_manager->listeners_groups, i); if( listeners_group->event_type == event_type ) { for( j = 0; j < vlc_array_count(&listeners_group->listeners); j++) { listener = vlc_array_item_at_index(&listeners_group->listeners, j); if( listener->event_type == event_type && listener->pf_callback == pf_callback && listener->p_user_data == p_user_data ) { /* that's our listener */ /* Mark this group as edited so that libvlc_event_send * will recheck what listener to call */ listeners_group->b_sublistener_removed = true; free( listener ); vlc_array_remove( &listeners_group->listeners, j ); found = true; break; } } } } vlc_mutex_unlock( &p_event_manager->object_lock ); vlc_mutex_unlock( &p_event_manager->event_sending_lock ); /* Now make sure any pending async event won't get fired after that point */ libvlc_event_listener_t listener_to_remove; listener_to_remove.event_type = event_type; listener_to_remove.pf_callback = pf_callback; listener_to_remove.p_user_data = p_user_data; listener_to_remove.is_asynchronous = true; libvlc_event_async_ensure_listener_removal(p_event_manager, &listener_to_remove); assert(found);}
开发者ID:AsamQi,项目名称:vlc,代码行数:57,
示例5: BackgroundWorkerCancelstatic void BackgroundWorkerCancel( struct background_worker* worker, void* id){ vlc_mutex_lock( &worker->lock ); for( size_t i = 0; i < vlc_array_count( &worker->tail.data ); ) { struct bg_queued_item* item = vlc_array_item_at_index( &worker->tail.data, i ); if( id == NULL || item->id == id ) { vlc_array_remove( &worker->tail.data, i ); worker->conf.pf_release( item->entity ); free( item ); continue; } ++i; } while( ( id == NULL && worker->head.active ) || ( id != NULL && worker->head.id == id ) ) { worker->head.deadline = VLC_TS_0; vlc_cond_signal( &worker->head.worker_wait ); vlc_cond_signal( &worker->tail.wait ); vlc_cond_wait( &worker->head.wait, &worker->lock ); } vlc_mutex_unlock( &worker->lock );}
开发者ID:tguillem,项目名称:vlc,代码行数:29,
示例6: RemoveDirToMonitor/** * @brief Remove a directory to monitor * @param p_ml A media library object * @param psz_dir the directory to remove * @return VLC_SUCCESS or VLC_EGENERIC */int RemoveDirToMonitor( media_library_t *p_ml, const char *psz_dir ){ assert( p_ml ); char **pp_results = NULL; int i_cols = 0, i_rows = 0, i_ret = VLC_SUCCESS; int i; bool b_recursive = var_CreateGetBool( p_ml, "ml-recursive-scan" ); if( b_recursive ) { i_ret = Query( p_ml, &pp_results, &i_rows, &i_cols, "SELECT media.id FROM media JOIN directories ON " "(media.directory_id = directories.id) WHERE " "directories.uri LIKE '%q%%'", psz_dir ); if( i_ret != VLC_SUCCESS ) { msg_Err( p_ml, "Error occured while making a query to the database" ); return i_ret; } QuerySimple( p_ml, "DELETE FROM directories WHERE uri LIKE '%q%%'", psz_dir ); } else { i_ret = Query( p_ml, &pp_results, &i_rows, &i_cols, "SELECT media.id FROM media JOIN directories ON " "(media.directory_id = directories.id) WHERE " "directories.uri = %Q", psz_dir ); if( i_ret != VLC_SUCCESS ) { msg_Err( p_ml, "Error occured while making a query to the database" ); return i_ret; } QuerySimple( p_ml, "DELETE FROM directories WHERE uri = %Q", psz_dir ); } vlc_array_t *p_where = vlc_array_new(); for( i = 1; i <= i_rows; i++ ) { int id = atoi( pp_results[i*i_cols] ); ml_element_t* p_find = ( ml_element_t * ) calloc( 1, sizeof( ml_element_t ) ); p_find->criteria = ML_ID; p_find->value.i = id; vlc_array_append( p_where, p_find ); } Delete( p_ml, p_where ); FreeSQLResult( p_ml, pp_results ); for( i = 0; i < vlc_array_count( p_where ); i++ ) { free( vlc_array_item_at_index( p_where, i ) ); } vlc_array_destroy( p_where ); return VLC_SUCCESS;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:66,
示例7: bdsm_SdClosevoid bdsm_SdClose (vlc_object_t *p_this){ services_discovery_t *sd = (services_discovery_t *)p_this; services_discovery_sys_t *p_sys = sd->p_sys; if( p_sys == NULL ) return; if( p_sys->p_ns ) { netbios_ns_discover_stop( p_sys->p_ns ); netbios_ns_destroy( p_sys->p_ns ); } if( p_sys->p_entry_item_list ) { for ( int i = 0; i < vlc_array_count( p_sys->p_entry_item_list ); i++ ) { struct entry_item *p_entry_item; p_entry_item = vlc_array_item_at_index( p_sys->p_entry_item_list, i ); vlc_gc_decref( p_entry_item->p_item ); free( p_entry_item ); } vlc_array_destroy( p_sys->p_entry_item_list ); } free( p_sys );}
开发者ID:ToBeStrong,项目名称:vlc,代码行数:30,
示例8: next_timeout/** * Computes the time until the next timeout expiration. * @note Interface lock must be held. * @return The time in milliseconds until the next expiration, * or -1 if there are no pending timeouts. */static int next_timeout(intf_thread_t *intf){ intf_sys_t *sys = intf->p_sys; mtime_t next_timeout = LAST_MDATE; unsigned count = vlc_array_count(sys->p_timeouts); for (unsigned i = 0; i < count; i++) { DBusTimeout *to = vlc_array_item_at_index(sys->p_timeouts, i); if (!dbus_timeout_get_enabled(to)) continue; mtime_t *expiry = dbus_timeout_get_data(to); if (next_timeout > *expiry) next_timeout = *expiry; } if (next_timeout >= LAST_MDATE) return -1; next_timeout /= 1000; if (next_timeout > INT_MAX) return INT_MAX; return (int)next_timeout;}
开发者ID:etix,项目名称:vlc,代码行数:35,
示例9: Closestatic void Close ( vlc_object_t *p_this ){ intf_thread_t *p_intf = (intf_thread_t*) p_this; playlist_t *p_playlist = pl_Hold( p_intf );; input_thread_t *p_input; var_DelCallback( p_playlist, "item-current", AllCallback, p_intf ); var_DelCallback( p_playlist, "intf-change", AllCallback, p_intf ); var_DelCallback( p_playlist, "playlist-item-append", AllCallback, p_intf ); var_DelCallback( p_playlist, "playlist-item-deleted", AllCallback, p_intf ); var_DelCallback( p_playlist, "random", AllCallback, p_intf ); var_DelCallback( p_playlist, "repeat", AllCallback, p_intf ); var_DelCallback( p_playlist, "loop", AllCallback, p_intf ); p_input = playlist_CurrentInput( p_playlist ); if ( p_input ) { var_DelCallback( p_input, "state", AllCallback, p_intf ); vlc_object_release( p_input ); } pl_Release( p_intf ); dbus_connection_unref( p_intf->p_sys->p_conn ); // Free the events array for( int i = 0; i < vlc_array_count( p_intf->p_sys->p_events ); i++ ) { callback_info_t* info = vlc_array_item_at_index( p_intf->p_sys->p_events, i ); free( info ); } vlc_mutex_destroy( &p_intf->p_sys->lock ); vlc_array_destroy( p_intf->p_sys->p_events ); free( p_intf->p_sys );}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:35,
示例10: vlc_array_count/** * @brief Insert all medias from a result array to the model * @param p_result_array the medias to append * @return see insertMedia * @note if bSignal==true, then it signals only once * not media or NULL items are skipped */int MLModel::insertResultArray( vlc_array_t *p_result_array, int row, bool bSignal ){ int i_ok = VLC_SUCCESS; int count = vlc_array_count( p_result_array ); if( !count ) return i_ok; if( row == -1 ) row = rowCount(); // Signal Qt that we will insert rows if( bSignal ) beginInsertRows( createIndex( -1, -1 ), row, row + count-1 ); // Loop and insert for( int i = 0; i < count; ++i ) { ml_result_t *p_result = (ml_result_t*) vlc_array_item_at_index( p_result_array, i ); if( !p_result || p_result->type != ML_TYPE_MEDIA ) continue; i_ok = insertMedia( p_result->value.p_media, row + i, false ); if( i_ok != VLC_SUCCESS ) break; } // Signal we're done if( bSignal ) endInsertRows(); return i_ok;}
开发者ID:LDiracDelta,项目名称:vlc_censor_plugin,代码行数:40,
示例11: GetPollFds/** * GetPollFds() fills an array of pollfd data structures with : * - the set of enabled dbus watches * - the unix pipe which we use to manually wake up the main loop * * This function must be called with p_sys->lock locked * * @return The number of file descriptors * * @param intf_thread_t *p_intf this interface thread's state * @param struct pollfd *p_fds a pointer to a pollfd array large enough to * contain all the returned data (number of enabled dbus watches + 1) */static int GetPollFds( intf_thread_t *p_intf, struct pollfd *p_fds ){ intf_sys_t *p_sys = p_intf->p_sys; int i_fds = 1, i_watches = vlc_array_count( p_sys->p_watches ); p_fds[0].fd = p_sys->p_pipe_fds[PIPE_OUT]; p_fds[0].events = POLLIN | POLLPRI; for( int i = 0; i < i_watches; i++ ) { DBusWatch *p_watch = NULL; p_watch = vlc_array_item_at_index( p_sys->p_watches, i ); if( !dbus_watch_get_enabled( p_watch ) ) continue; p_fds[i_fds].fd = dbus_watch_get_unix_fd( p_watch ); int i_flags = dbus_watch_get_flags( p_watch ); if( i_flags & DBUS_WATCH_READABLE ) p_fds[i_fds].events |= POLLIN | POLLPRI; if( i_flags & DBUS_WATCH_WRITABLE ) p_fds[i_fds].events |= POLLOUT; i_fds++; } return i_fds;}
开发者ID:iamnpc,项目名称:myfaplayer,代码行数:42,
示例12: UpdateTimeouts/** * UpdateTimeouts() updates the remaining time for each timeout and * returns how much time is left until the next timeout. * * This function must be called with p_sys->lock locked * * @return int The time remaining until the next timeout, in milliseconds * or -1 if there are no timeouts * * @param intf_thread_t *p_intf This interface thread's state * @param mtime_t i_loop_interval The time which has elapsed since the last * call to this function */static int UpdateTimeouts( intf_thread_t *p_intf, mtime_t i_loop_interval ){ intf_sys_t *p_sys = p_intf->p_sys; mtime_t i_next_timeout = LAST_MDATE; unsigned int i_timeouts = vlc_array_count( p_sys->p_timeouts ); if( 0 == i_timeouts ) return -1; for( unsigned int i = 0; i < i_timeouts; i++ ) { timeout_info_t *p_info = NULL; DBusTimeout *p_timeout = NULL; mtime_t i_interval = 0; p_timeout = vlc_array_item_at_index( p_sys->p_timeouts, i ); i_interval = dbus_timeout_get_interval( p_timeout ) * 1000; /* C++ vlc_cancel函数代码示例 C++ vlc_array_count函数代码示例
|