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

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

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

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

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

示例1: vlclua_msg_warn

static int vlclua_msg_warn( lua_State *L ){    int i_top = lua_gettop( L );    vlc_object_t *p_this = vlclua_get_this( L );    int i;    for( i = 1; i <= i_top; i++ )        msg_Warn( p_this, "%s", luaL_checkstring( L, i ) );    return 0;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:9,


示例2: vlclua_fd_get

/** Gets the OS file descriptor mapped to a VLC Lua file descriptor */static int vlclua_fd_get( lua_State *L, unsigned idx ){    intf_thread_t *intf = (intf_thread_t *)vlclua_get_this( L );    intf_sys_t *sys = intf->p_sys;    if( idx < 3u )        return idx;    idx -= 3;    return (idx < sys->fdc) ? sys->fdv[idx] : -1;}
开发者ID:DakaiTV,项目名称:DakaiVLC,代码行数:11,


示例3: vlclua_playlist_enqueue

static int vlclua_playlist_enqueue( lua_State *L ){    int i_count;    vlc_object_t *p_this = vlclua_get_this( L );    playlist_t *p_playlist = vlclua_get_playlist_internal( L );    i_count = vlclua_playlist_add_internal( p_this, L, p_playlist,                                            NULL, false );    lua_pushinteger( L, i_count );    return 1;}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:10,


示例4: vlclua_demux_read

static int vlclua_demux_read( lua_State *L ){    demux_t *p_demux = (demux_t *)vlclua_get_this( L );    const uint8_t *p_read;    int n = luaL_checkint( L, 1 );    int i_read = stream_Peek( p_demux->s, &p_read, n );    lua_pushlstring( L, (const char *)p_read, i_read );    int i_seek = stream_Read( p_demux->s, NULL, i_read );    assert(i_read==i_seek);    return 1;}
开发者ID:shanewfx,项目名称:vlc-arib,代码行数:11,


示例5: vlclua_net_poll

/* Takes a { fd : events } table as first arg and modifies it to { fd : revents } */static int vlclua_net_poll( lua_State *L ){    intf_thread_t *intf = (intf_thread_t *)vlclua_get_this( L );    intf_sys_t *sys = intf->p_sys;    luaL_checktype( L, 1, LUA_TTABLE );    int i_fds = 1;    lua_pushnil( L );    while( lua_next( L, 1 ) )    {        i_fds++;        lua_pop( L, 1 );    }    struct pollfd *p_fds = xmalloc( i_fds * sizeof( *p_fds ) );    int *luafds = xmalloc( i_fds * sizeof( *luafds ) );    lua_pushnil( L );    int i = 1;    p_fds[0].fd = sys->fd[0];    p_fds[0].events = POLLIN;    while( lua_next( L, 1 ) )    {        luafds[i] = luaL_checkinteger( L, -2 );        p_fds[i].fd = vlclua_fd_get( L, luafds[i] );        p_fds[i].events = luaL_checkinteger( L, -1 );        p_fds[i].events &= POLLIN | POLLOUT | POLLPRI;        lua_pop( L, 1 );        i++;    }    int i_ret;    do        i_ret = poll( p_fds, i_fds, -1 );    while( i_ret == -1 && errno == EINTR );    for( i = 1; i < i_fds; i++ )    {        lua_pushinteger( L, luafds[i] );        lua_pushinteger( L, p_fds[i].revents );        lua_settable( L, 1 );    }    lua_pushinteger( L, i_ret );    if( p_fds[0].revents )        i_ret = luaL_error( L, "Interrupted." );    else        i_ret = 1;    free( luafds );    free( p_fds );    return i_ret;}
开发者ID:DakaiTV,项目名称:DakaiVLC,代码行数:55,


示例6: vlclua_fd_get_lua

/** Gets the VLC Lua file descriptor mapped from an OS file descriptor */static int vlclua_fd_get_lua( lua_State *L, int fd ){    intf_thread_t *intf = (intf_thread_t *)vlclua_get_this( L );    intf_sys_t *sys = intf->p_sys;    if( (unsigned)fd < 3u )        return fd;    for( unsigned i = 0; i < sys->fdc; i++ )        if( sys->fdv[i] == fd )            return 3 + i;    return -1;}
开发者ID:DakaiTV,项目名称:DakaiVLC,代码行数:13,


示例7: vlclua_demux_peek

static int vlclua_demux_peek( lua_State *L ){    stream_t *s = (stream_t *)vlclua_get_this(L);    int n = luaL_checkinteger( L, 1 );    const uint8_t *p_peek;    ssize_t val = vlc_stream_Peek(s->s, &p_peek, n);    if (val > 0)        lua_pushlstring(L, (const char *)p_peek, val);    else        lua_pushnil( L );    return 1;}
开发者ID:videolan,项目名称:vlc,代码行数:13,


示例8: vlclua_demux_peek

static int vlclua_demux_peek( lua_State *L ){    demux_t *p_demux = (demux_t *)vlclua_get_this( L );    int n = (int)luaL_checkinteger( L, 1 );    const uint8_t *p_peek;    int i_peek = vlc_stream_Peek( p_demux->s, &p_peek, n );    if( i_peek > 0 )        lua_pushlstring( L, (const char *)p_peek, i_peek );    else        lua_pushnil( L );    return 1;}
开发者ID:rlugojr,项目名称:vlc,代码行数:13,


示例9: vlclua_sd_add_node

static int vlclua_sd_add_node( lua_State *L ){    services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );    if( lua_istable( L, -1 ) )    {        lua_getfield( L, -1, "title" );        if( lua_isstring( L, -1 ) )        {            const char *psz_name = lua_tostring( L, -1 );            input_item_t *p_input = input_item_NewWithType( "vlc://nop",                                                            psz_name, 0, NULL, 0,                                                            -1, ITEM_TYPE_NODE );            lua_pop( L, 1 );            if( p_input )            {                lua_getfield( L, -1, "arturl" );                if( lua_isstring( L, -1 ) && strcmp( lua_tostring( L, -1 ), "" ) )                {                    char *psz_value = strdup( lua_tostring( L, -1 ) );                    EnsureUTF8( psz_value );                    msg_Dbg( p_sd, "ArtURL: %s", psz_value );                    /** @todo Ask for art download if not local file */                    input_item_SetArtURL( p_input, psz_value );                    free( psz_value );                }                lua_pop( L, 1 );                lua_getfield( L, -1, "category" );                if( lua_isstring( L, -1 ) )                    services_discovery_AddItem( p_sd, p_input, luaL_checkstring( L, -1 ) );                else                    services_discovery_AddItem( p_sd, p_input, NULL );                input_item_t **udata = (input_item_t **)                                       lua_newuserdata( L, sizeof( input_item_t * ) );                *udata = p_input;                if( luaL_newmetatable( L, "node" ) )                {                    lua_newtable( L );                    luaL_register( L, NULL, vlclua_node_reg );                    lua_setfield( L, -2, "__index" );                }                lua_setmetatable( L, -2 );            }        }        else            msg_Err( p_sd, "vlc.sd.add_node: the /"title/" parameter can't be empty" );    }    else        msg_Err( p_sd, "Error parsing add_node arguments" );    return 1;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:51,


示例10: vlclua_stream_add_filter

static int vlclua_stream_add_filter( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    /* Make sure that we have 1 argument (+ 1 object) */    lua_settop( L, 2 );    stream_t **pp_stream = (stream_t **)luaL_checkudata( L, 1, "stream" );    if( !*pp_stream ) return vlclua_error( L );    const char *psz_filter = NULL;    if( lua_isstring( L, 2 ) )        psz_filter = lua_tostring( L, 2 );    if( !psz_filter || !*psz_filter )    {        msg_Dbg( p_this, "adding all automatic stream filters" );        while( true )        {            /* Add next automatic stream */            stream_t *p_filtered = vlc_stream_FilterNew( *pp_stream, NULL );            if( !p_filtered )                break;            else            {                msg_Dbg( p_this, "inserted an automatic stream filter" );                *pp_stream = p_filtered;            }        }        luaL_getmetatable( L, "stream" );        lua_setmetatable( L, 1 );    }    else    {        /* Add a named filter */        stream_t *p_filter = vlc_stream_FilterNew( *pp_stream, psz_filter );        if( !p_filter )            msg_Dbg( p_this, "Unable to open requested stream filter '%s'",                     psz_filter );        else        {            *pp_stream = p_filter;            luaL_getmetatable( L, "stream" );            lua_setmetatable( L, 1 );        }    }    return 1;}
开发者ID:mkeiser,项目名称:vlc,代码行数:49,


示例11: vlclua_demux_readline

static int vlclua_demux_readline( lua_State *L ){    stream_t *s = (stream_t *)vlclua_get_this(L);    char *line = vlc_stream_ReadLine(s->s);    if (line != NULL)    {        lua_pushstring(L, line);        free(line);    }    else        lua_pushnil( L );    return 1;}
开发者ID:videolan,项目名称:vlc,代码行数:15,


示例12: vlclua_demux_readline

static int vlclua_demux_readline( lua_State *L ){    demux_t *p_demux = (demux_t *)vlclua_get_this( L );    char *psz_line = stream_ReadLine( p_demux->s );    if( psz_line )    {        lua_pushstring( L, psz_line );        free( psz_line );    }    else    {        lua_pushnil( L );    }    return 1;}
开发者ID:shanewfx,项目名称:vlc-arib,代码行数:15,


示例13: vlclua_stream_new

static int vlclua_stream_new( lua_State *L ){    vlc_object_t * p_this = vlclua_get_this( L );    const char * psz_url = luaL_checkstring( L, 1 );    stream_t *p_stream = vlc_stream_NewURL( p_this, psz_url );    /* XXX: For hysterical raisins, append one inflate decompression stream     * filter automatically (if applicable). */    if( p_stream != NULL )    {        stream_t *inflated = vlc_stream_FilterNew( p_stream, "inflate" );        if( inflated != NULL )            p_stream = inflated;    }    return vlclua_stream_new_inner( L, p_stream );}
开发者ID:chouquette,项目名称:vlc,代码行数:16,


示例14: vlclua_demux_read

static int vlclua_demux_read( lua_State *L ){    demux_t *p_demux = (demux_t *)vlclua_get_this( L );    const uint8_t *p_read;    int n = (int)luaL_checkinteger( L, 1 );    int i_read = vlc_stream_Peek( p_demux->s, &p_read, n );    if( i_read > 0 )    {        lua_pushlstring( L, (const char *)p_read, i_read );        int i_seek = vlc_stream_Read( p_demux->s, NULL, i_read );        assert( i_read == i_seek );    }    else        lua_pushnil( L );    return 1;}
开发者ID:rlugojr,项目名称:vlc,代码行数:18,


示例15: vlclua_libvlc_command

static int vlclua_libvlc_command( lua_State *L ){    vlc_object_t * p_this = vlclua_get_this( L );    const char *psz_cmd;    vlc_value_t val_arg;    psz_cmd = luaL_checkstring( L, 1 );    val_arg.psz_string = strdup( luaL_optstring( L, 2, "" ) );    lua_pop( L, 2 );    int i_type = var_Type( p_this->p_libvlc, psz_cmd );    if( ! (i_type & VLC_VAR_ISCOMMAND) )    {        free( val_arg.psz_string );        return luaL_error( L, "libvlc's /"%s/" is not a command",                           psz_cmd );    }    return vlclua_push_ret( L,                            var_Set( p_this->p_libvlc, psz_cmd, val_arg ) );}
开发者ID:paa,项目名称:vlc,代码行数:19,


示例16: vlclua_httpd_handler_callback

static int vlclua_httpd_handler_callback(     httpd_handler_sys_t *p_sys, httpd_handler_t *p_handler, char *psz_url,     uint8_t *psz_request, int i_type, uint8_t *p_in, int i_in,     char *psz_remote_addr, char *psz_remote_host,     uint8_t **pp_data, int *pi_data ){    VLC_UNUSED(p_handler);    lua_State *L = p_sys->L;    /* function data */    lua_pushvalue( L, 1 );    lua_pushvalue( L, 2 );    /* function data function data */    lua_pushstring( L, psz_url );    /* function data function data url */    lua_pushstring( L, (const char *)psz_request );    /* function data function data url request */    lua_pushinteger( L, i_type ); /* Q: what does i_type stand for? */    /* function data function data url request type */    lua_pushlstring( L, (const char *)p_in, i_in ); /* Q: what do p_in contain? */    /* function data function data url request type in */    lua_pushstring( L, psz_remote_addr );    /* function data function data url request type in addr */    lua_pushstring( L, psz_remote_host );    /* function data function data url request type in addr host */    if( lua_pcall( L, 7, 1, 0 ) )    {        /* function data err */        vlc_object_t *p_this = vlclua_get_this( L );        const char *psz_err = lua_tostring( L, -1 );        msg_Err( p_this, "Error while running the lua HTTPd handler "                 "callback: %s", psz_err );        lua_settop( L, 2 );        /* function data */        return VLC_EGENERIC;    }    /* function data outdata */    *pp_data = vlclua_todata( L, -1, pi_data );    lua_pop( L, 1 );    /* function data */    return VLC_SUCCESS;}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:42,


示例17: vlclua_var_inherit

static int vlclua_var_inherit( lua_State *L ){    vlc_value_t val;    vlc_object_t *p_obj;    if( lua_type( L, 1 ) == LUA_TNIL )        p_obj = vlclua_get_this( L );    else    {        vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" );        p_obj = *pp_obj;    }    const char *psz_var = luaL_checkstring( L, 2 );    int i_type = config_GetType( p_obj, psz_var );    if( var_Inherit( p_obj, psz_var, i_type, &val ) != VLC_SUCCESS )        return 0;    lua_pop( L, 2 );    return vlclua_pushvalue( L, i_type, val, true );}
开发者ID:BossKing,项目名称:vlc,代码行数:20,


示例18: vlclua_demux_read

static int vlclua_demux_read( lua_State *L ){    stream_t *s = (stream_t *)vlclua_get_this(L);    int n = luaL_checkinteger( L, 1 );    char *buf = malloc(n);    if (buf != NULL)    {        ssize_t val = vlc_stream_Read(s->s, buf, n);        if (val > 0)            lua_pushlstring(L, buf, val);        else            lua_pushnil( L );        free(buf);    }    else        lua_pushnil( L );    return 1;}
开发者ID:videolan,项目名称:vlc,代码行数:20,


示例19: vlclua_vlm_new

static int vlclua_vlm_new( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    vlm_t *p_vlm = vlm_New( p_this );    if( !p_vlm )        return luaL_error( L, "Cannot start VLM." );    vlm_t **pp_vlm = lua_newuserdata( L, sizeof( vlm_t * ) );    *pp_vlm = p_vlm;    if( luaL_newmetatable( L, "vlm" ) )    {        lua_newtable( L );        luaL_register( L, NULL, vlclua_vlm_reg );        lua_setfield( L, -2, "__index" );        lua_pushcfunction( L, vlclua_vlm_delete );        lua_setfield( L, -2, "__gc" );    }    lua_setmetatable( L, -2 );    return 1;}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:22,


示例20: vlclua_command

static int vlclua_command( lua_State *L ){    vlc_object_t * p_this = vlclua_get_this( L );    char *psz_msg;    const char *psz_name = luaL_checkstring( L, 1 );    const char *psz_cmd = luaL_checkstring( L, 2 );    const char *psz_arg = luaL_checkstring( L, 3 );    int ret = var_Command( p_this, psz_name, psz_cmd, psz_arg, &psz_msg );    lua_pop( L, 3 );    if( psz_msg )    {        lua_pushstring( L, psz_msg );        free( psz_msg );    }    else    {        lua_pushliteral( L, "" );    }    return vlclua_push_ret( L, ret ) + 1;}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:22,


示例21: vlclua_fd_unmap

/** Unmaps an OS file descriptor from VLC Lua */static void vlclua_fd_unmap( lua_State *L, unsigned idx ){    intf_thread_t *intf = (intf_thread_t *)vlclua_get_this( L );    intf_sys_t *sys = intf->p_sys;    int fd = -1;    if( idx < 3u )        return; /* Never close stdin/stdout/stderr. */    idx -= 3;    if( idx >= sys->fdc )        return;    fd = sys->fdv[idx];    sys->fdc--;    memmove( sys->fdv + idx, sys->fdv + idx + 1,             (sys->fdc - idx) * sizeof (sys->fdv[0]) );    /* realloc() not really needed */#ifndef NDEBUG    for( unsigned i = 0; i < sys->fdc; i++ )        assert( sys->fdv[i] != fd );#endif}
开发者ID:DakaiTV,项目名称:DakaiVLC,代码行数:24,


示例22: vlclua_xml_create_reader

static int vlclua_xml_create_reader( lua_State *L ){    vlc_object_t *obj = vlclua_get_this( L );    stream_t *p_stream = *(stream_t **)luaL_checkudata( L, 2, "stream" );    xml_reader_t *p_reader = xml_ReaderCreate( obj, p_stream );    if( !p_reader )        return luaL_error( L, "XML reader creation failed." );    xml_reader_t **pp_reader = lua_newuserdata( L, sizeof( xml_reader_t * ) );    *pp_reader = p_reader;    if( luaL_newmetatable( L, "xml_reader" ) )    {        lua_newtable( L );        luaL_register( L, NULL, vlclua_xml_reader_reg );        lua_setfield( L, -2, "__index" );        lua_pushcfunction( L, vlclua_xml_reader_delete );        lua_setfield( L, -2, "__gc" );    }    lua_setmetatable( L, -2 );    return 1;}
开发者ID:mstorsjo,项目名称:vlc,代码行数:24,


示例23: vlclua_get_libvlc

static int vlclua_get_libvlc( lua_State *L ){    vlclua_push_vlc_object( L, vlclua_get_this( L )->p_libvlc,                            NULL );    return 1;}
开发者ID:iamnpc,项目名称:myfaplayer,代码行数:6,


示例24: vlclua_menu_prev

static int vlclua_menu_prev( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    osd_MenuPrev( p_this );    return 0;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:6,


示例25: vlclua_menu_activate

static int vlclua_menu_activate( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    osd_MenuActivate( p_this );    return 0;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:6,


示例26: vlclua_menu_down

static int vlclua_menu_down( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    osd_MenuDown( p_this );    return 0;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:6,


示例27: vlclua_menu_next

static int vlclua_menu_next( lua_State *L ){    vlc_object_t *p_this = vlclua_get_this( L );    osd_MenuNext( p_this );    return 0;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:6,



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


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