Example #1
0
QString QmlVlcVideo::get_crop()
{
    QString crop;
    char* c = libvlc_video_get_crop_geometry( m_player.get_mp() );
    if ( c )
        crop = c;
    libvlc_free( c );

    return crop;
}
QString VlcVideo::cropGeometryString() const
{
    QString crop = "";
    if (_vlcMediaPlayer && libvlc_media_player_has_vout(_vlcMediaPlayer)) {
        crop = libvlc_video_get_crop_geometry(_vlcMediaPlayer);
        VlcError::errmsg();
    }

    return crop;
}
Vlc::Ratio VlcVideo::cropGeometry() const
{
    QString crop = "";
    if (_vlcMediaPlayer && libvlc_media_player_has_vout(_vlcMediaPlayer)) {
        crop = libvlc_video_get_crop_geometry(_vlcMediaPlayer);
        VlcError::errmsg();
    }

    return Vlc::Ratio(Vlc::ratio().indexOf(crop));
}
Example #4
0
std::string FBVLCVideoAPI::get_crop()
{
    FBVLCPtr plg = getPlugin();
    vlc_player& p = plg->get_player();

    std::string crop;
    char* c = libvlc_video_get_crop_geometry(p.get_mp());
    if ( c )
        crop = c;
    libvlc_free(c);

    return crop;
}
Example #5
0
STDMETHODIMP VLCVideo::get_crop(BSTR* geometry)
{
    if( NULL == geometry )
        return E_POINTER;

    libvlc_media_player_t *p_md;
    HRESULT hr = getMD(&p_md);
    if( SUCCEEDED(hr) )
    {
        char *psz_geometry = libvlc_video_get_crop_geometry(p_md);
        if( !psz_geometry )
        {
            *geometry = BSTRFromCStr(CP_UTF8, psz_geometry);
            if( !geometry )
                hr = E_OUTOFMEMORY;
        } else if( !psz_geometry )
                hr = E_OUTOFMEMORY;
        free( psz_geometry );
    }
    return hr;
};
Example #6
0
RuntimeNPObject::InvokeResult
LibvlcVideoNPObject::getProperty(int index, NPVariant &result)
{
    /* is plugin still running */
    if( isPluginRunning() )
    {
        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
        libvlc_exception_t ex;
        libvlc_exception_init(&ex);

        libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
        RETURN_ON_EXCEPTION(this,ex);

        switch( index )
        {
            case ID_video_fullscreen:
            {
                int val = p_plugin->get_fullscreen(&ex);
                RETURN_ON_EXCEPTION(this,ex);
                BOOLEAN_TO_NPVARIANT(val, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_height:
            {
                int val = libvlc_video_get_height(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                INT32_TO_NPVARIANT(val, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_width:
            {
                int val = libvlc_video_get_width(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                INT32_TO_NPVARIANT(val, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_aspectratio:
            {
                NPUTF8 *psz_aspect = libvlc_video_get_aspect_ratio(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                if( !psz_aspect )
                    return INVOKERESULT_GENERIC_ERROR;

                STRINGZ_TO_NPVARIANT(psz_aspect, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_subtitle:
            {
                int i_spu = libvlc_video_get_spu(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                INT32_TO_NPVARIANT(i_spu, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_crop:
            {
                NPUTF8 *psz_geometry = libvlc_video_get_crop_geometry(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                if( !psz_geometry )
                    return INVOKERESULT_GENERIC_ERROR;

                STRINGZ_TO_NPVARIANT(psz_geometry, result);
                return INVOKERESULT_NO_ERROR;
            }
            case ID_video_teletext:
            {
                int i_page = libvlc_video_get_teletext(p_md, &ex);
                RETURN_ON_EXCEPTION(this,ex);
                INT32_TO_NPVARIANT(i_page, result);
                return INVOKERESULT_NO_ERROR;
            }
        }
    }
    return INVOKERESULT_GENERIC_ERROR;
}