[Qt-interest] QVideoFrame,QAbstractVideoSurface

Alexander Carôt alexander_carot at gmx.net
Wed Mar 31 18:05:12 CEST 2010


Hi all,

lately I have been starting to experiment with video processing. As a first step I want to display a video buffer, which I retrieve with the Quicktime-C-API (running on a MAC) on a Qt-display. In that context I found the new QVideoFrame and QAbstractVideoSurface classes. Some initial questions:

1.) QVideoFrame:
==============
I am doing this in the Quicktime-Callback:

OSErr videoCallback(SGChannel c, Ptr p, long len, long *offset, long chRefCon, TimeValue time, short writeType, long refCon){
  QSize *size = new QSize(320,240);
  QAbstractVideoBuffer *buf = (QAbstractVideoBuffer*) p;
  videoFrame = new QVideoFrame(buf,*size,QVideoFrame::Format_RGB32);
}

... and I wonder if I act correctly with this. So, is it basically valid to cast the Quicktime-Pointer p to a QVideoFrame ?

2.) QAbstractVideoSurface
=====================
I am not sure how to use it: The docs say: "It is not supposed to be instantiated directly. Instead, you should subclass it to create new video surfaces." -- can anyone give an example to actually use it on top of my GUI ?

In fact directly instantiating leads to: 

error: cannot allocate an object of abstract type ‘video’
video.h:12: note:   because the following virtual functions are pure within ‘video’:
/Library/Frameworks/QtMultimedia.framework/Versions/4/Headers/qabstractvideosurface.h:77: note: 	virtual QList<QVideoFrame::PixelFormat> QAbstractVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType) const
/Library/Frameworks/QtMultimedia.framework/Versions/4/Headers/qabstractvideosurface.h:88: note: 	virtual bool QAbstractVideoSurface::present(const QVideoFrame&)


Thanks in advance

-- A l e x



Dr.-Ing. Alexander Carôt 
Email : Alexander at Carot.de 
Tel.: +49 (0)177 5719797 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100331/ade29bcd/attachment.html 


More information about the Qt-interest-old mailing list