Remove unused variable
[platform/core/multimedia/libmm-camcorder.git] / src / include / mm_camcorder.h
index 494d517..4ca0807 100644 (file)
@@ -43,7 +43,7 @@
 
        @par
        Recording state and paused state exists when the mode of camcorder is
-       video-capture or audio-capture mode. In case of image-capture mode, CAPTURING state will 
+       video-capture or audio-capture mode. In case of image-capture mode, CAPTURING state will
        exsit.
 
        @par
                <td><center><b>Attribute</b></center></td>
                <td><center><b>Description</b></center></td>
        </tr>
-       <tr>
+       <tr>
                <td>#MMCAM_MODE</td>
                <td>Mode of camcorder ( still/video/audio )</td>
        </tr>
                <td><center><b>Attribute</b></center></td>
                <td><center><b>Description</b></center></td>
        </tr>
-       <tr>
+       <tr>
                <td>#MMCAM_AUDIO_ENCODER_BITRATE</td>
                <td>Bitrate of Audio Encoder</td>
        </tr>
                <td><center><b>Attribute</b></center></td>
                <td><center><b>Description</b></center></td>
        </tr>
-       <tr>
+       <tr>
                <td>#MMCAM_IMAGE_ENCODER_QUALITY</td>
                <td>Encoding quality of Image codec</td>
        </tr>
                <td><center><b>Attribute</b></center></td>
                <td><center><b>Description</b></center></td>
        </tr>
-       <tr>
+       <tr>
                <td>#MMCAM_AUDIO_VOLUME</td>
                <td>Input volume of audio source ( double value )</td>
        </tr>
@@ -621,7 +621,7 @@ extern "C" {
 /**
  * Set fraction value. Definition for fraction setting, such as MMCAM_CAMERA_SHUTTER_SPEED and MMCAM_CAMERA_EXPOSURE_VALUE.
  */
-#define MM_CAMCORDER_SET_FRACTION(numerator,denominator)       ((int)((((int)(numerator)) << 16) | (int)(denominator)))
+#define MM_CAMCORDER_SET_FRACTION(numerator, denominator)      ((int)((((int)(numerator)) << 16) | (int)(denominator)))
 
 /* Attributes Macros */
 /**
@@ -1276,12 +1276,24 @@ extern "C" {
  * The type of PTZ(Pan Tilt Zoom). Mechanical or Electonic PTZ.
  */
 #define MMCAM_CAMERA_PTZ_TYPE                   "camera-ptz-type"
+
 /**
  * Stream type and index for sound route
  */
 #define MMCAM_SOUND_STREAM_TYPE                 "sound-stream-type"
 #define MMCAM_SOUND_STREAM_INDEX                "sound-stream-index"
 
+/**
+ * The display reuse flag and sink element pointer
+ */
+#define MMCAM_DISPLAY_REUSE_HINT                "display-reuse-hint"
+#define MMCAM_DISPLAY_REUSE_ELEMENT             "display-reuse-element"
+
+/**
+ * The GBbus connection from outside
+ */
+#define MMCAM_GDBUS_CONNECTION                  "gdbus-connection"
+
 /*=======================================================================================
 | ENUM DEFINITIONS                                                                     |
 ========================================================================================*/
@@ -1319,8 +1331,7 @@ typedef enum {
 /**
  * An enumeration of Audio Format.
  */
-typedef enum
-{
+typedef enum {
        MM_CAMCORDER_AUDIO_FORMAT_PCM_U8 = 0,           /**< unsigned 8bit audio */
        MM_CAMCORDER_AUDIO_FORMAT_PCM_S16_LE = 2,       /**< signed 16bit audio. Little endian. */
 } MMCamcorderAudioFormat;
@@ -1536,7 +1547,7 @@ enum MMCamcorderGeometryMethod {
  * An enumeration for orientation values of tag .
  */
 enum MMCamcorderTagOrientation {
-       MM_CAMCORDER_TAG_ORT_NONE =0,           /**< No Orientation.*/
+       MM_CAMCORDER_TAG_ORT_NONE = 0,          /**< No Orientation.*/
        MM_CAMCORDER_TAG_ORT_0R_VT_0C_VL,       /**< The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.*/
        MM_CAMCORDER_TAG_ORT_0R_VT_0C_VR,       /**< The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.*/
        MM_CAMCORDER_TAG_ORT_0R_VB_0C_VR,       /**< The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.*/
@@ -1551,7 +1562,7 @@ enum MMCamcorderTagOrientation {
  * An enumeration for captured video orientation values of tag .
  */
 enum MMCamcorderTagVideoOrientation {
-       MM_CAMCORDER_TAG_VIDEO_ORT_NONE =0,     /**< No Orientation.*/
+       MM_CAMCORDER_TAG_VIDEO_ORT_NONE = 0,    /**< No Orientation.*/
        MM_CAMCORDER_TAG_VIDEO_ORT_90,          /**< 90 degree */
        MM_CAMCORDER_TAG_VIDEO_ORT_180, /**< 180 degree */
        MM_CAMCORDER_TAG_VIDEO_ORT_270, /**< 270 degree */
@@ -1609,13 +1620,13 @@ enum MMCamcorderPreviewType {
 /**
  * An enumeration for attribute values types.
  */
-typedef enum{
+typedef enum {
        MM_CAM_ATTRS_TYPE_INVALID = -1,         /**< Type is invalid */
        MM_CAM_ATTRS_TYPE_INT,                  /**< Integer type attribute */
        MM_CAM_ATTRS_TYPE_DOUBLE,               /**< Double type attribute */
        MM_CAM_ATTRS_TYPE_STRING,               /**< UTF-8 String type attribute */
        MM_CAM_ATTRS_TYPE_DATA,                 /**< Pointer type attribute */
-}MMCamAttrsType;
+} MMCamAttrsType;
 
 
 /**
@@ -1787,6 +1798,16 @@ typedef struct {
 
 
 /**
+ * Structure for muxed stream data.
+ */
+typedef struct {
+       void *data;             /**< pointer of muxed stream */
+       unsigned int length;    /**< length of stream buffer (in byte) */
+       unsigned long long offset;  /**< current offset for data */
+} MMCamcorderMuxedStreamDataType;
+
+
+/**
   * Prerequisite information for mm_camcorder_create()
   * The information to set prior to create.
   */
@@ -1822,7 +1843,6 @@ typedef struct _MMCamFaceDetectInfo {
        MMCamFaceInfo *face_info;               /**< face information, this should be freed after use it. */
 } MMCamFaceDetectInfo;
 
-#ifdef HAVE_WAYLAND
 /**
  * Wayland information
  */
@@ -1832,9 +1852,8 @@ typedef struct _MMCamWaylandInfo {
        int window_y;
        int window_width;
        int window_height;
-       void *evas_obj;
 } MMCamWaylandInfo;
-#endif /* HAVE_WAYLAND */
+
 
 /*=======================================================================================
 | TYPE DEFINITIONS                                                                     |
@@ -1871,6 +1890,21 @@ typedef gboolean (*mm_camcorder_audio_stream_callback)(MMCamcorderAudioStreamDat
 
 
 /**
+ *     Function definition for muxed stream callback.
+ *  Be careful! In this function, you can't call functions that change the state of camcorder such as mm_camcorder_stop(),
+ *  mm_camcorder_unrealize(), mm_camcorder_record(), mm_camcorder_commit(), and mm_camcorder_cancel(), etc.
+ *  Please don't hang this function long. It may cause low performance of camcorder or occur timeout error from encoding pipeline.
+ *  I recommend to you releasing this function ASAP.
+ *
+ *     @param[in]      stream                  Reference pointer to muxed stream data
+ *     @param[in]      user_param              User parameter which is received from user when callback function was set
+ *     @return         This function returns true on success, or false on failure.
+ *     @remarks
+ */
+typedef gboolean (*mm_camcorder_muxed_stream_callback)(MMCamcorderMuxedStreamDataType *stream, void *user_param);
+
+
+/**
  *     Function definition for video capture callback.
  *  Like '#mm_camcorder_video_stream_callback', you can't call mm_camcorder_stop() while you are hanging this function.
  *
@@ -1945,7 +1979,7 @@ int mm_camcorder_create(MMHandleType *camcorder, MMCamPreset *info);
  *  This is the finalizing function of mm_camcorder. If this function is not called or fails to call, the handle isn't released fully.
  *  This function releases attributes, mutexes, sessions, and handle itself. This function also removes all of remaining messages.
  *  So if your application should wait a certain message of mm_camcorder, please wait to call this function till getting the message.
- *     
+ *
  *
  *     @param[in]      camcorder       A handle of camcorder.
  *     @return         This function returns zero(MM_ERROR_NONE) on success, or negative value with error code.\n
@@ -2494,7 +2528,7 @@ int mm_camcorder_stop(MMHandleType camcorder);
  *     @pre            Previous state of mm-camcorder should be MM_CAMCORDER_STATE_PREPARE
  *     @post           Next state of mm-camcorder will be MM_CAMCORDER_STATE_CAPTURING
  *     @remarks        To call this function, preview should be started successfully.\n
- *                     This function is a pair of mm_camcorder_capture_stop(). 
+ *                     This function is a pair of mm_camcorder_capture_stop().
  *                     So user should call mm_camcorder_capture_stop() after getting captured image.
  *     @par example
  *     @code
@@ -2506,7 +2540,7 @@ gboolean capturing_picture()
        int err;
 
        err =  mm_camcorder_capture_start(hcam);
-       if (err < 0) 
+       if (err < 0)
        {
                printf("Fail to call mm_camcorder_capture_start  = %x\n", err);
                return FALSE;
@@ -2894,12 +2928,44 @@ gboolean setting_audio_stream_callback()
 
        return TRUE;
 }
- *     @endcode
+ *  @endcode
  */
 int mm_camcorder_set_audio_stream_callback(MMHandleType camcorder, mm_camcorder_audio_stream_callback callback, void *user_data);
 
 
 /**
+ *    mm_camcorder_set_muxed_stream_callback:\n
+ *  Set callback for user defined muxed stream callback function.
+ *  Users can retrieve muxed data using registered callback.
+ *  The callback function holds the same buffer that will be recorded.
+ *
+ *     @param[in]      camcorder       A handle of camcorder.
+ *     @param[in]      callback        Function pointer of callback function.
+ *     @param[in]      user_data       User parameter for passing to callback function.
+ *     @return         This function returns zero(MM_ERROR_NONE) on success, or negative value with error code.\n
+ *                     Please refer 'mm_error.h' to know the exact meaning of the error.
+ *     @see            mm_camcorder_muxed_stream_callback
+ *     @pre            None
+ *     @post           None
+ *     @remarks        registered 'callback' is called on internal thread of camcorder. Regardless of the status of main loop, this function will be called.
+ *     @par example
+ *     @code
+
+#include <mm_camcorder.h>
+
+gboolean setting_muxed_stream_callback()
+{
+       //set callback
+       mm_camcorder_set_muxed_stream_callback(hcam, (mm_camcorder_muxed_stream_callback)camcordertest_muxed_stream_cb, (void*)hcam);
+
+       return TRUE;
+}
+ *  @endcode
+ */
+int mm_camcorder_set_muxed_stream_callback(MMHandleType camcorder, mm_camcorder_muxed_stream_callback callback, void *user_data);
+
+
+/**
  *    mm_camcorder_get_state:\n
  *  Get the current state of camcorder.
  *  mm_camcorder is working on the base of its state. An user should check the state of mm_camcorder before calling its functions.
@@ -2932,6 +2998,7 @@ gboolean get_state_of_camcorder()
  *     @endcode
  */
 int mm_camcorder_get_state(MMHandleType camcorder, MMCamcorderStateType *state);
+int mm_camcorder_get_state2(MMHandleType camcorder, MMCamcorderStateType *state, MMCamcorderStateType *old_state);
 
 
 /**
@@ -3273,25 +3340,15 @@ gboolean stop_autofocus()
  */
 int mm_camcorder_stop_focusing(MMHandleType camcorder);
 
-/**
- *    mm_camcorder_get_video_caps:
- *  Stop focusing. This function halts focusing operation.
- *  This is the function to stop focusing in the middle of the operation.
- *  So if focusing is already finished or not started yet,
- *  this function will do nothing.
- *
- *     @param[in]      camcorder       A handle of camcorder.
- *     @return         This function returns zero(MM_ERROR_NONE) on success,
- *                     or negative value with error code.
- *                     Please refer 'mm_error.h' to know the exact meaning of the error.
- *     @see            mm_camcorder_create
- *     @pre            mm_camcorder_realize() should be called before calling this function.
- *     @post           None
- *     @remarks        None
- *     @par example
- *     @code
- */
-int mm_camcorder_get_video_caps(MMHandleType handle, char **caps);
+/* emit signal */
+void mm_camcorder_emit_signal(MMHandleType camcorder, const char *object_name,
+       const char *interface_name, const char *signal_name, int value);
+
+/* check compatability between codec and file format */
+int mm_camcorder_check_codec_fileformat_compatibility(const char *codec_type, int codec, int file_format);
+
+/* external storage state management */
+int mm_camcorder_manage_external_storage_state(MMHandleType camcorder, int storage_state);
 
 /**
        @}