您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vlc_mutex_init函数代码示例

51自学网 2021-06-03 09:44:36
  C++
这篇教程C++ vlc_mutex_init函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vlc_mutex_init函数的典型用法代码示例。如果您正苦于以下问题:C++ vlc_mutex_init函数的具体用法?C++ vlc_mutex_init怎么用?C++ vlc_mutex_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vlc_mutex_init函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: 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 )        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;    }    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:orewatakesi,项目名称:VLC-for-VS2010,代码行数:47,


示例2: Open

/***************************************************************************** * Open: initialize and create stuff *****************************************************************************/static int Open( vlc_object_t *p_this ){    playlist_t *pl = pl_Get( p_this );    services_discovery_t *p_sd = ( services_discovery_t* )p_this;    services_discovery_sys_t *p_sys  = malloc(                                    sizeof( services_discovery_sys_t ) );    if( !p_sys )        return VLC_ENOMEM;    p_sys->i_urls = 0;    p_sys->ppsz_urls = NULL;    p_sys->i_input = 0;    p_sys->pp_input = NULL;    p_sys->pp_items = NULL;    p_sys->i_items = 0;    vlc_mutex_init( &p_sys->lock );    vlc_cond_init( &p_sys->wait );    p_sys->b_update = true;    p_sys->b_savedurls_loaded = false;    p_sys->psz_request = NULL;    p_sys->update_type = UPDATE_URLS;    p_sd->p_sys  = p_sys;    /* Launch the callback associated with this variable */    var_Create( pl, "podcast-urls", VLC_VAR_STRING | VLC_VAR_DOINHERIT );    var_AddCallback( pl, "podcast-urls", UrlsChange, p_sys );    var_Create( pl, "podcast-request", VLC_VAR_STRING );    var_AddCallback( pl, "podcast-request", Request, p_sys );    if (vlc_clone (&p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW))    {        var_DelCallback( pl, "podcast-request", Request, p_sys );        var_DelCallback( pl, "podcast-urls", UrlsChange, p_sys );        vlc_cond_destroy( &p_sys->wait );        vlc_mutex_destroy( &p_sys->lock );        free (p_sys);        return VLC_EGENERIC;    }    return VLC_SUCCESS;}
开发者ID:andronmobi,项目名称:vlc-parrot-asteroid,代码行数:45,


示例3: CreateFilter

/***************************************************************************** * CreateFilter: allocates marquee video filter *****************************************************************************/static int CreateFilter( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    /* Allocate structure */    p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );    if( p_sys == NULL )        return VLC_ENOMEM;    vlc_mutex_init( &p_sys->lock );    p_sys->p_style = text_style_New();    config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,                       p_filter->p_cfg );#define CREATE_VAR( stor, type, var ) /    p_sys->stor = var_CreateGet##type##Command( p_filter, var ); /    var_AddCallback( p_filter, var, MarqueeCallback, p_sys );    p_sys->b_need_update = true;    CREATE_VAR( i_xoff, Integer, "marq-x" );    CREATE_VAR( i_yoff, Integer, "marq-y" );    CREATE_VAR( i_timeout,Integer, "marq-timeout" );    p_sys->i_refresh = 1000 * var_CreateGetIntegerCommand( p_filter,                                                           "marq-refresh" );    var_AddCallback( p_filter, "marq-refresh", MarqueeCallback, p_sys );    CREATE_VAR( i_pos, Integer, "marq-position" );    CREATE_VAR( psz_marquee, String, "marq-marquee" );    p_sys->p_style->i_font_alpha = 255 - var_CreateGetIntegerCommand( p_filter,                                                            "marq-opacity" );    var_AddCallback( p_filter, "marq-opacity", MarqueeCallback, p_sys );    CREATE_VAR( p_style->i_font_color, Integer, "marq-color" );    CREATE_VAR( p_style->i_font_size, Integer, "marq-size" );    /* Misc init */    p_filter->pf_sub_filter = Filter;    p_sys->last_time = 0;    return VLC_SUCCESS;}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:45,


示例4: vlc_interrupt_init

