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:
Quote:
void MainWindow::playVideoPart(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?
Re: Play continously updated QBuffer with Phonon
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?
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
Re: Play continously updated QBuffer with Phonon
Same here... did anyone ever solve this?
Thanks
Derek