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. Video rendering problem with phonon and QGraphicsScene
Qt 6.11 is out! See what's new in the release blog

Video rendering problem with phonon and QGraphicsScene

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.
  • N Offline
    N Offline
    nigeroid
    wrote on last edited by
    #1

    Hello. The following code
    @ QApplication a(argc, argv);
    Phonon::MediaObject *media = new Phonon::MediaObject();
    Phonon::VideoWidget *video = new Phonon::VideoWidget(NULL);
    video->setGeometry(0, 0, 200, 200);
    Phonon::createPath(media, video);
    Phonon::MediaSource source("1.avi");
    media->setCurrentSource(source);
    media->play();
    video->show();
    return a.exec();
    @

    shows me a video. its ok.
    But this:
    @ QApplication a(argc, argv);
    QGraphicsScene scene;
    Phonon::MediaObject *media = new Phonon::MediaObject();
    Phonon::VideoWidget *video = new Phonon::VideoWidget(NULL);
    video->setGeometry(0, 0, 200, 200);
    Phonon::createPath(media, video);
    Phonon::MediaSource source("1.avi");
    media->setCurrentSource(source);
    media->play();
    QGraphicsProxyWidget * pWidget = scene.addWidget(video,Qt::Widget);
    qDebug() << pWidget->size() << pWidget->widget()->size();
    qDebug() << pWidget->pos() << pWidget->widget()->pos();
    qDebug() << pWidget->isVisible() << pWidget->widget()->isVisible();
    QGraphicsView view(&scene);
    view.show();
    return a.exec();
    @

    shows me a widget with white background..and nothing else.. but where is my video ? ;) If i connect audiooutput to media, i hear sound of movie, so stream is going on.
    dump:

    @
    QSizeF(200, 200) QSize(200, 200)
    QPointF(0, 0) QPoint(0,0)
    true true
    @

    Tried with Qt 4.7, Qt 4.8.1.
    My task is to draw some widgets over video in full screen mode, such as playback buttons, seeker and volume slider. If i can do that by another way then using QGraphicsScene tell me please :)

    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