/** Add default audio track with default configuration */ public void AddVideoTrack(VideoEncoder encoder, Android.Hardware.CameraFacing camera, VideoQuality videoQuality, bool flash) { IStream stream = null; VideoQuality.Merge(videoQuality, defaultVideoQuality); switch (encoder) { case VideoEncoder.H263: stream = new H263Stream(camera); break; case VideoEncoder.H264: throw new NotImplementedException(); //break; } if (stream != null) { //Log.d(TAG,"Quality is: "+videoQuality.resX+"x"+videoQuality.resY+"px "+videoQuality.frameRate+"fps, "+videoQuality.bitRate+"bps"); ((VideoStream)stream).SetVideoQuality(videoQuality); ((VideoStream)stream).SetPreviewDisplay(surfaceHolder); ((VideoStream)stream).SetFlashState(flash); stream.SetDestination(destination, videoPort); tracks.Add(new Track(stream, Track.VIDEO)); } else { //do something here } }
/** Add default audio track with default configuration */ public void AddVideoTrack(VideoEncoder encoder,Android.Hardware.CameraFacing camera, VideoQuality videoQuality, bool flash) { IStream stream = null; VideoQuality.Merge(videoQuality,defaultVideoQuality); switch (encoder) { case VideoEncoder.H263: stream = new H263Stream(camera); break; case VideoEncoder.H264: throw new NotImplementedException(); //break; } if (stream != null) { //Log.d(TAG,"Quality is: "+videoQuality.resX+"x"+videoQuality.resY+"px "+videoQuality.frameRate+"fps, "+videoQuality.bitRate+"bps"); ((VideoStream) stream).SetVideoQuality(videoQuality); ((VideoStream) stream).SetPreviewDisplay(surfaceHolder); ((VideoStream) stream).SetFlashState(flash); stream.SetDestination(destination, videoPort); tracks.Add(new Track(stream,Track.VIDEO)); } else{ //do something here } }