}
/// <summary>
- /// The stream recorder class provides methods to create stream recorder,
- /// to start, stop and save the pushed content.
+ /// Provides methods to control stream recorder.
/// </summary>
+ /// <remarks>
+ /// StreamRecorder class provides functions to record raw image frame
+ /// also provides recording start, stop and save the content etc.
+ /// </remarks>
public class StreamRecorder : IDisposable
{
private IntPtr _handle;
private bool _disposed = false;
+ /// <summary>
+ /// Occurred when recording is progressing for recording status.
+ /// </summary>
private EventHandler<RecordingStatusChangedEventArgs> _recordingStatusChanged;
private Interop.StreamRecorder.RecordingStatusCallback _recordingStatusCallback;
+ /// <summary>
+ /// Occurred when recording time or size reach limit.
+ /// </summary>
private EventHandler<StreamRecordingLimitReachedEventArgs> _recordingLimitReached;
private Interop.StreamRecorder.RecordingLimitReachedCallback _recordingLimitReachedCallback;
+ /// <summary>
+ /// Occurred when streamrecorder complete to use pushed buffer.
+ /// </summary>
private EventHandler<StreamRecordingBufferConsumedEventArgs> _bufferConsumed;
private Interop.StreamRecorder.BufferConsumedCallback _bufferConsumedCallback;
+ /// <summary>
+ /// Occurred when streamrecorder state is changed.
+ /// </summary>
private EventHandler<StreamRecorderNotifiedEventArgs> _recorderNotified;
private Interop.StreamRecorder.NotifiedCallback _notifiedCallback;
+ /// <summary>
+ /// Occurred when error is occured.
+ /// </summary>
private EventHandler<StreamRecordingErrorOccurredEventArgs> _recordingErrorOccurred;
private Interop.StreamRecorder.RecorderErrorCallback _recorderErrorCallback;
+
private List<StreamRecorderFileFormat> _formats;
private List<StreamRecorderAudioCodec> _audioCodec;
private List<StreamRecorderVideoCodec> _videoCodec;
}
/// <summary>
- /// Event that occurs when recorder is interrupted.
+ /// Event that occurs when streamrecorder state is changed.
/// </summary>
public event EventHandler<StreamRecorderNotifiedEventArgs> RecorderNotified
{
}
/// <summary>
- /// Event that occurs when recording information changes.
+ /// Event that occurs when recording status changed.
/// </summary>
public event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged
{
}
/// <summary>
- /// Event that occurs when an error occurs during recorder operation.
+ /// Event that occurs when an error occured during recorder operation.
/// </summary>
public event EventHandler<StreamRecordingErrorOccurredEventArgs> RecordingErrorOccurred
{
}
/// <summary>
- /// The current state of the stream recorder.
+ /// Get the current state of the stream recorder.
/// </summary>
+ /// <value> The current state of stream recorder.
public StreamRecorderState State
{
get
}
/// <summary>
- /// The file format for recording media stream.
+ /// Get/Set the file format for recording media stream.
/// </summary>
+ /// <remarks>
+ /// Must set <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>.
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// </remarks>
+ /// <exception cref="ArgumentException">The format does not valid.</exception>
+ /// <seealso cref="SupportedFileFormats"/>
public StreamRecorderFileFormat FileFormat
{
get
/// <summary>
/// The audio codec for encoding an audio stream.
/// </summary>
+ /// <remarks>
+ /// Must set <see cref="StreamRecorderSourceType.Audio"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// </remarks>
+ /// <exception cref="ArgumentException">The codec does not valid.</exception>
+ /// <seealso cref="SupportedAudioEncodings"/>
public StreamRecorderAudioCodec AudioCodec
{
get
/// <summary>
/// The video codec for encoding video stream.
/// </summary>
+ /// <remarks>
+ /// Must set <see cref="StreamRecorderSourceType.Video"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// </remarks>
+ /// <exception cref="ArgumentException">The codec does not valid.</exception>
+ /// <seealso cref="SupportedVideoEncodings"/>
public StreamRecorderVideoCodec VideoCodec
{
get
/// <remarks>
/// After reaching the limitation, the data which is being recorded will
/// be discarded and not written to the file.
- /// The recorder state must be in 'Prepared' or 'Created' state.
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
/// </remarks>
- ///
+ /// <exception cref="ArgumentException">The value set to below 0.</exception>
+ /// <seealso cref="StreamRecordingLimitReachedEventArgs"/>
public int SizeLimit
{
get
/// <remarks>
/// After reaching the limitation, the data which is being recorded will
/// be discarded and not written to the file.
- /// The recorder state must be in 'Prepared' or 'Created' state.
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
/// </remarks>
+ /// <exception cref="ArgumentException">The value set to below 0.</exception>
+ /// <seealso cref="StreamRecordingLimitReachedEventArgs"/>
public int TimeLimit
{
get
/// <summary>
/// The sampling rate of an audio stream in hertz.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// Must set <see cref="StreamRecorderSourceType.Audio"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>.
+ /// </remarks>
+ /// <exception cref="ArgumentException">The value set to below 0.</exception>
public int AudioSampleRate
{
get
/// <summary>
/// The bitrate of an audio encoder in bits per second.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// Must set <see cref="StreamRecorderSourceType.Audio"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// </remarks>
+ /// <exception cref="ArgumentException">The value set to below 0.</exception>
public int AudioBitRate
{
get
/// <summary>
/// The bitrate of an video encoder in bits per second.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// Must set <see cref="StreamRecorderSourceType.Video"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// </remarks>
+ /// <exception cref="ArgumentException">The value set to below 0.</exception>
public int VideoBitRate
{
get
/// <summary>
/// The video frame rate for recording media stream.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// Must set <see cref="StreamRecorderSourceType.Video"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// </remarks>
+ /// <exception cref="NotSupportedException">The value set to below 0.</exception>
public int VideoFrameRate
{
get
}
/// <summary>
- /// The video frame rate for recording media stream.
+ /// Get or Set the video source format for recording media stream.
/// </summary>
+ /// <exception cref="ArgumentException">The value set to a invalid value.</exception>
+ /// <seealso cref="StreamRecorderVideoSourceFormat"/>
public StreamRecorderVideoSourceFormat VideoSourceFormat
{
get
/// The attribute is applied only in Created state.
/// For mono recording, set channel to 1.
/// For stereo recording, set channel to 2.
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
/// </remarks>
+ /// <exception cref="ArgumentException">The value set to a invalid value.</exception>
public int AudioChannel
{
get
/// <summary>
/// Video resolution of the video recording.
/// </summary>
+ /// <remarks>
+ /// Must set <see cref="StreamRecorderSourceType.Video"/> or <see cref="StreamRecorderSourceType.VideoAudio"/>
+ /// by <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>
+ /// The recorder state must be <see cref="StreamRecorderState.Created"/> state.
+ /// </remarks>
+ /// <exception cref="ArgumentException">The value set to a invalid value.</exception>
+ /// <seealso cref="SupportedVideoResolutions"/>
public StreamRecorderVideoResolution Resolution
{
get
/// It returns a list containing all the supported file
/// formats by Stream recorder.
/// </returns>
+ /// <seealso cref="StreamRecorderFileFormat"/>
public IEnumerable<StreamRecorderFileFormat> SupportedFileFormats
{
get
/// It returns a list containing all the supported audio encoders
/// by recorder.
/// </returns>
+ /// <seealso cref="StreamRecorderAudioCodec"/>
public IEnumerable<StreamRecorderAudioCodec> SupportedAudioEncodings
{
get
/// It returns a list containing all the supported video encoders
/// by recorder.
/// </returns>
+ /// <seealso cref="StreamRecorderVideoCodec"/>
public IEnumerable<StreamRecorderVideoCodec> SupportedVideoEncodings
{
get
/// It returns videoresolution list containing the width and height of
/// different resolutions supported by recorder.
/// </returns>
+ /// <seealso cref="StreamRecorderVideoResolution"/>
public IEnumerable<StreamRecorderVideoResolution> SupportedVideoResolutions
{
get
/// Prepare the stream recorder.
/// </summary>
/// <remarks>
- /// Before calling the function, it is required to set AudioEncoder,
- /// videoencoder and fileformat properties of recorder.
+ /// Before calling the function, it is required to set <see cref="StreamRecorder.EnableSourceBuffer(StreamRecorderSourceType)"/>,
+ /// <see cref="StreamRecorderAudioCodec"/>, <see cref="StreamRecorderVideoCodec"/> and <see cref="StreamRecorderFileFormat"/> properties of recorder.
/// </remarks>
+ /// <exception cref="InvalidOperationException">The streamrecorder is not in the valid state.</exception>
+ /// <seealso cref="Unprepare"/>
public void Prepare()
{
int ret = Interop.StreamRecorder.Prepare (_handle);
/// <summary>
/// Resets the stream recorder.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Prepared"/> state by <see cref="Prepare"/>, <see cref="Cancel"/> and <see cref="Commit"/>.
+ /// The StreamRecorder state will be <see cref="StreamRecorderState.Created"/>.
+ /// </remarks>
+ /// <exception cref="InvalidOperationException">The streamrecorder is not in the valid state.</exception>
+ /// <seealso cref="Prepare"/>
public void Unprepare()
{
int ret = Interop.StreamRecorder.Unprepare (_handle);
/// <remarks>
/// If file path has been set to an existing file, this file is removed automatically and updated by new one.
/// The filename should be set before this function is invoked.
+ /// The recorder state must be <see cref="StreamRecorderState.Prepared"/> state by <see cref="Prepare"/> or
+ /// <see cref="StreamRecorderState.Paused"/> state by <see cref="Pause"/>.
+ /// The filename shuild be set by <see cref="FilePath"/>
/// </remarks>
+ /// <exception cref="InvalidOperationException">The streamrecorder is not in the valid state.</exception>
+ /// <exception cref="UnauthorizedAccessException">The access ot the resources can not be granted.</exception>
+ /// <seealso cref="Pause"/>
+ /// <seealso cref="Commit"/>
+ /// <seealso cref="Cancel"/>
+ /// <seealso cref="FilePath"/>
+ /// <seealso cref="FileFormat"/>
public void Start()
{
int ret = Interop.StreamRecorder.Start (_handle);
/// Pause the recording.
/// </summary>
/// <remarks>
- /// Recording can be resumed with Start().
+ /// Recording can be resumed with <see cref="Start"/>.
/// </remarks>
+ /// <exception cref="InvalidOperationException">The streamrecorder is not in the valid state.</exception>
+ /// <seealso cref="Start"/>
+ /// <seealso cref="Commit"/>
+ /// <seealso cref="Cancel"/>
public void Pause()
{
int ret = Interop.StreamRecorder.Pause (_handle);
/// <summary>
/// Stops recording and saves the result.
/// </summary>
+ /// <remarks>
+ /// The recorder state must be <see cref="StreamRecorderState.Recording"/> state by <see cref="Start"/> or
+ /// <see cref="StreamRecorderState.Paused"/> state by <see cref="Pause"/>
+ /// When you want to record audio or video file, you need to add privilege according to rules below additionally.
+ /// <para>
+ /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage.
+ /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
+ /// </para>
+ /// </remarks>
+ /// <exception cref="InvalidOperationException">The streamrecorder is not in the valid state.</exception>
+ /// <exception cref="UnauthorizedAccessException">The access ot the resources can not be granted.</exception>
+ /// <seealso cref="Start"/>
+ /// <seealso cref="Pause"/>
public void Commit()
{
int ret = Interop.StreamRecorder.Commit (_handle);
/// Cancels the recording.
/// The recording data is discarded and not written in the recording file.
/// </summary>
+ /// <seealso cref="Start"/>
+ /// <seealso cref="Pause"/>
public void Cancel()
{
int ret = Interop.StreamRecorder.Cancel (_handle);