如何使用Android Pjsua 2暂停和取消暂停视频传输? [英] how to pause and unpause video transmission using Android Pjsua 2?
问题描述
我希望在飞行中进行视频通话时暂停和取消暂停视频传输,而不会使用Android Pjsua2库删除音频通话.但是有些我无法理解如何实现该功能以示例android pjsua2应用程序.任何帮助将不胜感激.
I wish to pause and unpause video transmission in video call on fly without dropping Audio call using Android Pjsua2 library. But some how i am not able to understand how to implement that feature to sample android pjsua2 app. Any help would be highly appreciated.
我仔细阅读了以下文档,但无法理解..如何实现
i went through below documentation and not able to understand ..how to implement it
枚举pjsua_call_vid_strm_op此枚举表示视频流通话中的操作.
enum pjsua_call_vid_strm_op This enumeration represents video stream operation on a call.
PJSUA_CALL_VID_STRM_START_TRANSMIT开始传输视频流.这将导致先前停止的流再次开始传输.请注意,由于以下原因,任何re-INVITE/UPDATE都不会传输到远程此操作仅在本地流上进行.
PJSUA_CALL_VID_STRM_START_TRANSMIT Start transmitting video stream. This will cause previously stopped stream to start transmitting again. Note that no re-INVITE/UPDATE is to be transmitted to remote since this operation only operates on local stream.
PJSUA_CALL_VID_STRM_STOP_TRANSMIT停止传输视频流.这将导致流在TX方向上暂停,从而导致停止发送任何视频数据包.不得重新邀请/更新通过此操作传输到远程.
PJSUA_CALL_VID_STRM_STOP_TRANSMIT Stop transmitting video stream. This will cause the stream to be paused in TX direction, causing it to stop sending any video packets. No re-INVITE/UPDATE is to be transmitted to remote with this operation.
link 文档 >
推荐答案
请考虑以下代码:
fun strmStopTransmit() {
if (manager.isCaptureActive(camDevId)) {
val callVidPrm = CallVidSetStreamParam()
callVidPrm.setCapDev(camDevId)
call.vidSetStream(pjsua_call_vid_strm_op.PJSUA_CALL_VID_STRM_STOP_TRANSMIT, callVidPrm)
}
}
其中 manager
是 pj :: VidDevManager
的实例(链接))和 call
是 pj :: Call
(链接).
Where manager
is instance of pj::VidDevManager
(link) (you can get it from pj::Endpoint
(link)) and call
is instance of pj::Call
(link).
反函数(继续传输)的实现是显而易见的.
The implementation of the inverse function (resuming transmission) is obvious.
祝你好运!
这篇关于如何使用Android Pjsua 2暂停和取消暂停视频传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!