⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vlc_variables.h

📁 mips版本的VLC视频服务器
💻 H
📖 第 1 页 / 共 2 页
字号:
 * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int __var_GetBool( vlc_object_t *p_obj, const char *psz_name ){    vlc_value_t val; val.b_bool = false;    __var_AssertType( p_obj, psz_name, VLC_VAR_BOOL );    if( !__var_Get( p_obj, psz_name, &val ) )        return val.b_bool;    else        return false;}/** * Get a time value * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int64_t __var_GetTime( vlc_object_t *p_obj, const char *psz_name ){    vlc_value_t val; val.i_time = 0L;    __var_AssertType( p_obj, psz_name, VLC_VAR_TIME );    if( !__var_Get( p_obj, psz_name, &val ) )        return val.i_time;    else        return 0;}/** * Get a float value * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline float __var_GetFloat( vlc_object_t *p_obj, const char *psz_name ){    vlc_value_t val; val.f_float = 0.0;    __var_AssertType( p_obj, psz_name, VLC_VAR_FLOAT );    if( !__var_Get( p_obj, psz_name, &val ) )        return val.f_float;    else        return 0.0;}/** * Get a string value * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline char *__var_GetString( vlc_object_t *p_obj, const char *psz_name ){    vlc_value_t val; val.psz_string = NULL;    __var_AssertType( p_obj, psz_name, VLC_VAR_STRING );    if( __var_Get( p_obj, psz_name, &val ) )        return NULL;    else        return val.psz_string;}LIBVLC_USEDstatic inline char *__var_GetNonEmptyString( vlc_object_t *p_obj, const char *psz_name ){    vlc_value_t val;    __var_AssertType( p_obj, psz_name, VLC_VAR_STRING );    if( __var_Get( p_obj, psz_name, &val ) )        return NULL;    if( *val.psz_string )        return val.psz_string;    free( val.psz_string );    return NULL;}/** * __var_GetInteger() with automatic casting */#define var_GetInteger(a,b)   __var_GetInteger( VLC_OBJECT(a),b)/** * __var_GetBool() with automatic casting */#define var_GetBool(a,b)   __var_GetBool( VLC_OBJECT(a),b)/** * __var_GetTime() with automatic casting */#define var_GetTime(a,b)   __var_GetTime( VLC_OBJECT(a),b)/** * __var_GetFloat() with automatic casting */#define var_GetFloat(a,b)   __var_GetFloat( VLC_OBJECT(a),b)/** * __var_GetString() with automatic casting */#define var_GetString(a,b)   __var_GetString( VLC_OBJECT(a),b)#define var_GetNonEmptyString(a,b)   __var_GetNonEmptyString( VLC_OBJECT(a),b)/** * Increment an integer variable * \param p_obj the object that holds the variable * \param psz_name the name of the variable */static inline void __var_IncInteger( vlc_object_t *p_obj, const char *psz_name ){    int i_val = __var_GetInteger( p_obj, psz_name );    __var_SetInteger( p_obj, psz_name, ++i_val );}#define var_IncInteger(a,b) __var_IncInteger( VLC_OBJECT(a), b )/** * Decrement an integer variable * \param p_obj the object that holds the variable * \param psz_name the name of the variable */static inline void __var_DecInteger( vlc_object_t *p_obj, const char *psz_name ){    int i_val = __var_GetInteger( p_obj, psz_name );    __var_SetInteger( p_obj, psz_name, --i_val );}#define var_DecInteger(a,b) __var_DecInteger( VLC_OBJECT(a), b )/** * Create a integer variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int __var_CreateGetInteger( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );    return __var_GetInteger( p_obj, psz_name );}/** * Create a boolean variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int __var_CreateGetBool( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_BOOL | VLC_VAR_DOINHERIT );    return __var_GetBool( p_obj, psz_name );}/** * Create a time variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int64_t __var_CreateGetTime( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_TIME | VLC_VAR_DOINHERIT );    return __var_GetTime( p_obj, psz_name );}/** * Create a float variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline float __var_CreateGetFloat( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );    return __var_GetFloat( p_obj, psz_name );}/** * Create a string variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline char *__var_CreateGetString( vlc_object_t *p_obj,                                           const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_STRING | VLC_VAR_DOINHERIT );    return __var_GetString( p_obj, psz_name );}LIBVLC_USEDstatic inline char *__var_CreateGetNonEmptyString( vlc_object_t *p_obj,                                                   const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_STRING | VLC_VAR_DOINHERIT );    return __var_GetNonEmptyString( p_obj, psz_name );}/** * __var_CreateGetInteger() with automatic casting */#define var_CreateGetInteger(a,b)   __var_CreateGetInteger( VLC_OBJECT(a),b)/** * __var_CreateGetBool() with automatic casting */#define var_CreateGetBool(a,b)   __var_CreateGetBool( VLC_OBJECT(a),b)/** * __var_CreateGetTime() with automatic casting */#define var_CreateGetTime(a,b)   __var_CreateGetTime( VLC_OBJECT(a),b)/** * __var_CreateGetFloat() with automatic casting */#define var_CreateGetFloat(a,b)   __var_CreateGetFloat( VLC_OBJECT(a),b)/** * __var_CreateGetString() with automatic casting */#define var_CreateGetString(a,b)   __var_CreateGetString( VLC_OBJECT(a),b)#define var_CreateGetNonEmptyString(a,b)   __var_CreateGetNonEmptyString( VLC_OBJECT(a),b)/** * Create a integer command variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int __var_CreateGetIntegerCommand( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_INTEGER | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetInteger( p_obj, psz_name );}/** * Create a boolean command variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int __var_CreateGetBoolCommand( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_BOOL | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetBool( p_obj, psz_name );}/** * Create a time command variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline int64_t __var_CreateGetTimeCommand( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_TIME | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetTime( p_obj, psz_name );}/** * Create a float command variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline float __var_CreateGetFloatCommand( vlc_object_t *p_obj, const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_FLOAT | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetFloat( p_obj, psz_name );}/** * Create a string command variable with inherit and get its value. * * \param p_obj The object that holds the variable * \param psz_name The name of the variable */LIBVLC_USEDstatic inline char *__var_CreateGetStringCommand( vlc_object_t *p_obj,                                           const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_STRING | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetString( p_obj, psz_name );}LIBVLC_USEDstatic inline char *__var_CreateGetNonEmptyStringCommand( vlc_object_t *p_obj,                                                   const char *psz_name ){    __var_Create( p_obj, psz_name, VLC_VAR_STRING | VLC_VAR_DOINHERIT                                   | VLC_VAR_ISCOMMAND );    return __var_GetNonEmptyString( p_obj, psz_name );}/** * __var_CreateGetInteger() with automatic casting */#define var_CreateGetIntegerCommand(a,b)   __var_CreateGetIntegerCommand( VLC_OBJECT(a),b)/** * __var_CreateGetBoolCommand() with automatic casting */#define var_CreateGetBoolCommand(a,b)   __var_CreateGetBoolCommand( VLC_OBJECT(a),b)/** * __var_CreateGetTimeCommand() with automatic casting */#define var_CreateGetTimeCommand(a,b)   __var_CreateGetTimeCommand( VLC_OBJECT(a),b)/** * __var_CreateGetFloat() with automatic casting */#define var_CreateGetFloatCommand(a,b)   __var_CreateGetFloatCommand( VLC_OBJECT(a),b)/** * __var_CreateGetStringCommand() with automatic casting */#define var_CreateGetStringCommand(a,b)   __var_CreateGetStringCommand( VLC_OBJECT(a),b)#define var_CreateGetNonEmptyStringCommand(a,b)   __var_CreateGetNonEmptyStringCommand( VLC_OBJECT(a),b)/** * @} */#endif /*  _VLC_VARIABLES_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -