kurento
Android Get a media stream
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
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
public void onAddStream(final MediaStream stream) {
VideoTrack track = stream.getVideoTracks(0);
YuvImageRenderer renderer = remoteRenderer;
track.addRenderer(new VideoRenderer(renderer));
}