/** * Initializes an interruption context. */void vlc_interrupt_init(vlc_interrupt_t *ctx){    vlc_rwlock_wrlock(&vlc_interrupt_lock);    assert(vlc_interrupt_refs < UINT_MAX);    if (vlc_interrupt_refs++ == 0)#ifndef NDEBUG        vlc_threadvar_create(&vlc_interrupt_var, vlc_interrupt_destructor);#else        vlc_threadvar_create(&vlc_interrupt_var, NULL);#endif    vlc_rwlock_unlock(&vlc_interrupt_lock);    vlc_mutex_init(&ctx->lock);    ctx->interrupted = false;    atomic_init(&ctx->killed, false);#ifndef NDEBUG    ctx->attached = false;#endif    ctx->callback = NULL;}
开发者ID:0xheart0,项目名称:vlc,代码行数:23,


示例5: malloc

/***************************************************************************** * Public functions *****************************************************************************/playlist_preparser_t *playlist_preparser_New( vlc_object_t *parent ){    playlist_preparser_t *p_preparser = malloc( sizeof(*p_preparser) );    if( !p_preparser )        return NULL;    p_preparser->object = parent;    p_preparser->p_fetcher = playlist_fetcher_New( parent );    if( unlikely(p_preparser->p_fetcher == NULL) )        msg_Err( parent, "cannot create fetcher" );    vlc_mutex_init( &p_preparser->lock );    vlc_cond_init( &p_preparser->wait );    vlc_sem_init( &p_preparser->item_done, 0 );    p_preparser->b_live = false;    p_preparser->i_waiting = 0;    p_preparser->pp_waiting = NULL;    return p_preparser;}
开发者ID:mingyueqingquan,项目名称:vlc,代码行数:23,


示例6: libvlc_InternalDialogInit

intlibvlc_InternalDialogInit(libvlc_int_t *p_libvlc){    assert(p_libvlc != NULL);    vlc_dialog_provider *p_provider = malloc(sizeof(*p_provider));    if (p_provider == NULL)        return VLC_EGENERIC;    vlc_mutex_init(&p_provider->lock);    vlc_array_init(&p_provider->dialog_array);    memset(&p_provider->cbs, 0, sizeof(p_provider->cbs));    p_provider->p_cbs_data = NULL;    p_provider->pf_ext_update = NULL;    p_provider->p_ext_data = NULL;    libvlc_priv(p_libvlc)->p_dialog_provider = p_provider;    return VLC_SUCCESS;}
开发者ID:IAPark,项目名称:vlc,代码行数:20,


示例7: Create

static int Create( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_YUVA )    {        msg_Err( p_filter,                 "Unsupported input chroma /"%4.4s/". "                 "Bluescreen can only use /"YUVA/".",                 (char*)&p_filter->fmt_in.video.i_chroma );        return VLC_EGENERIC;    }    /* Allocate structure */    p_filter->p_sys = malloc( sizeof( filter_sys_t ) );    if( p_filter->p_sys == NULL )        return VLC_ENOMEM;    p_sys = p_filter->p_sys;    config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,                       p_filter->p_cfg );    int val;    vlc_mutex_init( &p_sys->lock );#define GET_VAR( name, min, max )                                           /    val = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX #name );        /    p_sys->i_##name = __MIN( max, __MAX( min, val ) );                      /    var_AddCallback( p_filter, CFG_PREFIX #name, BluescreenCallback, p_sys );    GET_VAR( u, 0x00, 0xff );    GET_VAR( v, 0x00, 0xff );    GET_VAR( ut, 0x00, 0xff );    GET_VAR( vt, 0x00, 0xff );    p_sys->p_at = NULL;#undef GET_VAR    p_filter->pf_video_filter = Filter;    return VLC_SUCCESS;}
开发者ID:banketree,项目名称:faplayer,代码行数:41,


示例8: libvlc_new

