Phonon movie to gl texture



  • Hi everyone,

    I'm trying to display a movie inside an OpenGL scene (on a quad for example), but for now i have only managed to display it directly on the frontbuffer, that's not bad but since I'ld want to apply post-effects through glsl shaders on the movie it's not suffisant. Below is my code :

    @
    void Movie::init()
    {
    connect(&myMediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(stateChanged(Phonon::State, Phonon::State)));
    myMediaObject.setCurrentSource(myMoviePath);

    QGraphicsProxyWidget *qGraphicsProxyWidget = new QGraphicsProxyWidget();

    Phonon::createPath(&myMediaObject, &myAudioOutput);
    Phonon::createPath(&myMediaObject, &myVideoWidget);
    qGraphicsProxyWidget->setWidget(&myVideoWidget);

    QGraphicsScene *qGraphicsScene = new QGraphicsScene();
    qGraphicsScene->addItem(qGraphicsProxyWidget);

    myMediaObject.setCurrentSource(Phonon::MediaSource(myMoviePath));

    myGraphicsView = new QGraphicsView(qGraphicsScene, myScene->glWidgetContainer());
    myGraphicsView->setViewport(new QGLWidget(0, myScene->glWidget()));
    myGraphicsView->setFrameStyle(QGraphicsView::NoFrame);
    myGraphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    myGraphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    myGraphicsView->show();
    }
    @

    Do you know a way to force the QGraphicsView or the QGLWidget to draw in a texture (perhaps through a Framebuffer Object), or maybe a way to retrieve the texture or qpixmap used by Phonon::VideoWidget to display the movie ?

    Thanks in advance


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.