如何在iOS中显示pjsip传入视频? [英] How to display pjsip incoming video in iOS?
问题描述
我正在研究iOS上的PJSIP-Swift项目. 我只是用视频设置编译了PJSIP,以允许使用视频.
I'm working on a PJSIP-Swift project on iOS. I just compiled PJSIP with video settings to allow to use video.
我通过使用Pjsip成功将视频发送到另一台设备.
I succeeded to send video to another device by using Pjsip.
现在,我需要在iOS应用程序上显示传入的流. 我将一个View放在情节提要中的ViewController中,以便在其中显示传入的视频.
Now I need to display the incoming stream on my iOS application. I put a View in my ViewController in the storyboard in order to display the incoming video in.
但是我的问题是我不知道如何将我的视图与PJSIP的传入视频绑定.
But my problem is I have no idea how to bind my view with the incoming video from PJSIP.
该怎么做? 谢谢.
我认为我对问题的理解更好,现在我认为我必须在我的目标C代码中使用指针来操纵pjsip函数.该指针将引用一个作为ViewController的swift文件中的UIView. 我发布了一个新主题以使问题更准确:如何在Objective C中创建一个快速移动的指针?
Edit : I think I understand better the problem and now I think I have to use a pointer in my objective C code where I manipulate pjsip functions. This pointer would refer to an UIView in a swift file that is a ViewController. I posted a new topic to be more accurate in my question : How to create a pointer in Objective C to swift?
Edit2:有一个示例ipjsuaAppDelegate.m 此处.在文件底部,有一个函数 displayWindow .我认为就我而言,我必须获得对象父母"的参考.他们在这里引用了这样的视图:
UIView *parent = app.viewController.view;
但是就我而言,我不知道如何在我的快速代码中而不是那个app.viewController引用一个特定的视图.
Edit2 : There is a sample ipjsuaAppDelegate.m here. In the bottom of the file there is a function displayWindow. I think in my case I have to get a reference for the object "parent". Here they made the reference to the view like that :
UIView *parent = app.viewController.view;
But in my case I don't know how to make a reference to a specific view in my swift code instead of that app.viewController...
推荐答案
在Swift 4.2中,您可以尝试以下操作:
In swift 4.2, you can try this:
let view = Unmanaged<UIView>.fromOpaque(wi.hwnd.info.ios.window).takeUnretainedValue()
这篇关于如何在iOS中显示pjsip传入视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!