libvlc_instance_t * libvlc_new( int argc, const char *const *argv ){    libvlc_threads_init ();    libvlc_instance_t *p_new = malloc (sizeof (*p_new));    if (unlikely(p_new == NULL))        return NULL;//    const char *my_argv[argc + 2];	const char **my_argv = (const char **)malloc(sizeof(char *) * (argc + 2));			// sunqueen modify    my_argv[0] = "libvlc"; /* dummy arg0, skipped by getopt() et al */    for( int i = 0; i < argc; i++ )         my_argv[i + 1] = argv[i];    my_argv[argc + 1] = NULL; /* C calling conventions require a NULL */    libvlc_int_t *p_libvlc_int = libvlc_InternalCreate();    if (unlikely (p_libvlc_int == NULL))        goto error;    if (libvlc_InternalInit( p_libvlc_int, argc + 1, my_argv ))    {        libvlc_InternalDestroy( p_libvlc_int );        goto error;    }    p_new->p_libvlc_int = p_libvlc_int;    p_new->libvlc_vlm.p_vlm = NULL;    p_new->libvlc_vlm.p_event_manager = NULL;    p_new->libvlc_vlm.pf_release = NULL;    p_new->ref_count = 1;    p_new->p_callback_list = NULL;    vlc_mutex_init(&p_new->instance_lock);	free( my_argv );			// sunqueen add    return p_new;error:    free (p_new);	free( my_argv );			// sunqueen add    libvlc_threads_deinit ();    return NULL;}
开发者ID:839687571,项目名称:vlc-2.2.1.32-2013,代码行数:41,


示例9: Open

/***************************************************************************** * Open: initialize 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 (intf_sys_t) );    if( p_sys == NULL )        return VLC_ENOMEM;    p_intf->p_sys = p_sys;    p_sys->hotkeyWindow = NULL;    vlc_mutex_init( &p_sys->lock );    vlc_cond_init( &p_sys->wait );    if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )    {        vlc_mutex_destroy( &p_sys->lock );        vlc_cond_destroy( &p_sys->wait );        free( p_sys );        p_intf->p_sys = NULL;        return VLC_ENOMEM;    }    vlc_mutex_lock( &p_sys->lock );    while( p_sys->hotkeyWindow == NULL )        vlc_cond_wait( &p_sys->wait, &p_sys->lock );    if( p_sys->hotkeyWindow == INVALID_HANDLE_VALUE )    {        vlc_mutex_unlock( &p_sys->lock );        vlc_join( p_sys->thread, NULL );        vlc_mutex_destroy( &p_sys->lock );        vlc_cond_destroy( &p_sys->wait );        free( p_sys );        p_intf->p_sys = NULL;        return VLC_ENOMEM;    }    vlc_mutex_unlock( &p_sys->lock );    return VLC_SUCCESS;}
开发者ID:BossKing,项目名称:vlc,代码行数:44,


示例10: Open

static int Open( vlc_object_t *p_this ){    int res;    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;    res = UpnpInit( 0, 0 );    if( res != UPNP_E_SUCCESS )    {        msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );        free( p_sys );        return VLC_EGENERIC;    }    p_sys->serverList = new MediaServerList( p_sd );    vlc_mutex_init( &p_sys->callbackLock );    res = UpnpRegisterClient( Callback, p_sd, &p_sys->clientHandle );    if( res != UPNP_E_SUCCESS )    {        msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );        Close( (vlc_object_t*) p_sd );        return VLC_EGENERIC;    }    res = UpnpSearchAsync( p_sys->clientHandle, 5,            MEDIA_SERVER_DEVICE_TYPE, p_sd );    if( res != UPNP_E_SUCCESS )    {        msg_Err( p_sd, "%s", UpnpGetErrorMessage( res ) );        Close( (vlc_object_t*) p_sd );        return VLC_EGENERIC;    }    return VLC_SUCCESS;}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:41,


示例11: libvlc_event_async_init

/************************************************************************** *       libvlc_event_async_init (private) : * * Destroy what might have been created by. **************************************************************************/static voidlibvlc_event_async_init(libvlc_event_manager_t * p_em){    p_em->async_event_queue = calloc(1, sizeof(struct libvlc_event_async_queue));    int error = vlc_threadvar_create(&queue(p_em)->is_asynch_dispatch_thread_var, NULL);    assert(!error);    vlc_mutex_init(&queue(p_em)->lock);    vlc_cond_init(&queue(p_em)->signal);    vlc_cond_init(&queue(p_em)->signal_idle);    error = vlc_clone (&queue(p_em)->thread, event_async_loop, p_em, VLC_THREAD_PRIORITY_LOW);    if(error)    {        free(p_em->async_event_queue);        p_em->async_event_queue = NULL;        return;    }}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:26,


示例12: Open

/** * Open the filter */static int Open( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    /* */    if( !es_format_IsSimilar( &p_filter->fmt_in, &p_filter->fmt_out ) )    {        msg_Err( p_filter, "Input and output format does not match" );        return VLC_EGENERIC;    }    /* Allocate structure */    p_filter->p_sys = p_sys = malloc( sizeof( *p_sys ) );    if( !p_sys )        return VLC_ENOMEM;    config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,                       p_filter->p_cfg );    p_sys->pi_order = NULL;    vlc_mutex_init( &p_sys->lock );    p_sys->change.i_rows =        var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "rows" );    p_sys->change.i_cols =        var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "cols" );    p_sys->change.b_blackslot =        var_CreateGetBoolCommand( p_filter, CFG_PREFIX "black-slot" );    p_sys->b_change = true;    var_AddCallback( p_filter, CFG_PREFIX "rows", PuzzleCallback, p_sys );    var_AddCallback( p_filter, CFG_PREFIX "cols", PuzzleCallback, p_sys );    var_AddCallback( p_filter, CFG_PREFIX "black-slot", PuzzleCallback, p_sys );    p_filter->pf_video_filter = Filter;    p_filter->pf_video_mouse = Mouse;    return VLC_SUCCESS;}
开发者ID:paa,项目名称:vlc,代码行数:43,


