diff options
author | Jiyong Min <jiyong.min@samsung.com> | 2017-07-11 14:14:48 +0900 |
---|---|---|
committer | Jiyong Min <jiyong.min@samsung.com> | 2017-07-11 14:19:41 +0900 |
commit | 55e061d4fc3a7070616f9f6c3e211fd8bbe4e4b4 (patch) | |
tree | 43f071d57d4cdd45b4b29b9b94370dded3912a32 | |
parent | c1ada51f27a2490026adf1a7f906337b0854a8c7 (diff) | |
download | metadata-extractor-55e061d4fc3a7070616f9f6c3e211fd8bbe4e4b4.tar.gz metadata-extractor-55e061d4fc3a7070616f9f6c3e211fd8bbe4e4b4.tar.bz2 metadata-extractor-55e061d4fc3a7070616f9f6c3e211fd8bbe4e4b4.zip |
Remove type_private.h and add define for GSperical-metadatasubmit/tizen/20170721.015330accepted/tizen/unified/20170721.201954
- Disable sperical(360VR) metadata and ready to test
Change-Id: I87f416f0379ea690ff0a557e83d9611d1c0f0ae8
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
-rwxr-xr-x | include/metadata_extractor_private.h | 22 | ||||
-rwxr-xr-x | include/metadata_extractor_type_private.h | 68 | ||||
-rwxr-xr-x | packaging/capi-media-metadata-extractor.spec | 3 | ||||
-rwxr-xr-x | src/metadata_extractor.c | 17 | ||||
-rwxr-xr-x | test/metadata_extractor_test.c | 9 |
5 files changed, 46 insertions, 73 deletions
diff --git a/include/metadata_extractor_private.h b/include/metadata_extractor_private.h index 3c83f78..0834a77 100755 --- a/include/metadata_extractor_private.h +++ b/include/metadata_extractor_private.h @@ -68,6 +68,28 @@ typedef struct { MMHandleType tag_h; } metadata_extractor_s; +/*TODO: Move attributes to metadata_extractor_type.h after ACR*/ +#ifdef SUPPORT_GSPHERICAL_METADATA +#define METADATA_360_STITCHED 35 /**< Flag indicating if the video is stitched (Since 4.0) */ +#define METADATA_360_STITCHING_SOFTWARE 36 /**< Software used to stitch the spherical video (Since 4.0) */ +#define METADATA_360_PROJECTION_TYPE 37 /**< Projection type used in the video frames (Since 4.0) */ +#define METADATA_360_STEREO_MODE 38 /**< Description of stereoscopic 3D layout (Since 4.0) */ +#define METADATA_360_SOURCE_COUNT 39 /**< Number of cameras used to create the spherical video (Since 4.0) */ +#define METADATA_360_INIT_VIEW_HEADING 40 /**< The heading angle of the initial view in degrees. (Since 4.0) */ +#define METADATA_360_INIT_VIEW_PITCH 41 /**< The pitch angle of the initial view in degrees (Since 4.0) */ +#define METADATA_360_INIT_VIEW_ROLL 42 /**< The roll angle of the initial view in degrees (Since 4.0) */ +#define METADATA_360_TIMESTAMP 43 /**< Epoch timestamp of when the first frame in the video was recorded (Since 4.0) */ +#define METADATA_360_FULL_PANO_WIDTH 44 /**< Width of the encoded video frame in pixels (Since 4.0) */ +#define METADATA_360_FULL_PANO_HEIGHT 45 /**< Height of the encoded video frame in pixels (Since 4.0) */ +#define METADATA_360_CROPPED_AREA_IMAGE_WIDTH 46 /**< Width of the video frame to display (e.g. cropping) (Since 4.0) */ +#define METADATA_360_CROPPED_AREA_IMAGE_HEIGHT 47 /**< Height of the video frame to display (e.g. cropping) (Since 4.0) */ +#define METADATA_360_CROPPED_AREA_LEFT 48 /**< Column where the left edge of the image was cropped from the full sized panorama (Since 4.0) */ +#define METADATA_360_CROPPED_AREA_TOP 49 /**< Row where the top edge of the image was cropped from the full sized panorama (Since 4.0) */ +#define METADATA_AMBISONIC_TYPE 50 /**< Ambisonics type in User Data Information (Since 4.0) */ +#define METADATA_AMBISONIC_FORMAT 51 /**< Ambisonics format in User Data Information (Since 4.0) */ +#define METADATA_AMBISONIC_ORDER 52 /**< Ambisonics order in User Data Information (Since 4.0) */ +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/include/metadata_extractor_type_private.h b/include/metadata_extractor_type_private.h deleted file mode 100755 index d52f830..0000000 --- a/include/metadata_extractor_type_private.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -#ifndef __TIZEN_MEDIA_METADATA_EXTRACTOR_TYPE_PRIVATE_H__ -#define __TIZEN_MEDIA_METADATA_EXTRACTOR_TYPE_PRIVATE_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * @file metadata_extractor_type_private.h - */ - -/** -* @addtogroup CAPI_METADATA_EXTRACTOR_MODULE -* @{ -*/ - -/*TODO: Move attributes to metadata_extractor_type.h after ACR*/ - -/** - * @ingroup CAPI_METADATA_EXTRACTOR_MODULE - * @brief Enumeration of attributes to be introduced in 4.0. This is a temp change until ACR - * @since_tizen @if MOBILE 4.0 @elseif WEARABLE 4.0 @endif - */ - -#define METADATA_360_STITCHED 35 /**< Flag indicating if the video is stitched (Since 4.0) */ -#define METADATA_360_STITCHING_SOFTWARE 36 /**< Software used to stitch the spherical video (Since 4.0) */ -#define METADATA_360_PROJECTION_TYPE 37 /**< Projection type used in the video frames (Since 4.0) */ -#define METADATA_360_STEREO_MODE 38 /**< Description of stereoscopic 3D layout (Since 4.0) */ -#define METADATA_360_SOURCE_COUNT 39 /**< Number of cameras used to create the spherical video (Since 4.0) */ -#define METADATA_360_INIT_VIEW_HEADING 40 /**< The heading angle of the initial view in degrees. (Since 4.0) */ -#define METADATA_360_INIT_VIEW_PITCH 41 /**< The pitch angle of the initial view in degrees (Since 4.0) */ -#define METADATA_360_INIT_VIEW_ROLL 42 /**< The roll angle of the initial view in degrees (Since 4.0) */ -#define METADATA_360_TIMESTAMP 43 /**< Epoch timestamp of when the first frame in the video was recorded (Since 4.0) */ -#define METADATA_360_FULL_PANO_WIDTH 44 /**< Width of the encoded video frame in pixels (Since 4.0) */ -#define METADATA_360_FULL_PANO_HEIGHT 45 /**< Height of the encoded video frame in pixels (Since 4.0) */ -#define METADATA_360_CROPPED_AREA_IMAGE_WIDTH 46 /**< Width of the video frame to display (e.g. cropping) (Since 4.0) */ -#define METADATA_360_CROPPED_AREA_IMAGE_HEIGHT 47 /**< Height of the video frame to display (e.g. cropping) (Since 4.0) */ -#define METADATA_360_CROPPED_AREA_LEFT 48 /**< Column where the left edge of the image was cropped from the full sized panorama (Since 4.0) */ -#define METADATA_360_CROPPED_AREA_TOP 49 /**< Row where the top edge of the image was cropped from the full sized panorama (Since 4.0) */ -#define METADATA_AMBISONIC_TYPE 50 /**< Ambisonics type in User Data Information (Since 4.0) */ -#define METADATA_AMBISONIC_FORMAT 51 /**< Ambisonics format in User Data Information (Since 4.0) */ -#define METADATA_AMBISONIC_ORDER 52 /**< Ambisonics order in User Data Information (Since 4.0) */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /*__TIZEN_MEDIA_METADATA_EXTRACTOR_TYPE_PRIVATE_H__*/ diff --git a/packaging/capi-media-metadata-extractor.spec b/packaging/capi-media-metadata-extractor.spec index 9e5b5a6..39dcb25 100755 --- a/packaging/capi-media-metadata-extractor.spec +++ b/packaging/capi-media-metadata-extractor.spec @@ -1,6 +1,6 @@ Name: capi-media-metadata-extractor Summary: A media metadata extractor library in Tizen Native API -Version: 0.1.5 +Version: 0.1.6 Release: 1 Group: Multimedia/API License: Apache-2.0 @@ -30,6 +30,7 @@ cp %{SOURCE1001} . export CFLAGS+=" -Wextra -Wno-array-bounds" export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow" export CFLAGS+=" -Wwrite-strings -Wswitch-default" +#export CFLAGS+=" -DSUPPORT_GSPHERICAL_METADATA" MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} diff --git a/src/metadata_extractor.c b/src/metadata_extractor.c index dd1c224..44c2d16 100755 --- a/src/metadata_extractor.c +++ b/src/metadata_extractor.c @@ -20,7 +20,6 @@ #include <mm_file.h> #include <metadata_extractor.h> #include <metadata_extractor_private.h> -#include <metadata_extractor_type_private.h> /*TODO (m.alieksieie): Remove after ACR*/ #define SAFE_FREE(src) { if (src) {free(src); src = NULL; } } #define META_MAX_LEN 256 @@ -75,6 +74,7 @@ static int __metadata_extractor_destroy_handle(metadata_extractor_s *metadata); static int __metadata_extractor_get_audio_codec(metadata_extractor_s *metadata, char **audio_codec); static int __metadata_extractor_get_video_codec(metadata_extractor_s *metadata, char **video_codec); static int __metadata_extractor_get_is_360(metadata_extractor_s *metadata, int *is_360); +#ifdef SUPPORT_GSPHERICAL_METADATA static int __metadata_extractor_get_is_stitched(metadata_extractor_s *metadata, int *is_stitched); static int __metadata_extractor_get_projection_type(metadata_extractor_s *metadata, char **projection_type); static int __metadata_extractor_get_stitching_software(metadata_extractor_s *metadata, char **stitching_software); @@ -93,6 +93,7 @@ static int __metadata_extractor_get_cropped_area_top(metadata_extractor_s *metad static int __metadata_extractor_get_ambisonic_type(metadata_extractor_s *metadata, int *ambisonic_type); static int __metadata_extractor_get_ambisonic_format(metadata_extractor_s *metadata, int *ambisonic_format); static int __metadata_extractor_get_ambisonic_order(metadata_extractor_s *metadata, int *ambisonic_order); +#endif static int __metadata_extractor_check_and_extract_meta(metadata_extractor_s *metadata, metadata_extractor_type_e metadata_type) { @@ -1126,6 +1127,7 @@ static int __metadata_extractor_get_is_360(metadata_extractor_s *metadata, int * return ret; } +#ifdef SUPPORT_GSPHERICAL_METADATA static int __metadata_extractor_get_is_stitched(metadata_extractor_s *metadata, int *is_stitched) { int ret = METADATA_EXTRACTOR_ERROR_NONE; @@ -1530,6 +1532,7 @@ static int __metadata_extractor_get_ambisonic_order(metadata_extractor_s *metada return ret; } +#endif static int __metadata_extractor_destroy_handle(metadata_extractor_s *metadata) { @@ -1723,10 +1726,16 @@ int metadata_extractor_get_metadata(metadata_extractor_h metadata, metadata_extr ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_ATTR); } else if ((attribute >= METADATA_DURATION) && (attribute < METADATA_HAS_AUDIO)) ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_ATTR); - else if (((attribute > METADATA_HAS_AUDIO) && (attribute <= METADATA_ROTATE)) - || ((attribute >= METADATA_360) && (attribute <= METADATA_360_CROPPED_AREA_TOP)) + else if ((attribute > METADATA_HAS_AUDIO) && (attribute <= METADATA_ROTATE)) + ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_TAG); +#ifdef SUPPORT_GSPHERICAL_METADATA + else if (((attribute >= METADATA_360) && (attribute <= METADATA_360_CROPPED_AREA_TOP)) || ((attribute >= METADATA_AMBISONIC_TYPE) && (attribute <= METADATA_AMBISONIC_ORDER))) ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_TAG); +#else + else if (attribute == METADATA_360) + ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_TAG); +#endif else if ((attribute == METADATA_AUDIO_CODEC) || (attribute == METADATA_VIDEO_CODEC)) ret = __metadata_extractor_check_and_extract_meta(_metadata, METADATA_TYPE_ATTR); else { @@ -1915,6 +1924,7 @@ int metadata_extractor_get_metadata(metadata_extractor_h metadata, metadata_extr ret = __metadata_extractor_get_is_360(_metadata, &i_value); break; } +#ifdef SUPPORT_GSPHERICAL_METADATA case METADATA_360_STITCHED: { is_string = 0; ret = __metadata_extractor_get_is_stitched(_metadata, &i_value); @@ -2005,6 +2015,7 @@ int metadata_extractor_get_metadata(metadata_extractor_h metadata, metadata_extr ret = __metadata_extractor_get_ambisonic_order(_metadata, &i_value); break; } +#endif default: break; } diff --git a/test/metadata_extractor_test.c b/test/metadata_extractor_test.c index f89d1d0..09aa259 100755 --- a/test/metadata_extractor_test.c +++ b/test/metadata_extractor_test.c @@ -20,7 +20,7 @@ #include <unistd.h> #include <stdbool.h> #include <metadata_extractor.h> -#include <metadata_extractor_type_private.h> /*TODO (m.alieksieie): Remove after ACR*/ +#include <metadata_extractor_private.h> #define SAFE_FREE(src) { if (src) {free(src); src = NULL; } } @@ -99,6 +99,7 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) char *video_codec = NULL; char *audio_codec = NULL; char *is_360 = NULL; +#ifdef SUPPORT_GSPHERICAL_METADATA char *is_stitched = NULL; char *stitching_software = NULL; char *projection_type = NULL; @@ -117,6 +118,7 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) char *ambisonic_type = NULL; char *ambisonic_format = NULL; char *ambisonic_order = NULL; +#endif int idx = 0; unsigned long time_info = 0; @@ -203,6 +205,8 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) printf("video_codec = [%s]\n", video_codec); metadata_extractor_get_metadata(metadata, METADATA_360, &is_360); printf("is_360 = [%s]\n", is_360); + +#ifdef SUPPORT_GSPHERICAL_METADATA metadata_extractor_get_metadata(metadata, METADATA_360_STITCHED, &is_stitched); printf("is_stitched = [%s]\n", is_stitched); metadata_extractor_get_metadata(metadata, METADATA_360_STITCHING_SOFTWARE, &stitching_software); @@ -239,6 +243,7 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) printf("ambisonic_format = [%s]\n", ambisonic_format); metadata_extractor_get_metadata(metadata, METADATA_AMBISONIC_ORDER, &ambisonic_order); printf("ambisonic_order = [%s]\n", ambisonic_order); +#endif metadata_extractor_get_metadata(metadata, METADATA_SYNCLYRICS_NUM, &synclyrics_num); if (synclyrics_num) { @@ -308,6 +313,7 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) SAFE_FREE(audio_codec); SAFE_FREE(video_codec); SAFE_FREE(is_360); +#ifdef SUPPORT_GSPHERICAL_METADATA SAFE_FREE(is_stitched); SAFE_FREE(stitching_software); SAFE_FREE(projection_type); @@ -326,6 +332,7 @@ static bool __capi_metadata_extractor(metadata_extractor_h metadata) SAFE_FREE(ambisonic_type); SAFE_FREE(ambisonic_format); SAFE_FREE(ambisonic_order); +#endif return true; |