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

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

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

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

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

示例1: aout_ReplayGainSelect

/*** Replay gain ***/static float aout_ReplayGainSelect(vlc_object_t *obj, const char *str,                                   const audio_replay_gain_t *replay_gain){    unsigned mode = AUDIO_REPLAY_GAIN_MAX;    if (likely(str != NULL))    {   /* Find selectrf mode */        if (!strcmp (str, "track"))            mode = AUDIO_REPLAY_GAIN_TRACK;        else        if (!strcmp (str, "album"))            mode = AUDIO_REPLAY_GAIN_ALBUM;    }    /* */    float multiplier;    if (mode == AUDIO_REPLAY_GAIN_MAX)    {        multiplier = 1.f;    }    else    {        float gain;        /* If the selectrf mode is not available, prefer the other one */        if (!replay_gain->pb_gain[mode] && replay_gain->pb_gain[!mode])            mode = !mode;        if (replay_gain->pb_gain[mode])            gain = replay_gain->pf_gain[mode]                 + var_InheritFloat (obj, "audio-replay-gain-preamp");        else            gain = var_InheritFloat (obj, "audio-replay-gain-default");        multiplier = pow (10., gain / 20.);        if (replay_gain->pb_peak[mode]         && var_InheritBool (obj, "audio-replay-gain-peak-protection")         && replay_gain->pf_peak[mode] * multiplier > 1.f)            multiplier = 1.f / replay_gain->pf_peak[mode];    }    /* Command line / configuration gain */    multiplier *= var_InheritFloat (obj, "gain");    return multiplier;}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:49,


示例2: window_get_param

/* * Obtain the window type from the window type variable. */void window_get_param( vlc_object_t * p_aout, window_param * p_param ){    /* Fetch Kaiser parameter */    p_param->f_kaiser_alpha = var_InheritFloat( p_aout, "effect-kaiser-param" );    /* Fetch window type */    char * psz_preset = var_InheritString( p_aout, "effect-fft-window" );    if( !psz_preset )    {        goto no_preset;    }    for( int i = 0; i < NB_WINDOWS; i++ )    {        if( !strcasecmp( psz_preset, window_list[i] ) )        {            p_param->wind_type = i;            return;        }    }no_preset:    msg_Warn( p_aout, "No matching window preset found; using rectangular "                      "window (i.e. no window)" );    p_param->wind_type = NONE;}
开发者ID:yexihu,项目名称:vlc-2.2.0-rc2.32-2013,代码行数:29,


示例3: playlist_VolumeUp

/** * Raises the volume. * /param value how much to increase (> 0) or decrease (< 0) the volume * /param volp if non-NULL, will contain contain the resulting volume */int playlist_VolumeUp (playlist_t *pl, int value, float *volp){    int ret = -1;    float delta = value * var_InheritFloat (pl, "volume-step");    audio_output_t *aout = playlist_GetAout (pl);    if (aout != NULL)    {        float vol = aout_VolumeGet (aout);        if (vol >= 0.)        {            vol += delta / (float)AOUT_VOLUME_DEFAULT;            if (vol < 0.)                vol = 0.;            if (vol > 2.)                vol = 2.;            if (volp != NULL)                *volp = vol;            ret = aout_VolumeSet (aout, vol);        }        vlc_object_release (aout);    }    return ret;}
开发者ID:AsamQi,项目名称:vlc,代码行数:30,


示例4: Open

static int Open( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    if ( !AOUT_FMTS_IDENTICAL( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )    {        msg_Warn( p_filter, "bad input or output format" );        return VLC_EGENERIC;    }    p_sys = p_filter->p_sys = malloc( sizeof( *p_sys ) );    if( !p_sys )        return VLC_ENOMEM;    p_sys->p_mixer = aout_MixerNew( p_this, p_filter->fmt_in.audio.i_format );    if( !p_sys->p_mixer )    {        msg_Warn( p_filter, "unsupported format" );        free( p_sys );        return VLC_EGENERIC;    }    p_sys->f_gain = var_InheritFloat( p_filter->p_parent, "gain-value" );    msg_Dbg( p_filter, "gain multiplier sets to %.2fx", p_sys->f_gain );    p_filter->pf_audio_filter = Process;    return VLC_SUCCESS;}
开发者ID:eduardovra,项目名称:vlc,代码行数:29,


示例5: OpenDecoder

/***************************************************************************** * OpenDecoder: probe the decoder and return score *****************************************************************************/static int OpenDecoder( vlc_object_t *p_this ){    decoder_t *p_dec = (decoder_t*)p_this;    if( p_dec->fmt_in.i_codec != VLC_CODEC_SVG )        return VLC_EGENERIC;    decoder_sys_t *p_sys = malloc( sizeof(decoder_sys_t) );    if (!p_sys)        return VLC_ENOMEM;    p_dec->p_sys = p_sys;    p_sys->i_width = var_InheritInteger( p_this, "svg-width" );    p_sys->i_height = var_InheritInteger( p_this, "svg-height" );    p_sys->f_scale = var_InheritFloat( p_this, "svg-scale" );    /* Initialize library */#if (GLIB_MAJOR_VERSION < 2 || GLIB_MINOR_VERSION < 36)    g_type_init();#endif    /* Set output properties */    p_dec->fmt_out.i_codec = VLC_CODEC_BGRA;    /* Set callbacks */    p_dec->pf_decode = DecodeBlock;    return VLC_SUCCESS;}
开发者ID:mstorsjo,项目名称:vlc,代码行数:32,


示例6: delInput

/* Define the Input used.   Add the callbacks on input   p_input is held once here */void InputManager::setInput( input_thread_t *_p_input ){    delInput();    p_input = _p_input;    if( p_input && !( p_input->b_dead || !vlc_object_alive (p_input) ) )    {        msg_Dbg( p_intf, "IM: Setting an input" );        vlc_object_hold( p_input );        addCallbacks();        UpdateStatus();        UpdateName();        UpdateArt();        UpdateTeletext();        UpdateNavigation();        UpdateVout();        p_item = input_GetItem( p_input );        emit rateChanged( var_GetFloat( p_input, "rate" ) );    }    else    {        p_input = NULL;        p_item = NULL;        assert( !p_input_vbi );        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );    }}
开发者ID:RodrigoNieves,项目名称:vlc,代码行数:30,


示例7: OpenDecoder

/***************************************************************************** * OpenDecoder: probe the decoder and return score *****************************************************************************/static int OpenDecoder( vlc_object_t *p_this ){    decoder_t *p_dec = (decoder_t*)p_this;    if( p_dec->fmt_in.i_codec != VLC_CODEC_SVG )        return VLC_EGENERIC;    decoder_sys_t *p_sys = malloc( sizeof(decoder_sys_t) );    if (!p_sys)        return VLC_ENOMEM;    p_dec->p_sys = p_sys;    p_sys->i_width = var_InheritInteger( p_this, "svg-width" );    p_sys->i_height = var_InheritInteger( p_this, "svg-height" );    p_sys->f_scale = var_InheritFloat( p_this, "svg-scale" );    /* Initialize library */    rsvg_init();    /* Set output properties */    p_dec->fmt_out.i_cat = VIDEO_ES;    p_dec->fmt_out.i_codec = VLC_CODEC_BGRA;    /* Set callbacks */    p_dec->pf_decode_video = DecodeBlock;    return VLC_SUCCESS;}
开发者ID:5UN5H1N3,项目名称:vlc,代码行数:31,


示例8: msg_Dbg

/* delete Input if it ever existed.   Delete the callbacls on input   p_input is released once here */void InputManager::delInput(){    if( !p_input ) return;    msg_Dbg( p_intf, "IM: Deleting the input" );    /* Save time / position */    float f_pos = var_GetFloat( p_input , "position" );    int64_t i_time = var_GetTime( p_input, "time");    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {        i_time = -1;    }    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );    delCallbacks();    i_old_playing_status = END_S;    p_item               = NULL;    oldName              = "";    artUrl               = "";    b_video              = false;    timeA                = 0;    timeB                = 0;    f_rate               = 0. ;    if( p_input_vbi )    {        vlc_object_release( p_input_vbi );        p_input_vbi = NULL;    }    vlc_object_release( p_input );    p_input = NULL;    emit positionUpdated( -1.0, 0 ,0 );    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );    emit nameChanged( "" );    emit chapterChanged( 0 );    emit titleChanged( 0 );    emit playingStatusChanged( END_S );    emit teletextPossible( false );    emit AtoBchanged( false, false );    emit voutChanged( false );    emit voutListChanged( NULL, 0 );    /* Reset all InfoPanels but stats */    emit artChanged( NULL );    emit artChanged( "" );    emit infoChanged( NULL );    emit currentMetaChanged( (input_item_t *)NULL );    emit encryptionChanged( false );    emit recordingStateChanged( false );    emit cachingChanged( 1 );}
开发者ID:Kubink,项目名称:vlc,代码行数:59,


