Results 1 to 5 of 5

Thread: Play continously updated QBuffer with Phonon

  1. #1
    Join Date
    Sep 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Play continously updated QBuffer with Phonon

    Hi!

    Currently im encoding a movie to another format, but at the same time i want to play it, so that you don't have to wait for encoding to finish before watching the movie. The way i thought to do it was to make Phonon play a QBuffer, and just update the QBuffer as more data presents itself.

    This is the relevant code:

    void MainWindow:layVideoPart(QByteArray *part)
    {
    if (videoWidget == 0)
    setupVideoWidget();

    if (inputBuffer == 0)
    {
    inputBuffer = new QBuffer(part);
    inputBuffer->open(QBuffer::ReadWrite | QBuffer::Append);
    }
    else
    {
    inputBuffer->write(part->trimmed());
    }

    //if (mediaObject.state() != Phonon::PlayingState)
    //{
    mediaObject.enqueue(Phonon::MediaSource(inputBuffe r));
    mediaObject.play();
    //}
    }
    Unfortuanetly, this only plays the first part of the movie, and stops shortly afterwards... anyone got any idea of how i ca get this working?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Play continously updated QBuffer with Phonon

    Implement a custom abstractmediastream
    http://qt.gitorious.org/qt/qt/blobs/...tmediastream.h

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Play continously updated QBuffer with Phonon

    As far as I can gather, abstractmediastream is not supported by all backends, only Xine...

    The problem i'm having, i realized, is that MediaSource apperantly reads the data from my inputBuffer only once, which means it will stop playback when reached the end of the read bytes, not the end of the actual QBuffer...

    Is there really no way to get around this? Is there a better way to stream video over a tcpSocket?

  4. #4
    Join Date
    Oct 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Play continously updated QBuffer with Phonon

    Hi,

    sorry to re-open such an old thread, but I was wondering if you (or anyone) found the solution to this as I am now in the same boat so to speak.

    Thanks

    John

  5. #5
    Join Date
    Aug 2011
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Play continously updated QBuffer with Phonon

    Same here... did anyone ever solve this?

    Thanks
    Derek

Similar Threads

  1. Phonon, play sound on key press
    By ale6111 in forum Qt Programming
    Replies: 0
    Last Post: 1st August 2010, 16:18
  2. How to reverse play a video with phonon
    By Markus in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2010, 06:48
  3. Cnan't play mp3 with phonon
    By Skepsor in forum Qt Programming
    Replies: 11
    Last Post: 11th June 2010, 14:54
  4. Phonon Cannot Play Sound (without Error)
    By padawan in forum Qt Programming
    Replies: 5
    Last Post: 16th September 2009, 15:17
  5. Phonon Media Object blocking on play()
    By traetox in forum Qt Programming
    Replies: 0
    Last Post: 21st May 2008, 05:43

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.