Tizen Native API
7.0
|
The Metadata Extractor API provides functions for extracting the metadata from an input media file.
Required Header
#include <metadata_extractor.h>
Overview
The Metadata Extractor API allows you to extract the metadata from a media file. To extract a particular type of metadata(metadata_extractor_attr_e), create/destroy the handle(metadata_extractor_create()/metadata_extractor_destroy). To set the path for extracting, and call metadata_extractor_get_metadata().
Functions | |
int | metadata_extractor_create (metadata_extractor_h *metadata) |
Creates metadata. | |
int | metadata_extractor_set_path (metadata_extractor_h metadata, const char *path) |
Sets the file path to extract. | |
int | metadata_extractor_set_buffer (metadata_extractor_h metadata, const void *buffer, int size) |
Sets the buffer to extract. | |
int | metadata_extractor_destroy (metadata_extractor_h metadata) |
Destroys metadata. | |
int | metadata_extractor_get_metadata (metadata_extractor_h metadata, metadata_extractor_attr_e attribute, char **value) |
Gets metadata. | |
int | metadata_extractor_get_artwork (metadata_extractor_h metadata, void **artwork, int *size, char **mime_type) |
Gets the artwork image in a media file. | |
int | metadata_extractor_get_frame (metadata_extractor_h metadata, void **frame, int *size) |
Gets the frame of a video media file. | |
int | metadata_extractor_get_synclyrics (metadata_extractor_h metadata, int index, unsigned long *time_stamp, char **lyrics) |
Gets the synclyrics of a media file. | |
int | metadata_extractor_get_frame_at_time (metadata_extractor_h metadata, unsigned long timestamp, bool is_accurate, void **frame, int *size) |
Gets the frame of a video media. | |
Typedefs | |
typedef struct metadata_extractor_s * | metadata_extractor_h |
The metadata extractor handle. | |
Defines | |
#define | METADATA_EXTRACTOR_ERROR_CLASS TIZEN_ERROR_METADATA_EXTRACTOR |
Definition for Metadata extractor Error Class. |
Define Documentation
#define METADATA_EXTRACTOR_ERROR_CLASS TIZEN_ERROR_METADATA_EXTRACTOR |
Definition for Metadata extractor Error Class.
- Since :
- 2.3
Typedef Documentation
typedef struct metadata_extractor_s* metadata_extractor_h |
The metadata extractor handle.
- Since :
- 2.3
Enumeration Type Documentation
Enumeration for attribute.
- Since :
- 2.3
- Enumerator:
Enumeration for metadata extractor error.
- Since :
- 2.3
- Enumerator:
Function Documentation
int metadata_extractor_create | ( | metadata_extractor_h * | metadata | ) |
Creates metadata.
- Since :
- 2.3
- Remarks:
- The metadata should be released using metadata_extractor_destroy().
- Parameters:
-
[in] metadata The handle to metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY Out of memory
- See also:
- metadata_extractor_destroy()
int metadata_extractor_destroy | ( | metadata_extractor_h | metadata | ) |
Destroys metadata.
- Since :
- 2.3
- Parameters:
-
[in] metadata The handle to metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed
- Precondition:
- Create a metadata handle by calling metadata_extractor_create().
- See also:
- metadata_extractor_create()
int metadata_extractor_get_artwork | ( | metadata_extractor_h | metadata, |
void ** | artwork, | ||
int * | size, | ||
char ** | mime_type | ||
) |
Gets the artwork image in a media file.
- Since :
- 2.3
- Remarks:
- The artwork and mime_type should be released using free().
In case of accessing specific path in internal storage or external storage, you may add the privilege for accessing the path.
For example, if you get the specific path by using storage_get_directory(). you should add privilege http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage.
- Parameters:
-
[in] metadata The handle to metadata [out] artwork The encoded artwork image [out] size The encoded artwork size [out] mime_type The MIME of the artwork
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY Out of memory METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
int metadata_extractor_get_frame | ( | metadata_extractor_h | metadata, |
void ** | frame, | ||
int * | size | ||
) |
Gets the frame of a video media file.
- Since :
- 2.3
- Remarks:
- The frame should be released using free(). In case of accessing specific path in internal storage or external storage, you may add the privilege for accessing the path.
For example, if you get the specific path by using storage_get_directory(). you should add privilege http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage.
- Parameters:
-
[in] metadata The handle to metadata [out] frame The raw frame data in RGB888 [out] size The frame data size
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY Out of memory METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
int metadata_extractor_get_frame_at_time | ( | metadata_extractor_h | metadata, |
unsigned long | timestamp, | ||
bool | is_accurate, | ||
void ** | frame, | ||
int * | size | ||
) |
Gets the frame of a video media.
- Since :
- 2.3
- Remarks:
- The frame should be released using free(). In case of accessing specific path in internal storage or external storage, you may add the privilege for accessing the path.
For example, if you get the specific path by using storage_get_directory(). you should add privilege http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage.
- Parameters:
-
[in] metadata The handle to metadata [in] timestamp The timestamp in milliseconds [in] is_accurate If true
the user can get an accurate frame for the given timestamp,
otherwisefalse
if the user can only get the nearest i-frame of the video rapidly[out] frame The raw frame data in RGB888 [out] size The frame data size
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY Out of memory METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
int metadata_extractor_get_metadata | ( | metadata_extractor_h | metadata, |
metadata_extractor_attr_e | attribute, | ||
char ** | value | ||
) |
Gets metadata.
- Since :
- 2.3
- Remarks:
- The value should be released using free().
In case of accessing specific path in internal storage or external storage, you may add the privilege for accessing the path.
For example, if you get the specific path by using storage_get_directory(). you should add privilege http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage.
- Parameters:
-
[in] metadata The handle to metadata [in] attribute The key attribute name to get [out] value The value of the attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY Out of memory METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
int metadata_extractor_get_synclyrics | ( | metadata_extractor_h | metadata, |
int | index, | ||
unsigned long * | time_stamp, | ||
char ** | lyrics | ||
) |
Gets the synclyrics of a media file.
- Since :
- 2.3
- Remarks:
- The lyrics should be released using free(). In case of accessing specific path in internal storage or external storage, you may add the privilege for accessing the path.
For example, if you get the specific path by using storage_get_directory(). you should add privilege http://tizen.org/privilege/mediastorage or http://tizen.org/privilege/externalstorage.
- Parameters:
-
[in] metadata The handle to metadata [in] index The index of time/lyrics to set [out] time_stamp The time information of the index [out] lyrics The lyrics of the index
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
- Get the time/lyrics set number by calling metadata_extractor_get_metadata(METADATA_SYNCLYRICS_NUM).
int metadata_extractor_set_buffer | ( | metadata_extractor_h | metadata, |
const void * | buffer, | ||
int | size | ||
) |
Sets the buffer to extract.
- Since :
- 2.3
- Parameters:
-
[in] metadata The handle to metadata [in] buffer The buffer to extract metadata [in] size The buffer size
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed
- Precondition:
- Create a metadata handle by calling metadata_extractor_create().
int metadata_extractor_set_path | ( | metadata_extractor_h | metadata, |
const char * | path | ||
) |
Sets the file path to extract.
- Since :
- 2.3
- Parameters:
-
[in] metadata The handle to metadata [in] path The path to extract metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
METADATA_EXTRACTOR_ERROR_NONE Successful METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EXTRACTOR_ERROR_FILE_EXISTS File does not exist METADATA_EXTRACTOR_ERROR_OPERATION_FAILED Internal operation failed
- Precondition:
- Create a metadata handle by calling metadata_extractor_create().