Exemple #1
0
        /// <summary>
        /// Resumes the recording.
        /// </summary>
        /// <remarks>
        /// The recorder should be in the <see cref="RecorderState.Paused"/> state.
        /// The state of recorder will be the <see cref="RecorderState.Recording"/> after this.
        /// It has no effect if the current state is the <see cref="RecorderState.Recording"/>.
        /// </remarks>
        /// <exception cref="InvalidOperationException">
        ///     The recorder is not in the valid state.<br/>
        ///     -or-<br/>
        ///     An internal error occurred.
        /// </exception>
        /// <exception cref="ObjectDisposedException">The recorder already has been disposed of.</exception>
        /// <since_tizen> 4 </since_tizen>
        public void Resume()
        {
            if (_state == RecorderState.Recording)
            {
                return;
            }

            ValidateState(RecorderState.Paused);

            Native.Start(Handle).ThrowIfError("Failed to resume the media recorder");

            SetState(RecorderState.Recording);
        }
Exemple #2
0
        /// <summary>
        /// Starts the recording.
        /// </summary>
        /// <remarks>
        /// The recorder must be in the <see cref="RecorderState.Ready"/> state.
        /// The state of the recorder will be the <see cref="RecorderState.Recording"/> after this. <br/>
        /// <br/>
        /// If the specified path exists, the file is removed automatically and updated by new one.<br/>
        /// The mediastorage privilege(http://tizen.org/privilege/mediastorage) is required if the path is relevant to media storage.<br/>
        /// The externalstorage privilege(http://tizen.org/privilege/externalstorage) is required if the path is relevant to external storage.<br/>
        /// <br/>
        /// In the video recorder, some preview format does not support record mode.
        /// You should use the default preview format or the <see cref="CameraPixelFormat.Nv12"/> in the record mode.
        /// </remarks>
        /// <param name="savePath">The file path for recording result.</param>
        /// <privilege>http://tizen.org/privilege/recorder</privilege>
        /// <exception cref="InvalidOperationException">
        ///     The recorder is not in the valid state.<br/>
        ///     -or-<br/>
        ///     The preview format of the camera is not supported.<br/>
        ///     -or-<br/>
        ///     An internal error occurred.
        /// </exception>
        /// <exception cref="ObjectDisposedException">The recorder already has been disposed of.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="savePath"/> is null.</exception>
        /// <exception cref="ArgumentException"><paramref name="savePath"/> is a zero-length string, contains only white space.</exception>
        /// <exception cref="UnauthorizedAccessException">Caller does not have required privilege.</exception>
        /// <seealso cref="Commit"/>
        /// <seealso cref="Cancel"/>
        /// <since_tizen> 4 </since_tizen>
        public void Start(string savePath)
        {
            ValidateState(RecorderState.Ready);

            if (savePath == null)
            {
                throw new ArgumentNullException(nameof(savePath));
            }

            if (string.IsNullOrWhiteSpace(savePath))
            {
                throw new ArgumentException($"{nameof(savePath)} is an empty string.", nameof(savePath));
            }

            Native.SetFileName(Handle, savePath).ThrowIfError("Failed to set save path.");

            Native.Start(Handle).ThrowIfError("Failed to start the media recorder");

            SetState(RecorderState.Recording);
        }