예제 #1
0
        private bool addMovieFileOutput(out string errorMessage)
        {
            errorMessage = "";

            // create a movie file output and add it to the capture session
            movieFileOutput = new AVCaptureMovieFileOutput();
            if (movieSegmentDurationInMilliSeconds > 0)
            {
                movieFileOutput.MaxRecordedDuration = new CMTime(movieSegmentDurationInMilliSeconds, 1000);
            }

            // setup the delegate that handles the writing
            movieSegmentWriter = new MovieSegmentWriterDelegate();

            // subscribe to the delegate events
            movieSegmentWriter.MovieSegmentRecordingStarted  += new EventHandler <MovieSegmentRecordingStartedEventArgs>(handleMovieSegmentRecordingStarted);
            movieSegmentWriter.MovieSegmentRecordingComplete += new EventHandler <MovieSegmentRecordingCompleteEventArgs>(handleMovieSegmentRecordingComplete);
            movieSegmentWriter.CaptureError += new EventHandler <CaptureErrorEventArgs>(handleMovieCaptureError);

            session.AddOutput(movieFileOutput);

            return(true);
        }
예제 #2
0
		private bool addMovieFileOutput( out string errorMessage )
		{
			errorMessage = "";

			// create a movie file output and add it to the capture session
			movieFileOutput = new AVCaptureMovieFileOutput();
			if ( movieSegmentDurationInMilliSeconds > 0 )
			{
				movieFileOutput.MaxRecordedDuration = new CMTime( movieSegmentDurationInMilliSeconds, 1000 );
			}

			// setup the delegate that handles the writing
			movieSegmentWriter = new MovieSegmentWriterDelegate();

			// subscribe to the delegate events
			movieSegmentWriter.MovieSegmentRecordingStarted += new EventHandler<MovieSegmentRecordingStartedEventArgs>( handleMovieSegmentRecordingStarted );
			movieSegmentWriter.MovieSegmentRecordingComplete += new EventHandler<MovieSegmentRecordingCompleteEventArgs>( handleMovieSegmentRecordingComplete );
			movieSegmentWriter.CaptureError += new EventHandler<CaptureErrorEventArgs>( handleMovieCaptureError );

			session.AddOutput (movieFileOutput);

			return true;
		}
		bool AddMovieFileOutput (out string errorMessage)
		{
			errorMessage = string.Empty;

			// create a movie file output and add it to the capture session
			movieFileOutput = new AVCaptureMovieFileOutput();
			if (movieSegmentDurationInMilliSeconds > 0)
				movieFileOutput.MaxRecordedDuration = new CMTime( movieSegmentDurationInMilliSeconds, 1000);

			// setup the delegate that handles the writing
			movieSegmentWriter = new MovieSegmentWriterDelegate();

			// subscribe to the delegate events
			movieSegmentWriter.MovieSegmentRecordingStarted += HandleMovieSegmentRecordingStarted;
			movieSegmentWriter.MovieSegmentRecordingComplete += HandleMovieSegmentRecordingComplete;
			movieSegmentWriter.CaptureError += HandleMovieCaptureError;

			session.AddOutput (movieFileOutput);

			return true;
		}