[Interest] Is QMediaMetData::Orientation available on Windows when working with MediaFoundation backend?

Steve Schilz sschilz at pasco.com
Wed Jul 12 04:07:28 CEST 2017


Hi,

I am working with QMediaPlayer on Microsoft Windows using VS2015,  with the Media Foundation Backend Where I am trying to read the QMediaMetadata:Orientation parameter.

I have loaded several test files that were generated from various iPhone and Android Phones, and although I can read Resolution, VideoFrameRate, Duration and so forth, but I cannot access the Orientation parameter.
Is this not implemented for this platform, or is there another method to read this data.

Thanks Steve

Code Samples and Additional info:
----------------------------------------------
To attempt to read the rotation, I successfully connect to the mediaStatusChanged signal, and receive QMediaPlayer::LoadedMedia status,
.  E.g. this code succeeds:

       QVariant var = mPlayer->metaData(QMediaMetaData::Resolution);
       if (var.isValid() && var.canConvert<QSize>() && var.toSize() != mNativeSize)
       {
              mNativeSize = var.toSize();
              mImage = QImage(mNativeSize.width(), mNativeSize.height(), QImage::Format_ARGB32_Premultiplied);
              mImage.fill(Qt::white);
              // Video surface is used with VideoRendering::Software
              if (mVideoSurface)
              {
                     mVideoSurface->SetNativeSize(mNativeSize);
              }
       }

If I query mPlayer->availableMetaData(), it returns the following attributes:
  Duration
  AudioBitRate
  ChannelCount
  AudioCode
  SampleRate
  VideoBitRate
   Resolution
  VideoFrameRate
  VideoCodec
  PixelAspectRatio
  Date
  MediaType

Obviously, Orientation is missing, so this code fails:

       QStringList metaData = mPlayer->availableMetaData();
       if (metaData.contains(QMediaMetaData::Orientation))
       {
              var = mPlayer->metaData(QMediaMetaData::Orientation);
              if (var.isValid())
              {
                     mRotation = var.toInt();
              }
       }


Steve Schilz
Software Engineer III
PASCO scientific
www.pasco.com<http://www.pasco.com/>
think science


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170712/7949943a/attachment.html>


More information about the Interest mailing list