Solved QMediaPlayer::setSourceDevice() sourceUrl MIME type format?
-
Hi!
This may be a dumb question, but I'm trying to implement media streaming in my application and want to play binary mpeg-ts data stream with QMediaPlayer.
Documentation says this for the setSourceDevice() function parameter sourceUrl:
The sourceUrl can be provided to resolve additional information about the media, mime type etc.
I can't quite get how MIME type should be added to the QUrl, I haven't really encountered an url where MIME type is present. Do I even need to use this parameter for this kind of encoded binary data stream, and if yes, then how should I be specifying this information to sourceUrl?
I tried to eyeball the source code, but I didn't quite get with my limited knowledge in Qt Multimedia where that information is parsed and used.
Thanks in advance for any help with this! It has had me going circles for a while.
-
I scoured through the source code more and found out that there is apparently currently no support to play from a QIODevice, only from either a network url, a qrc-baked file or a local file. I eventually resorted to writing QIODevice output to localhost port as UDP packages and read the videostream from there, data happened to already be in mpeg-ts format.
Still no idea how the mention of adding mime type information would work, but it's now obsolete need for my project.