示例9: delInput

/* Define the Input used.   Add the callbacks on input   p_input is held once here */void InputManager::setInput( input_thread_t *_p_input ){    delInput();    p_input = _p_input;    if( p_input != NULL )    {        msg_Dbg( p_intf, "IM: Setting an input" );        vlc_object_hold( p_input );        addCallbacks();        UpdateStatus();        UpdateName();        UpdateArt();        UpdateTeletext();        UpdateNavigation();        UpdateVout();        p_item = input_GetItem( p_input );        emit rateChanged( var_GetFloat( p_input, "rate" ) );        /* Get Saved Time */        if( p_item->i_type == ITEM_TYPE_FILE )        {            char *uri = input_item_GetURI( p_item );            int i_time = RecentsMRL::getInstance( p_intf )->time( qfu(uri) );            if( i_time > 0 && qfu( uri ) != lastURI &&                    !var_GetFloat( p_input, "run-time" ) &&                    !var_GetFloat( p_input, "start-time" ) &&                    !var_GetFloat( p_input, "stop-time" ) )            {                emit resumePlayback( (int64_t)i_time * 1000 );            }            playlist_Lock( THEPL );            // Add root items only            playlist_item_t* p_node = playlist_CurrentPlayingItem( THEPL );            if ( p_node != NULL && p_node->p_parent != NULL && p_node->p_parent->i_id == THEPL->p_playing->i_id )            {                // Save the latest URI to avoid asking to restore the                // position on the same input file.                lastURI = qfu( uri );                RecentsMRL::getInstance( p_intf )->addRecent( lastURI );            }            playlist_Unlock( THEPL );            free( uri );        }    }    else    {        p_item = NULL;        lastURI.clear();        assert( !p_input_vbi );        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );    }}
开发者ID:DaemonSnake,项目名称:vlc,代码行数:58,


示例10: Open

/***************************************************************************** * Open a directory *****************************************************************************/static int Open( vlc_object_t *p_this ){    access_t *p_access = (access_t*)p_this;    if( !p_access->psz_filepath )        return VLC_EGENERIC;    /* Some tests can be skipped if this module was explicitly requested.     * That way, the user can play "corrupt" recordings if necessary     * and we can avoid false positives in the general case. */    bool b_strict = strcmp( p_access->psz_name, "vdr" );    /* Do a quick test based on the directory name to see if this     * directory might contain a VDR recording. We can be reasonably     * sure if ScanDirectory() actually finds files. */    if( b_strict )    {        char psz_extension[4];        int i_length = 0;        const char *psz_name = BaseName( p_access->psz_filepath );        if( sscanf( psz_name, "%*u-%*u-%*u.%*u.%*u.%*u%*[-.]%*u.%3s%n",            psz_extension, &i_length ) != 1 || strcasecmp( psz_extension, "rec" ) ||            ( psz_name[i_length] != DIR_SEP_CHAR && psz_name[i_length] != '/0' ) )            return VLC_EGENERIC;    }    /* Only directories can be recordings */    struct stat st;    if( vlc_stat( p_access->psz_filepath, &st ) ||        !S_ISDIR( st.st_mode ) )        return VLC_EGENERIC;    access_sys_t *p_sys = vlc_calloc( p_this, 1, sizeof( *p_sys ) );    if( unlikely(p_sys == NULL) )        return VLC_ENOMEM;    p_access->p_sys = p_sys;    p_sys->fd = -1;    p_sys->cur_seekpoint = 0;    p_sys->fps = var_InheritFloat( p_access, "vdr-fps" );    ARRAY_INIT( p_sys->file_sizes );    /* Import all files and prepare playback. */    if( !ScanDirectory( p_access ) ||        !SwitchFile( p_access, 0 ) )    {        Close( p_this );        return VLC_EGENERIC;    }    ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek );    return VLC_SUCCESS;}
开发者ID:chouquette,项目名称:vlc,代码行数:57,


示例11: float

/*** Replay gain ***/float (aout_ReplayGainSelect)(vlc_object_t *obj, const char *str,                              const audio_replay_gain_t *replay_gain){    float gain = 0.;    unsigned mode = AUDIO_REPLAY_GAIN_MAX;    if (likely(str != NULL))    {   /* Find selectrf mode */        if (!strcmp (str, "track"))            mode = AUDIO_REPLAY_GAIN_TRACK;        else        if (!strcmp (str, "album"))            mode = AUDIO_REPLAY_GAIN_ALBUM;        /* If the selectrf mode is not available, prefer the other one */        if (mode != AUDIO_REPLAY_GAIN_MAX && !replay_gain->pb_gain[mode])        {            if (replay_gain->pb_gain[!mode])                mode = !mode;        }    }    /* */    if (mode == AUDIO_REPLAY_GAIN_MAX)        return 1.;    if (replay_gain->pb_gain[mode])        gain = replay_gain->pf_gain[mode]             + var_InheritFloat (obj, "audio-replay-gain-preamp");    else        gain = var_InheritFloat (obj, "audio-replay-gain-default");    float multiplier = pow (10., gain / 20.);    if (replay_gain->pb_peak[mode]     && var_InheritBool (obj, "audio-replay-gain-peak-protection")     && replay_gain->pf_peak[mode] * multiplier > 1.0)        multiplier = 1.0f / replay_gain->pf_peak[mode];    return multiplier;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:42,


示例12: QVLCMW

PlaylistDialog::PlaylistDialog( intf_thread_t *_p_intf )                : QVLCMW( _p_intf ){    setWindowTitle( qtr( "Playlist" ) );    setWindowRole( "vlc-playlist" );    setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );    playlistWidget = new PlaylistWidget( p_intf, this );    setCentralWidget( playlistWidget );    readSettings( "playlistdialog", QSize( 600,700 ) );}
开发者ID:qdk0901,项目名称:vlc,代码行数:12,


示例13: Open

/***************************************************************************** * Open: initialize as "audio filter" *****************************************************************************/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;    p_sys->scale             = 1.0;    p_sys->sample_rate       = p_filter->fmt_in.audio.i_rate;    p_sys->samples_per_frame = aout_FormatNbChannels( &p_filter->fmt_in.audio );    p_sys->bytes_per_sample  = 4;    p_sys->bytes_per_frame   = p_sys->samples_per_frame * p_sys->bytes_per_sample;    msg_Dbg( p_this, "format: %5i rate, %i nch, %i bps, %s",             p_sys->sample_rate,             p_sys->samples_per_frame,             p_sys->bytes_per_sample,             "fl32" );    p_sys->ms_stride       = var_InheritInteger( p_this, "scaletempo-stride" );    p_sys->percent_overlap = var_InheritFloat( p_this, "scaletempo-overlap" );    p_sys->ms_search       = var_InheritInteger( p_this, "scaletempo-search" );    msg_Dbg( p_this, "params: %i stride, %.3f overlap, %i search",             p_sys->ms_stride, p_sys->percent_overlap, p_sys->ms_search );    p_sys->buf_queue      = NULL;    p_sys->buf_overlap    = NULL;    p_sys->table_blend    = NULL;    p_sys->buf_pre_corr   = NULL;    p_sys->table_window   = NULL;    p_sys->bytes_overlap  = 0;    p_sys->bytes_queued   = 0;    p_sys->bytes_to_slide = 0;    p_sys->frames_stride_error = 0;    if( reinit_buffers( p_filter ) != VLC_SUCCESS )    {        Close( p_this );        return VLC_EGENERIC;    }    p_filter->fmt_in.audio.i_format = VLC_CODEC_FL32;    aout_FormatPrepare(&p_filter->fmt_in.audio);    p_filter->fmt_out.audio = p_filter->fmt_in.audio;    p_filter->pf_audio_filter = DoWork;    return VLC_SUCCESS;}
开发者ID:IAPark,项目名称:vlc,代码行数:54,


示例14: getIntf

void VlcProc::init_equalizer(){    playlist_t* pPlaylist = getIntf()->p_sys->p_playlist;    audio_output_t* pAout = playlist_GetAout( pPlaylist );    if( pAout )    {        if( !var_Type( pAout, "equalizer-bands" ) )            var_Create( pAout, "equalizer-bands",                        VLC_VAR_STRING | VLC_VAR_DOINHERIT);        if( !var_Type( pAout, "equalizer-preamp" ) )            var_Create( pAout, "equalizer-preamp",                        VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);        // New Aout (addCallbacks)        var_AddCallback( pAout, "audio-filter",                         onGenericCallback, this );        var_AddCallback( pAout, "equalizer-bands",                         onEqBandsChange, this );        var_AddCallback( pAout, "equalizer-preamp",                         onEqPreampChange, this );    }    // is equalizer enabled ?    char *pFilters = pAout ?                   var_GetNonEmptyString( pAout, "audio-filter" ) :                   var_InheritString( getIntf(), "audio-filter" );    bool b_equalizer = pFilters && strstr( pFilters, "equalizer" );    free( pFilters );    SET_BOOL( m_cVarEqualizer, b_equalizer );    // retrieve initial bands    char* bands = pAout ?                  var_GetString( pAout, "equalizer-bands" ) :                  var_InheritString( getIntf(), "equalizer-bands" );    if( bands )    {        m_varEqBands.set( bands );        free( bands );    }    // retrieve initial preamp    float preamp = pAout ?                   var_GetFloat( pAout, "equalizer-preamp" ) :                   var_InheritFloat( getIntf(), "equalizer-preamp" );    EqualizerPreamp *pVarPreamp = (EqualizerPreamp*)m_cVarEqPreamp.get();    pVarPreamp->set( (preamp + 20.0) / 40.0 );    if( pAout )        vlc_object_release( pAout);}
开发者ID:jomanmuk,项目名称:vlc-2.2,代码行数:50,


示例15: SkinObject

WindowManager::WindowManager( intf_thread_t *pIntf ):    SkinObject( pIntf ), m_magnet( 0 ), m_alpha( 255 ), m_moveAlpha( 255 ),    m_opacityEnabled( false ), m_opacity( 255 ), m_direction( kNone ),    m_maximizeRect(0, 0, 50, 50), m_pTooltip( NULL ), m_pPopup( NULL ){    // Create and register a variable for the "on top" status    VarManager *pVarManager = VarManager::instance( getIntf() );    m_cVarOnTop = VariablePtr( new VarBoolImpl( getIntf() ) );    pVarManager->registerVar( m_cVarOnTop, "vlc.isOnTop" );    // transparency switched on or off by user    m_opacityEnabled = var_InheritBool( getIntf(), "skins2-transparency" );    // opacity overridden by user    m_opacity = 255 * var_InheritFloat( getIntf(), "qt-opacity" );}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:16,


示例16: msg_Dbg

/* delete Input if it ever existed.   Delete the callbacls on input   p_input is released once here */void InputManager::delInput(){    if( !p_input ) return;    msg_Dbg( p_intf, "IM: Deleting the input" );    delCallbacks();    i_old_playing_status = END_S;    p_item               = NULL;    oldName              = "";    artUrl               = "";    b_video              = false;    timeA                = 0;    timeB                = 0;    f_rate               = 0. ;    if( p_input_vbi )    {        vlc_object_release( p_input_vbi );        p_input_vbi = NULL;    }    vlc_object_release( p_input );    p_input = NULL;    emit positionUpdated( -1.0, 0 ,0 );    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );    emit nameChanged( "" );    emit chapterChanged( 0 );    emit titleChanged( 0 );    emit playingStatusChanged( END_S );    emit teletextPossible( false );    emit AtoBchanged( false, false );    emit voutChanged( false );    emit voutListChanged( NULL, 0 );    /* Reset all InfoPanels but stats */    emit artChanged( NULL );    emit artChanged( "" );    emit infoChanged( NULL );    emit currentMetaChanged( (input_item_t *)NULL );    emit encryptionChanged( false );    emit recordingStateChanged( false );    emit cachingChanged( 1 );}
开发者ID:DZLiao,项目名称:vlc-2.1.4.32.subproject-2013-update2,代码行数:50,


示例17: delInput

/* Define the Input used.   Add the callbacks on input   p_input is held once here */void InputManager::setInput( input_thread_t *_p_input ){    delInput();    p_input = _p_input;    if( p_input != NULL )    {        msg_Dbg( p_intf, "IM: Setting an input" );        vlc_object_hold( p_input );        addCallbacks();        UpdateStatus();        UpdateName();        UpdateArt();        UpdateTeletext();        UpdateNavigation();        UpdateVout();        p_item = input_GetItem( p_input );        emit rateChanged( var_GetFloat( p_input, "rate" ) );        /* Get Saved Time */        if( p_item->i_type == ITEM_TYPE_FILE )        {            int i_time = RecentsMRL::getInstance( p_intf )->time( p_item->psz_uri );            if( i_time > 0 &&                    !var_GetFloat( p_input, "run-time" ) &&                    !var_GetFloat( p_input, "start-time" ) &&                    !var_GetFloat( p_input, "stop-time" ) )            {                emit resumePlayback( (int64_t)i_time * 1000 );            }        }    }    else    {        p_item = NULL;        assert( !p_input_vbi );        emit rateChanged( var_InheritFloat( p_intf, "rate" ) );    }}
开发者ID:Kubink,项目名称:vlc,代码行数:43,


示例18: Open

static int Open( vlc_object_t *p_this ){    filter_t *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys = (filter_sys_t *)vlc_object_create( p_this, sizeof( *p_sys ) );			// sunqueen modify    if( unlikely( p_sys == NULL ) )        return VLC_ENOMEM;    p_filter->p_sys = p_sys;    p_sys->volume.format = p_filter->fmt_in.audio.i_format;    p_sys->module = module_need( &p_sys->volume, "audio volume", NULL, false );    if( p_sys->module == NULL )    {        msg_Warn( p_filter, "unsupported format" );        vlc_object_release( &p_sys->volume );        return VLC_EGENERIC;    }    p_sys->f_gain = var_InheritFloat( p_filter->p_parent, "gain-value" );    msg_Dbg( p_filter, "gain multiplier sets to %.2fx", p_sys->f_gain );    p_filter->fmt_out.audio = p_filter->fmt_in.audio;    p_filter->pf_audio_filter = Process;    return VLC_SUCCESS;}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:24,


示例19: Open

/***************************************************************************** * Open: *****************************************************************************/static int Open( vlc_object_t *p_this ){    demux_t      *p_demux = (demux_t*)p_this;    demux_sys_t  *p_sys;    if (p_demux->out == NULL)        return VLC_EGENERIC;    p_sys = vlc_obj_calloc( p_this, 1, sizeof(demux_sys_t) );    if( !p_sys ) return VLC_ENOMEM;    p_sys->f_fps = var_InheritFloat( p_demux, CFG_PREFIX "fps" );    if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0;    p_sys->i_frame_interval = CLOCK_FREQ / p_sys->f_fps;#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2    freerdp_channels_global_init();#endif    p_sys->p_instance = freerdp_new();    if ( !p_sys->p_instance )    {        msg_Err( p_demux, "rdp instantiation error" );        return VLC_EGENERIC;    }    p_demux->p_sys = p_sys;    p_sys->p_instance->PreConnect = preConnectHandler;    p_sys->p_instance->PostConnect = postConnectHandler;    p_sys->p_instance->Authenticate = authenticateHandler;    /* Set up context handlers and let it be allocated */    p_sys->p_instance->ContextSize = sizeof( vlcrdp_context_t );    freerdp_context_new( p_sys->p_instance );    vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_sys->p_instance->context;    p_vlccontext->p_demux = p_demux;    /* Parse uri params for pre-connect */    vlc_url_t url;    vlc_UrlParse( &url, p_demux->psz_location );    if ( !EMPTY_STR(url.psz_host) )        p_sys->psz_hostname = strdup( url.psz_host );    else        p_sys->psz_hostname = strdup( "localhost" );    p_sys->i_port = ( url.i_port > 0 ) ? url.i_port : 3389;    vlc_UrlClean( &url );    if ( ! freerdp_connect( p_sys->p_instance ) )    {        msg_Err( p_demux, "can't connect to rdp server" );        goto error;    }    if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux, VLC_THREAD_PRIORITY_INPUT ) != VLC_SUCCESS )    {        msg_Err( p_demux, "can't spawn thread" );        freerdp_disconnect( p_sys->p_instance );        goto error;    }    p_demux->pf_demux = NULL;    p_demux->pf_control = Control;    return VLC_SUCCESS;error:    freerdp_free( p_sys->p_instance );    free( p_sys->psz_hostname );    return VLC_EGENERIC;}
开发者ID:mstorsjo,项目名称:vlc,代码行数:77,


示例20: Open

static int Open (vlc_object_t *p_this){    decoder_t *p_dec = (decoder_t *)p_this;    if (p_dec->fmt_in.i_codec != VLC_CODEC_MIDI)        return VLC_EGENERIC;    decoder_sys_t *p_sys = (decoder_sys_t *)malloc (sizeof (*p_sys));			// sunqueen modify    if (unlikely(p_sys == NULL))        return VLC_ENOMEM;    p_sys->settings = new_fluid_settings ();    p_sys->synth = new_fluid_synth (p_sys->settings);    p_sys->soundfont = -1;    char *font_path = var_InheritString (p_this, "soundfont");    if (font_path != NULL)    {        msg_Dbg (p_this, "loading sound fonts file %s", font_path);        p_sys->soundfont = fluid_synth_sfload (p_sys->synth, font_path, 1);        if (p_sys->soundfont == -1)            msg_Err (p_this, "cannot load sound fonts file %s", font_path);        free (font_path);    }#ifdef _POSIX_VERSION    else    {        glob_t gl;        glob ("/usr/share/sounds/sf2/*.sf2", GLOB_NOESCAPE, NULL, &gl);        for (size_t i = 0; i < gl.gl_pathc; i++)        {            const char *path = gl.gl_pathv[i];            msg_Dbg (p_this, "loading sound fonts file %s", path);            p_sys->soundfont = fluid_synth_sfload (p_sys->synth, path, 1);            if (p_sys->soundfont != -1)                break; /* it worked! */            msg_Err (p_this, "cannot load sound fonts file %s", path);        }        globfree (&gl);    }#endif    if (p_sys->soundfont == -1)    {        msg_Err (p_this, "sound font file required for synthesis");        dialog_Fatal (p_this, _("MIDI synthesis not set up"),            _("A sound font file (.SF2) is required for MIDI synthesis./n"              "Please install a sound font and configure it "              "from the VLC preferences "              "(Input / Codecs > Audio codecs > FluidSynth)./n"));        delete_fluid_synth (p_sys->synth);        delete_fluid_settings (p_sys->settings);        free (p_sys);        return VLC_EGENERIC;    }    fluid_synth_set_chorus_on (p_sys->synth,                               var_InheritBool (p_this, "synth-chorus"));    fluid_synth_set_gain (p_sys->synth,                          var_InheritFloat (p_this, "synth-gain"));    fluid_synth_set_polyphony (p_sys->synth,                               var_InheritInteger (p_this, "synth-polyphony"));    fluid_synth_set_reverb_on (p_sys->synth,                               var_InheritBool (p_this, "synth-reverb"));    p_dec->fmt_out.i_cat = AUDIO_ES;    p_dec->fmt_out.audio.i_rate =        var_InheritInteger (p_this, "synth-sample-rate");;    fluid_synth_set_sample_rate (p_sys->synth, p_dec->fmt_out.audio.i_rate);    p_dec->fmt_out.audio.i_channels = 2;    p_dec->fmt_out.audio.i_original_channels =    p_dec->fmt_out.audio.i_physical_channels =        AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;    p_dec->fmt_out.audio.i_bitspersample = 32;    date_Init (&p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1);    date_Set (&p_sys->end_date, 0);    p_dec->p_sys = p_sys;    p_dec->pf_decode_audio = DecodeBlock;    return VLC_SUCCESS;}
开发者ID:Aki-Liang,项目名称:vlc-2.1.0.oldlib-2010,代码行数:84,


示例21: AbstractController

/********************************************************************** * Fullscrenn control widget **********************************************************************/FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWidget *_parent )                           : AbstractController( _p_i, _parent ){    RTL_UNAFFECTED_WIDGET    i_mouse_last_x      = -1;    i_mouse_last_y      = -1;    b_mouse_over        = false;    i_mouse_last_move_x = -1;    i_mouse_last_move_y = -1;#if HAVE_TRANSPARENCY    b_slow_hide_begin   = false;    i_slow_hide_timeout = 1;#endif    b_fullscreen        = false;    i_hide_timeout      = 1;    i_screennumber      = -1;    vout.clear();    setWindowFlags( Qt::ToolTip );    setMinimumWidth( FSC_WIDTH );    isWideFSC = false;    setFrameShape( QFrame::StyledPanel );    setFrameStyle( QFrame::Sunken );    setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );    QVBoxLayout *controlLayout2 = new QVBoxLayout( this );    controlLayout2->setContentsMargins( 4, 6, 4, 2 );    /* First line */    InputControlsWidget *inputC = new InputControlsWidget( p_intf, this );    controlLayout2->addWidget( inputC );    controlLayout = new QHBoxLayout;    QString line = getSettings()->value( "MainWindow/FSCtoolbar", FSC_TB_DEFAULT ).toString();    parseAndCreate( line, controlLayout );    controlLayout2->addLayout( controlLayout );    /* hiding timer */    p_hideTimer = new QTimer( this );    p_hideTimer->setSingleShot( true );    CONNECT( p_hideTimer, timeout(), this, hideFSC() );    /* slow hiding timer */#if HAVE_TRANSPARENCY    p_slowHideTimer = new QTimer( this );    CONNECT( p_slowHideTimer, timeout(), this, slowHideFSC() );    f_opacity = var_InheritFloat( p_intf, "qt-fs-opacity" );#endif    i_sensitivity = var_InheritInteger( p_intf, "qt-fs-sensitivity" );    vlc_mutex_init_recursive( &lock );    DCONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),              this, setVoutList( vout_thread_t **, int ) );    /* First Move */    previousPosition = getSettings()->value( "FullScreen/pos" ).toPoint();    screenRes = getSettings()->value( "FullScreen/screen" ).toRect();    isWideFSC = getSettings()->value( "FullScreen/wide" ).toBool();    i_screennumber = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );    CONNECT( this, fullscreenChanged( bool ), THEMIM, changeFullscreen( bool ) );}
开发者ID:r1k,项目名称:vlc,代码行数:69,


示例22: Open

//.........这里部分代码省略.........        if( p_sys->i_col > 1 )            p_sys->i_overlap_w2 = i_overlap2_max * p_sys->bz_length / 100;        else            p_sys->i_overlap_w2 = 0;        if( p_sys->i_row > 1 )            p_sys->i_overlap_h2 = i_overlap2_max * p_sys->bz_height / 100;        else            p_sys->i_overlap_h2 = 0;        /* */        int i_div_max_w = 1;        int i_div_max_h = 1;        for( int i = 0; i < VOUT_MAX_PLANES; i++ )        {            i_div_max_w = __MAX( i_div_max_w, p_chroma->pi_div_w[i] );            i_div_max_h = __MAX( i_div_max_h, p_chroma->pi_div_h[i] );        }        p_sys->i_overlap_w2 = i_div_max_w * (p_sys->i_overlap_w2 / i_div_max_w);        p_sys->i_overlap_h2 = i_div_max_h * (p_sys->i_overlap_h2 / i_div_max_h);    }    else    {        p_sys->i_overlap_w2 = 0;        p_sys->i_overlap_h2 = 0;    }    /* Compute attenuate parameters */    if( p_sys->b_attenuate )    {        panoramix_gamma_t p_gamma[VOUT_MAX_PLANES];        p_gamma[0].f_gamma = var_InheritFloat( p_splitter, CFG_PREFIX "bz-gamma-red" );        p_gamma[1].f_gamma = var_InheritFloat( p_splitter, CFG_PREFIX "bz-gamma-green" );        p_gamma[2].f_gamma = var_InheritFloat( p_splitter, CFG_PREFIX "bz-gamma-blue" );        p_gamma[0].f_black_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blackcrush-red" ) / 255.0;        p_gamma[1].f_black_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blackcrush-green" ) / 255.0;        p_gamma[2].f_black_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blackcrush-blue" ) / 255.0;        p_gamma[0].f_white_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitecrush-red" ) / 255.0;        p_gamma[1].f_white_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitecrush-green" ) / 255.0;        p_gamma[2].f_white_crush = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitecrush-blue" ) / 255.0;        p_gamma[0].f_black_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blacklevel-red" ) / 255.0;        p_gamma[1].f_black_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blacklevel-green" ) / 255.0;        p_gamma[2].f_black_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-blacklevel-blue" ) / 255.0;        p_gamma[0].f_white_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitelevel-red" ) / 255.0;        p_gamma[1].f_white_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitelevel-green" ) / 255.0;        p_gamma[2].f_white_level = var_InheritInteger( p_splitter, CFG_PREFIX "bz-whitelevel-blue" ) / 255.0;        for( int i = 3; i < VOUT_MAX_PLANES; i++ )        {            /* Initialize unsupported planes */            p_gamma[i].f_gamma = 1.0;            p_gamma[i].f_black_crush = 140.0/255.0;            p_gamma[i].f_white_crush = 200.0/255.0;            p_gamma[i].f_black_level = 150.0/255.0;            p_gamma[i].f_white_level = 0.0/255.0;        }        if( p_chroma->i_chroma == VLC_CODEC_YV12 )        {            /* Exchange U and V */            panoramix_gamma_t t = p_gamma[1];            p_gamma[1] = p_gamma[2];
开发者ID:Mettbrot,项目名称:vlc,代码行数:67,


示例23: Create

/***************************************************************************** * Create: allocates opencv_wrapper video thread output method ***************************************************************************** * This function allocates and initializes a opencv_wrapper vout method. *****************************************************************************/static int Create( vlc_object_t *p_this ){    filter_t* p_filter = (filter_t*)p_this;    char *psz_chroma, *psz_output;    /* Allocate structure */    p_filter->p_sys = malloc( sizeof( filter_sys_t ) );    if( p_filter->p_sys == NULL )        return VLC_ENOMEM;    /* Load the internal OpenCV filter.     *     * This filter object is needed to call the internal OpenCV filter     * for processing, the wrapper just converts into an IplImage* for     * the other filter.     *     * We don't need to set up video formats for this filter as it not     * actually using a picture_t.     */    p_filter->p_sys->p_opencv = vlc_object_create( p_filter, sizeof(filter_t) );    if( !p_filter->p_sys->p_opencv ) {        free( p_filter->p_sys );        return VLC_ENOMEM;    }    p_filter->p_sys->psz_inner_name = var_InheritString( p_filter, "opencv-filter-name" );    if( p_filter->p_sys->psz_inner_name )        p_filter->p_sys->p_opencv->p_module =            module_need( p_filter->p_sys->p_opencv,                         "opencv internal filter",                         p_filter->p_sys->psz_inner_name,                         true );    if( !p_filter->p_sys->p_opencv->p_module )    {        msg_Err( p_filter, "can't open internal opencv filter: %s", p_filter->p_sys->psz_inner_name );        free( p_filter->p_sys->psz_inner_name );        p_filter->p_sys->psz_inner_name = NULL;        vlc_object_release( p_filter->p_sys->p_opencv );        free( p_filter->p_sys );        return VLC_ENOMOD;    }    /* Init structure */    p_filter->p_sys->p_image = image_HandlerCreate( p_filter );    for( int i = 0; i < VOUT_MAX_PLANES; i++ )        p_filter->p_sys->p_cv_image[i] = NULL;    p_filter->p_sys->p_proc_image = NULL;    p_filter->p_sys->p_to_be_freed = NULL;    p_filter->p_sys->i_cv_image_size = 0;    /* Retrieve and apply config */    psz_chroma = var_InheritString( p_filter, "opencv-chroma" );    if( psz_chroma == NULL )    {        msg_Err( p_filter, "configuration variable %s empty, using 'grey'",                         "opencv-chroma" );        p_filter->p_sys->i_internal_chroma = GREY;    } else if( !strcmp( psz_chroma, "input" ) )        p_filter->p_sys->i_internal_chroma = CINPUT;    else if( !strcmp( psz_chroma, "I420" ) )        p_filter->p_sys->i_internal_chroma = GREY;    else if( !strcmp( psz_chroma, "RGB32" ) )        p_filter->p_sys->i_internal_chroma = RGB;    else {        msg_Err( p_filter, "no valid opencv-chroma provided, using 'grey'" );        p_filter->p_sys->i_internal_chroma = GREY;    }    free( psz_chroma );    psz_output = var_InheritString( p_filter, "opencv-output" );    if( psz_output == NULL )    {        msg_Err( p_filter, "configuration variable %s empty, using 'input'",                         "opencv-output" );        p_filter->p_sys->i_wrapper_output = VINPUT;    } else if( !strcmp( psz_output, "none" ) )        p_filter->p_sys->i_wrapper_output = NONE;    else if( !strcmp( psz_output, "input" ) )        p_filter->p_sys->i_wrapper_output = VINPUT;    else if( !strcmp( psz_output, "processed" ) )        p_filter->p_sys->i_wrapper_output = PROCESSED;    else {        msg_Err( p_filter, "no valid opencv-output provided, using 'input'" );        p_filter->p_sys->i_wrapper_output = VINPUT;    }    free( psz_output );    p_filter->p_sys->f_scale =        var_InheritFloat( p_filter, "opencv-scale" );    msg_Info(p_filter, "Configuration: opencv-scale: %f, opencv-chroma: %d, "//.........这里部分代码省略.........
开发者ID:Aki-Liang,项目名称:vlc-2.1.0.oldlib-2010,代码行数:101,


示例24: Open

/***************************************************************************** * Open: initialize as "audio filter" *****************************************************************************/static int Open( vlc_object_t *p_this ){    filter_t     *p_filter = (filter_t *)p_this;    filter_sys_t *p_sys;    bool b_fit = true;    if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||        p_filter->fmt_out.audio.i_format != VLC_CODEC_FL32 )    {        b_fit = false;        p_filter->fmt_in.audio.i_format = p_filter->fmt_out.audio.i_format = VLC_CODEC_FL32;        msg_Warn( p_filter, "bad input or output format" );    }    if( ! AOUT_FMTS_SIMILAR( &p_filter->fmt_in.audio, &p_filter->fmt_out.audio ) )    {        b_fit = false;        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" );    }    if( ! b_fit )        return VLC_EGENERIC;    /* Allocate structure */    p_sys = p_filter->p_sys = malloc( sizeof(*p_sys) );    if( ! p_sys )        return VLC_ENOMEM;    p_filter->pf_audio_filter = DoWork;    p_sys->scale             = 1.0;    p_sys->sample_rate       = p_filter->fmt_in.audio.i_rate;    p_sys->samples_per_frame = aout_FormatNbChannels( &p_filter->fmt_in.audio );    p_sys->bytes_per_sample  = 4;    p_sys->bytes_per_frame   = p_sys->samples_per_frame * p_sys->bytes_per_sample;    msg_Dbg( p_this, "format: %5i rate, %i nch, %i bps, %s",             p_sys->sample_rate,             p_sys->samples_per_frame,             p_sys->bytes_per_sample,             "fl32" );    p_sys->ms_stride       = var_InheritInteger( p_this, "scaletempo-stride" );    p_sys->percent_overlap = var_InheritFloat( p_this, "scaletempo-overlap" );    p_sys->ms_search       = var_InheritInteger( p_this, "scaletempo-search" );    msg_Dbg( p_this, "params: %i stride, %.3f overlap, %i search",             p_sys->ms_stride, p_sys->percent_overlap, p_sys->ms_search );    p_sys->buf_queue      = NULL;    p_sys->buf_overlap    = NULL;    p_sys->table_blend    = NULL;    p_sys->buf_pre_corr   = NULL;    p_sys->table_window   = NULL;    p_sys->bytes_overlap  = 0;    p_sys->bytes_queued   = 0;    p_sys->bytes_to_slide = 0;    p_sys->frames_stride_error = 0;    if( reinit_buffers( p_filter ) != VLC_SUCCESS )    {        Close( p_this );        return VLC_EGENERIC;    }    return VLC_SUCCESS;}
开发者ID:CSRedRat,项目名称:vlc,代码行数:69,


示例25: Open

/***************************************************************************** * Open: *****************************************************************************/static int Open( vlc_object_t *p_this ){    demux_t      *p_demux = (demux_t*)p_this;    demux_sys_t  *p_sys;    if (p_demux->out == NULL)        return VLC_EGENERIC;    p_sys = vlc_obj_calloc( p_this, 1, sizeof(demux_sys_t) );    if( !p_sys ) return VLC_ENOMEM;    p_sys->f_fps = var_InheritFloat( p_demux, CFG_PREFIX "fps" );    if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0;    p_sys->i_frame_interval = vlc_tick_rate_duration( p_sys->f_fps );    char *psz_chroma = var_InheritString( p_demux, CFG_PREFIX "chroma" );    vlc_fourcc_t i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );    free( psz_chroma );    if ( !i_chroma || vlc_fourcc_IsYUV( i_chroma ) )    {        msg_Err( p_demux, "Only RGB chroma are supported" );        return VLC_EGENERIC;    }    const vlc_chroma_description_t *p_chroma_desc = vlc_fourcc_GetChromaDescription( i_chroma );    if ( !p_chroma_desc )    {        msg_Err( p_demux, "Unable to get RGB chroma description" );        return VLC_EGENERIC;    }#ifdef NDEBUG    rfbEnableClientLogging = FALSE;#endif    p_sys->p_client = rfbGetClient( p_chroma_desc->pixel_bits / 3, // bitsPerSample                                    3, // samplesPerPixel                                    p_chroma_desc->pixel_size ); // bytesPerPixel    if ( ! p_sys->p_client )    {        msg_Dbg( p_demux, "Unable to set up client for %s",                 vlc_fourcc_GetDescription( VIDEO_ES, i_chroma ) );        return VLC_EGENERIC;    }    msg_Dbg( p_demux, "set up client for %s %d %d %d",             vlc_fourcc_GetDescription( VIDEO_ES, i_chroma ),             p_chroma_desc->pixel_bits / 3, 3, p_chroma_desc->pixel_size );    p_sys->p_client->MallocFrameBuffer = mallocFrameBufferHandler;    p_sys->p_client->canHandleNewFBSize = TRUE;    p_sys->p_client->GetCredential = getCredentialHandler;    p_sys->p_client->GetPassword = getPasswordHandler; /* VNC simple auth */    /* Set compression and quality levels */    p_sys->p_client->appData.compressLevel =            var_InheritInteger( p_demux, CFG_PREFIX "compress-level" );    p_sys->p_client->appData.qualityLevel =            var_InheritInteger( p_demux, CFG_PREFIX "quality-level" );    /* Parse uri params */    vlc_url_t url;    vlc_UrlParse( &url, p_demux->psz_location );    if ( !EMPTY_STR(url.psz_host) )        p_sys->p_client->serverHost = strdup( url.psz_host );    else        p_sys->p_client->serverHost = strdup( "localhost" );    p_sys->p_client->appData.viewOnly = TRUE;    p_sys->p_client->serverPort = ( url.i_port > 0 ) ? url.i_port : 5900;    msg_Dbg( p_demux, "VNC init %s host=%s port=%d",             p_demux->psz_location,             p_sys->p_client->serverHost,             p_sys->p_client->serverPort );    vlc_UrlClean( &url );    /* make demux available for callback handlers */    rfbClientSetClientData( p_sys->p_client, DemuxThread, p_demux );    p_demux->p_sys = p_sys;    if( !rfbInitClient( p_sys->p_client, NULL, NULL ) )    {        msg_Err( p_demux, "can't connect to RFB server" );        return VLC_EGENERIC;    }    p_sys->i_starttime = vlc_tick_now();    if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux, VLC_THREAD_PRIORITY_INPUT ) != VLC_SUCCESS )    {        msg_Err( p_demux, "can't spawn thread" );        return VLC_EGENERIC;    }//.........这里部分代码省略.........
开发者ID:mstorsjo,项目名称:vlc,代码行数:101,


示例26: QVLCMW

MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ){    /* Variables initialisation */    bgWidget             = NULL;    videoWidget          = NULL;    playlistWidget       = NULL;    stackCentralOldWidget= NULL;#ifndef HAVE_MAEMO    sysTray              = NULL;#endif    fullscreenControls   = NULL;    cryptedLabel         = NULL;    controls             = NULL;    inputC               = NULL;    b_hideAfterCreation  = false; // --qt-start-minimized    playlistVisible      = false;    input_name           = "";    /* Ask for Privacy */    FirstRun::CheckAndRun( this, p_intf );    /**     *  Configuration and settings     *  Pre-building of interface     **/    /* Main settings */    setFocusPolicy( Qt::StrongFocus );    setAcceptDrops( true );    setWindowRole( "vlc-main" );    setWindowIcon( QApplication::windowIcon() );    setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );#ifdef Q_WS_MAC    setAttribute( Qt::WA_MacBrushedMetal );#endif    /* Is video in embedded in the UI or not */    b_videoEmbedded = var_InheritBool( p_intf, "embedded-video" );    /* Does the interface resize to video size or the opposite */    b_autoresize = var_InheritBool( p_intf, "qt-video-autoresize" );    /* Are we in the enhanced always-video mode or not ? */    b_minimalView = var_InheritBool( p_intf, "qt-minimal-view" );    /* Do we want anoying popups or not */    b_notificationEnabled = var_InheritBool( p_intf, "qt-notification" );    /* Set the other interface settings */    settings = getSettings();    settings->beginGroup( "MainWindow" );    /* */    b_plDocked = getSettings()->value( "pl-dock-status", true ).toBool();    settings->endGroup( );    /**************     * Status Bar *     **************/    createStatusBar();    /**************************     *  UI and Widgets design     **************************/    setVLCWindowsTitle();    /************     * Menu Bar *     ************/    QVLCMenu::createMenuBar( this, p_intf );    CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),             this, destroyPopupMenu() );    createMainWidget( settings );    /*********************************     * Create the Systray Management *     *********************************/    initSystray();    /********************     * Input Manager    *     ********************/    MainInputManager::getInstance( p_intf );#ifdef WIN32    himl = NULL;    p_taskbl = NULL;    taskbar_wmsg = RegisterWindowMessage("TaskbarButtonCreated");#endif    /************************************************************     * Connect the input manager to the GUI elements it manages *     ************************************************************/    /**     * Connects on nameChanged()     * Those connects are different because options can impeach them to trigger.     **/    /* Main Interface statusbar *///.........这里部分代码省略.........
开发者ID:banketree,项目名称:faplayer,代码行数:101,


示例27: Open

static int Open(vlc_object_t *object){    demux_t *demux = (demux_t*)object;    /* Detect the image type */    const image_format_t *img;    const uint8_t *peek;    int peek_size = 0;    for (int i = 0; ; i++) {        img = &formats[i];        if (!img->codec)            return VLC_EGENERIC;        if (img->detect) {            if (img->detect(demux->s))                break;        } else {            if (peek_size < img->marker_size)                peek_size = stream_Peek(demux->s, &peek, img->marker_size);            if (peek_size >= img->marker_size &&                !memcmp(peek, img->marker, img->marker_size))                break;        }    }    msg_Dbg(demux, "Detected image: %s",            vlc_fourcc_GetDescription(VIDEO_ES, img->codec));    if( img->codec == VLC_CODEC_MXPEG )    {        return VLC_EGENERIC; //let avformat demux this file    }    /* Load and if selected decode */    es_format_t fmt;    es_format_Init(&fmt, VIDEO_ES, img->codec);    fmt.video.i_chroma = fmt.i_codec;    block_t *data = Load(demux);    if (data && var_InheritBool(demux, "image-decode")) {        char *string = var_InheritString(demux, "image-chroma");        vlc_fourcc_t chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, string);        free(string);        data = Decode(demux, &fmt.video, chroma, data);        fmt.i_codec = fmt.video.i_chroma;    }    fmt.i_id    = var_InheritInteger(demux, "image-id");    fmt.i_group = var_InheritInteger(demux, "image-group");    if (var_InheritURational(demux,                             &fmt.video.i_frame_rate,                             &fmt.video.i_frame_rate_base,                             "image-fps") ||        fmt.video.i_frame_rate <= 0 || fmt.video.i_frame_rate_base <= 0) {        msg_Err(demux, "Invalid frame rate, using 10/1 instead");        fmt.video.i_frame_rate      = 10;        fmt.video.i_frame_rate_base = 1;    }    /* If loadind failed, we still continue to avoid mis-detection     * by other demuxers. */    if (!data)        msg_Err(demux, "Failed to load the image");    /* */    demux_sys_t *sys = malloc(sizeof(*sys));    if (!sys) {        if (data)            block_Release(data);        es_format_Clean(&fmt);        return VLC_ENOMEM;    }    sys->data        = data;    sys->es          = es_out_Add(demux->out, &fmt);    sys->duration    = CLOCK_FREQ * var_InheritFloat(demux, "image-duration");    sys->is_realtime = var_InheritBool(demux, "image-realtime");    sys->pts_origin  = sys->is_realtime ? mdate() : 0;    sys->pts_next    = VLC_TS_INVALID;    date_Init(&sys->pts, fmt.video.i_frame_rate, fmt.video.i_frame_rate_base);    date_Set(&sys->pts, 0);    es_format_Clean(&fmt);    demux->pf_demux   = Demux;    demux->pf_control = Control;    demux->p_sys      = sys;    return VLC_SUCCESS;}
开发者ID:jomanmuk,项目名称:vlc-2.2,代码行数:89,


示例28: screen_InitCapture

int screen_InitCapture(demux_t *p_demux){    demux_sys_t *p_sys = p_demux->p_sys;    screen_data_t *p_data;    CGLError returnedError;    p_sys->p_data = p_data = calloc(1, sizeof(screen_data_t));    if (!p_data)        return VLC_ENOMEM;    /* fetch the screen we should capture */    p_data->display_id = kCGDirectMainDisplay;    p_data->rate = var_InheritFloat (p_demux, "screen-fps");    unsigned int displayCount = 0;    returnedError = CGGetOnlineDisplayList(0, NULL, &displayCount);    if (!returnedError) {        CGDirectDisplayID *ids;        ids = (CGDirectDisplayID *)malloc(displayCount * sizeof(CGDirectDisplayID));        returnedError = CGGetOnlineDisplayList(displayCount, ids, &displayCount);        if (!returnedError) {            if (p_sys->i_display_id > 0) {                for (unsigned int i = 0; i < displayCount; i++) {                    if (p_sys->i_display_id == ids[i]) {                        p_data->display_id = ids[i];                        break;                    }                }            } else if (p_sys->i_screen_index > 0 && p_sys->i_screen_index <= displayCount)                p_data->display_id = ids[p_sys->i_screen_index - 1];        }        free(ids);    }    /* Get the device context for the whole screen */    CGRect rect = CGDisplayBounds(p_data->display_id);    p_data->screen_left = rect.origin.x;    p_data->screen_top = rect.origin.y;    p_data->screen_width = rect.size.width;    p_data->screen_height = rect.size.height;    p_data->width = p_sys->i_width;    p_data->height = p_sys->i_height;    if (p_data->width <= 0 || p_data->height <= 0) {        p_data->width = p_data->screen_width;        p_data->height = p_data->screen_height;    }    /* setup format */    es_format_Init(&p_sys->fmt, VIDEO_ES, VLC_CODEC_RGB32);    p_sys->fmt.video.i_visible_width   =        p_sys->fmt.video.i_width           = rect.size.width;    p_sys->fmt.video.i_visible_height  =        p_sys->fmt.video.i_height          = rect.size.height;    p_sys->fmt.video.i_bits_per_pixel  = 32;    p_sys->fmt.video.i_chroma          = VLC_CODEC_RGB32;    p_sys->fmt.video.i_rmask           = 0x00ff0000;    p_sys->fmt.video.i_gmask           = 0x0000ff00;    p_sys->fmt.video.i_bmask           = 0x000000ff;    p_sys->fmt.video.i_frame_rate      = 1000 * p_data->rate;    p_sys->fmt.video.i_frame_rate_base = 1000;    p_sys->fmt.video.i_sar_num         =        p_sys->fmt.video.i_sar_den         = 1;    return VLC_SUCCESS;}
开发者ID:jomanmuk,项目名称:vlc-2.2,代码行数:66,


示例29: Open

/***************************************************************************** * Open: check file and initializes structures *****************************************************************************/static int Open( vlc_object_t * p_this ){    demux_t     *p_demux = (demux_t*)p_this;    int         i_size;    bool        b_matched = false;    if( IsMxpeg( p_demux->s ) && !p_demux->b_force )        // let avformat handle this case        return VLC_EGENERIC;    demux_sys_t *p_sys = (demux_sys_t *)malloc( sizeof( demux_sys_t ) );			// sunqueen modify    if( unlikely(p_sys == NULL) )        return VLC_ENOMEM;    p_demux->pf_control = Control;    p_demux->p_sys      = p_sys;    p_sys->p_es         = NULL;    p_sys->i_time       = VLC_TS_0;    p_sys->i_level      = 0;    p_sys->psz_separator = NULL;    p_sys->i_frame_size_estimate = 15 * 1024;    char *content_type = stream_ContentType( p_demux->s );    if ( content_type )    {        //FIXME: this is not fully match to RFC        char* boundary = strstr( content_type, "boundary=" );        if( boundary )        {	    boundary += strlen( "boundary=" );	    size_t len = strlen( boundary );	    if( len > 2 && boundary[0] == '"'	        && boundary[len-1] == '"' )	    {	        boundary[len-1] = '/0';	        boundary++;	    }            p_sys->psz_separator = strdup( boundary );            if( !p_sys->psz_separator )            {                free( content_type );                goto error;            }        }        free( content_type );    }    b_matched = CheckMimeHeader( p_demux, &i_size);    if( b_matched )    {        p_demux->pf_demux = MimeDemux;        stream_Read( p_demux->s, NULL, i_size );    }    else if( i_size == 0 )    {        /* 0xffd8 identify a JPEG SOI */        if( p_sys->p_peek[0] == 0xFF && p_sys->p_peek[1] == 0xD8 )        {            msg_Dbg( p_demux, "JPEG SOI marker detected" );            p_demux->pf_demux = MjpgDemux;            p_sys->i_level++;        }        else        {            goto error;        }    }    else    {        goto error;    }    /* Frame rate */    float f_fps = var_InheritFloat( p_demux, "mjpeg-fps" );    p_sys->i_still_end = 0;    if( demux_IsPathExtension( p_demux, ".jpeg" ) ||        demux_IsPathExtension( p_demux, ".jpg" ) )    {        /* Plain JPEG file = single still picture */        p_sys->b_still = true;        if( f_fps == 0.f )            /* Defaults to 1fps */            f_fps = 1.f;    }    else        p_sys->b_still = false;    p_sys->i_frame_length = f_fps ? (CLOCK_FREQ / f_fps) : 0;    es_format_Init( &p_sys->fmt, VIDEO_ES, 0 );    p_sys->fmt.i_codec = VLC_CODEC_MJPG;    p_sys->p_es = es_out_Add( p_demux->out, &p_sys->fmt );    return VLC_SUCCESS;error://.........这里部分代码省略.........
开发者ID:Aki-Liang,项目名称:vlc-2.1.0.oldlib-2010,代码行数:101,



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


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