使用android libjingle(WebRTC)的多个流

时间:2016-06-15 03:25:54

标签: webrtc libjingle

当我使用libjingle开发WebRTC Android应用程序时,我想通过一个摄像头制作多个流(例如一个是HD,另一个是VGA)。 但是,我找不到合适的解决方案。 当我尝试按照以下方式制作VideoSource时,我得到了RuntimeException。 的RuntimeException。

videoSource = factory.createVideoSource(videoCapturer,videoConstraints);

06-14 22:55:48.465 13986-15059/com.lgit.webrtc E/AndroidRuntime: FATAL EXCEPTION: EventThread
                                                                 Process: com.lgit.webrtc, PID: 13986
                                                                 java.lang.RuntimeException: Capturer can only be taken once!
                                                                     at org.webrtc.VideoCapturer.takeNativeVideoCapturer(VideoCapturer.java:52)
                                                                     at org.webrtc.PeerConnectionFactory.createVideoSource(PeerConnectionFactory.java:111)
                                                                     at com.lgit.webrtcclient.WebRtcClient.setTrack(WebRtcClient.java:452)
                                                                     at com.lgit.webrtcclient.WebRtcClient.access$1600(WebRtcClient.java:30)
                                                                     at com.lgit.webrtcclient.WebRtcClient$Peer.<init>(WebRtcClient.java:261)
                                                                     at com.lgit.webrtcclient.WebRtcClient.addPeer(WebRtcClient.java:270)
                                                                     at com.lgit.webrtcclient.WebRtcClient.access$900(WebRtcClient.java:30)
                                                                     at com.lgit.webrtcclient.WebRtcClient$MessageHandler$1.call(WebRtcClient.java:157)
                                                                     at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                     at io.socket.client.Socket.onevent(Socket.java:340)
                                                                     at io.socket.client.Socket.onpacket(Socket.java:293)
                                                                     at io.socket.client.Socket.access$100(Socket.java:19)
                                                                     at io.socket.client.Socket$2$2.call(Socket.java:111)
                                                                     at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                     at io.socket.client.Manager.ondecoded(Manager.java:407)
                                                                     at io.socket.client.Manager.access$1600(Manager.java:20)
                                                                     at io.socket.client.Manager$7.call(Manager.java:383)
                                                                     at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                     at io.socket.parser.Parser$Decoder.add(Parser.java:157)
                                                                     at io.socket.client.Manager.ondata(Manager.java:399)
                                                                     at io.socket.client.Manager.access$1000(Manager.java:20)
                                                                     at io.socket.client.Manager$2.call(Manager.java:350)
                                                                     at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                     at io.socket.engineio.client.Socket.onPacket(Socket.java:497)
                                                                     at io.socket.engineio.client.Socket.access$900(Socket.java:30)
                                                                     at io.socket.engineio.client.Socket$5.call(Socket.java:299)
                                                                     at io.socket.emitter.Emitter.emit(Emitter.java:117)
                                                                     at io.socket.engineio.client.Transport.onPacket(Transport.java:127)
                                                                     at io.socket.engineio.client.Transport.onData(Transport.java:119)
                                                                     at io.socket.engineio.client.transports.WebSocket.access$300(WebSocket.java:32)
                                                                     at io.socket.engineio.client.transports.WebSocket$1$3.run(WebSocket.java:111)
                                                                     at io.socket.thread.EventThread$2.run(EventThread.java:75)
                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                     at java.lang.Thread.run(Thread.java:818)

0 个答案:

没有答案