support webm format 13/169613/2 accepted/tizen/unified/20180213.132804 submit/tizen/20180208.063721
authoryujie.cheng <yujie.cheng@samsung.com>
Thu, 8 Feb 2018 02:47:26 +0000 (10:47 +0800)
committeryujie.cheng <yujie.cheng@samsung.com>
Thu, 8 Feb 2018 03:32:20 +0000 (11:32 +0800)
Change-Id: I4154332ff696b0efc060ad58876ad4d892e1715c

formats/ffmpeg/mm_file_format_ffmpeg.c
packaging/libmm-fileinfo.spec
utils/mm_file_util_validity.c

index e14ebd7..ae87e58 100755 (executable)
@@ -1305,6 +1305,14 @@ static int ConvertVideoCodecEnum(int AVVideoCodecID)
                ret_codecid = MM_VIDEO_CODEC_MPEG4;
                break;
 #endif
+#ifdef USE_PRODUCT_FEATURE
+       case AV_CODEC_ID_VP8:
+               ret_codecid = MM_VIDEO_CODEC_VP8;
+               break;
+       case AV_CODEC_ID_VP9:
+               ret_codecid = MM_VIDEO_CODEC_VP9;
+               break;
+#endif
        default:
                ret_codecid = MM_VIDEO_CODEC_NONE;
                break;
index fa3b3a6..cfa95bb 100755 (executable)
@@ -1,6 +1,6 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
-Version:    0.6.73
+Version:    0.6.74
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index e2cae07..5d0b7d3 100755 (executable)
@@ -903,8 +903,9 @@ int MMFileFormatIsValidMatroska(MMFileIOHandle *pFileIO, const char *mmfileuri,
        int ret = 0;
        int len_mask = 0x80;
        unsigned int size = 1, n = 1, total = 0;
-       char probe_data[] = { 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' };
-
+       //char probe_data[] = { 'm', 'a', 't', 'r', 'o', 's', 'k', 'a' };
+       /*support webm, add probe data*/
+       const char * probe_data[2] = { "matroska", "webm" };
        if (fp == NULL) {
                ret = mmfile_open(&fp, mmfileuri, MMFILE_RDONLY);
                if (ret == MMFILE_IO_FAILED) {
@@ -960,11 +961,17 @@ int MMFileFormatIsValidMatroska(MMFileIOHandle *pFileIO, const char *mmfileuri,
        if (_MMFILE_MKV_READ_BUFFER_LENGTH < 4 + size + total)
                return 0;
 
-       for (n = 4 + size ; n <= 4 + size + total - sizeof(probe_data); n++) {
-               if (!memcmp(&buffer[n], probe_data, sizeof(probe_data))) {
-                       debug_msg(RELEASE, "String matroska found!!!\n");
-                       ret = 1;
-                       goto exit;
+       /*compare two kinds of probe data*/
+       for (int i = 0; i < 2; i++) {
+               unsigned int probelen = strlen(probe_data[i]);
+               if (total < probelen)
+                       continue;
+               for (n = 4 + size ; n <= 4 + size + total - probelen; n++) {
+                       if (!memcmp(&buffer[n], probe_data[i], probelen)) {
+                               debug_msg(RELEASE, "String %s found!!!\n", probe_data[i]);
+                               ret = 1;
+                               goto exit;
+                       }
                }
        }