This should be something simple but I cannot figure this out. How can I get the video dimensions for a file that is loaded into QVideoWidget/QMediaPlayer. So, my code is as follows:
QMediaPlayer m_MediaPLayer(0, QMediaPlayer::VideoSurface);
m_VideoWidget = new QVideoWidget;
m_MediaPLayer.setVideoOutput(m_VideoWidget);
m_MediaPLayer.setMedia(QUrl::fromLocalFile("file.avi"));
m_MediaPLayer.play();
// I am here checking for media status changed event
connect(&m_MediaPLayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
void MyClass::mediaStatusChanged(QMediaPlayer::MediaStatus status)
{
// Here I get notification for media status change but no idea how to
// get the video size. I could not figure out a way.
}