Change flag for some attributes
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_gstcommon.c
index 2204baf..3bc8440 100644 (file)
@@ -396,8 +396,7 @@ int _mmcamcorder_create_preview_elements(MMHandleType handle)
 
                if (sink_element) {
                        int attr_index = 0;
-                       mmf_attrs_t *attrs = MMF_CAMCORDER_ATTRS(handle);
-                       mmf_attribute_t *attr_item = NULL;
+                       MMHandleType attrs = MMF_CAMCORDER_ATTRS(handle);
 
                        _mmcam_dbg_log("reuse sink element %p in attribute", sink_element);
 
@@ -406,9 +405,8 @@ int _mmcamcorder_create_preview_elements(MMHandleType handle)
                        /* reset attribute */
                        if (attrs) {
                                mm_attrs_get_index((MMHandleType)attrs, MMCAM_DISPLAY_REUSE_ELEMENT, &attr_index);
-                               attr_item = &attrs->items[attr_index];
-                               mmf_attribute_set_data(attr_item, NULL, 0);
-                               mmf_attribute_commit(attr_item);
+                               mm_attrs_set_data(attrs, attr_index, NULL, 0);
+                               mm_attrs_commit(attrs, attr_index);
                        } else {
                                _mmcam_dbg_warn("attribute is NULL");
                                err = MM_ERROR_CAMCORDER_NOT_INITIALIZED;
@@ -1865,6 +1863,14 @@ static GstPadProbeReturn __mmcamcorder_video_dataprobe_preview(GstPad *pad, GstP
                                stream.stride[0] = stream.width << 1;
                                stream.elevation[0] = stream.height;
                                break;
+                       case MM_PIXEL_FORMAT_RGBA:
+                       case MM_PIXEL_FORMAT_ARGB:
+                               stream.data_type = MM_CAM_STREAM_DATA_RGB;
+                               stream.data.rgb.data = mapinfo.data;
+                               stream.data.rgb.length_data = stream.length_total;
+                               stream.stride[0] = stream.width << 2;
+                               stream.elevation[0] = stream.height;
+                               break;
                        default:
                                stream.data_type = MM_CAM_STREAM_DATA_YUV420;
                                stream.data.yuv420.yuv = mapinfo.data;
@@ -2158,7 +2164,7 @@ GstPadProbeReturn __mmcamcorder_eventprobe_monitor(GstPad *pad, GstPadProbeInfo
                        const GstSegment *segment;
                        gst_event_parse_segment(event, &segment);
                        if (segment->format == GST_FORMAT_BYTES) {
-                               _mmcam_dbg_log("change current offset %llu -> %llu",
+                               _mmcam_dbg_log("change current offset %llu -> %"G_GUINT64_FORMAT,
                                        sc->muxed_stream_offset, segment->start);
 
                                sc->muxed_stream_offset = (unsigned long long)segment->start;
@@ -2714,7 +2720,16 @@ bool _mmcamcorder_set_videosrc_caps(MMHandleType handle, unsigned int fourcc, in
                }
 
                if (caps) {
-                       _mmcam_dbg_log("vidoesrc new caps set. %"GST_PTR_FORMAT, caps);
+                       gchar *caps_str = gst_caps_to_string(caps);
+
+                       if (caps_str) {
+                               _mmcam_dbg_log("vidoesrc new caps set [%s]", caps_str);
+                               g_free(caps_str);
+                               caps_str = NULL;
+                       } else {
+                               _mmcam_dbg_warn("caps string failed");
+                       }
+
                        MMCAMCORDER_G_OBJECT_SET_POINTER(sc->element[_MMCAMCORDER_VIDEOSRC_FILT].gst, "caps", caps);
                        gst_caps_unref(caps);
                        caps = NULL;