美文网首页
webRTC ppt

webRTC ppt

作者: heiheiwanne | 来源:发表于2017-06-01 10:58 被阅读131次

参考1

kurento

Android Get a media stream

image.png
VideoCapturer c = VideoCapturer.create(device);
PeerConnectionFactory factory = new PeerConnectionFactory();
MediaStream localStream = factory.createLocalMediaStream(streamName);
VideoSource s = factory.createVideoSource(c, constraints);
VideoTrack t = factory.createVideoTrack(trackName, s);
localStream.addTrack(t);

Stream between peers


image.png
PeerConnection pc = 
    factory.createPeerConnection(iceServers, constraints, observer);
pc.addStream(localStream);
pc.createOffer(this, offerConstraints);
public void onCreateSuccess(
    final SessionDescription offer) { sendMessage(offer); }

Display a media stream


image.png
public void onAddStream(final MediaStream stream) {
  VideoTrack track = stream.getVideoTracks(0);
  YuvImageRenderer renderer = remoteRenderer;
  track.addRenderer(new VideoRenderer(renderer));
}

相关文章

网友评论

      本文标题:webRTC ppt

      本文链接:https://www.haomeiwen.com/subject/fzbsfxtx.html