#define THUMB_STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? true : false)
int create_video_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate);
-int create_video_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height, bool auto_rotate);
+int create_video_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height);
int create_image_thumbnail_to_file(const char *path, unsigned int width, unsigned int height, const char *thumb_path, bool auto_rotate);
int create_image_thumbnail_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height);
__get_rotation_and_cdis(path, &_rot_type, &_cdis_value);
err = __get_video_meta(_cdis_value, path, video_track_num, width, height, frame, frame_size);
- *rot_type = _rot_type;
+ if (rot_type)
+ *rot_type = _rot_type;
return err;
}
unsigned char **thumb_buffer,
size_t *thumb_size,
unsigned int *thumb_width,
- unsigned int *thumb_height,
- bool auto_rotate)
+ unsigned int *thumb_height)
{
int err = MS_MEDIA_ERR_NONE;
int video_track_num = 0;
void *frame = NULL;
size_t frame_size = 0;
mm_util_image_h img = NULL;
- mm_util_rotate_type_e rot_type = MM_UTIL_ROTATE_NUM;
err = __check_parameter_validity_for_buffer(path, width, height, thumb_buffer, thumb_size, thumb_width, thumb_height);
thumb_retvm_if(err != MS_MEDIA_ERR_NONE, err, "Invalid parameter");
//Get video info
- err = __get_video_info(path, &video_track_num, &video_w, &video_h, &frame, &frame_size, &rot_type);
+ err = __get_video_info(path, &video_track_num, &video_w, &video_h, &frame, &frame_size, NULL);
thumb_retvm_if(err != MM_UTIL_ERROR_NONE, err, "fail to __get_video_info [%d]", err);
thumb_retvm_if(video_track_num == 0, MM_UTIL_ERROR_NONE, "No video track");
- if (!auto_rotate)
- rot_type = MM_UTIL_ROTATE_0;
-
//Extract thumbnail
- err = __get_video_thumb_to_buffer(video_w, video_h, frame, frame_size, rot_type, width, height, &img);
+ err = __get_video_thumb_to_buffer(video_w, video_h, frame, frame_size, MM_UTIL_ROTATE_0, width, height, &img);
g_free(frame);
if (err != MS_MEDIA_ERR_NONE)
return err;