2

I'm developing a cross-platform SIP application based on PJSUA2 for the core and QtQuick for the GUI.

PJSUA2 provides an API for displaying the user's capture devices as well as the remote party video stream. Such an API exposes a native window handler for a given video. The native window handler is platform-specific (HWND on Windows, NSView* on Mac, etc).

I'd like to embed this native window into a specific QML component, let's say a Rectangle.

Is that possible?

FYI: I'm using MacOS Sierra 10.12.6, PJSIP 2.7 with SDL backend and Qt 5.9.2. But I'd like to make it work on both Windows and MacOS.

csguth
  • 569
  • 3
  • 18

1 Answers1

2

You cannot. You can't even include a QWidget inside a Qt Quick Item.

To give you somehting to chew, you can take a look at https://github.com/vlc-qt/vlc-qt .

They offer QWidgets and QtQuick Items that allow to use VLC to play videos.

They use a window handle (HWND) for the widget (https://github.com/vlc-qt/vlc-qt/blob/master/src/core/MediaPlayer.cpp#L217).

But for Qt Quick they copy each video frame into a QSGNode (https://github.com/vlc-qt/vlc-qt/blob/master/src/core/VideoStream.cpp#L111 and https://github.com/vlc-qt/vlc-qt/blob/master/src/qml/rendering/VideoNode.cpp#L32).

Benjamin T
  • 8,120
  • 20
  • 37