Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
572 views
in Technique[技术] by (71.8m points)

java - how to pause and unpause video transmission using Android Pjsua 2?

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

enum pjsua_call_vid_strm_op This enumeration represents video stream operation on a call.

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 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 documentation

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Consider this code:

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)
    }
}

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.

Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...