Tizen Native API
|
Functions | |
int | metadata_editor_create (metadata_editor_h *metadata) |
Create metadata. | |
int | metadata_editor_set_path (metadata_editor_h metadata, const char *path) |
Set file path to read or write metadata. | |
int | metadata_editor_get_metadata (metadata_editor_h metadata, metadata_editor_attr_e attribute, char **value) |
Get the metadata corresponding to the attribute. | |
int | metadata_editor_set_metadata (metadata_editor_h metadata, metadata_editor_attr_e attribute, const char *value) |
Set the attribute of the metadata. | |
int | metadata_editor_update_metadata (metadata_editor_h metadata) |
Update the modified metadata. | |
int | metadata_editor_get_picture (metadata_editor_h metadata, int index, void **picture, int *size, char **mime_type) |
Get the picture in the media file. | |
int | metadata_editor_append_picture (metadata_editor_h metadata, const char *picture_path) |
Append the picture to the media file. | |
int | metadata_editor_remove_picture (metadata_editor_h metadata, int index) |
Remove artwork image from media file. | |
int | metadata_editor_destroy (metadata_editor_h metadata) |
Destroy metadata. | |
Typedefs | |
typedef void * | metadata_editor_h |
The handle of media metadata. |
The Metadata Editor API provides functions for editing the metadata of mp3, mp4 contents.
Required Header
#include <metadata_editor.h>
Overview
The Metadata Editor API allows you to read the metadata from a media file(metadata_editor_get_metadata()). To edit a metadata(metadata_editor_set_metadata()), create/destory the handle(metadata_editor_create()/metadata_editor_destroy), and append/ remove a picture in the metadata(metadata_editor_append_picture()/ metadata_editor_remove_picture()).
Typedef Documentation
typedef void* metadata_editor_h |
The handle of media metadata.
- Since :
- 2.4
Enumeration Type Documentation
The enumerations of attribute.
- Since :
- 2.4
- Enumerator:
The enumerations of media metadata error.
- Since :
- 2.4
- Enumerator:
Function Documentation
int metadata_editor_append_picture | ( | metadata_editor_h | metadata, |
const char * | picture_path | ||
) |
Append the picture to the media file.
- Since :
- 2.4
- Remarks:
- You must call metadata_editor_update_metadata() for applying to the metadata of the media file. if not, you will see the existing metadata when you call metadata_editor_get_metadata().
Image type of the metadata supports jpeg and png.
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] picture_path The path of picture for adding to the metadata
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_NOT_SUPPORTED unsupported file type METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()
int metadata_editor_create | ( | metadata_editor_h * | metadata | ) |
Create metadata.
- Since :
- 2.4
- Remarks:
- You must release metadata using metadata_editor_destroy().
- Parameters:
-
[in] metadata The handle to metadata
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available
- See also:
- metadata_editor_destroy()
int metadata_editor_destroy | ( | metadata_editor_h | metadata | ) |
Destroy metadata.
- Since :
- 2.4
- Parameters:
-
[in] metadata The handle to metadata
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail
- Precondition:
- Create metadata handle by calling metadata_editor_create()
- See also:
- metadata_editor_create()
int metadata_editor_get_metadata | ( | metadata_editor_h | metadata, |
metadata_editor_attr_e | attribute, | ||
char ** | value | ||
) |
Get the metadata corresponding to the attribute.
- Since :
- 2.4
- Remarks:
- You must release value using
free()
.
If the attribute value of the metadata is empty, return value is NULL.
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 key attribute name to get [out] value The value of the attribute
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()
int metadata_editor_get_picture | ( | metadata_editor_h | metadata, |
int | index, | ||
void ** | picture, | ||
int * | size, | ||
char ** | mime_type | ||
) |
Get the picture in the media file.
- Since :
- 2.4
- Remarks:
- You must release picture 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 picture order [out] picture encoded picture [out] size encoded picture size [out] mime_type the mime type of picture
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()
int metadata_editor_remove_picture | ( | metadata_editor_h | metadata, |
int | index | ||
) |
Remove artwork image from media file.
- Since :
- 2.4
- Remarks:
- You must call metadata_editor_update_metadata() for applying to the metadata of the media file. if not, you will see the existing metadata when you call metadata_editor_get_metadata().
- Parameters:
-
[in] metadata The handle to metadata [in] index artwork image order
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()
int metadata_editor_set_metadata | ( | metadata_editor_h | metadata, |
metadata_editor_attr_e | attribute, | ||
const char * | value | ||
) |
Set the attribute of the metadata.
- Since :
- 2.4
This function set the attribute of the metadata for updating the metadata.
- Remarks:
- You must release value using
free()
.
You must call metadata_editor_update_metadata() for applying to the metadata of the media file. if not, you will see the existing metadata when you call metadata_editor_get_metadata().
- Parameters:
-
[in] metadata The handle to metadata [in] attribute key attribute name to get [int] value The value of the attribute
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()
int metadata_editor_set_path | ( | metadata_editor_h | metadata, |
const char * | path | ||
) |
Set file path to read or write metadata.
- Since :
- 2.4
- Remarks:
- 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] path path to read or write metadata
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_FILE_EXISTS File not exist METADATA_EDITOR_ERROR_NOT_SUPPORTED unsupported file type METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail
- Precondition:
- Create metadata handle by calling metadata_editor_create()
int metadata_editor_update_metadata | ( | metadata_editor_h | metadata | ) |
Update the modified metadata.
- Since :
- 2.4
This function update the metadata in the media file that is modified by metadata_editor_set_metadata().
- Remarks:
- 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
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
METADATA_EDITOR_ERROR_NONE Successful METADATA_EDITOR_ERROR_INVALID_PARAMETER Invalid parameter METADATA_EDITOR_ERROR_OUT_OF_MEMORY Not enough memory is available METADATA_EDITOR_ERROR_PERMISSION_DENIED Permission denied METADATA_EDITOR_ERROR_OPERATION_FAILED Internal Operation Fail
- Precondition:
- Set path to read or write metadata by calling metadata_editor_set_path()