Please nominate your Qt Champions for 2021!

QMediaObject::metaData() and QMediaObject::metaDataChanged(const QString & key, const QVariant & value) usage

  • The documentation says that the signal, QMediaObject::metaDataChanged( const QString &key, const QVariant &value), allows you to specify which meta data key you wish to receive. How does one go about specifying that or am I misreading the documentation?

    I don't need or want a signal for every possible piece of meta data that is available for the video I open. I would just use the metaDataAvailableChanged(bool) signal and check for true, then grab the data I need, but that signal is never sent in Linux. I am interested in 3 pieces of meta data for my application, 1) Resolution, 2) Title and 3) VideoFrameRate. Unfortunately, the 3rd is never set in Linux. (It must be there for the video to play correctly. I haven't dug into the gstreamer API to see if it is available, but my suspicion is that it is.)

    I would either like to grab all pieces at the same time once the data is available, as metaDataAvailableChanged with a value of true should indicate, or be able to get signals specific to the pieces of data of interest.

    Since the metaDataAvailableChanged signal is never sent, I'm looking for a way to perform the second approach. A piece of sample code showing how to specify the signal in the connect statement and how to specify the slot that will receive it, being that the first parameter will be a constant of a specific value...of type, QString.

    There are more than a few values returned that are not present in QMediaMetaData, such as maximum-bitrate, minimum-bitrate, encoder, subtitle-codec and container-format. I can guess at the data type, but have no direct knowledge. I do not want to be responding to signals that are not relevant to the application. For my application, once the data I need is available, I do not expect it to change. (I realize there are movies like Dr. Strangelove that change aspect ratio during the film. Shouldn't be an issue for me.)

Log in to reply