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
Definition for Metadata extractor Error Class.
- Since :
- 2.3
Typedef Documentation
The metadata extractor handle.
- Since :
- 2.3
Enumeration Type Documentation
Enumeration for attribute.
- Since :
- 2.3
- Enumerator:
METADATA_DURATION |
Duration
|
METADATA_VIDEO_BITRATE |
Video Bitrate
|
METADATA_VIDEO_FPS |
Video FPS
|
METADATA_VIDEO_WIDTH |
Video Width
|
METADATA_VIDEO_HEIGHT |
Video Height
|
METADATA_HAS_VIDEO |
Video stream count
|
METADATA_AUDIO_BITRATE |
Audio Bitrate
|
METADATA_AUDIO_CHANNELS |
Audio Channels
|
METADATA_AUDIO_SAMPLERATE |
Audio Samplerate
|
METADATA_AUDIO_BITPERSAMPLE |
Audio bit per sample
|
METADATA_HAS_AUDIO |
Audio stream count
|
METADATA_ARTIST |
Artist
|
METADATA_TITLE |
Title
|
METADATA_ALBUM |
Album
|
METADATA_ALBUM_ARTIST |
Album_Artist
|
METADATA_GENRE |
Genre
|
METADATA_COMPOSER |
Composer
|
METADATA_COPYRIGHT |
Copyright
|
METADATA_DATE |
Date
|
METADATA_DESCRIPTION |
Description
|
METADATA_COMMENT |
Comment
|
METADATA_TRACK_NUM |
Track number info
|
METADATA_CLASSIFICATION |
Classification
|
METADATA_RATING |
Rating
|
METADATA_LONGITUDE |
Longitude
|
METADATA_LATITUDE |
Latitude
|
METADATA_ALTITUDE |
Altitude
|
METADATA_CONDUCTOR |
Conductor
|
METADATA_UNSYNCLYRICS |
Unsynchronized lyric
|
METADATA_SYNCLYRICS_NUM |
Synchronized lyric (time/lyric set) number
|
METADATA_RECDATE |
Recording date
|
METADATA_ROTATE |
Rotate(Orientation) Information
|
METADATA_VIDEO_CODEC |
Video Codec (Since 3.0)
|
METADATA_AUDIO_CODEC |
Audio Codec (Since 3.0)
|
METADATA_360 |
Flag indicating if the video is a spherical video (Since 3.0)
|
Enumeration for metadata extractor error.
- Since :
- 2.3
- Enumerator:
METADATA_EXTRACTOR_ERROR_NONE |
Successful
|
METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER |
Invalid parameter
|
METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY |
Out of memory
|
METADATA_EXTRACTOR_ERROR_FILE_EXISTS |
File does not exist
|
METADATA_EXTRACTOR_ERROR_PERMISSION_DENIED |
Permission denied
|
METADATA_EXTRACTOR_ERROR_OPERATION_FAILED |
Invalid internal operation
|
Function Documentation
Creates metadata.
- Since :
- 2.3
- Parameters:
-
[in] | metadata | The handle to metadata |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- metadata_extractor_destroy()
Gets the artwork image in a media file.
- Since :
- 2.3
- 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:
-
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
- See also:
- metadata_extractor_create()
-
metadata_extractor_destroy()
Gets the frame of a video media.
- Since :
- 2.3
- 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,
otherwise false 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:
-
- Precondition:
- Set the path to extract by calling metadata_extractor_set_path().
- See also:
- metadata_extractor_create()
-
metadata_extractor_destroy()
Gets the synclyrics of a media file.
- Since :
- 2.3
- 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:
-
- 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).
- See also:
- metadata_extractor_create()
-
metadata_extractor_destroy()