From c5a9666afb1e104083fc578852805cb82852f31f Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Tue, 18 Oct 2022 09:15:23 +0900 Subject: [PATCH] Fix the data type size difference Change-Id: Ibe5aedb1561ea75415fe0827c5fd086c5552ba4b --- formats/ffmpeg/mm_file_format_frame.c | 4 ++-- include/mm_file.h | 4 ++-- include/mm_file_format_frame.h | 4 ++-- mm_file.c | 8 ++++---- packaging/libmm-fileinfo.spec | 2 +- tests/mm_file_test.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/formats/ffmpeg/mm_file_format_frame.c b/formats/ffmpeg/mm_file_format_frame.c index 5a3e22c..ed2e756 100755 --- a/formats/ffmpeg/mm_file_format_frame.c +++ b/formats/ffmpeg/mm_file_format_frame.c @@ -515,7 +515,7 @@ exception: return ret; } -int mmfile_format_get_frame(const char *path, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) +int mmfile_format_get_frame(const char *path, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) { int ret = MMFILE_FORMAT_SUCCESS; AVFormatContext *pFormatCtx = NULL; @@ -533,7 +533,7 @@ int mmfile_format_get_frame(const char *path, double timestamp, bool is_accurate return ret; } -int mmfile_format_get_frame_from_memory(const void *data, unsigned int datasize, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) +int mmfile_format_get_frame_from_memory(const void *data, unsigned int datasize, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) { int ret = MMFILE_FORMAT_SUCCESS; int format = -1; diff --git a/include/mm_file.h b/include/mm_file.h index f4ba486..f54cec6 100755 --- a/include/mm_file.h +++ b/include/mm_file.h @@ -655,9 +655,9 @@ int mm_file_get_synclyrics_info(MMHandleType tag_attrs, int index, unsigned long * @see metadata_extractor_create(), metadata_extractor_destroy() */ -int mm_file_get_video_frame(const char *path, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +int mm_file_get_video_frame(const char *path, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); -int mm_file_get_video_frame_from_memory(const void *data, unsigned int datasize, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +int mm_file_get_video_frame_from_memory(const void *data, unsigned int datasize, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); int mm_file_check_uhqa(const char *filename, bool *is_uhqa); diff --git a/include/mm_file_format_frame.h b/include/mm_file_format_frame.h index 62c6b33..256f286 100755 --- a/include/mm_file_format_frame.h +++ b/include/mm_file_format_frame.h @@ -20,7 +20,7 @@ */ #ifndef __MMFILE_DYN_LOADING__ -int mmfile_format_get_frame(const char *path, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +int mmfile_format_get_frame(const char *path, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); -int mmfile_format_get_frame_from_memory(const void *data, unsigned int datasize, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +int mmfile_format_get_frame_from_memory(const void *data, unsigned int datasize, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); #endif diff --git a/mm_file.c b/mm_file.c index f453169..719d445 100644 --- a/mm_file.c +++ b/mm_file.c @@ -167,8 +167,8 @@ static int (*mmfile_format_read_stream)(MMFileFormatContext *formatContext); static int (*mmfile_format_read_frame)(MMFileFormatContext *formatContext, unsigned int timestamp, MMFileFormatFrame *frame); static int (*mmfile_format_read_tag)(MMFileFormatContext *formatContext); static int (*mmfile_format_close)(MMFileFormatContext *formatContext); -static int (*mmfile_format_get_frame)(const char *path, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); -static int (*mmfile_format_get_frame_from_memory)(const void *data, unsigned int datasize, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +static int (*mmfile_format_get_frame)(const char *path, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); +static int (*mmfile_format_get_frame_from_memory)(const void *data, unsigned int datasize, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height); #endif #ifdef __MMFILE_DYN_LOADING__ @@ -945,7 +945,7 @@ int mm_file_create_content_attrs_safe(MMHandleType *contents_attrs, const char * } -int mm_file_get_video_frame(const char *path, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) +int mm_file_get_video_frame(const char *path, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) { int ret = 0; void *formatFuncHandle = NULL; @@ -988,7 +988,7 @@ exception: } -int mm_file_get_video_frame_from_memory(const void *data, unsigned int datasize, double timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) +int mm_file_get_video_frame_from_memory(const void *data, unsigned int datasize, int64_t timestamp, bool is_accurate, unsigned char **frame, int *size, int *width, int *height) { int ret = 0; void *formatFuncHandle = NULL; diff --git a/packaging/libmm-fileinfo.spec b/packaging/libmm-fileinfo.spec index ce7325a..be58f11 100644 --- a/packaging/libmm-fileinfo.spec +++ b/packaging/libmm-fileinfo.spec @@ -1,6 +1,6 @@ Name: libmm-fileinfo Summary: Media Fileinfo -Version: 1.0.16 +Version: 1.0.17 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tests/mm_file_test.c b/tests/mm_file_test.c index 66eacc5..7c658cd 100755 --- a/tests/mm_file_test.c +++ b/tests/mm_file_test.c @@ -604,12 +604,12 @@ static void __get_video_frame(const char *path, const char *accurate, bool file_ int width = 0; int height = 0; bool is_accurate = false; - double time_stamp = 5. * 1000 * 1000; //5sec + int64_t time_stamp = 5 * 1000 * 1000; //5sec if (accurate && accurate[0] == '1') is_accurate = true; - printf("Extracting video frame for [%s] [%f] accurate [%d]\n", path, time_stamp, is_accurate); + printf("Extracting video frame for [%s] [%"PRId64"] accurate [%d]\n", path, time_stamp, is_accurate); if (file_test) ret = mm_file_get_video_frame(path, time_stamp, is_accurate, &_frame, &_frame_size, &width, &height); -- 2.7.4