Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Phonon movie to gl texture
Qt 6.11 is out! See what's new in the release blog

Phonon movie to gl texture

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved