vinipsmaker / tufao

An asynchronous web framework for C++ built on top of Qt
http://vinipsmaker.github.io/tufao/
GNU Lesser General Public License v2.1
589 stars 179 forks source link

Does tufao support media streaming downloading? #52

Closed kingctan closed 9 years ago

kingctan commented 9 years ago

Does tufao support media streaming downloading? such as mp3, mp4 and flv and so on. I want to play these media and downloading the remaining parts at the same time.

vinipsmaker commented 9 years ago

Yes, it does.

If the underlying connection is HTTP/1.1, when you call Tufao::HttpServerResponse::write, the bytes are sent as soon as appropriate (Tufão will issue the write imediately, but the command is executed when the Qt+OS stack think it is appropriate).

I remember one of the first examples to test it was a timer that would show 3... 2... 1... on firefox.

I tried to write a webcam streaming video a while back (one year, I think), but I got trouble trying to mix the GStreamer event loop and Qt event loop and all I was able to achieve was the first frame. Maybe it was related to the GStreamer's queue element or the codec. I remember when I tried a different codec, not even the first frame worked.