New APIs are added
[platform/core/api/recorder.git] / include / recorder.h
index 682a2ee..fb9be7e 100644 (file)
@@ -161,6 +161,25 @@ typedef enum {
 } recorder_policy_e;
 
 /**
+ * @brief Enumeration for the recorder type.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       RECORDER_TYPE_AUDIO = 0,    /**< Audio only recorder */
+       RECORDER_TYPE_VIDEO         /**< Video recorder (audio is optional) */
+} recorder_type_e;
+
+/**
+ * @brief Enumeration for the recorder device state.
+ * @since_tizen 3.0
+ */
+typedef enum {
+       RECORDER_DEVICE_STATE_IDLE = 0,     /**< No recording in progress */
+       RECORDER_DEVICE_STATE_RECORDING,    /**< Now recording */
+       RECORDER_DEVICE_STATE_PAUSED        /**< All recordings are paused */
+} recorder_device_state_e;
+
+/**
  * @}
 */
 
@@ -216,6 +235,16 @@ typedef void (*recorder_recording_status_cb)(unsigned long long elapsed_time, un
 typedef void (*recorder_state_changed_cb)(recorder_state_e previous , recorder_state_e current , bool by_policy, void *user_data);
 
 /**
+ * @brief Called when the recorder device state is changed.
+ * @since_tizen 3.0
+ * @param[in] type The recorder type
+ * @param[in] state The state of the recorder device
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see        recorder_add_device_state_changed_cb()
+ */
+typedef void (*recorder_device_state_changed_cb)(recorder_type_e type, recorder_device_state_e state, void *user_data);
+
+/**
  * @brief Called when the recorder is interrupted by a policy.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] policy        The policy that is interrupting the recorder
@@ -1154,6 +1183,50 @@ int recorder_unset_error_cb(recorder_h recorder);
 
 
 /**
+ * @brief Gets the state of recorder device.
+ * @since_tizen 3.0
+ * @param[in] type The recorder type
+ * @param[out] state The current state of the device
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
+ */
+int recorder_get_device_state(recorder_type_e type, recorder_device_state_e *state);
+
+/**
+ * @brief Registers a callback function to be called when the recorder device state changes.
+ * @since_tizen 3.0
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @param[out] cb_id The id of the registered callback
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #RECORDER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
+ * @post This function will invoke recorder_device_state_changed_cb() when the recorder device's state changes.
+ * @see recorder_remove_device_state_changed_cb()
+ * @see recorder_device_state_changed_cb()
+ */
+int recorder_add_device_state_changed_cb(recorder_device_state_changed_cb callback, void *user_data, int *cb_id);
+
+/**
+ * @brief Unregisters a callback function.
+ * @since_tizen 3.0
+ * @param[in] cb_id The id of the registered callback
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
+ * @see recorder_add_device_state_changed_cb()
+ */
+int recorder_remove_device_state_changed_cb(int cb_id);
+
+/**
  * @}
  */