*
* @section CAPI_MEDIA_CONTENT_MODULE_OVERVIEW Overview
* The Media Content API provides functions and enumerations used in the entire Content Service.\n
- * The information about media items i.e. image, audio and video, are managed in the content database and
+ * The information about media items i.e. image, audio, video and ebook, are managed in the content database and
* operations that involve database requires an active connection with the media content service.\n
* During media scanning, Media Service extract media information automatically. media information include basic file info like
* path, size, modified time etc and some metadata like ID3tag, EXIF, thumbnail, etc. (thumbnail extracted only in Internal and SD card storage.) \n
* </tr>
* <tr>
* <td>@ref CAPI_CONTENT_MEDIA_INFO_MODULE </td>
- * <td> Provide generic information about media content items (i.e. image, audio, video and others).\n
+ * <td> Provide generic information about media content items (i.e. image, audio, video, ebook and others).\n
* Provide details about audio files (e.g. name, genre etc) present in the device.\n
* Provide details about image files (e.g. width, height, orientation etc) present in the device.\n
- * Provide details about video files (e.g. width, height, duration etc) present in the device .</td>
+ * Provide details about video files (e.g. width, height, duration etc) present in the device.\n
+ * Provide details about ebook files (e.g. subject, author etc) present in the device.</td>
* </tr>
* <tr>
* <td>@ref CAPI_CONTENT_MEDIA_PLAYLIST_MODULE </td>
* \#include <media_content.h>
*
* @section CAPI_CONTENT_MEDIA_FOLDER_MODULE_OVERVIEW Overview
- * A Folder is used to organize media content files i.e. image, audio, video files, in the physical storage of the device.
+ * A Folder is used to organize media content files i.e. image, audio, video, ebook files, in the physical storage of the device.
* The Media Folder API provides functions to get basic information about existing folders e.g. folder name, path and storage type.
* It also provides functions to get information related to media items present in the folder.
*
*
* @section CAPI_CONTENT_MEDIA_VIDEO_META_MODULE_OVERVIEW Overview
* The Video Metadata API provides functions to get information about video files present in the device.
- * Following information about video content (#video_meta_h )is provided:
+ * Following information about video content (#video_meta_h) is provided:
* <table>
* <tr>
* <th>Attribute</th>
*
*/
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_BOOK_META_MODULE Book Metadata
+ * @brief The Book Metadata API provides functions to get information about ebook files present in the device.
+ *
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_BOOK_META_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_BOOK_META_MODULE_OVERVIEW Overview
+ * The Book Metadata API provides functions to get information about book files present in the device.
+ * Following information about book content (#book_meta_h) is provided:
+ * <table>
+ * <tr>
+ * <th>Attribute</th>
+ * <th>Filter Keyword</th>
+ * <th>Comments</th>
+ * </tr>
+ * <tr>
+ * <td>subject</td>
+ * <td>#MEDIA_GENRE</td>
+ * <td>Get from metadata if exist.</td>
+ * </tr>
+ * <tr>
+ * <td>author</td>
+ * <td>#MEDIA_COMPOSER</td>
+ * <td>Get from metadata if exist.</td>
+ * </tr>
+ * <tr>
+ * <td>date</td>
+ * <td>#MEDIA_RECORDED_DATE</td>
+ * <td>Get from metadata if exist.</td>
+ * </tr>
+ * <tr>
+ * <td>publisher</td>
+ * <td>#MEDIA_COPYRIGHT</td>
+ * <td>Get from metadata if exist.</td>
+ * </tr>
+ * </table>
+ * \n
+ *<p>
+ * For getting the book handle (#book_meta_h) from the media information (#media_info_h), call the media_info_get_book() function.\n
+ * For getting the information related to book files stored in the device call the respective get functions e.g. to get author of the ebook file
+ * call #book_meta_get_author() function and so on.\n
+ * When the book handle is no longer needed, it should be destroyed by calling #book_meta_destroy() function.
+ */
+
/**
* @defgroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE Face Detection
* @brief The Face Detection API provides functions to detect face information about stored image files.
--- /dev/null
+/*
+* Copyright (c) 2021 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_CONTENT_MEDIA_BOOK_H__
+#define __TIZEN_CONTENT_MEDIA_BOOK_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_book.h
+ * @brief This file contains the book metadata API and related functions to proceed with book metadata. \n
+ * Description of the book content involves: author, publisher, date, and subject.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_BOOK_META_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the book metadata.
+ * @details This function copies the book metadata handle from a source to destination.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a dst should be released using book_meta_destroy().
+ *
+ * @param[out] dst The destination handle to the book metadata
+ * @param[in] src The source handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_info_get_book()
+ * @see book_meta_destroy()
+ */
+int book_meta_clone(book_meta_h *dst, book_meta_h src);
+
+/**
+ * @brief Destroys the book metadata.
+ * @details This function frees all resources related to the book metadata handle. This handle
+ * can no longer be used to perform any operations. A new handle has to
+ * be created before the next use.
+ *
+ * @since_tizen 6.5
+ *
+ * @param[in] book The handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see book_meta_clone()
+ */
+int book_meta_destroy(book_meta_h book);
+
+/**
+ * @brief Gets the ID of the media of the given book metadata.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a media_id should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] media_id The media ID
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_media_id(book_meta_h book, char **media_id);
+
+/**
+ * @brief Gets the subject of the given book metadata.
+ * @details If there is no information, @a subject will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a subject should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] subject The subject of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_subject(book_meta_h book, char **subject);
+
+/**
+ * @brief Gets the author of the given book metadata.
+ * @details If there is no information, @a author will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a author should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] author The author of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_author(book_meta_h book, char **author);
+
+/**
+ * @brief Gets the publication date of the given book metadata.
+ * @details If there is no information, @a date will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a date should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] date The date of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_date(book_meta_h book, char **date);
+
+/**
+ * @brief Gets the publisher notice of the given book metadata.
+ * @details If there is no information, @a publisher will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a publisher should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] publisher The publisher of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_publisher(book_meta_h book, char **publisher);
+
+/**
+ *@}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__TIZEN_CONTENT_MEDIA_BOOK_H__*/
#define __TIZEN_CONTENT_MEDIA_CONTENT_H__
#include <media_audio.h>
-#include <media_content_type.h>
#include <media_filter.h>
#include <media_folder.h>
#include <media_image.h>
#include <media_bookmark.h>
#include <media_storage.h>
#include <media_face.h>
+#include <media_book.h>
#ifdef __cplusplus
extern "C" {
* @brief Enumeration for the media file format.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks Since 4.0, #MEDIA_CONTENT_TYPE_OTHERS is related to the following feature:\n
- * %http://tizen.org/feature/content.scanning.others\n
- * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
+ * %http://tizen.org/feature/content.scanning.others\n
+ * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
*/
typedef enum {
- MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of an image */
- MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of a video */
+ MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of an image */
+ MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of a video */
MEDIA_CONTENT_TYPE_SOUND = 2, /**<The type of sound */
- MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
+ MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
MEDIA_CONTENT_TYPE_OTHERS = 4, /**<The type of other */
+ MEDIA_CONTENT_TYPE_BOOK = 5, /**<The type of book (Since 6.5)*/
} media_content_type_e;
/**
typedef struct audio_meta_s *audio_meta_h;
/**
+ * @ingroup CAPI_CONTENT_MEDIA_BOOK_META_MODULE
+ * @brief The structure type for the Book metadata handle.
+ * @since_tizen 6.5
+ */
+typedef struct book_meta_s *book_meta_h;
+
+/**
* @ingroup CAPI_CONTENT_MEDIA_FILTER_MODULE
* @brief The structure type for the Media filter handle.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
int media_info_get_audio(media_info_h media, audio_meta_h *audio);
/**
+ * @brief Gets a book metadata handle for a given media info.
+ * @details This function returns a book metadata handle retrieved from the media info handle. \n
+ * The title and description information of the book can be obtained from @a media.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a book should be released using book_meta_destroy().
+ *
+ * @param[in] media The handle to the media info
+ * @param[out] book The handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_info_get_title()
+ * @see media_info_get_description()
+ * @see book_meta_destroy()
+ */
+int media_info_get_book(media_info_h media, book_meta_h *book);
+
+/**
* @brief Gets the media ID.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks The @a media_id should be released using free().
* @brief This file contains the media info API and related structure and enumeration. \n
* Description of the audio, video,image content involves: album, artist, album_artist, genre and description tags. \n
* Parameters of the recording are also supported, as: format, bitrate, duration, size etc. \n
-* Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
+* Definitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
*/
typedef struct {
char *media_id;
+ char *author;
+ char *publisher;
+ char *date;
+ char *subject;
+} book_meta_s;
+
+typedef struct {
+ char *media_id;
char *file_path;
char *display_name;
media_content_type_e media_type;
image_meta_s *image_meta;
video_meta_s *video_meta;
audio_meta_s *audio_meta;
+ book_meta_s *book_meta;
} media_info_s;
typedef struct {
--- /dev/null
+/*
+* Copyright (c) 2021 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_CONTENT_MEDIA_BOOK_H__
+#define __TIZEN_CONTENT_MEDIA_BOOK_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_book.h
+ * @brief This file contains the book metadata API and related functions to proceed with book metadata. \n
+ * Description of the book content involves: author, publisher, date, and subject.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_BOOK_META_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the book metadata.
+ * @details This function copies the book metadata handle from a source to destination.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a dst should be released using book_meta_destroy().
+ *
+ * @param[out] dst The destination handle to the book metadata
+ * @param[in] src The source handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_info_get_book()
+ * @see book_meta_destroy()
+ */
+int book_meta_clone(book_meta_h *dst, book_meta_h src);
+
+/**
+ * @brief Destroys the book metadata.
+ * @details This function frees all resources related to the book metadata handle. This handle
+ * can no longer be used to perform any operations. A new handle has to
+ * be created before the next use.
+ *
+ * @since_tizen 6.5
+ *
+ * @param[in] book The handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see book_meta_clone()
+ */
+int book_meta_destroy(book_meta_h book);
+
+/**
+ * @brief Gets the ID of the media of the given book metadata.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a media_id should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] media_id The media ID
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_media_id(book_meta_h book, char **media_id);
+
+/**
+ * @brief Gets the subject of the given book metadata.
+ * @details If there is no information, @a subject will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a subject should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] subject The subject of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_subject(book_meta_h book, char **subject);
+
+/**
+ * @brief Gets the author of the given book metadata.
+ * @details If there is no information, @a author will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a author should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] author The author of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_author(book_meta_h book, char **author);
+
+/**
+ * @brief Gets the publication date of the given book metadata.
+ * @details If there is no information, @a date will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a date should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] date The date of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_date(book_meta_h book, char **date);
+
+/**
+ * @brief Gets the publisher notice of the given book metadata.
+ * @details If there is no information, @a publisher will be NULL.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a publisher should be released using free().
+ *
+ * @param[in] book The handle to the book metadata
+ * @param[out] publisher The publisher of the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int book_meta_get_publisher(book_meta_h book, char **publisher);
+
+/**
+ *@}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__TIZEN_CONTENT_MEDIA_BOOK_H__*/
#define __TIZEN_CONTENT_MEDIA_CONTENT_H__
#include <media_audio.h>
-#include <media_content_type.h>
#include <media_filter.h>
#include <media_folder.h>
#include <media_image.h>
#include <media_bookmark.h>
#include <media_storage.h>
#include <media_face.h>
+#include <media_book.h>
#include <media_content_product.h>
#ifdef __cplusplus
* @brief Enumeration for the media file format.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks Since 4.0, #MEDIA_CONTENT_TYPE_OTHERS is related to the following feature:\n
- * %http://tizen.org/feature/content.scanning.others\n
- * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
+ * %http://tizen.org/feature/content.scanning.others\n
+ * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
*/
typedef enum {
- MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of an image */
- MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of a video */
+ MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of an image */
+ MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of a video */
MEDIA_CONTENT_TYPE_SOUND = 2, /**<The type of sound */
- MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
+ MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
MEDIA_CONTENT_TYPE_OTHERS = 4, /**<The type of other */
- MEDIA_CONTENT_TYPE_PVR = 1001, /**<The type of PVR */
- MEDIA_CONTENT_TYPE_UHD = 1002, /**<The type of UHD */
- MEDIA_CONTENT_TYPE_SCSA = 1003, /**<The type of SCSA */
+ MEDIA_CONTENT_TYPE_BOOK = 5, /**<The type of book (Since 6.5)*/
+ MEDIA_CONTENT_TYPE_PVR = 1001, /**<The type of PVR */
+ MEDIA_CONTENT_TYPE_UHD = 1002, /**<The type of UHD */
+ MEDIA_CONTENT_TYPE_SCSA = 1003, /**<The type of SCSA */
} media_content_type_e;
/**
typedef struct audio_meta_s *audio_meta_h;
/**
+ * @ingroup CAPI_CONTENT_MEDIA_BOOK_META_MODULE
+ * @brief The structure type for the Book metadata handle.
+ * @since_tizen 6.5
+ */
+typedef struct book_meta_s *book_meta_h;
+
+/**
* @ingroup CAPI_CONTENT_MEDIA_FILTER_MODULE
* @brief The structure type for the Media filter handle.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
int media_info_get_audio(media_info_h media, audio_meta_h *audio);
/**
+ * @brief Gets a book metadata handle for a given media info.
+ * @details This function returns a book metadata handle retrieved from the media info handle. \n
+ * The title and description information of the book can be obtained from @a media.
+ *
+ * @since_tizen 6.5
+ *
+ * @remarks The @a book should be released using book_meta_destroy().
+ *
+ * @param[in] media The handle to the media info
+ * @param[out] book The handle to the book metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_info_get_title()
+ * @see media_info_get_description()
+ * @see book_meta_destroy()
+ */
+int media_info_get_book(media_info_h media, book_meta_h *book);
+
+/**
* @brief Gets the media ID.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks The @a media_id should be released using free().
* @brief This file contains the media info API and related structure and enumeration. \n
* Description of the audio, video,image content involves: album, artist, album_artist, genre and description tags. \n
* Parameters of the recording are also supported, as: format, bitrate, duration, size etc. \n
-* Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
+* Definitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
*/
typedef struct {
char *media_id;
+ char *author;
+ char *publisher;
+ char *date;
+ char *subject;
+} book_meta_s;
+
+typedef struct {
+ char *media_id;
char *file_path;
char *display_name;
media_content_type_e media_type;
image_meta_s *image_meta;
video_meta_s *video_meta;
audio_meta_s *audio_meta;
+ book_meta_s *book_meta;
} media_info_s;
typedef struct {
/* DB field for media */
#define DB_FIELD_MEDIA_DISPLAY_NAME "media_display_name"
-#define DB_FIELD_MEDIA_TYPE "media_type"
+#define DB_FIELD_MEDIA_TYPE "media_type"
#define DB_FIELD_MEDIA_MIME_TYPE "media_mime_type"
#define DB_FIELD_MEDIA_SIZE "media_size"
#define DB_FIELD_MEDIA_ADDED_TIME "media_added_time"
--- /dev/null
+/*
+* Copyright (c) 2021 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.
+*/
+
+
+#include <media_info_private.h>
+
+int book_meta_destroy(book_meta_h book)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+
+ g_free(_book->media_id);
+ g_free(_book->author);
+ g_free(_book->publisher);
+ g_free(_book->subject);
+ g_free(_book->date);
+ g_free(_book);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_clone(book_meta_h *dst, book_meta_h src)
+{
+ book_meta_s *_src = (book_meta_s *)src;
+
+ content_retip_if_fail(dst);
+ content_retip_if_fail(src);
+
+ book_meta_s *_dst = g_new0(book_meta_s, 1);
+
+ _dst->media_id = g_strdup(_src->media_id);
+ _dst->author = g_strdup(_src->author);
+ _dst->date = g_strdup(_src->date);
+ _dst->publisher = g_strdup(_src->publisher);
+ _dst->subject = g_strdup(_src->subject);
+
+ *dst = (book_meta_h)_dst;
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_get_media_id(book_meta_h book, char **media_id)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+ content_retip_if_fail(media_id);
+
+ *media_id = g_strdup(_book->media_id);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_get_subject(book_meta_h book, char **subject)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+ content_retip_if_fail(subject);
+
+ *subject = g_strdup(_book->subject);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_get_author(book_meta_h book, char **author)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+ content_retip_if_fail(author);
+
+ *author = g_strdup(_book->author);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_get_date(book_meta_h book, char **date)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+ content_retip_if_fail(date);
+
+ *date = g_strdup(_book->date);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+int book_meta_get_publisher(book_meta_h book, char **publisher)
+{
+ book_meta_s *_book = (book_meta_s *)book;
+
+ content_retip_if_fail(book);
+ content_retip_if_fail(publisher);
+
+ *publisher = g_strdup(_book->publisher);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
return;
}
-static bool __media_info_isFaceRecognition_feature_supported()
+static bool __media_info_isFaceRecognition_feature_supported(void)
{
bool isFaceRecognitionSupported = false;
_media->audio_meta->duration = sqlite3_column_int(stmt, MEDIA_INFO_DURATION);
_media->audio_meta->samplerate = sqlite3_column_int(stmt, MEDIA_INFO_SAMPLERATE);
_media->audio_meta->channel = sqlite3_column_int(stmt, MEDIA_INFO_CHANNEL);
+ } else if (_media->media_type == MEDIA_CONTENT_TYPE_BOOK) {
+ _media->book_meta = g_new0(book_meta_s, 1);
+ _media->book_meta->subject = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_GENRE));
+ _media->book_meta->author = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_COMPOSER));
+ _media->book_meta->date = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_RECORDED_DATE));
+ _media->book_meta->publisher = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_COPYRIGHT));
}
}
#ifdef _USE_TVPD_MODE
g_free(_media->audio_meta);
}
+ if (_media->book_meta) {
+ g_free(_media->book_meta->media_id);
+ g_free(_media->book_meta->author);
+ g_free(_media->book_meta->date);
+ g_free(_media->book_meta->publisher);
+ g_free(_media->book_meta->subject);
+
+ g_free(_media->book_meta);
+ }
+
g_free(_media);
return MEDIA_CONTENT_ERROR_NONE;
_dst->audio_meta->duration = _src->audio_meta->duration;
_dst->audio_meta->bitrate = _src->audio_meta->bitrate;
_dst->audio_meta->bitpersample = _src->audio_meta->bitpersample;
+ } else if (_src->media_type == MEDIA_CONTENT_TYPE_BOOK && _src->book_meta) {
+ _dst->book_meta = g_new0(book_meta_s, 1);
+
+ _dst->book_meta->media_id = g_strdup(_src->book_meta->media_id);
+ _dst->book_meta->author = g_strdup(_src->book_meta->author);
+ _dst->book_meta->date = g_strdup(_src->book_meta->date);
+ _dst->book_meta->publisher = g_strdup(_src->book_meta->publisher);
+ _dst->book_meta->subject = g_strdup(_src->book_meta->subject);
}
*dst = (media_info_h)_dst;
return ret;
}
+int media_info_get_book(media_info_h media, book_meta_h *book)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+
+ media_info_s *_media = (media_info_s*)media;
+
+ content_retip_if_fail(media);
+ content_retip_if_fail(_media->media_type == MEDIA_CONTENT_TYPE_BOOK);
+ content_retip_if_fail(book);
+
+ book_meta_s *_book = g_new0(book_meta_s, 1);
+
+ _book->media_id = g_strdup(_media->media_id);
+ _book->author = g_strdup(_media->book_meta->author);
+ _book->publisher = g_strdup(_media->book_meta->publisher);
+ _book->date = g_strdup(_media->book_meta->date);
+ _book->subject = g_strdup(_media->book_meta->subject);
+
+ *book = (book_meta_h)_book;
+
+ return ret;
+}
+
int media_info_get_media_id(media_info_h media, char **media_id)
{
media_info_s *_media = (media_info_s*)media;