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. Changing width / height of played video file on phonon video widget
Qt 6.11 is out! See what's new in the release blog

Changing width / height of played video file on phonon video widget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k 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.
  • S Offline
    S Offline
    swhweng
    wrote on last edited by
    #1

    Hello,

    In an application when I have ui created in Qt Designer with added QStackedWidget , I create

    @
    Phonon::MediaObject *mediaObject;
    Phonon::MediaSource *mediaSource;
    Phonon::VideoWidget * videow;
    @

    and add videow to the stacked widget by :

    @
    this->ui->stackedWidget->insertWidget(0,videow);
    @

    objects creations and connections:

    @
       videow = new Phonon::VideoWidget(this);
       videow->setScaleMode(Phonon::VideoWidget::FitInView);
       videow->setFixedSize(w,h);
       this->ui->stackedWidget->insertWidget(0,videow)
       mediaObject = new Phonon::MediaObject(this);
       Phonon::createPath(mediaObject,videow);
       QString fileName = "video1.avi";
       mediaSource = new Phonon::MediaSource(fileName);
       mediaObject->setCurrentSource(*mediaSource);
       connect(videow,SIGNAL(finished()),this,SLOT(playEnded())); 
    

    @

    and then play video file by invoking

    @
    this->mediaObject->play();
    @

    When I run the program built in release mode , having above code ,
    the video file is played on Phonon::VideoWidget that is inserted into QStackedWidget but with dimensions not set by mine at the code above ( w , h ) but with source dimensions of the .avi file ( 640*480 for a case ) file.
    And I get the following warning :
    @
    Warning: driver is sending image at 640x480@

    Does anybody know what is the bug in changing playing video dimensions ?
    Does anybody know how to change display video width , height in the Phonon::VideoWidget ?

    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