間違ったツリーを吠えています。これは機能するはずです。Phonon::VideoWidgetのsnapshot()関数を使用してQImageを作成します。
編集
私はこの問題をさらに調査しました。スナップショット機能も実装されていません。phononsrcvideowidget.cppの実装は次のとおりです。
QImage VideoWidget::snapshot() const {
P_D(const VideoWidget);
ConstIface<IFACES4> iface(d);
if(iface) return iface->snapshot();
return QImage(); // TODO not implemented in VideoInterface
}
IFACES4は、フォノン4.4用に次のように定義されているVideoWidgetInterface44を参照します(videowidgetinterface.hから)。
class VideoWidgetInterface
{
public:
virtual ~VideoWidgetInterface() {}
virtual Phonon::VideoWidget::AspectRatio aspectRatio() const = 0;
virtual void setAspectRatio(Phonon::VideoWidget::AspectRatio) = 0;
virtual qreal brightness() const = 0;
virtual void setBrightness(qreal) = 0;
virtual Phonon::VideoWidget::ScaleMode scaleMode() const = 0;
virtual void setScaleMode(Phonon::VideoWidget::ScaleMode) = 0;
virtual qreal contrast() const = 0;
virtual void setContrast(qreal) = 0;
virtual qreal hue() const = 0;
virtual void setHue(qreal) = 0;
virtual qreal saturation() const = 0;
virtual void setSaturation(qreal) = 0;
virtual QWidget *widget() = 0;
virtual int overlayCapabilities() const = 0;
virtual bool createOverlay(QWidget *widget, int type) = 0;
};
class VideoWidgetInterface44 : public VideoWidgetInterface
{
public:
virtual QImage snapshot() const = 0;
};
}
#ifdef PHONON_BACKEND_VERSION_4_4
namespace Phonon { typedef VideoWidgetInterface44 VideoWidgetInterfaceLatest; }
#else
namespace Phonon { typedef VideoWidgetInterface VideoWidgetInterfaceLatest; }
#endif
また、gstreamerおよびvlcバックエンドの実装についても見てきました。フォノン4.4のスナップショット機能はまだサポートしていません。そのため、当面の間、スナップショットを作成する他の方法を検討します。