Qt6 porting guidance: QCamera and QAbstractVideoSurface
-
it seems that the replacement for
QAbstractVideoSurface
isQVideoSink
, but there's lost functionality..for example, my media app can take a single cam input and multiplex-route it to multiple
QGraphicsScenes
(via aQGraphicsVideoItems
) in different windows. note this is multiple separate scenes, not the same scene in each view)in qt5 i did this by subclassing
QAbstractVideoSurface
, instantiate one and callcamera->setViewFinder()
with it.
there is nosetViewFinder()
any more. ?? how do we ... do that now?in the subclass i would be overriding
supportedPixelFormats()
to supply the available format(s)
but that function no longer exists?then i would override
present()
to send the new frame off to each scene with aQGraphicsVideoItem
in it, but the present() function is gone too?it does have
newVideoFrame()
, but that function isn't virtual, so i can't override it.how shall i accomplish this?
-dave
-
i was able to solve it with instantiating a
QVideoSink
and setting that as the output, and hooking into thevideoFrameChanged
signal. i keep a list of the videoSinks i want to send the frames to, and farm them out when i get thevideoFrameChanged
notify -
i was able to solve it with instantiating a
QVideoSink
and setting that as the output, and hooking into thevideoFrameChanged
signal. i keep a list of the videoSinks i want to send the frames to, and farm them out when i get thevideoFrameChanged
notify -