示例13: Create

/***************************************************************************** * Create: allocates adjust video thread output method ***************************************************************************** * This function allocates and initializes a adjust vout method. *****************************************************************************/static int Create( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    /* Allocate structure */    p_filter->p_sys = malloc( sizeof( filter_sys_t ) );    if( p_filter->p_sys == NULL )        return VLC_ENOMEM;    p_sys = p_filter->p_sys;    BufferInit( &p_sys->input );    BufferInit( &p_sys->output );    QueueInit( &p_sys->atomic );    QueueInit( &p_sys->pending );    QueueInit( &p_sys->processed );    do_ListInit( &p_sys->overlays );    p_sys->i_inputfd = -1;    p_sys->i_outputfd = -1;    p_sys->b_updated = true;    p_sys->b_atomic = false;    vlc_mutex_init( &p_sys->lock );    p_filter->pf_sub_source = Filter;    config_ChainParse( p_filter, "overlay-", ppsz_filter_options,                       p_filter->p_cfg );    p_sys->psz_inputfile = var_CreateGetStringCommand( p_filter,                                                       "overlay-input" );    p_sys->psz_outputfile = var_CreateGetStringCommand( p_filter,                                                        "overlay-output" );    var_AddCallback( p_filter, "overlay-input", AdjustCallback, p_sys );    var_AddCallback( p_filter, "overlay-output", AdjustCallback, p_sys );    RegisterCommand( p_filter );    return VLC_SUCCESS;}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:45,


示例14: dialog_add_locked

static vlc_dialog_id *dialog_add_locked(vlc_dialog_provider *p_provider, enum dialog_type i_type){    vlc_dialog_id *p_id = calloc(1, sizeof(*p_id));    if (p_id == NULL)        return NULL;    if(vlc_array_append(&p_provider->dialog_array, p_id))    {        free(p_id);        return NULL;    }    vlc_mutex_init(&p_id->lock);    vlc_cond_init(&p_id->wait);    p_id->i_type = i_type;    p_id->i_refcount = 2; /* provider and callbacks */    return p_id;}
开发者ID:videolan,项目名称:vlc,代码行数:22,


示例15: malloc

