summaryrefslogtreecommitdiff
path: root/server/thumb-server-internal.c
diff options
context:
space:
mode:
authorhj kim <backto.kim@samsung.com>2020-03-06 04:21:38 (GMT)
committerhj kim <backto.kim@samsung.com>2020-03-13 06:52:23 (GMT)
commit7987cc930a4af11c432f21de47b826332590d8ca (patch)
tree8549122c919b9ab84dea6ea2117d10e8cc9e5c98 /server/thumb-server-internal.c
parent07702e87ee405bff94c3d66aa84f6424f5865dc4 (diff)
downloadlibmedia-thumbnail-7987cc930a4af11c432f21de47b826332590d8ca.zip
libmedia-thumbnail-7987cc930a4af11c432f21de47b826332590d8ca.tar.gz
libmedia-thumbnail-7987cc930a4af11c432f21de47b826332590d8ca.tar.bz2
Create New APIs for Creating Video Thumbnailrefs/changes/58/226858/17
To unify duplicated thumbnail extracting codes in libmedia-service, libmedia-thumbnail and thumbnail-util Change-Id: I1d9fd61349fe02086240db07e3b22a058518c65e
Diffstat (limited to 'server/thumb-server-internal.c')
-rwxr-xr-xserver/thumb-server-internal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/thumb-server-internal.c b/server/thumb-server-internal.c
index 33716ca..d65adf7 100755
--- a/server/thumb-server-internal.c
+++ b/server/thumb-server-internal.c
@@ -22,6 +22,7 @@
#include "thumb-server-internal.h"
#include "media-thumb-util.h"
#include "media-thumb-debug.h"
+#include "media-thumbnail.h"
#include <fcntl.h>
#include <unistd.h>
@@ -55,8 +56,8 @@ static int __thumbnail_get_data(const char *origin_path, char *thumb_path)
err = _media_thumb_image(origin_path, thumb_path, THUMB_DEFAULT_WIDTH, THUMB_DEFAULT_HEIGHT, NULL);
thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_image failed");
} else if (file_type == THUMB_VIDEO_TYPE) {
- err = _media_thumb_video(origin_path, thumb_path, THUMB_DEFAULT_WIDTH, THUMB_DEFAULT_HEIGHT, NULL);
- thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_video failed");
+ err = create_video_thumbnail_to_file(origin_path, CONTENT_THUMB_DEFAULT_WIDTH, CONTENT_THUMB_DEFAULT_HEIGHT, thumb_path, true);
+ thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "create_video_thumbnail_to_file failed");
} else {
thumb_err("invalid file type");
return MS_MEDIA_ERR_THUMB_UNSUPPORTED;
@@ -93,8 +94,9 @@ static int __thumbnail_get_raw_data(const char *origin_path, unsigned int *width
err = _media_thumb_image(origin_path, NULL, thumb_width, thumb_height, &thumb_info);
thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_image failed");
} else if (file_type == THUMB_VIDEO_TYPE) {
- err = _media_thumb_video(origin_path, NULL, thumb_width, thumb_height, &thumb_info);
- thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "_media_thumb_video failed");
+ err = create_video_thumbnail_to_buffer(origin_path, thumb_width, thumb_height,
+ &thumb_info.data, &thumb_info.size, &thumb_info.width, &thumb_info.height, true);
+ thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "create_video_thumbnail_to_buffer failed");
} else {
thumb_err("invalid file type");
return MS_MEDIA_ERR_THUMB_UNSUPPORTED;