Tizen Native API
7.0
|
The Media Format APIs provides functions for specify video or audio information.
Required Header
#include <media_format.h>
Functions | |
int | media_format_create (media_format_h *fmt) |
Creates a media format. | |
int | media_format_get_type (media_format_h fmt, media_format_type_e *formattype) |
Gets format type of media format. | |
int | media_format_get_container_mime (media_format_h fmt, media_format_mimetype_e *mimetype) |
Gets container MIME type of media format. | |
int | media_format_get_text_info (media_format_h fmt, media_format_mimetype_e *mimetype, media_format_text_type_e *type) |
Gets text track information of media format. | |
int | media_format_get_video_info (media_format_h fmt, media_format_mimetype_e *mimetype, int *width, int *height, int *avg_bps, int *max_bps) |
Gets video information of media format. | |
int | media_format_get_audio_info (media_format_h fmt, media_format_mimetype_e *mimetype, int *channel, int *samplerate, int *bit, int *avg_bps) |
Gets audio information of media format. | |
int | media_format_get_audio_aac_type (media_format_h fmt, bool *is_adts) |
Gets audio aac type of media format. | |
int | media_format_get_audio_aac_header_type (media_format_h fmt, media_format_aac_header_type_e *aac_header_type) |
Gets audio aac header type of media format. | |
int | media_format_get_video_frame_rate (media_format_h fmt, int *frame_rate) |
Gets video frame rate of media format. | |
int | media_format_set_container_mime (media_format_h fmt, media_format_mimetype_e mimetype) |
Sets container MIME type of media format. | |
int | media_format_set_text_mime (media_format_h fmt, media_format_mimetype_e mimetype) |
Sets text MIME type of media format. | |
int | media_format_set_text_type (media_format_h fmt, media_format_text_type_e type) |
Sets text type of media format. | |
int | media_format_set_video_mime (media_format_h fmt, media_format_mimetype_e mimetype) |
Sets video MIME type of media format. | |
int | media_format_set_video_width (media_format_h fmt, int width) |
Sets video width of media format. | |
int | media_format_set_video_height (media_format_h fmt, int height) |
Sets video height of media format. | |
int | media_format_set_video_avg_bps (media_format_h fmt, int avg_bps) |
Sets video avg_bps of media format. | |
int | media_format_set_video_max_bps (media_format_h fmt, int max_bps) |
Sets video max_bps of media format. | |
int | media_format_set_video_frame_rate (media_format_h fmt, int frame_rate) |
Sets video frame rate of media format. | |
int | media_format_set_audio_mime (media_format_h fmt, media_format_mimetype_e mimetype) |
Sets audio MIME type of media format. | |
int | media_format_set_audio_channel (media_format_h fmt, int channel) |
Sets audio channel of media format. | |
int | media_format_set_audio_samplerate (media_format_h fmt, int samplerate) |
Sets audio samplerate of media format. | |
int | media_format_set_audio_bit (media_format_h fmt, int bit) |
Sets audio bit of media format. | |
int | media_format_set_audio_avg_bps (media_format_h fmt, int avg_bps) |
Sets audio avg_bps of media format. | |
int | media_format_set_audio_aac_type (media_format_h fmt, bool is_adts) |
Sets audio aac type of media format. | |
int | media_format_set_audio_aac_header_type (media_format_h fmt, media_format_aac_header_type_e aac_header_type) |
Sets audio aac header type of media format. | |
int | media_format_ref (media_format_h fmt) |
Increases reference count of media_format_h object. | |
int | media_format_unref (media_format_h fmt) |
Decreases reference count of media_format_h object. | |
int | media_format_is_writable (media_format_h fmt, bool *is_writable) |
Checks whether the media_format_h is writable or not. | |
int | media_format_make_writable (media_format_h fmt, media_format_h *out_fmt) |
Returns a writable copy of media_format_h. | |
int | media_format_set_extra (media_format_h fmt, void *extra_data) |
Sets extra data of media format. | |
int | media_format_get_extra (media_format_h fmt, void **extra_data) |
Gets extra data of media format. | |
int | media_format_set_audio_channel_mask (media_format_h fmt, uint64_t channel_mask) |
Sets audio channel mask of media format. | |
int | media_format_get_audio_channel_mask (media_format_h fmt, uint64_t *channel_mask) |
Gets audio channel mask of media format. | |
int | media_format_is_little_endian (media_format_h fmt, bool *is_little_endian) |
Checks whether the given media format is little endian. | |
int | media_format_get_audio_bit_depth (media_format_h fmt, int *bit_depth) |
Gets the number of bits of information in digital audio using pulse-code modulation (PCM). | |
int | media_format_channel_positions_from_mask (media_format_h fmt, uint64_t channel_mask, media_format_channel_position_e **positions) |
Converts the channels in the channel_mask to a positions array. | |
int | media_format_channel_positions_to_mask (media_format_h fmt, const media_format_channel_position_e *positions, uint64_t *channel_mask_out) |
Converts the positions array to a bitmask. | |
Typedefs | |
typedef struct media_format_s * | media_format_h |
Media Format handle type. |
Typedef Documentation
typedef struct media_format_s* media_format_h |
Media Format handle type.
- Since :
- 2.3
Enumeration Type Documentation
Enumeration for media format aac header type.
- Since :
- 3.0
- Enumerator:
Enumeration for audio channel positions.
- Since :
- 5.5
- Enumerator:
enum media_format_error_e |
Enumerations of media format error.
- Since :
- 2.3
Enumeration for media format MIME type.
- Since :
- 2.3
- Enumerator:
MEDIA_FORMAT_L16 media format mime type is L16, AUDIO
MEDIA_FORMAT_ALAW media format mime type is ALAW, AUDIO
MEDIA_FORMAT_ULAW media format mime type is ULAW, AUDIO
MEDIA_FORMAT_AMR media format mime type is AMR, AUDIO, indicates MEDIA_FORMAT_AMR_NB (Since 2.4)
MEDIA_FORMAT_AMR_NB media format mime type is AMR_NB, AUDIO , (Since 2.4)
MEDIA_FORMAT_AMR_WB media format mime type is AMR_WB, AUDIO, (Since 2.4)
MEDIA_FORMAT_G729 media format mime type is G729, AUDIO
MEDIA_FORMAT_AAC media format mime type is AAC, AUDIO, indicates MEDIA_FORMAT_AAC_LC (Since 2.4)
MEDIA_FORMAT_AAC_LC media format mime type is AAC_LC, AUDIO, (Since 2.4)
MEDIA_FORMAT_AAC_HE media format mime type is AAC_HE, AUDIO, (Since 2.4)
MEDIA_FORMAT_AAC_HE_PS media format mime type is AAC_HE_PS, AUDIO, (Since 2.4)
MEDIA_FORMAT_MP3 media format mime type is MP3, AUDIO
MEDIA_FORMAT_MP2 media format mime type is MP23, AUDIO, (Since 4.0)
MEDIA_FORMAT_VORBIS media format mime type is VORBIS, AUDIO, (Since 2.4)
MEDIA_FORMAT_FLAC media format mime type is FLAC, AUDIO, (Since 2.4)
MEDIA_FORMAT_WMAV1 media format mime type is WMAV1, AUDIO, (Since 2.4)
MEDIA_FORMAT_WMAV2 media format mime type is WMAV2, AUDIO, (Since 2.4)
MEDIA_FORMAT_WMAPRO media format mime type is WMAVPRO, AUDIO, (Since 2.4)
MEDIA_FORMAT_WMALSL media format mime type is WMAVLSL, AUDIO, (Since 2.4)
MEDIA_FORMAT_AC3 media format mime type is AC3, AUDIO, (Since 4.0)
MEDIA_FORMAT_EAC3 media format mime type is EAC3, AUDIO, (Since 4.0)
MEDIA_FORMAT_DTS media format mime type is DTS, AUDIO, (Since 4.0)
MEDIA_FORMAT_OPUS media format mime type is OPUS, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM media format mime type is PCM, AUDIO, indicates MEDIA_FORMAT_PCM_S16LE (Since 3.0)
MEDIA_FORMAT_PCM_S16LE media format mime type is PCM signed 16-bit little-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_S24LE media format mime type is PCM signed 24-bit little-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_S32LE media format mime type is PCM signed 32-bit little-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_S16BE media format mime type is PCM signed 16-bit big-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_S24BE media format mime type is PCM signed 24-bit big-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_S32BE media format mime type is PCM signed 32-bit big-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_F32LE media format mime type is PCM 32-bit floating point little-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_F32BE media format mime type is PCM 32-bit floating point big-endian, AUDIO, (Since 3.0)
MEDIA_FORMAT_PCM_U16LE media format mime type is PCM unsigned 16-bit little-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM_U24LE media format mime type is PCM unsigned 24-bit little-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM_U32LE media format mime type is PCM unsigned 32-bit little-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM_U16BE media format mime type is PCM unsigned 16-bit big-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM_U24BE media format mime type is PCM unsigned 24-bit big-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCM_U32BE media format mime type is PCM unsigned 32-bit big-endian, AUDIO, (Since 4.0)
MEDIA_FORMAT_PCMA media format mime type is PCM A-law, AUDIO
MEDIA_FORMAT_PCMU media format mime type is PCM U-law, AUDIO
MEDIA_FORMAT_H261 media format mime type is H261, VIDEO
MEDIA_FORMAT_H263 media format mime type is H263, VIDEO
MEDIA_FORMAT_H263P media format mime type is H263P, VIDEO
MEDIA_FORMAT_H263_BLP media format mime type is H263 Baseline Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_H320_CEP media format mime type is H263 H.320 Coding Efficiency Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_BCP media format mime type is H263 Backward-Compatibility Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_ISW2P media format mime type is H263 the version 2 Interactive and Streaming Wireless Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_ISW3P media format mime type is H263 the version 3 Interactive and Streaming Wireless Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_CHCP media format mime type is H263 Conversation High Compression Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_C_INTERNETP media format mime type is H263 Conversational Internet Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_C_INTERLACEP media format mime type is H263 Conversational Interlace Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H263_HLP media format mime type is H263 High Latency Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_H264_SP media format mime type is H264 baseline profile, VIDEO
MEDIA_FORMAT_H264_MP media format mime type is H264 main profile, VIDEO
MEDIA_FORMAT_H264_HP media format mime type is H264 high profile, VIDEO
MEDIA_FORMAT_H264_EXTP media format mime type is H264 Extended Profile, VIDEO (Since 3.0)
MEDIA_FORMAT_H264_H10P media format mime type is H264 High10 Profile, VIDEO (Since 3.0)
MEDIA_FORMAT_H264_H422P media format mime type is H264 High422 Profile, VIDEO (Since 3.0)
MEDIA_FORMAT_H264_H444P media format mime type is H264 High444 Profile, VIDEO (Since 3.0)
MEDIA_FORMAT_H264_C444P media format mime type is H264 CAVLC444 Profile, VIDEO (Since 3.0)
MEDIA_FORMAT_MJPEG media format mime type is MJPEG, VIDEO
MEDIA_FORMAT_MPEG1 media format mime type is MPEG1, VIDEO
MEDIA_FORMAT_MPEG2_SP media format mime type is MPEG2 simple profile, VIDEO
MEDIA_FORMAT_MPEG2_MP media format mime type is MPEG2 main profile, VIDEO
MEDIA_FORMAT_MPEG2_HP media format mime type is MPEG2 high profile, VIDEO
MEDIA_FORMAT_MPEG4_SP media format mime type is MPEG4 simple profile, VIDEO
MEDIA_FORMAT_MPEG4_ASP media format mime type is MPEG4 advanced simple profile, VIDEO
MEDIA_FORMAT_HEVC media format mime type is HEVC, VIDEO, (Since 2.4)
MEDIA_FORMAT_HEVC_MP media format mime type is HEVC Main Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_HEVC_M10P media format mime type is HEVC Main10 Profile, VIDEO, (Since 3.0)
MEDIA_FORMAT_VP8 media format mime type is VP8, VIDEO, (Since 2.4)
MEDIA_FORMAT_VP9 media format mime type is VP9, VIDEO, (Since 2.4)
MEDIA_FORMAT_VC1 media format mime type is VC1, VIDEO, (Since 2.4)
MEDIA_FORMAT_DIVX4 media format mime type is DIVX4, VIDEO, (Since 4.0)
MEDIA_FORMAT_DIVX5 media format mime type is DIVX5, VIDEO, (Since 4.0)
MEDIA_FORMAT_XVID media format mime type is XVID, VIDEO, (Since 4.0)
MEDIA_FORMAT_AV1 media format mime type is AV1, VIDEO, (Since 6.0)
MEDIA_FORMAT_I420 media format mime type is I420, VIDEO
MEDIA_FORMAT_NV12 media format mime type is NV12, VIDEO
MEDIA_FORMAT_NV12T media format mime type is NV12T, VIDEO
MEDIA_FORMAT_YV12 media format mime type is YV12, VIDEO
MEDIA_FORMAT_NV21 media format mime type is NV21, VIDEO
MEDIA_FORMAT_NV16 media format mime type is NV16, VIDEO
MEDIA_FORMAT_YUYV media format mime type is YUYV, VIDEO
MEDIA_FORMAT_UYVY media format mime type is UYVY, VIDEO
MEDIA_FORMAT_422P media format mime type is 422P, VIDEO
MEDIA_FORMAT_RGB565 media format mime type is RGB565, VIDEO
MEDIA_FORMAT_RGB888 media format mime type is RGB888, VIDEO
MEDIA_FORMAT_RGBA media format mime type is RGBA, VIDEO
MEDIA_FORMAT_ARGB media format mime type is ARGB, VIDEO
MEDIA_FORMAT_BGRA media format mime type is BGRA, VIDEO, (Since 3.0)
MEDIA_FORMAT_Y8 media format mime type is Y8, VIDEO, (Since 5.5)
MEDIA_FORMAT_CONTAINER_MP4 media format mime type is MP4 container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_AVI media format mime type is AVI container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_MPEG2TS media format mime type is MPEG2TS container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_MPEG2PS media format mime type is MPEG2PS container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_MATROSKA media format mime type is MATROSKA container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_WEBM media format mime type is WEBM container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_3GP media format mime type is 3GP container, VIDEO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_WAV media format mime type is WAV container, AUDIO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_OGG media format mime type is OGG container, AUDIO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_AAC_ADTS media format mime type is AAC_ADTS container, AUDIO, (Since 3.0)
MEDIA_FORMAT_CONTAINER_AAC_ADIF media format mime type is AAC_ADIF container, AUDIO, (Since 3.0)
MEDIA_FORMAT_NATIVE_VIDEO media format mime type is HW dependent, VIDEO, (Since 2.4)
MEDIA_FORMAT_TEXT_MP4 media format mime type is MP4, TEXT, (Since 3.0)
MEDIA_FORMAT_TEXT_3GP media format mime type is 3GP, TEXT, (Since 3.0)
MEDIA_FORMAT_MAX media format mime type is MEDIA_FORMAT_MAX, Do not use
Enumeration for media format text type.
- Since :
- 3.0
enum media_format_type_e |
Enumeration for media format type.
- Since :
- 2.3
- Enumerator:
Function Documentation
int media_format_channel_positions_from_mask | ( | media_format_h | fmt, |
uint64_t | channel_mask, | ||
media_format_channel_position_e ** | positions | ||
) |
Converts the channels in the channel_mask to a positions array.
The size of the position array is equal to the number of channels, that can be obtained with media_format_get_audio_info().
- Since :
- 5.5
- Remarks:
- A channel_mask with fewer bits set than the number of channels is considered valid. The positions should be released with free().
- Parameters:
-
[in] fmt The media format handle [in] channel_mask The input channel_mask [out] positions The channel positions array, its length is equal to the number of channels
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- Precondition:
- The number of channels must be set with media_format_set_audio_channel().
- The channel should be set before calling media_format_channel_positions_from_mask().
- Example
int channels; uint64_t channel_mask; media_format_channel_position_e *positions; media_format_get_audio_info(fmt, NULL, &channels, NULL, NULL, NULL); positions = malloc(channels * sizeof(media_format_channel_position_e)); media_format_channel_positions_from_mask(fmt, channel_mask, &positions); ... free(positions);
int media_format_channel_positions_to_mask | ( | media_format_h | fmt, |
const media_format_channel_position_e * | positions, | ||
uint64_t * | channel_mask_out | ||
) |
Converts the positions array to a bitmask.
- Since :
- 5.5
- Remarks:
- A channel_mask_out with fewer bits set than the number of channels is considered valid.
- Parameters:
-
[in] fmt The media format handle [in] positions The channel positions array, its length is equal to the number of channels [out] channel_mask_out the output channel mask
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- Precondition:
- The number of channels must be set with media_format_set_audio_channel().
- The channel should be set before calling media_format_channel_positions_to_mask().
- See also:
- media_format_set_audio_channel()
int media_format_create | ( | media_format_h * | fmt | ) |
Creates a media format.
- Since :
- 2.3
It creates media format. and reference count will be set to 1 For destroying media_format_h handle, use media_format_unref().
- Parameters:
-
[out] fmt allocated media_format_h
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_ref()
- media_format_unref()
int media_format_get_audio_aac_header_type | ( | media_format_h | fmt, |
media_format_aac_header_type_e * | aac_header_type | ||
) |
Gets audio aac header type of media format.
- Since :
- 3.0
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt The media_format_h to get audio information [out] aac_header_type The media_format_aac_header_type_e, ex) MEDIA_FORMAT_AAC_HEADER_ADTS
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
int media_format_get_audio_aac_type | ( | media_format_h | fmt, |
bool * | is_adts | ||
) |
Gets audio aac type of media format.
- Since :
- 2.4
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt media_format_h to get audio information [out] is_adts AAC ADTS flag of the audio
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_format_set_audio_aac_type()
int media_format_get_audio_bit_depth | ( | media_format_h | fmt, |
int * | bit_depth | ||
) |
Gets the number of bits of information in digital audio using pulse-code modulation (PCM).
- Since :
- 5.5
- Parameters:
-
[in] fmt The media format handle [out] bit_depth The number of bits of information in each sample
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
int media_format_get_audio_channel_mask | ( | media_format_h | fmt, |
uint64_t * | channel_mask | ||
) |
Gets audio channel mask of media format.
- Since :
- 5.5
- Parameters:
-
[in] fmt The media format handle [out] channel_mask The output channel mask
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- Example
int channels; uint64_t channel_mask; media_format_channel_position_e *positions; media_format_get_audio_info(fmt, NULL, &channels, NULL, NULL, NULL); positions = malloc(channels * sizeof(media_format_channel_position_e)); media_format_get_audio_channel_mask(fmt, &channel_mask); media_format_channel_positions_from_mask(fmt, channel_mask, &positions); ... free(positions);
int media_format_get_audio_info | ( | media_format_h | fmt, |
media_format_mimetype_e * | mimetype, | ||
int * | channel, | ||
int * | samplerate, | ||
int * | bit, | ||
int * | avg_bps | ||
) |
Gets audio information of media format.
- Since :
- 2.3
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
returns mimetype, channels, height, samplerate bps, max bps of this media format.
- Parameters:
-
[in] fmt media_format_h to get audio information [out] mimetype media_format_mimetype_e , ex) MEDIA_FORMAT_PCM [out] channel channel of the audio [out] samplerate sampling rate of the audio [out] bit bit resolution of the audio [out] avg_bps average bps of the audio
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
int media_format_get_container_mime | ( | media_format_h | fmt, |
media_format_mimetype_e * | mimetype | ||
) |
Gets container MIME type of media format.
- Since :
- 3.0
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt The media_format_h to get container mime type [out] mimetype The media_format_mimetype_e, ex) MEDIA_FORMAT_CONTAINER_MP4
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_format_set_container_mime()
int media_format_get_extra | ( | media_format_h | fmt, |
void ** | extra_data | ||
) |
Gets extra data of media format.
The user can get extra data which user sets value via media_format_set_extra().
- Since :
- 4.0
- Remarks:
- The application is responsible for freeing extra_data. For description of extra data behavior upon making an object writable, see the description of media_format_make_writable().
- Parameters:
-
[in] fmt The media format handle [out] extra_data The extra data to get
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_format_set_extra()
int media_format_get_text_info | ( | media_format_h | fmt, |
media_format_mimetype_e * | mimetype, | ||
media_format_text_type_e * | type | ||
) |
Gets text track information of media format.
- Since :
- 3.0
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt The media_format_h to get text information [out] mimetype The media_format_mimetype_e, ex) MEDIA_FORMAT_TEXT_MP4 [out] type The media_format_text_type_e
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_format_set_text_mime()
int media_format_get_type | ( | media_format_h | fmt, |
media_format_type_e * | formattype | ||
) |
Gets format type of media format.
- Since :
- 3.0
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt The media_format_h to get format type [out] formattype The media_format_type_e, ex) MEDIA_FORMAT_AUDIO
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
int media_format_get_video_frame_rate | ( | media_format_h | fmt, |
int * | frame_rate | ||
) |
Gets video frame rate of media format.
- Since :
- 3.0
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
- Parameters:
-
[in] fmt The media_format_h to get [out] frame_rate The video frame rate
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
int media_format_get_video_info | ( | media_format_h | fmt, |
media_format_mimetype_e * | mimetype, | ||
int * | width, | ||
int * | height, | ||
int * | avg_bps, | ||
int * | max_bps | ||
) |
Gets video information of media format.
- Since :
- 2.3
- Remarks:
- Since 6.5, MEDIA_FORMAT_ERROR_INVALID_OPERATION is removed.
returns mimetype, width, height, average bps, max bps of this media format.
- Parameters:
-
[in] fmt media_format_h to get video information [out] mimetype media_format_mimetype_e , ex) MEDIA_FORMAT_H264_HP [out] width width of the video [out] height height of the video [out] avg_bps average bps of the video [out] max_bps max bps of the video
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
int media_format_is_little_endian | ( | media_format_h | fmt, |
bool * | is_little_endian | ||
) |
Checks whether the given media format is little endian.
- Since :
- 5.5
- Parameters:
-
[in] fmt The media format handle [out] is_little_endian true
if the given media format is little endian,false
if the given media format is big endian
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
int media_format_is_writable | ( | media_format_h | fmt, |
bool * | is_writable | ||
) |
Checks whether the media_format_h is writable or not.
- Since :
- 2.3
- Parameters:
-
[in] fmt exist media_format_h [out] is_writable if ref_count is 1, return true. if not, return false
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_make_writable()
int media_format_make_writable | ( | media_format_h | fmt, |
media_format_h * | out_fmt | ||
) |
Returns a writable copy of media_format_h.
If there is only one reference count on fmt, the caller must be the owner, and so this function will return the object unchanged. while, if there is more than one reference count on the object, a new object will be returned. The caller will own a reference to the returned object. In a nutshell, this function unrefs the fmt and refs the out_fmt returned. Don't access fmt after calling this function.
- Since :
- 2.3
- Remarks:
- If a new object is returned, it will not have its own copy of extra data. The new object's extra data object will be the original object's extra data.
- Parameters:
-
[in] fmt exist media_format_h , don't access it after calling this function [out] out_fmt new copied media_format_h, the caller is owner of this object
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_is_writable()
int media_format_ref | ( | media_format_h | fmt | ) |
Increases reference count of media_format_h object.
- Since :
- 2.3
increase ref_count of media_format_h
- Parameters:
-
[in] fmt exist media_format_h
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_unref()
int media_format_set_audio_aac_header_type | ( | media_format_h | fmt, |
media_format_aac_header_type_e | aac_header_type | ||
) |
Sets audio aac header type of media format.
- Since :
- 3.0
- Parameters:
-
[in] fmt The media_format_h to get audio information [in] aac_header_type The media_format_aac_header_type_e, ex) MEDIA_FORMAT_AAC_HEADER_ADTS
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
int media_format_set_audio_aac_type | ( | media_format_h | fmt, |
bool | is_adts | ||
) |
Sets audio aac type of media format.
- Since :
- 2.4
Sets audio aac data type of this media format
- Parameters:
-
[in] fmt media_format_h to set [in] is_adts aac adts flag of the audio
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_aac_type()
int media_format_set_audio_avg_bps | ( | media_format_h | fmt, |
int | avg_bps | ||
) |
Sets audio avg_bps of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] avg_bps average bit per second of the audio
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_info()
int media_format_set_audio_bit | ( | media_format_h | fmt, |
int | bit | ||
) |
Sets audio bit of media format.
- Since :
- 2.3
Sets audio bit resolution of this media format
- Parameters:
-
[in] fmt media_format_h to set [in] bit bit of the audio
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_info()
int media_format_set_audio_channel | ( | media_format_h | fmt, |
int | channel | ||
) |
Sets audio channel of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set audio information [in] channel channel of the audio
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_info()
int media_format_set_audio_channel_mask | ( | media_format_h | fmt, |
uint64_t | channel_mask | ||
) |
Sets audio channel mask of media format.
- Since :
- 5.5
- Parameters:
-
[in] fmt The media format handle [in] channel_mask The input channel mask
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- Example
uint64_t channel_mask; media_format_channel_position_e position[2]; position[0] = MEDIA_FORMAT_CHANNEL_POSITION_FRONT_LEFT; position[1] = MEDIA_FORMAT_CHANNEL_POSITION_FRONT_RIGHT; media_format_channel_positions_to_mask(fmt, position, &channel_mask); media_format_set_audio_channel_mask(fmt, channel_mask);
int media_format_set_audio_mime | ( | media_format_h | fmt, |
media_format_mimetype_e | mimetype | ||
) |
Sets audio MIME type of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set audio information [in] mimetype media_format_mimetype_e , ex) MEDIA_FORMAT_PCM
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_info()
int media_format_set_audio_samplerate | ( | media_format_h | fmt, |
int | samplerate | ||
) |
Sets audio samplerate of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] samplerate sampling rate of the audio
- Precondition:
- must set audio MIME type by media_format_set_audio_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_audio_info()
int media_format_set_container_mime | ( | media_format_h | fmt, |
media_format_mimetype_e | mimetype | ||
) |
Sets container MIME type of media format.
- Since :
- 3.0
- Parameters:
-
[in] fmt The media_format_h to set [in] mimetype The media_format_mimetype_e, ex) MEDIA_FORMAT_CONTAINER_MP4
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_container_mime()
int media_format_set_extra | ( | media_format_h | fmt, |
void * | extra_data | ||
) |
Sets extra data of media format.
The user can set data that media format does not support.
- Since :
- 4.0
- Remarks:
- The application is responsible for freeing extra_data. For description of extra data behavior upon making an object writable, see the description of media_format_make_writable().
- Parameters:
-
[in] fmt The media format handle [in] extra_data The extra data to set
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_format_get_extra()
int media_format_set_text_mime | ( | media_format_h | fmt, |
media_format_mimetype_e | mimetype | ||
) |
Sets text MIME type of media format.
- Since :
- 3.0
- Parameters:
-
[in] fmt The media_format_h to set [in] mimetype The media_format_mimetype_e, ex) MEDIA_FORMAT_TEXT
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_text_info()
int media_format_set_text_type | ( | media_format_h | fmt, |
media_format_text_type_e | type | ||
) |
Sets text type of media format.
- Since :
- 3.0
- Parameters:
-
[in] fmt The media_format_h to set [in] type The text type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_text_info()
int media_format_set_video_avg_bps | ( | media_format_h | fmt, |
int | avg_bps | ||
) |
Sets video avg_bps of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] avg_bps average bps of the video
- Precondition:
- must set video MIME type by media_format_set_video_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_video_info()
int media_format_set_video_frame_rate | ( | media_format_h | fmt, |
int | frame_rate | ||
) |
Sets video frame rate of media format.
- Since :
- 3.0
- Parameters:
-
[in] fmt The media_format_h to set [in] frame_rate The video frame rate
- Precondition:
- must set video MIME type by media_format_set_video_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
int media_format_set_video_height | ( | media_format_h | fmt, |
int | height | ||
) |
Sets video height of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] height height of the video
- Precondition:
- must set video MIME type by media_format_set_video_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_video_info()
int media_format_set_video_max_bps | ( | media_format_h | fmt, |
int | max_bps | ||
) |
Sets video max_bps of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] max_bps max bps of the video
- Precondition:
- must set video MIME type by media_format_set_video_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_video_info()
int media_format_set_video_mime | ( | media_format_h | fmt, |
media_format_mimetype_e | mimetype | ||
) |
Sets video MIME type of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] mimetype media_format_mimetype_e , ex) MEDIA_FORMAT_H264_HP
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_video_info()
int media_format_set_video_width | ( | media_format_h | fmt, |
int | width | ||
) |
Sets video width of media format.
- Since :
- 2.3
- Parameters:
-
[in] fmt media_format_h to set [in] width width of the video
- Precondition:
- must set video MIME type by media_format_set_video_mime()
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_get_video_info()
int media_format_unref | ( | media_format_h | fmt | ) |
Decreases reference count of media_format_h object.
- Since :
- 2.3
- Parameters:
-
[in] fmt exist media_format_h
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_FORMAT_ERROR_NONE Successful MEDIA_FORMAT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_FORMAT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_FORMAT_ERROR_INVALID_OPERATION Invalid operation
- See also:
- media_format_ref()