1. Fix prevent issue 87/40287/3 tizen_3.0.2015.q2_common accepted/tizen/common/20150603.075156 accepted/tizen/mobile/20150603.082706 accepted/tizen/tv/20150603.083311 accepted/tizen/wearable/20150603.083007 submit/tizen/20150602.025305
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 2 Jun 2015 01:21:59 +0000 (10:21 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 2 Jun 2015 01:26:04 +0000 (10:26 +0900)
2. Add new structure - MMVideoBuffer

Change-Id: I8d8d9b269603b69502c20fba28053ec8217fa1a6
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
include/mm_types.h
mm_attrs_private.c
packaging/libmm-common.spec

index 1eb029f..1a23c66 100644 (file)
@@ -49,8 +49,8 @@
 
 /**
  * @def Defines range of logical volume factor.
- * It's for logical volume control in player. 
- * So, don't use this one for media volume. 
+ * It's for logical volume control in player.
+ * So, don't use this one for media volume.
  * range : 0 ~ 1.0 (1.0 = 100%)
  */
 #define MM_VOLUME_LEVEL_MIN    0       /**< Minimum factor of volume */
@@ -69,7 +69,6 @@ enum MMVideoDeviceType {
        MM_VIDEO_DEVICE_NONE = -1,      /**< No camera */
        MM_VIDEO_DEVICE_CAMERA0,        /**< Primary camera */
        MM_VIDEO_DEVICE_CAMERA1,        /**< Secondary camera */
-       MM_VIDEO_DEVICE_CAMERAPLEX, /**< Primary camera + Secondary camera */
        MM_VIDEO_DEVICE_NUM,            /**< Number of video capture devices */
 };
 
@@ -348,8 +347,8 @@ enum MMFileFormatType {
         MM_FILE_FORMAT_WMA,             /**< WMA file format */
         MM_FILE_FORMAT_WMV,             /**< WMV file format */
         MM_FILE_FORMAT_JPG,             /**< JPEG file format */
-        MM_FILE_FORMAT_FLAC,                           /**< FLAC file format */
-        MM_FILE_FORMAT_M2TS,            /**< MPEG2-TransportStream file format */
+        MM_FILE_FORMAT_FLAC,            /**< FLAC file format */
+        MM_FILE_FORMAT_M2TS,            /**< MPEG2-Transport Stream file format */
         MM_FILE_FORMAT_NUM,             /**< Number of file format type */
 };
 
@@ -499,6 +498,49 @@ typedef enum  {
        MM_DISPLAY_METHOD_CUSTOM_ROI_LETER_BOX
 }MMDisplayGeometryMethodRoiMode;
 
+
+#define MM_VIDEO_BUFFER_PLANE_MAX   4  /**< Max num of video buffer plane */
+/*
+ * Enumerations of multimedia video buffer type
+ */
+typedef enum {
+       MM_VIDEO_BUFFER_TYPE_PHYSICAL_ADDRESS = 0,
+       MM_VIDEO_BUFFER_TYPE_DMABUF_FD,
+       MM_VIDEO_BUFFER_TYPE_TBM_BO
+} MMVideoBufferType;
+
+typedef struct {
+       void *paddr[MM_VIDEO_BUFFER_PLANE_MAX];         /**< physical address */
+       int dmabuf_fd[MM_VIDEO_BUFFER_PLANE_MAX];       /**< dmabuf fd */
+       void *bo[MM_VIDEO_BUFFER_PLANE_MAX];            /**< TBM bo */
+} MMVideoBufferHandle;
+
+/*
+ * Type definition of multimedia video buffer
+ */
+typedef struct {
+       MMVideoBufferType type;                                 /**< buffer type
+                                                                     - The field of handle that type indicates should be filled,
+                                                                       and other fields of handle are optional. */
+       MMPixelFormatType format;                               /**< buffer type */
+       int plane_num;                                          /**< number of planes */
+       int width[MM_VIDEO_BUFFER_PLANE_MAX];                   /**< width of buffer */
+       int height[MM_VIDEO_BUFFER_PLANE_MAX];                  /**< height of buffer */
+       int stride_width[MM_VIDEO_BUFFER_PLANE_MAX];            /**< stride width of buffer */
+       int stride_height[MM_VIDEO_BUFFER_PLANE_MAX];           /**< stride height of buffer */
+       int size[MM_VIDEO_BUFFER_PLANE_MAX];                    /**< size of planes */
+       void *data[MM_VIDEO_BUFFER_PLANE_MAX];                  /**< data pointer(user address) of planes */
+       int handle_num;                                         /**< number of buffer handle */
+       int handle_size[MM_VIDEO_BUFFER_PLANE_MAX];             /**< size of handles */
+       MMVideoBufferHandle handle;                             /**< handle of buffer */
+       int is_secured;                                         /**< secured buffer flag. ex) TrustZone memory, user can not access it. */
+       int flush_request;                                      /**< flush request flag
+                                                                     - If this flag is TRUE, sink element will make copy of last buffer,
+                                                                       and it will return all buffers from src element.
+                                                                       Then, src element can restart without changing pipeline state. */
+} MMVideoBuffer;
+
+
 #ifdef __cplusplus
        }
 #endif
index 973687c..6f82972 100644 (file)
@@ -485,9 +485,9 @@ int mmf_attribute_set_string(mmf_attribute_t *item, const char *string, int size
        return_val_if_fail(item, -1);
 
        if (mmf_value_set_string(&item->tmpval, string,size) == 0) {
-               if (string) 
-                       item->flags |= MM_ATTRS_FLAG_MODIFIED; 
-               
+               if (string)
+                       item->flags |= MM_ATTRS_FLAG_MODIFIED;
+
                return 0;
        }
        return -1;
@@ -517,6 +517,7 @@ MMHandleType mmf_attrs_new(int count)
 
        attrs->count = count;
        attrs->items = (mmf_attribute_t *) malloc (sizeof(mmf_attribute_t) * count);
+       return_val_if_fail(attrs->items, 0);
        memset(attrs->items, 0, sizeof(mmf_attribute_t) * count);
 
        if (pthread_mutex_init(&attrs->write_lock, NULL) != 0) {
index 34e3d87..6d753e9 100644 (file)
@@ -1,7 +1,7 @@
 Name:       libmm-common
 Summary:    Multimedia Framework Common Lib
-Version:    0.2.85
-Release:    1
+Version:    0.2.86
+Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz