- Posts: 2
- Joined: Tue Dec 12, 2023 7:20 am
- Real Name: Marco Sartore
Hi Marco,
QuadPreview works by having 4 instances of DeckLinkInputPage, one for each quadrant. Each instance infers its own capture device (DeckLinkInputDevice) and screen preview (DeckLinkOpenGLWidget). It does not need to know the index of the capture device because the device/preview relationship is constrained within the DeckLinkInputPage hierarchy.
There is one caveat to this - on macOS, starting in Desktop Video SDK 12.3, the preview uses the IDeckLinkMetalScreenPreviewHelper to provide the capture preview. The difference here is that there is no equivalent to QOpenGLWidget, the Metal preview is drawn with viewport determined from the geometry of the underlying preview widget. In this case we do need to know the index of the view so we can match the preview frame with the viewport.
I suggest reviewing the Mac version of QuadPreview to see how the view index is passed between the DeckLinkInputPage and DeckLinkPreviewWidget object.
The simplest way to overcome is to pass the index to the constructor of your class that implements IDeckLinkScreenPreviewCallback interface, store this value as a member. On IDeckLinkScreenPreviewCallback::DrawFrame callback, pass the index to your underlying preview code.
Regards
Cameron