Пример #1
0
 public virtual void StartRecording (Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback) {
     // Make sure that recording size is even
     videoFormat = new VideoFormat(
         videoFormat.width >> 1 << 1,
         videoFormat.height >> 1 << 1,
         videoFormat.framerate,
         videoFormat.bitrate,
         videoFormat.keyframeInterval
     );
     // Save state
     this.dispatch = new MainDispatch();
     this.videoFormat = videoFormat;
     this.recordingCallback = recordingCallback;
     this.framebuffer = new Texture2D(videoFormat.width, videoFormat.height, TextureFormat.ARGB32, false);
     // Start recording
     NatCorderBridge.StartRecording(
         container,
         videoFormat.width,
         videoFormat.height,
         videoFormat.framerate,
         videoFormat.bitrate,
         videoFormat.keyframeInterval,
         audioFormat.sampleRate,
         audioFormat.channelCount
     );
 }
Пример #2
0
 public void StartRecording (Configuration configuration, VideoCallback videoCallback, IAudioSource audioSource) {
     // Make sure that recording size is multiple of two
     configuration = new Configuration(2 * (configuration.width / 2), 2 * (configuration.height / 2), configuration.framerate, configuration.bitrate, configuration.keyframeInterval);
     // Save state
     this.dispatch = new MainDispatch();
     this.configuration = configuration;
     this.videoCallback = videoCallback;
     this.audioSource = audioSource;
     this.framebuffer = new Texture2D(configuration.width, configuration.height, TextureFormat.ARGB32, false);
     // Start recording
     NatCorderBridge.StartRecording(
         configuration.width,
         configuration.height,
         configuration.framerate,
         configuration.bitrate,
         configuration.keyframeInterval,
         audioSource != null,
         audioSource != null ? audioSource.sampleRate : 0,
         audioSource != null ? audioSource.sampleCount : 0,
         audioSource != null ? audioSource.channelCount : 0
     );
 }
Пример #3
0
 public void StartRecording(Configuration configuration, SaveCallback saveCallback, IAudioSource audioSource)
 {
     this.dispatch      = new MainDispatch();
     this.configuration = configuration;
     this.saveCallback  = saveCallback;
     this.audioSource   = audioSource;
     // Start recording
     NatCorderBridge.StartRecording(
         configuration.width,
         configuration.height,
         configuration.framerate,
         configuration.bitrate,
         configuration.keyframeInterval,
         audioSource != null,
         audioSource != null ? audioSource.sampleRate : 0,
         audioSource != null ? audioSource.channelCount : 0
         );
     // Start listening for audio
     if (audioSource != null)
     {
         audioSource.listener = this;
     }
 }