module_t *vlc_module_create (vlc_object_t *obj){    module_t *module = malloc (sizeof (*module));    if (module == NULL)        return NULL;    module->psz_object_name = strdup( default_name );    module->next = NULL;    module->submodule = NULL;    module->parent = NULL;    module->submodule_count = 0;    vlc_gc_init (module, vlc_module_destruct);    vlc_mutex_init (&module->lock);    module->psz_shortname = NULL;    module->psz_longname = (char*)default_name;    module->psz_help = NULL;    for (unsigned i = 0; i < MODULE_SHORTCUT_MAX; i++)        module->pp_shortcuts[i] = NULL;    module->psz_capability = (char*)"";    module->i_score = 1;    module->i_cpu = 0;    module->b_unloadable = true;    module->b_reentrant = true;    module->b_submodule = false;    module->pf_activate = NULL;    module->pf_deactivate = NULL;    module->p_config = NULL;    module->confsize = 0;    module->i_config_items = 0;    module->i_bool_items = 0;    /*module->handle = garbage */    module->psz_filename = NULL;    module->b_builtin = false;    module->b_loaded = false;    (void)obj;    return module;}
开发者ID:MisTelochka,项目名称:vlc,代码行数:39,


示例16: NAME

JNIEXPORT void JNICALL NAME(nativeCreate)(JNIEnv *env, jobject thiz){    initClasses(env, thiz);    vlc_mutex_t *parse_lock = calloc(1, sizeof(vlc_mutex_t));    vlc_mutex_init(parse_lock);    setIntValue(env, thiz, "mNativeMediaParseLock", (jint) parse_lock);    vlc_cond_t *parse_cond = calloc(1, sizeof(vlc_cond_t));    vlc_cond_init(parse_cond);    setIntValue(env, thiz, "mNativeMediaParseCond", (jint) parse_cond);    setIntValue(env, thiz, "mNativeMediaBufferingCount", 0);    const char *argv[] = {"-I", "dummy", "-vvv", "--no-plugins-cache", "--no-drop-late-frames", "--input-timeshift-path", "/data/local/tmp"};    libvlc_instance_t *instance = libvlc_new_with_builtins(sizeof(argv) / sizeof(*argv), argv, vlc_builtins_modules);    setIntValue(env, thiz, "mLibVlcInstance", (jint) instance);    libvlc_media_player_t *mp = libvlc_media_player_new(instance);    setIntValue(env, thiz, "mLibVlcMediaPlayer", (jint) mp);    /* throw? */    libvlc_event_manager_t *em = libvlc_media_player_event_manager(mp);    for (int i = 0; i < sizeof(mp_listening) / sizeof(*mp_listening); i++)    {        libvlc_event_attach(em, mp_listening[i], vlc_event_callback, thiz);    }}
开发者ID:OneDream,项目名称:faplayer,代码行数:22,


示例17: Open

/***************************************************************************** * Open: *****************************************************************************/static int Open( vlc_object_t *p_this ){    filter_t     *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||        p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )    {        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 ) )    {        memcpy( &p_filter->fmt_out.audio, &p_filter->fmt_in.audio,                sizeof(audio_sample_format_t) );        msg_Warn( p_filter, "input and output formats are not similar" );        return VLC_EGENERIC;    }    p_filter->pf_audio_filter = DoWork;    /* Allocate structure */    p_sys = p_filter->p_sys = malloc( sizeof( *p_sys ) );    if( !p_sys )        return VLC_ENOMEM;    vlc_mutex_init( &p_sys->lock );    if( EqzInit( p_filter, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS )    {        vlc_mutex_destroy( &p_sys->lock );        free( p_sys );        return VLC_EGENERIC;    }    return VLC_SUCCESS;}
开发者ID:hustcalm,项目名称:vlc-player,代码行数:41,


示例18: __intf_Create

