Results 1 to 6 of 6

Thread: Playing movies

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    9

    Default Re: Playing movies

    Thanks a lot for your reply.

    Finally, my need is quite simple (I do not need sound support, and the animations are just as a gif files) so a mng file used through a QMovie object will be enough.

    I did an application test with a QMovie object and I see that the displaying of each frames flicks, probably due to the way I do to process the display.

    So I connect the status notification signal (using QMovie::connectStatus) to a slot in my application and when the status equals to QMovie::EndOfFrame I get the QPixmap and process the drawing using a QLabel ... here is my code :
    Qt Code:
    1. void TestFullMainWindow::processMovieStatusChanged( int status )
    2. {
    3. switch(status)
    4. {
    5. case(QMovie::EndOfFrame):
    6. frame->setPixmap(movie->framePixmap());
    7. break;
    8.  
    9. default:
    10. break;
    11. }
    To copy to clipboard, switch view to plain text mode 

    I know that there is something called double buffering to avoid flicking effect but I don't know how to apply it to my case, but maybe my problem comes from the way I'm trying to code the frame displaying ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Posts
    162
    Qt products
    Qt3
    Platforms
    Windows
    Thanks
    9

    Default Re: Playing movies

    Hmmm finally I update my code with :
    Qt Code:
    1. QRect rect = frame->rect();
    2. bitBlt(frame, rect.topLeft(), &movie->framePixmap());
    To copy to clipboard, switch view to plain text mode 

    instead of :
    Qt Code:
    1. frame->setPixmap(movie->framePixmap());
    To copy to clipboard, switch view to plain text mode 

    and it flicks less.

    Is it the way to do ?

Similar Threads

  1. Playing mplayer inside QWidget
    By sinha.ashish in forum Qt Programming
    Replies: 21
    Last Post: 14th January 2011, 12:14
  2. playing mp3 file with QSound
    By highlightsong in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2008, 09:24
  3. playing mplayer within a Qwidget in windows environment
    By ag.sitesh in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2008, 11:11
  4. Playing Media files in Qt 4
    By sar_van81 in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2007, 05:53
  5. Playing mpegs
    By lewis in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 16:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.