The StreamRecorder API provides functions for StreamRecorder with buffer including media packet.
Required Header
#include <streamrecorder.h>
Overview
The StreamRecorder API allows application developers to support using the video or audio recorder. It includes functions that record video or audio and supports to set up notifications for state changes of creation, prepared, record, pause, information about resolution and binary data format, and functions for artistic.
The StreamRecorder API allows creation of components required in recording video or audio including:
- selecting a proper output format
- controlling the StreamRecorder state
- getting supported formats and video resolutions
The StreamRecorder API also notifies you (by callback mechanism) when a significant parameter changes.
Difference
Basically, the StreamRecorder API can help easily to make video/audio content same as the Recorder API.
However, the StreamRecorder API is different from Recorder API.
The StreamRecorder API is able to record user buffer from application. This allows the user to make unique contents with a purpose.
Difference | Recorder | StreamRecorder |
INPUT | Camera / Mic Device | Media Packet / Buffer |
State Diagram
State Transitions
Callback(Event) Operations
The callback mechanism is used to notify the application about significant StreamRecorder events.
Foreach Operations
Typedef Documentation
The Streamrecorder handle.
- Since :
- 3.0
Enumeration Type Documentation
Enumeration for the audio codec.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_AUDIO_CODEC_AMR |
AMR codec
|
STREAMRECORDER_AUDIO_CODEC_AAC |
AAC codec
|
STREAMRECORDER_AUDIO_CODEC_PCM |
PCM codec
|
Enumeration for Streamrecorder error type.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_ERROR_NONE |
Successful
|
STREAMRECORDER_ERROR_INVALID_PARAMETER |
Invalid parameter
|
STREAMRECORDER_ERROR_INVALID_STATE |
Invalid state
|
STREAMRECORDER_ERROR_OUT_OF_MEMORY |
Out of memory
|
STREAMRECORDER_ERROR_INVALID_OPERATION |
Internal error
|
STREAMRECORDER_ERROR_OUT_OF_STORAGE |
Out of storage
|
STREAMRECORDER_ERROR_PERMISSION_DENIED |
The access to the resources can not be granted
|
STREAMRECORDER_ERROR_NOT_SUPPORTED |
The feature is not supported
|
Enumeration for the file container format.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_FILE_FORMAT_3GP |
3GP file format
|
STREAMRECORDER_FILE_FORMAT_MP4 |
MP4 file format
|
STREAMRECORDER_FILE_FORMAT_AMR |
AMR file format
|
STREAMRECORDER_FILE_FORMAT_ADTS |
ADTS file format
|
STREAMRECORDER_FILE_FORMAT_WAV |
WAV file format
|
Enumeration for the Streamrecorder notification.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_NOTIFY_NONE |
None
|
STREAMRECORDER_NOTIFY_STATE_CHANGED |
The notification of normal state changes
|
Enumeration for the recording limit reached.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_RECORDING_LIMIT_TYPE_TIME |
Time limit (second) of recording file
|
STREAMRECORDER_RECORDING_LIMIT_TYPE_SIZE |
Size limit (kilo bytes [KB]) of recording file
|
Enumeration for the source type.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_SOURCE_VIDEO |
Video only
|
STREAMRECORDER_SOURCE_AUDIO |
Audio only
|
STREAMRECORDER_SOURCE_VIDEO_AUDIO |
Video and Audio
|
Enumeration for Streamrecorder states.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_STATE_NONE |
StreamRecorder is not created
|
STREAMRECORDER_STATE_CREATED |
StreamRecorder is created, but not prepared
|
STREAMRECORDER_STATE_PREPARED |
StreamRecorder is prepared to record
|
STREAMRECORDER_STATE_RECORDING |
StreamRecorder is recording media
|
STREAMRECORDER_STATE_PAUSED |
StreamRecorder is paused while recording media
|
Enumeration for the video codec.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_VIDEO_CODEC_H263 |
H263 codec
|
STREAMRECORDER_VIDEO_CODEC_MPEG4 |
MPEG4 codec
|
Enumeration for the pixel format.
- Since :
- 3.0
- Enumerator:
STREAMRECORDER_VIDEO_SOURCE_FORMAT_INVALID |
Invalid pixel format
|
STREAMRECORDER_VIDEO_SOURCE_FORMAT_NV12 |
NV12 pixel format
|
STREAMRECORDER_VIDEO_SOURCE_FORMAT_NV21 |
NV12 pixel format
|
STREAMRECORDER_VIDEO_SOURCE_FORMAT_I420 |
I420 pixel format
|
STREAMRECORDER_VIDEO_SOURCE_FORMAT_NUM |
Number of the video source format
|
Function Documentation
Creates a streamrecorder handle to record a video or audio.
- Since :
- 3.0
- Parameters:
-
[out] | recorder | A handle to the streamrecorder |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Destroys the streamrecorder handle.
- Since :
- 3.0
- Parameters:
-
[in] | recorder | The handle to the streamrecorder |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- The recorder state should be STREAMRECORDER_STATE_CREATED.
- Postcondition:
- The recorder state will be STREAMRECORDER_STATE_NONE.
Sets the video source as live buffer to be used for recording.
- Since :
- 3.0
- Parameters:
-
[in] | recorder | A handle to the streamrecorder |
[in] | type | The type of source input |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- The streamrecorder state must be only STREAMRECORDER_STATE_CREATED
Gets the streamrecorder's current state.
- Since :
- 3.0
- Parameters:
-
[in] | recorder | The handle to the streamrecorder |
[out] | state | The current state of the streamrecorder |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Pushes buffer to StreamRecorder to record audio/video.
- Since :
- 3.0
- Parameters:
-
[in] | recorder | The handle to the streamrecorder |
[in] | inbuf | The media packet containing buffer and other associated values |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-