/** * Create the interface, and prepare it for main loop. * * /param p_this the calling vlc_object_t * /param psz_module a preferred interface module * /return a pointer to the created interface thread, NULL on error */intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module ){    intf_thread_t * p_intf;    /* Allocate structure */    p_intf = vlc_object_create( p_this, VLC_OBJECT_INTF );    if( !p_intf )        return NULL;    p_intf->b_interaction = false;#if defined( __APPLE__ ) || defined( WIN32 )    p_intf->b_should_run_on_first_thread = false;#endif    /* Choose the best module */    p_intf->psz_intf = strdup( psz_module );    p_intf->p_module = module_Need( p_intf, "interface", psz_module, false );    if( p_intf->p_module == NULL )    {        msg_Err( p_intf, "no suitable interface module" );        free( p_intf->psz_intf );        vlc_object_release( p_intf );        return NULL;    }    /* Initialize structure */    p_intf->b_menu        = false;    p_intf->b_menu_change = false;    /* Initialize mutexes */    vlc_mutex_init( &p_intf->change_lock );    /* Attach interface to its parent object */    vlc_object_attach( p_intf, p_this );    vlc_object_set_destructor( p_intf, intf_Destroy );    return p_intf;}
开发者ID:mahaserver,项目名称:MHSVLC,代码行数:45,


示例19: Open

/***************************************************************************** * Open: *****************************************************************************/static int Open( vlc_object_t *p_this ){    filter_t     *p_filter = (filter_t *)p_this;    /* Allocate structure */    filter_sys_t *p_sys = p_filter->p_sys = malloc( sizeof( *p_sys ) );    if( !p_sys )        return VLC_ENOMEM;    vlc_mutex_init( &p_sys->lock );    if( EqzInit( p_filter, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS )    {        vlc_mutex_destroy( &p_sys->lock );        free( p_sys );        return VLC_EGENERIC;    }    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;}
开发者ID:andronmobi,项目名称:vlc-parrot-asteroid,代码行数:26,


示例20: background_worker_New

struct background_worker* background_worker_New( void* owner,    struct background_worker_config* conf ){    struct background_worker* worker = malloc( sizeof *worker );    if( unlikely( !worker ) )        return NULL;    worker->conf = *conf;    worker->owner = owner;    worker->head.id = NULL;    worker->head.active = false;    worker->head.deadline = VLC_TS_INVALID;    vlc_mutex_init( &worker->lock );    vlc_cond_init( &worker->head.wait );    vlc_cond_init( &worker->head.worker_wait );    vlc_array_init( &worker->tail.data );    vlc_cond_init( &worker->tail.wait );    return worker;}
开发者ID:tguillem,项目名称:vlc,代码行数:23,


示例21: libvlc_event_manager_new

/************************************************************************** *       libvlc_event_manager_new (internal) : * * Init an object's event manager. **************************************************************************/libvlc_event_manager_t *libvlc_event_manager_new( void * p_obj, libvlc_instance_t * p_libvlc_inst ){    libvlc_event_manager_t * p_em;    p_em = malloc(sizeof( libvlc_event_manager_t ));    if( !p_em )    {        libvlc_printerr( "Not enough memory" );        return NULL;    }    p_em->p_obj = p_obj;    p_em->p_obj = p_obj;    p_em->async_event_queue = NULL;    p_em->p_libvlc_instance = p_libvlc_inst;    libvlc_retain( p_libvlc_inst );    vlc_array_init( &p_em->listeners_groups );    vlc_mutex_init( &p_em->object_lock );    vlc_mutex_init_recursive( &p_em->event_sending_lock );    return p_em;}
开发者ID:AsamQi,项目名称:vlc,代码行数:28,


示例22: init

	/* Set vars, config. (Called by VLCMenuBar::createMenuBar in menus.cpp) */	void init( intf_thread_t * p_intf, MainInterface * mainInterface, QMenu * p_menu )	{		// Set namespace vars		Moviesoap::p_GuiMenu = (Moviesoap::Menu *) p_menu;		Moviesoap::p_obj = VLC_OBJECT(p_intf);		Moviesoap::p_playlist = pl_Get(p_intf);		vlc_mutex_init( &lock );		#ifdef MSDEBUG1			msg_Info( p_obj, "Moviesoap::init in progress..." );		#endif		// build config (tolerances) from file or defaults		config.load();		// Create variable pointer to blackout config		#define MOVIESOAP_BLACKOUT_CONFIG_POINTER		var_CreateGetAddress( p_obj->p_libvlc, MOVIESOAP_BLACKOUT_VARNAME);		var_SetAddress( p_obj->p_libvlc, MOVIESOAP_BLACKOUT_VARNAME, &blackout_config );		// Add callback(s) to playlist		var_AddCallback( p_playlist, "item-change", PCB_ItemChange, NULL );		// Add callback(s) to root    	var_AddCallback( p_intf->p_libvlc, "key-pressed", CB_KeyEvent, p_intf );		// Check for updates		vlc_clone( &thread_for_http, handleUpdateCheck, p_intf, VLC_THREAD_PRIORITY_LOW );	}
开发者ID:entrity,项目名称:moviesoap,代码行数:24,


示例23: 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));    msg_Dbg(p_intf, "Entering Open()");    if (!p_sys)        return VLC_ENOMEM;    p_intf->p_sys = p_sys;    vlc_mutex_init(&p_sys->lock);    vlc_cond_init(&p_sys->wait);    var_AddCallback(pl_Get(p_intf), "item-current", ItemChange, p_intf);    msg_Dbg(p_intf, "Added Item Change Callback");    p_intf->pf_run = Run;    return VLC_SUCCESS;}
开发者ID:watchedit,项目名称:vlc-module,代码行数:26,


