diff options
author | hj kim <backto.kim@samsung.com> | 2020-04-21 17:16:22 +0900 |
---|---|---|
committer | hj kim <backto.kim@samsung.com> | 2020-04-21 17:16:37 +0900 |
commit | 6ada3d9b060113e9dd3871e247bbb920bad02966 (patch) | |
tree | 9e60092258f01126d4f0c13f04ec9fbd70f796d5 | |
parent | af09f087f8f5120330609536be8aa251bfb9e56f (diff) | |
download | gst-plugins-camera-n4-tizen_6.5.tar.gz gst-plugins-camera-n4-tizen_6.5.tar.bz2 gst-plugins-camera-n4-tizen_6.5.zip |
Use mm_util_encode_to_jpeg_memory() instead of old deprecated mm_util_jpeg_encode_to_memory()tizen_7.0_m2_releasetizen_6.5.m2_releasetizen_6.0.m2_releasesubmit/tizen_6.5/20211028.161601submit/tizen_6.0_hotfix/20201103.114801submit/tizen_6.0_hotfix/20201102.192501submit/tizen_6.0/20201029.205101submit/tizen/20200423.093243submit/tizen/20200422.053736accepted/tizen/unified/20200424.141606accepted/tizen/7.0/unified/hotfix/20221116.104505accepted/tizen/7.0/unified/20221110.061441accepted/tizen/6.5/unified/20211028.093603accepted/tizen/6.0/unified/hotfix/20201103.052345accepted/tizen/6.0/unified/20201030.123808tizen_7.0_hotfixtizen_7.0tizen_6.5tizen_6.0_hotfixtizen_6.0tizenaccepted/tizen_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unified
Change-Id: I90bf45f3f995cf12281aa6a352f3f57fe1ded9a4
-rw-r--r-- | camerasrc/src/gstcamerasrc.c | 32 | ||||
-rw-r--r-- | packaging/gst-plugins-camera-n4.spec | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/camerasrc/src/gstcamerasrc.c b/camerasrc/src/gstcamerasrc.c index 8d4734e..2af1721 100644 --- a/camerasrc/src/gstcamerasrc.c +++ b/camerasrc/src/gstcamerasrc.c @@ -37,6 +37,7 @@ #include <mm_error.h> #include <mm_types.h> +#include <mm_util_image.h> #include <mm_util_jpeg.h> #include "gstcamerasrc.h" @@ -1934,16 +1935,18 @@ static gboolean _gst_camerasrc_NV21_to_I420(GstCameraSrc *camerasrc, unsigned ch static gboolean gst_camerasrc_jpeg_capture(GstCameraSrc *camerasrc, gint buffer_index, GstCameraBuffer *buffer) { - int ret = 0; + int ret = MM_UTIL_ERROR_NONE; unsigned char *buffer_I420 = NULL; - unsigned char *jpeg_result = NULL; - unsigned int jpeg_size = 0; + void *jpeg_result = NULL; + size_t jpeg_size = 0; GstCaps *main_caps = NULL; GstBuffer *main_buffer = NULL; GstSample *main_sample = NULL; camerasrc_frame_data_t frame_data; + mm_util_image_h decoded = NULL; + size_t src_size = 0; GST_INFO_OBJECT(camerasrc, "Start to encode image"); @@ -1967,22 +1970,19 @@ static gboolean gst_camerasrc_jpeg_capture(GstCameraSrc *camerasrc, gint buffer_ return FALSE; } - ret = mm_util_jpeg_encode_to_memory((void **)&jpeg_result, &jpeg_size, - buffer_I420, camerasrc->width, camerasrc->height, - MM_UTIL_COLOR_YUV420, camerasrc->cap_jpg_quality); - + src_size = (camerasrc->width * camerasrc->height * 3) >> 1; + ret = mm_image_create_image(camerasrc->width, camerasrc->height, MM_UTIL_COLOR_YUV420, buffer_I420, src_size, &decoded); /* release converted src buffer */ free(buffer_I420); - buffer_I420 = NULL; - - if (ret != MM_ERROR_NONE || jpeg_result == NULL) { - GST_ERROR_OBJECT(camerasrc, "jpeg encoding failed %p, 0x%x", jpeg_result, ret); - - if (jpeg_result) { - free(jpeg_result); - jpeg_result = NULL; - } + if (ret != MM_UTIL_ERROR_NONE) { + GST_ERROR_OBJECT(camerasrc, "mm_image_create_image failed [%d]", ret); + return FALSE; + } + ret = mm_util_encode_to_jpeg_memory(decoded, camerasrc->cap_jpg_quality, &jpeg_result, &jpeg_size); + mm_image_destroy_image(decoded); + if (ret != MM_UTIL_ERROR_NONE) { + GST_ERROR_OBJECT(camerasrc, "mm_util_encode_to_jpeg_memory failed [%d]", ret); return FALSE; } diff --git a/packaging/gst-plugins-camera-n4.spec b/packaging/gst-plugins-camera-n4.spec index 61d49f8..bd42c60 100644 --- a/packaging/gst-plugins-camera-n4.spec +++ b/packaging/gst-plugins-camera-n4.spec @@ -1,6 +1,6 @@ Name: gst-plugins-camera-n4 Summary: GStreamer codec plugins package for N4 -Version: 0.0.9 +Version: 0.0.10 Release: 0 Group: Multimedia/Framework License: LGPL-2.1 |