Tizen Native API
5.5
|
The Video Metadata API provides functions to get information about video files present in the device.
#include <media_content.h>
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:
Attribute | Filter Keyword | Comments |
---|---|---|
album | MEDIA_ALBUM | Get from metadata if exist. |
artist | MEDIA_ARTIST | Get from metadata if exist. |
album_artist | MEDIA_ALBUM_ARTIST | Get from metadata if exist. |
genre | MEDIA_GENRE | Get from metadata if exist. |
composer | MEDIA_COMPOSER | Get from metadata if exist. |
year | MEDIA_YEAR | Get from metadata if exist. |
recorded_date | MEDIA_RECORDED_DATE | Get from metadata if exist. if not, same as modified time. |
copyright | MEDIA_COPYRIGHT | Get from metadata if exist. |
track_num | MEDIA_TRACK_NUM | Get from metadata if exist. |
bit_rate | MEDIA_BITRATE | Bitrate |
bitpersample | MEDIA_BITPERSAMPLE | Bit per sample |
sample_rate | MEDIA_SAMPLERATE | Samplerate |
channel | MEDIA_CHANNEL | Channel |
duration | MEDIA_DURATION | Duration |
rating | MEDIA_RATING | Get from metadata if exist. |
rotation | MEDIA_ORIENTATION | Video rotation |
width | MEDIA_WIDTH | Width |
height | MEDIA_HEIGHT | Height |
longitude | MEDIA_LONGITUDE | Get from metadata if exist. |
latitude | MEDIA_LATITUDE | Get from metadata if exist. |
altitude | MEDIA_ALTITUDE | Get from metadata if exist. |
is_360_content | MEDIA_360 | Whether 360 content or not. |
For getting the video handle (video_meta_h) from the media information (media_info_h), call the media_info_get_video() function.
For getting the information related to video files stored in the device call the respective get functions e.g. to get duration of the video file call video_meta_get_duration() function and so on.
When the video handle is no longer needed, it should be destroyed by calling video_meta_destroy() function.
Functions | |
int | video_meta_clone (video_meta_h *dst, video_meta_h src) |
Clones the video metadata. | |
int | video_meta_destroy (video_meta_h video) |
Destroys the video metadata. | |
int | video_meta_get_media_id (video_meta_h video, char **media_id) |
Gets the ID of the media of the given video metadata. | |
int | video_meta_get_album (video_meta_h video, char **album) |
Gets the album of the given video metadata. | |
int | video_meta_get_artist (video_meta_h video, char **artist) |
Gets the artist of the given video metadata. | |
int | video_meta_get_album_artist (video_meta_h video, char **album_artist) |
Gets the video album artist. | |
int | video_meta_get_genre (video_meta_h video, char **genre) |
Gets the genre of the given video metadata. | |
int | video_meta_get_composer (video_meta_h video, char **composer) |
Gets the composer of the given video metadata. | |
int | video_meta_get_year (video_meta_h video, char **year) |
Gets the year of the given video metadata. | |
int | video_meta_get_recorded_date (video_meta_h video, char **recorded_date) |
Gets the recorded date of the given video metadata. | |
int | video_meta_get_copyright (video_meta_h video, char **copyright) |
Gets the copyright notice of the given video metadata. | |
int | video_meta_get_track_num (video_meta_h video, char **track_num) |
Gets the track number of the given video metadata. | |
int | video_meta_get_bit_rate (video_meta_h video, int *bit_rate) |
Gets the bitrate of the given video metadata in bitrate per second. | |
int | video_meta_get_duration (video_meta_h video, int *duration) |
Gets the track duration of the given video metadata. | |
int | video_meta_get_width (video_meta_h video, int *width) |
Gets the width of the given video metadata. | |
int | video_meta_get_height (video_meta_h video, int *height) |
Gets the height of the given video metadata. | |
int | video_meta_get_rotation (video_meta_h video, int *rotation) |
Gets the rotation of the given video metadata. | |
Typedefs | |
typedef struct video_meta_s * | video_meta_h |
The structure type for the Video metadata handle. |
typedef struct video_meta_s* video_meta_h |
The structure type for the Video metadata handle.
int video_meta_clone | ( | video_meta_h * | dst, |
video_meta_h | src | ||
) |
Clones the video metadata.
This function copies the video metadata handle from a source to destination.
[out] | dst | The destination handle to the video metadata |
[in] | src | The source handle to the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_destroy | ( | video_meta_h | video | ) |
Destroys the video metadata.
This function frees all resources related to the video metadata handle. This handle no longer can be used to perform any operations. A new handle has to be created before the next use.
[in] | video | The handle to the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_album | ( | video_meta_h | video, |
char ** | album | ||
) |
Gets the album of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no album info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | album | The album of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_album_artist | ( | video_meta_h | video, |
char ** | album_artist | ||
) |
Gets the video album artist.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no album artist info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | album_artist | The album artist of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_artist | ( | video_meta_h | video, |
char ** | artist | ||
) |
Gets the artist of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no artist info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | artist | The artist of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_bit_rate | ( | video_meta_h | video, |
int * | bit_rate | ||
) |
Gets the bitrate of the given video metadata in bitrate per second.
[in] | video | The handle to the video metadata |
[out] | bit_rate | The video bit rate in bit per second [bps] |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_composer | ( | video_meta_h | video, |
char ** | composer | ||
) |
Gets the composer of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no composer info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | composer | The composer of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_copyright | ( | video_meta_h | video, |
char ** | copyright | ||
) |
Gets the copyright notice of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no copyright info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | copyright | The copyright of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_duration | ( | video_meta_h | video, |
int * | duration | ||
) |
Gets the track duration of the given video metadata.
[in] | video | The handle to the video metadata |
[out] | duration | The video duration in milliseconds |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_genre | ( | video_meta_h | video, |
char ** | genre | ||
) |
Gets the genre of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no genre info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | genre | The genre of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_height | ( | video_meta_h | video, |
int * | height | ||
) |
Gets the height of the given video metadata.
[in] | video | The handle to the video metadata |
[out] | height | The video height in pixels |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_media_id | ( | video_meta_h | video, |
char ** | media_id | ||
) |
Gets the ID of the media of the given video metadata.
[in] | video | The handle to the video metadata |
[out] | media_id | The media ID |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_recorded_date | ( | video_meta_h | video, |
char ** | recorded_date | ||
) |
Gets the recorded date of the given video metadata.
The format of the recorded date may vary depending on the file format.
For more details on the recorded date format, refer to the file format specification.
[in] | video | The handle to the video metadata |
[out] | recorded_date | The recorded date of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_rotation | ( | video_meta_h | video, |
int * | rotation | ||
) |
Gets the rotation of the given video metadata.
[in] | video | The handle to the video metadata |
[out] | rotation | The clockwise rotation angle of the video in degrees (can be returned from 0 to less than 360) |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_track_num | ( | video_meta_h | video, |
char ** | track_num | ||
) |
Gets the track number of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no track info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | track_num | The track number of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int video_meta_get_width | ( | video_meta_h | video, |
int * | width | ||
) |
Gets the width of the given video metadata.
[in] | video | The handle to the video metadata |
[out] | width | The video width in pixels |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int video_meta_get_year | ( | video_meta_h | video, |
char ** | year | ||
) |
Gets the year of the given video metadata.
If the value is an empty string, the method returns "Unknown".
Since 3.0, if the media content has no year info, the method returns empty string.
[in] | video | The handle to the video metadata |
[out] | year | The year of the video metadata |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |