4

これは簡単なはずですが、私はこれを理解できません。QVideoWidget/QMediaPlayer にロードされたファイルのビデオ サイズを取得するにはどうすればよいですか。したがって、私のコードは次のとおりです。

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. 

}
4

2 に答える 2