static int ProcessVideoFile(const char *filePath) { ZInfo4(DBG_MISC, "video: %s", filePath); ZDB_METAVIDEO *metadata = NULL; char filename[MAX_PATH_SIZE] = {0}; char dstPath[MAX_PATH_SIZE] = {0}; int isDir; if((metadata = GetVideoMetadata((char *)filePath)) == NULL) { ZError(DBG_MISC, "Get video metadata failed!"); return -1; } getFileName(filePath, &filename[0]); sprintf(dstPath, "%s/%s", VIDEO_SORT_FOLDER, filename); if(ZUtilIsFilePresent(dstPath, &isDir)) { getNewFileName(pzfs, filename); sprintf(dstPath, "%s/%s", VIDEO_SORT_FOLDER, filename); ZInfo3(DBG_MISC, "File exist, will use new filename [%s]", filename); } if(metadata->res) free(metadata->res); metadata->res = strdup(dstPath); if(ZDBInsertVideo(zfs.zVDBHandle, metadata)) { ZError(DBG_MISC, "Insert Video to DB failed!"); free(metadata); return -2; } if (rename (filePath, dstPath) != 0) { ZError (DBG_MISC, "Move file failed -> %s -> %s", filePath, dstPath); } free(metadata); return 0; }
bool ISOControl::HasVideoTrack() { nsRefPtr<VideoTrackMetadata> vidMeta; GetVideoMetadata(vidMeta); return vidMeta; }