Ejemplo n.º 1
0
 public void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback videoCallback)
 {
     // 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 = videoCallback;
     // Start recording
     natcorder.Call("startRecording",
                    (int)container,
                    videoFormat.width,
                    videoFormat.height,
                    videoFormat.framerate,
                    videoFormat.bitrate,
                    videoFormat.keyframeInterval,
                    audioFormat.sampleRate,
                    audioFormat.channelCount
                    );
 }
Ejemplo n.º 2
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
     );
 }
Ejemplo n.º 3
0
        public void StartRecording(RecordingCallback callback)
        {
            this.callback = callback;
            // Create filestream
            var filename = string.Format("recording_{0}.wav", DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_fff"));

            outputStream = new FileStream(Path.Combine(NatMic.Implementation.RecordingPath, filename), FileMode.Create);
            // 'Allocate' header
            const byte @null = new byte();

            for (int i = 0; i < 44; i++)
            {
                outputStream.WriteByte(@null);
            }
        }
Ejemplo n.º 4
0
 public void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback)
 {
 }
Ejemplo n.º 5
0
 public static void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback)
 {
     if (IsRecording)
     {
         Debug.LogError("NatCorder Error: Cannot start recording because NatCorder is already recording");
         return;
     }
     if (recordingCallback == null)
     {
         Debug.LogError("NatCorder Error: Cannot record video without callback");
         return;
     }
     Implementation.StartRecording(container, videoFormat, audioFormat, recordingCallback);
 }
Ejemplo n.º 6
0
 public static extern void SetRecordingCallback(uint handle, RecordingCallback callback, int mediaTypes);
Ejemplo n.º 7
0
 public override void StartRecording(Container container, VideoFormat videoFormat, AudioFormat audioFormat, RecordingCallback recordingCallback)
 {
     base.StartRecording(
         container,
         videoFormat,
         audioFormat,
         path => recordingCallback(path.Replace('/', '\\'))
         );
 }