示例24: calloc

static picture_t *PictureAlloc(vout_display_sys_t *sys, video_format_t *fmt,                               bool b_opaque){    picture_t *p_pic;    picture_resource_t rsc;    picture_sys_t *p_picsys = calloc(1, sizeof(*p_picsys));    if (unlikely(p_picsys == NULL))        return NULL;    memset(&rsc, 0, sizeof(picture_resource_t));    rsc.p_sys = p_picsys;    if (b_opaque)    {        p_picsys->hw.b_vd_ref = true;        p_picsys->hw.p_surface = sys->p_window->p_surface;        p_picsys->hw.p_jsurface =  sys->p_window->p_jsurface;        p_picsys->hw.i_index = -1;        vlc_mutex_init(&p_picsys->hw.lock);        rsc.pf_destroy = AndroidOpaquePicture_DetachVout;    }    else    {        p_picsys->sw.p_vd_sys = sys;        rsc.pf_destroy = AndroidPicture_Destroy;    }    p_pic = picture_NewFromResource(fmt, &rsc);    if (!p_pic)    {        free(p_picsys);        return NULL;    }    return p_pic;}
开发者ID:mstorsjo,项目名称:vlc,代码行数:37,


示例25: CommonInit

int CommonInit( vout_thread_t *p_vout ){    vout_sys_t *p_sys = p_vout->p_sys;    p_sys->hwnd      = NULL;    p_sys->hvideownd = NULL;    p_sys->hparent   = NULL;    p_sys->hfswnd    = NULL;    p_sys->i_changes = 0;    SetRectEmpty( &p_sys->rect_display );    SetRectEmpty( &p_sys->rect_parent );    vlc_mutex_init( &p_sys->lock );    var_Create( p_vout, "video-title", VLC_VAR_STRING | VLC_VAR_DOINHERIT );    /* Set main window's size */    p_sys->i_window_width  = p_vout->i_window_width;    p_sys->i_window_height = p_vout->i_window_height;    p_sys->p_event = EventThreadCreate( p_vout );    if( !p_sys->p_event )        return VLC_EGENERIC;    if( EventThreadStart( p_sys->p_event ) )        return VLC_EGENERIC;    /* Variable to indicate if the window should be on top of others */    /* Trigger a callback right now */    var_TriggerCallback( p_vout, "video-on-top" );    /* Why not with glwin32 */#if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)    var_Create( p_vout, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );    DisableScreensaver ( p_vout );#endif    return VLC_SUCCESS;}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:37,



注:本文中的vlc_mutex_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vlc_mutex_lock函数代码示例
C++ vlc_mutex_destroy函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。