这篇教程C++ vlc_clone函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vlc_clone函数的典型用法代码示例。如果您正苦于以下问题:C++ vlc_clone函数的具体用法?C++ vlc_clone怎么用?C++ vlc_clone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vlc_clone函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: startbool LinkTracker::start(){ if(vlc_clone(&(this->linkTrachThread), track, (void*)this->curInfo, VLC_THREAD_PRIORITY_LOW)) return false; if(vlc_clone(&(this->linkNotifyThread), update, (void*)this, VLC_THREAD_PRIORITY_LOW)) return false; return true;}
开发者ID:shenhui0509,项目名称:dash,代码行数:8,
示例2: Open/* * Initializes UPNP instance. */static int Open( vlc_object_t *p_this ){ services_discovery_t *p_sd = ( services_discovery_t* )p_this; services_discovery_sys_t *p_sys = ( services_discovery_sys_t * ) calloc( 1, sizeof( services_discovery_sys_t ) ); if( !( p_sd->p_sys = p_sys ) ) return VLC_ENOMEM; p_sd->description = _("Universal Plug'n'Play"); p_sys->p_upnp = UpnpInstanceWrapper::get( p_this, p_sd ); if ( !p_sys->p_upnp ) { free(p_sys); return VLC_EGENERIC; } /* XXX: Contrary to what the libupnp doc states, UpnpSearchAsync is * blocking (select() and send() are called). Therefore, Call * UpnpSearchAsync from an other thread. */ if ( vlc_clone( &p_sys->thread, SearchThread, p_this, VLC_THREAD_PRIORITY_LOW ) ) { p_sys->p_upnp->release( true ); free(p_sys); return VLC_EGENERIC; } return VLC_SUCCESS;}
开发者ID:videolan,项目名称:vlc,代码行数:34,
示例3: EmOpen/** * Wrap an existing X11 window to embed the video. */static int EmOpen (vout_window_t *wnd, const vout_window_cfg_t *cfg){ xcb_window_t window = var_InheritInteger (wnd, "drawable-xid"); if (window == 0) return VLC_EGENERIC; if (AcquireDrawable (VLC_OBJECT(wnd), window)) return VLC_EGENERIC; vout_window_sys_t *p_sys = malloc (sizeof (*p_sys)); xcb_connection_t *conn = xcb_connect (NULL, NULL); if (p_sys == NULL || xcb_connection_has_error (conn)) goto error; p_sys->embedded = true; p_sys->keys = NULL; wnd->handle.xid = window; wnd->control = Control; wnd->sys = p_sys; p_sys->conn = conn; xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply (conn, xcb_get_geometry (conn, window), NULL); if (geo == NULL) { msg_Err (wnd, "bad X11 window 0x%08"PRIx8, window); goto error; } p_sys->root = geo->root; free (geo); if (var_InheritBool (wnd, "keyboard-events")) { p_sys->keys = CreateKeyHandler (VLC_OBJECT(wnd), conn); if (p_sys->keys != NULL) { const uint32_t mask = XCB_CW_EVENT_MASK; const uint32_t values[1] = { XCB_EVENT_MASK_KEY_PRESS, }; xcb_change_window_attributes (conn, window, mask, values); } } CacheAtoms (p_sys); if ((p_sys->keys != NULL) && vlc_clone (&p_sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW)) DestroyKeyHandler (p_sys->keys); xcb_flush (conn); (void) cfg; return VLC_SUCCESS;error: xcb_disconnect (conn); free (p_sys); ReleaseDrawable (VLC_OBJECT(wnd), window); return VLC_EGENERIC;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:63,
示例4: 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;}
开发者ID:cobr123,项目名称:qtVlc,代码行数:61,
示例5: 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;}
开发者ID:poiru,项目名称:vlc-libcad,代码行数:34,
示例6: Open/***************************************************************************** * OpenIntf: initialise interface *****************************************************************************/static int Open ( vlc_object_t *p_this ){ intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys = malloc( sizeof( *p_sys ) ); if( unlikely(p_sys == NULL) ) return VLC_ENOMEM; p_sys->p_motion = motion_create( VLC_OBJECT( p_intf ) ); if( p_sys->p_motion == NULL ) {error: free( p_sys ); return VLC_EGENERIC; } p_intf->p_sys = p_sys; if( vlc_clone( &p_sys->thread, RunIntf, p_intf, VLC_THREAD_PRIORITY_LOW ) ) { motion_destroy( p_sys->p_motion ); goto error; } return VLC_SUCCESS;}
开发者ID:mstorsjo,项目名称:vlc,代码行数:28,
示例7: Openstatic int Open(vlc_object_t *obj){ intf_thread_t *intf = (intf_thread_t *)obj; intf_sys_t *sys = malloc(sizeof (*sys)); if (unlikely(sys == NULL)) return VLC_ENOMEM; intf->p_sys = sys; /* Run the helper thread */ sys->ready = CreateEvent(NULL, FALSE, FALSE, NULL); if (vlc_clone(&sys->thread, HelperThread, intf, VLC_THREAD_PRIORITY_LOW)) { free(sys); msg_Err(intf, "one instance mode DISABLED " "(IPC helper thread couldn't be created)"); return VLC_ENOMEM; } WaitForSingleObject(sys->ready, INFINITE); CloseHandle(sys->ready); return VLC_SUCCESS;}
开发者ID:videolan,项目名称:vlc,代码行数:25,
示例8: OpenVoD/***************************************************************************** * Open: Starts the RTSP server module *****************************************************************************/int OpenVoD( vlc_object_t *p_this ){ vod_t *p_vod = (vod_t *)p_this; vod_sys_t *p_sys = NULL; char *psz_url; p_vod->p_sys = p_sys = malloc( sizeof( vod_sys_t ) ); if( !p_sys ) goto error; psz_url = var_InheritString( p_vod, "rtsp-host" ); if( psz_url == NULL ) p_sys->psz_rtsp_path = strdup( "/" ); else { vlc_url_t url; vlc_UrlParse( &url, psz_url, 0 ); free( psz_url ); if( url.psz_path == NULL ) p_sys->psz_rtsp_path = strdup( "/" ); else if( !( strlen( url.psz_path ) > 0 && url.psz_path[strlen( url.psz_path ) - 1] == '/' ) ) { if( asprintf( &p_sys->psz_rtsp_path, "%s/", url.psz_path ) == -1 ) { p_sys->psz_rtsp_path = NULL; vlc_UrlClean( &url ); goto error; } } else p_sys->psz_rtsp_path = strdup( url.psz_path ); vlc_UrlClean( &url ); } p_vod->pf_media_new = MediaNew; p_vod->pf_media_del = MediaAskDel; p_sys->p_fifo_cmd = block_FifoNew(); if( vlc_clone( &p_sys->thread, CommandThread, p_vod, VLC_THREAD_PRIORITY_LOW ) ) { msg_Err( p_vod, "cannot spawn rtsp vod thread" ); block_FifoRelease( p_sys->p_fifo_cmd ); goto error; } return VLC_SUCCESS;error: if( p_sys ) { free( p_sys->psz_rtsp_path ); free( p_sys ); } return VLC_EGENERIC;}
开发者ID:yexihu,项目名称:vlc-2.2.0-rc2.32-2013,代码行数:63,
示例9: MOVIESOAP_CALLBACK static MOVIESOAP_CALLBACK(InputCbState) { #ifdef MSDEBUG3 msg_Info( p_this, "!!! CALLBACK input state !!! : %s ... new: %d ... old: %d", psz_var, (int) newval.i_int, (int) oldval.i_int ); #endif // Stop or Start filter if (p_loadedFilter) { // spawn new thread to handle Filter restart if (newval.i_int == PLAYING_S) vlc_clone( &thread_for_filter_restart, EP_StartFilter, NULL, VLC_THREAD_PRIORITY_LOW ); else vlc_clone( &thread_for_filter_restart, EP_KillTimers, NULL, VLC_THREAD_PRIORITY_LOW ); } return 0; }
开发者ID:entrity,项目名称:moviesoap,代码行数:16,
示例10: Openstatic int Open(vlc_object_t *obj){ intf_thread_t *intf = (intf_thread_t *)obj; intf_sys_t *sys = malloc(sizeof (*sys)); if (unlikely(sys == NULL)) return VLC_ENOMEM; intf->p_sys = sys; sys->server = var_InheritString(intf, "server"); sys->channel = var_InheritString(intf, "channel"); sys->nick = var_InheritString(intf, "nick"); if(sys->server == NULL) { msg_Err(intf, "No server specified, use --server"); return VLC_SUCCESS; } if(sys->channel == NULL) { msg_Err(intf, "No channel specified, use --channel"); return VLC_SUCCESS; } if(sys->nick == NULL) { msg_Err(intf, "No nickname specified, use --nick"); return VLC_SUCCESS; } if(vlc_clone(&sys->thread, Run, intf, VLC_THREAD_PRIORITY_LOW)) { return VLC_ENOMEM; } return VLC_SUCCESS;}
开发者ID:mistakes-consortium,项目名称:vlc-irc-rc,代码行数:34,
示例11: 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;}
开发者ID:MisTelochka,项目名称:vlc,代码行数:35,
示例12: mallocstruct vlc_h2_output *vlc_h2_output_create(struct vlc_tls *tls, bool client){ struct vlc_h2_output *out = malloc(sizeof (*out)); if (unlikely(out == NULL)) return NULL; out->tls = tls; out->prio.first = NULL; out->prio.last = &out->prio.first; out->queue.first = NULL; out->queue.last = &out->queue.first; out->size = 0; out->failed = false; out->closing = false; vlc_mutex_init(&out->lock); vlc_cond_init(&out->wait); void *(*cb)(void *) = client ? vlc_h2_client_output_thread : vlc_h2_output_thread; if (vlc_clone(&out->thread, cb, out, VLC_THREAD_PRIORITY_INPUT)) { vlc_cond_destroy(&out->wait); vlc_mutex_destroy(&out->lock); free(out); out = NULL; } return out;}
开发者ID:0xheart0,项目名称:vlc,代码行数:30,
示例13: mallocvlc_demux_chained_t *vlc_demux_chained_New(vlc_object_t *parent, const char *name, es_out_t *out){ vlc_demux_chained_t *dc = malloc(sizeof (*dc) + strlen(name) + 1); if (unlikely(dc == NULL)) return NULL; dc->writer = vlc_stream_fifo_New(parent, &dc->reader); if (dc->writer == NULL) { free(dc); return NULL; } dc->stats.position = 0.; dc->stats.length = 0; dc->stats.time = 0; dc->out = out; strcpy(dc->name, name); vlc_mutex_init(&dc->lock); if (vlc_clone(&dc->thread, vlc_demux_chained_Thread, dc, VLC_THREAD_PRIORITY_INPUT)) { vlc_stream_Delete(dc->reader); vlc_stream_fifo_Close(dc->writer); vlc_mutex_destroy(&dc->lock); free(dc); dc = NULL; } return dc;}
开发者ID:videolan,项目名称:vlc,代码行数:33,
示例14: Open/***************************************************************************** * Open: initialize and create stuff *****************************************************************************/static int Open( vlc_object_t *p_this ){ services_discovery_t *p_sd = ( services_discovery_t * )p_this; services_discovery_sys_t *p_sys; if( !( p_sys = malloc( sizeof( services_discovery_sys_t ) ) ) ) return VLC_ENOMEM; p_sd->p_sys = p_sys; p_sd->description = _("MTP devices"); p_sys->psz_name = NULL; vlc_mutex_lock( &mtp_lock ); if( !b_mtp_initialized ) { LIBMTP_Init(); b_mtp_initialized = true; } vlc_mutex_unlock( &mtp_lock ); if (vlc_clone (&p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW)) { free (p_sys); return VLC_EGENERIC; } return VLC_SUCCESS;}
开发者ID:etix,项目名称:vlc,代码行数:29,
示例15: vlc_timer_createint vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data){ struct vlc_timer *timer = malloc (sizeof (*timer)); if (unlikely(timer == NULL)) return ENOMEM; vlc_mutex_init (&timer->lock); vlc_cond_init (&timer->reschedule); assert (func); timer->func = func; timer->data = data; timer->value = 0; timer->interval = 0; atomic_init(&timer->overruns, 0); if (vlc_clone (&timer->thread, vlc_timer_thread, timer, VLC_THREAD_PRIORITY_INPUT)) { vlc_cond_destroy (&timer->reschedule); vlc_mutex_destroy (&timer->lock); free (timer); return ENOMEM; } *id = timer; return 0;}
开发者ID:0xheart0,项目名称:vlc,代码行数:27,
示例16: 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;}
开发者ID:Kubink,项目名称:vlc,代码行数:28,
示例17: spawn_set_p_input /* Set Moviesoap::p_input using a new thread */ void spawn_set_p_input(bool force_overwrite) { if (p_obj) { if (p_playlist == NULL || p_input == NULL || force_overwrite) { vlc_clone( &thread_for_getting_input_thread, EP_SetMoviesoapP_Input, NULL, VLC_THREAD_PRIORITY_LOW ); } } }
开发者ID:entrity,项目名称:moviesoap,代码行数:9,
示例18: Open/***************************************************************************** * Open: initialize module *****************************************************************************/static int Open( vlc_object_t *p_this, enum type_e i_type ){ services_discovery_t *p_sd = ( services_discovery_t* )p_this; services_discovery_sys_t *p_sys; const char *desc; p_sd->p_sys = p_sys = calloc( 1, sizeof( *p_sys) ); if( !p_sys ) return VLC_ENOMEM; p_sys->i_type = i_type; if( p_sys->i_type == Video ) { desc = N_("My Videos"); p_sys->psz_dir[0] = config_GetUserDir( VLC_VIDEOS_DIR ); p_sys->psz_dir[1] = var_CreateGetString( p_sd, "input-record-path" ); p_sys->psz_var = "record-file"; } else if( p_sys->i_type == Audio ) { desc = N_("My Music"); p_sys->psz_dir[0] = config_GetUserDir( VLC_MUSIC_DIR ); p_sys->psz_dir[1] = var_CreateGetString( p_sd, "input-record-path" ); p_sys->psz_var = "record-file"; } else if( p_sys->i_type == Picture ) { desc = N_("My Pictures"); p_sys->psz_dir[0] = config_GetUserDir( VLC_PICTURES_DIR ); p_sys->psz_dir[1] = var_CreateGetString( p_sd, "snapshot-path" ); p_sys->psz_var = "snapshot-file"; } else { free( p_sys ); return VLC_EGENERIC; } p_sd->description = vlc_gettext(desc); var_AddCallback( p_sd->obj.libvlc, p_sys->psz_var, onNewFileAdded, p_sd ); if( vlc_clone( &p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW ) ) { var_DelCallback( p_sd->obj.libvlc, p_sys->psz_var, onNewFileAdded, p_sd ); free( p_sys->psz_dir[1] ); free( p_sys->psz_dir[0] ); free( p_sys ); return VLC_EGENERIC; } return VLC_SUCCESS;}
开发者ID:IAPark,项目名称:vlc,代码行数:60,
示例19: Open/***************************************************************************** * Open: *****************************************************************************/static int Open( vlc_object_t *p_this ){ intf_thread_t *p_intf = (intf_thread_t *)p_this; intf_sys_t *p_sys; p_intf->p_sys = p_sys = calloc( 1, sizeof(*p_sys) ); if( !p_sys ) return VLC_ENOMEM; char *psz_display = var_CreateGetNonEmptyString( p_intf, "x11-display" ); int i_screen_default; p_sys->p_connection = xcb_connect( psz_display, &i_screen_default ); free( psz_display ); if( !p_sys->p_connection ) goto error; /* Get the root windows of the default screen */ const xcb_setup_t* xcbsetup = xcb_get_setup( p_sys->p_connection ); if( !xcbsetup ) goto error; xcb_screen_iterator_t iter = xcb_setup_roots_iterator( xcbsetup ); for( int i = 0; i < i_screen_default; i++ ) { if( !iter.rem ) break; xcb_screen_next( &iter ); } if( !iter.rem ) goto error; p_sys->root = iter.data->root; /* */ p_sys->p_symbols = xcb_key_symbols_alloc( p_sys->p_connection ); // FIXME if( !p_sys->p_symbols ) goto error; Mapping( p_intf ); Register( p_intf ); if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) { Unregister( p_intf ); free( p_sys->p_map ); goto error; } return VLC_SUCCESS;error: if( p_sys->p_symbols ) xcb_key_symbols_free( p_sys->p_symbols ); if( p_sys->p_connection ) xcb_disconnect( p_sys->p_connection ); free( p_sys ); return VLC_EGENERIC;}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:60,
示例20: Open/** * Open the module * @param p_this: the filter object * @return VLC_SUCCESS or vlc error codes */static int Open( vlc_object_t * p_this ){ filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys; /* Test the audio format */ if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 || p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 ) { msg_Warn( p_filter, "bad input or output format" ); return VLC_EGENERIC; } if( !AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) ) { msg_Warn( p_filter, "input and outut are not similar" ); return VLC_EGENERIC; } p_filter->pf_audio_filter = DoWork; p_sys = p_filter->p_sys = (filter_sys_t*)malloc( sizeof( *p_sys ) ); if( !p_sys ) return VLC_ENOMEM; /* Create the object for the thread */ vlc_sem_init( &p_sys->ready, 0 ); p_sys->b_error = false; p_sys->b_quit = false; p_sys->i_width = var_InheritInteger( p_filter, "projectm-width" ); p_sys->i_height = var_InheritInteger( p_filter, "projectm-height" ); p_sys->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio ); vlc_mutex_init( &p_sys->lock ); p_sys->p_buffer = NULL; p_sys->i_buffer_size = 0; p_sys->i_nb_samples = 0; /* Create the thread */ if( vlc_clone( &p_sys->thread, Thread, p_filter, VLC_THREAD_PRIORITY_LOW ) ) goto error; vlc_sem_wait( &p_sys->ready ); if( p_sys->b_error ) { vlc_join( p_sys->thread, NULL ); goto error; } return VLC_SUCCESS;error: vlc_sem_destroy( &p_sys->ready ); free (p_sys ); return VLC_EGENERIC;}
开发者ID:LDiracDelta,项目名称:vlc_censor_plugin,代码行数:59,
示例21: VLC_OBJECTstream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *out ){ vlc_object_t *p_obj = VLC_OBJECT(p_demux); /* We create a stream reader, and launch a thread */ stream_t *s; stream_sys_t *p_sys; s = stream_CommonNew( p_obj ); if( s == NULL ) return NULL; s->p_input = p_demux->p_input; s->pf_read = DStreamRead; s->pf_control= DStreamControl; s->pf_destroy= DStreamDelete; s->p_sys = p_sys = malloc( sizeof( *p_sys) ); if( !s->p_sys ) { stream_Delete( s ); return NULL; } p_sys->i_pos = 0; p_sys->out = out; p_sys->p_block = NULL; p_sys->psz_name = strdup( psz_demux ); p_sys->stats.position = 0.; p_sys->stats.length = 0; p_sys->stats.time = 0; /* decoder fifo */ if( ( p_sys->p_fifo = block_FifoNew() ) == NULL ) { stream_Delete( s ); free( p_sys->psz_name ); free( p_sys ); return NULL; } atomic_init( &p_sys->active, true ); vlc_mutex_init( &p_sys->lock ); if( vlc_clone( &p_sys->thread, DStreamThread, s, VLC_THREAD_PRIORITY_INPUT ) ) { vlc_mutex_destroy( &p_sys->lock ); block_FifoRelease( p_sys->p_fifo ); stream_Delete( s ); free( p_sys->psz_name ); free( p_sys ); return NULL; } return s;}
开发者ID:rohilsurana,项目名称:vlc,代码行数:54,
示例22: playlist_Activate/** * Creates the main playlist thread. */void playlist_Activate( playlist_t *p_playlist ){ playlist_private_t *p_sys = pl_priv(p_playlist); if( vlc_clone( &p_sys->thread, Thread, p_playlist, VLC_THREAD_PRIORITY_LOW ) ) { msg_Err( p_playlist, "cannot spawn playlist thread" ); abort(); }}
开发者ID:EasySoftwares,项目名称:EasyMoviePlayer,代码行数:14,
示例23: Open/** * Open the module. * @param p_this: the filter object * @return VLC_SUCCESS or vlc error codes */static int Open(vlc_object_t * p_this){ filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys; p_sys = p_filter->p_sys = (filter_sys_t*)malloc(sizeof(*p_sys)); if (p_sys == NULL) return VLC_ENOMEM; /* Create the object for the thread */ vlc_sem_init(&p_sys->ready, 0); p_sys->b_error = false; p_sys->i_width = var_InheritInteger(p_filter, "glspectrum-width"); p_sys->i_height = var_InheritInteger(p_filter, "glspectrum-height"); p_sys->i_channels = aout_FormatNbChannels(&p_filter->fmt_in.audio); p_sys->i_prev_nb_samples = 0; p_sys->p_prev_s16_buff = NULL; p_sys->f_rotationAngle = 0; p_sys->f_rotationIncrement = ROTATION_INCREMENT; /* Fetch the FFT window parameters */ window_get_param( VLC_OBJECT( p_filter ), &p_sys->wind_param ); /* Create the FIFO for the audio data. */ p_sys->fifo = block_FifoNew(); if (p_sys->fifo == NULL) goto error; /* Create the thread */ if (vlc_clone(&p_sys->thread, Thread, p_filter, VLC_THREAD_PRIORITY_VIDEO)) goto error; /* Wait for the displaying thread to be ready. */ vlc_sem_wait(&p_sys->ready); if (p_sys->b_error) { vlc_join(p_sys->thread, NULL); goto error; } p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32; p_filter->fmt_out.audio = p_filter->fmt_in.audio; p_filter->pf_audio_filter = DoWork; return VLC_SUCCESS;error: vlc_sem_destroy(&p_sys->ready); free(p_sys); return VLC_EGENERIC;}
开发者ID:jsharma44,项目名称:vlc,代码行数:58,
示例24: Open/** * Open the module * @param p_this: the filter object * @return VLC_SUCCESS or vlc error codes */static int Open( vlc_object_t * p_this ){ filter_t *p_filter = (filter_t *)p_this; filter_sys_t *p_sys; /* Test the audio format */ if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ) { msg_Warn( p_filter, "bad input format" ); return VLC_EGENERIC; } p_sys = p_filter->p_sys = (filter_sys_t*)malloc( sizeof( *p_sys ) ); if( unlikely( !p_sys ) ) { return VLC_ENOMEM; } /* Create the object for the thread */ vlc_sem_init( &p_sys->ready, 0 ); p_sys->b_error = false; p_sys->b_quit = false; p_sys->i_width = var_InheritInteger( p_filter, "vsxu-width" ); p_sys->i_height = var_InheritInteger( p_filter, "vsxu-height" ); p_sys->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio ); vlc_mutex_init( &p_sys->lock ); vlc_mutex_init( &p_sys->cyclic_block_mutex ); p_sys->vsxu_cyclic_buffer = new cyclic_block_queue(); /* Create the thread */ if( vlc_clone( &p_sys->thread, Thread, p_filter, VLC_THREAD_PRIORITY_LOW ) ) goto error; vlc_sem_wait( &p_sys->ready ); if( p_sys->b_error ) { vlc_join( p_sys->thread, NULL ); goto error; } p_filter->fmt_out.audio = p_filter->fmt_in.audio; p_filter->pf_audio_filter = DoWork; return VLC_SUCCESS;error: vlc_sem_destroy( &p_sys->ready ); free (p_sys ); return VLC_EGENERIC;}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:57,
示例25: playlist_Activate/** * Create the main playlist threads. * Additionally to the playlist, this thread controls : * - Statistics * - VLM * /param p_parent * /return an object with a started thread */void playlist_Activate( playlist_t *p_playlist ){ /* */ playlist_private_t *p_sys = pl_priv(p_playlist); /* Start the playlist thread */ if( vlc_clone( &p_sys->thread, Thread, p_playlist, VLC_THREAD_PRIORITY_LOW ) ) { msg_Err( p_playlist, "cannot spawn playlist thread" ); } msg_Dbg( p_playlist, "playlist threads correctly activated" );}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:21,
注:本文中的vlc_clone函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vlc_cond_destroy函数代码示例 C++ vlc_cancel函数代码示例 |