1
我正在使用webrtc實現調用功能。我成功地能夠撥打語音電話。但視頻通話提供錯誤。即使我無法通過VideoCapturerAndroid添加本地流。我搜查了所有通過Google搜索找到的參考資料,但沒有一個爲我的案例工作。我根據支持格式更改了媒體限制(視頻),但沒有運氣。請幫我解決問題。android webrtc VideoCapturerAndroid由於未設置applicationContext而崩潰
它顯示運行時異常未設置applicationContext。
W/System.err: java.lang.RuntimeException: applicationContext not set.
W/System.err: at org.webrtc.VideoCapturerAndroid.startCapture(VideoCapturerAndroid.java:499)
完整日誌在下面給出。
04-12 15:08:03.657 23560-24939/com.example.messenger D/VideoCapturerAndroid: VideoCapturerAndroid
04-12 15:08:03.657 23560-24939/com.example.messenger D/VideoCapturerAndroid: init: Camera 1, Facing front, Orientation 270
04-12 15:08:03.657 23560-24939/com.example.messenger D/VideoCapturerAndroid: Get supported formats.
04-12 15:08:03.657 23560-24939/com.example.messenger D/VideoCapturerAndroid: Opening camera 1
04-12 15:08:03.842 23560-23560/com.example.messenger V/ActivityThread: updateVisibility : ActivityRecord{152a65d3 [email protected] {com.example.messenger/com.example.messenger.activity.ChatActivity}} show : false
04-12 15:08:04.007 23560-24939/com.example.messenger D/VideoCapturerAndroid: Opening camera 0
04-12 15:08:04.192 23560-24939/com.example.messenger D/VideoCapturerAndroid: Get supported formats done.
04-12 15:08:04.197 23560-24939/com.example.messenger D/VideoCapturerAndroid: Supported formats for camera 1: [
{
"width": 1920,
"height": 1080,
"framerate": 30
},
{
"width": 1440,
"height": 1080,
"framerate": 30
},
{
"width": 1280,
"height": 960,
"framerate": 30
},
{
"width": 1280,
"height": 720,
"framerate": 30
},
{
"width": 1056,
"height": 864,
"framerate": 30
},
{
"width": 1024,
"height": 768,
"framerate": 30
},
{
"width": 1008,
"height": 566,
"framerate": 30
},
{
"width": 800,
"height": 600,
"framerate": 30
},
{
"width": 800,
"height": 480,
"framerate": 30
},
{
"width": 800,
"height": 450,
"framerate": 30
},
{
"width": 720,
"height": 480,
"framerate": 30
},
{
"width": 640,
"height": 480,
"framerate": 30
},
{
"width": 528,
"height": 432,
"framerate": 30
},
{
"width": 480,
"height": 320,
"framerate": 30
},
{
"width": 480,
"height": 270,
"framerate": 30
},
{
"width": 352,
"height": 288,
"framerate": 30
},
{
"width": 320,
"height": 240,
"framerate": 30
}
]
04-12 15:08:04.202 23560-24946/com.example.messenger D/VideoCapturerAndroid: startCapture requested: [email protected]
04-12 15:08:04.202 23560-24946/com.example.messenger W/System.err: java.lang.RuntimeException: applicationContext not set.
04-12 15:08:04.202 23560-24946/com.example.messenger W/System.err: at org.webrtc.VideoCapturerAndroid.startCapture(VideoCapturerAndroid.java:499)
04-12 15:08:04.202 23560-24946/com.example.messenger E/rtc: #
# Fatal error in ../../talk/app/webrtc/java/jni/androidvideocapturer_jni.cc, line 126
# Check failed: !jni()->ExceptionCheck()
# error during VideoCapturerAndroid.startCapture
#
04-12 15:08:04.202 23560-24946/com.example.messenger A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 24946 (Thread-64952)
在此先感謝。
謝謝你的回答。你能告訴我你使用的WebRTC版本嗎?目前我正在使用'io.pristine:libjingle:9694 @ aar'for android。 – Tamal
原始.aar已過年,您可以通過以下說明在https://webrtc.org/native-code/android/上構建最新版本的Ubuntu機器 – Ajay
我在以下git repo中上傳了我的框架https://github.com/AjayChoudary/WebRTCFramework/ – Ajay