Tizen Native API
3.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/destory 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. |
Typedef Documentation
typedef struct metadata_extractor_s* metadata_extractor_h |
The metadata extractor handle.
- Since :
- 2.3.1
Enumeration Type Documentation
Enumeration for attribute.
- Since :
- 2.3.1
- Enumerator:
Enumeration for metadata extractor error.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int metadata_extractor_create | ( | metadata_extractor_h * | metadata | ) |
Creates metadata.
- Since :
- 2.3.1
- Remarks:
- You must release metadata 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 Not enough memory is available METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- See also:
- metadata_extractor_destroy()
int metadata_extractor_destroy | ( | metadata_extractor_h | metadata | ) |
Destroys metadata.
- Since :
- 2.3.1
- 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 METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- 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.1
- Remarks:
- You must release artwork and artwork_mime 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 previlege 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 type of 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 Not enough memory is available 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.1
- Remarks:
- You must release frame 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 previlege 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 Not enough memory is available 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.1
- Remarks:
- You must release frame 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 previlege 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 Not enough memory is available 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.1
- Remarks:
- You must release value 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 previlege 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 Not enough memory is available 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.1
- Remarks:
- You must release lyrics 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 previlege 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.1
- 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 METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- 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.1
- 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 METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Create a metadata handle by calling metadata_extractor_create().