* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* @addtogroup CodecBase
* @{
*
* @brief The CodecBase module provides variables, properties, and functions
* for audio and video muxer, demuxer, and basic encoding and decoding functions.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
*/
* @file native_avcodec_base.h
*
* @brief Declare the Native API used for audio and video muxer,
* demuxer and basic encoding and decoding functions.
*
* @kit AVCodecKit
* @library libnative_media_codecbase.so
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
*/
#ifndef NATIVE_AVCODEC_BASE_H
#define NATIVE_AVCODEC_BASE_H
#include <stdint.h>
#include <stdio.h>
#include "native_avbuffer.h"
#include "native_avmemory.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct NativeWindow OHNativeWindow;
typedef struct OH_AVCodec OH_AVCodec;
* @brief When an error occurs in the running of the OH_AVCodec instance, the function pointer will be called
* to report specific error information.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param errorCode specific error code
* @param userData The data that the user rely on to execute the callback.
* @since 9
* @version 1.0
*/
typedef void (*OH_AVCodecOnError)(OH_AVCodec *codec, int32_t errorCode, void *userData);
* @brief When the resolution of the decoding input stream or the resolution of the encoding output stream changes,
* the function pointer will be called to report the new stream description information.
* It should be noted that the life cycle of the OH_AVFormat pointer is only valid when the function pointer is called,
* and it is forbidden to continue to access after the call ends.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param format New output stream description information
* @param userData The data that the user rely on to execute the callback.
* @since 9
* @version 1.0
*/
typedef void (*OH_AVCodecOnStreamChanged)(OH_AVCodec *codec, OH_AVFormat *format, void *userData);
* @brief When OH_AVCodec needs new input data during the running process,
* the function pointer will be called and carry an available buffer to fill in the new input data.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param index The index corresponding to the newly available input buffer.
* @param data New available input buffer.
* @param userData The data that the user rely on to execute the callback.
* @deprecated since 11
* @useinstead OH_AVCodecOnNeedInputBuffer
* @since 9
* @version 1.0
*/
typedef void (*OH_AVCodecOnNeedInputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData);
* @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be
* called and carry a buffer containing the new output data. It should be noted that the life cycle of the
* OH_AVCodecBufferAttr pointer is only valid when the function pointer is called, which prohibits continued
* access after the call ends.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param index The index corresponding to the new output buffer.
* @param data Buffer containing the new output data
* @param attr The description of the new output buffer, please refer to {@link OH_AVCodecBufferAttr}
* @param userData The data that the user rely on to execute the callback.
* @deprecated since 11
* @useinstead OH_AVCodecOnNewOutputBuffer
* @since 9
* @version 1.0
*/
typedef void (*OH_AVCodecOnNewOutputData)(OH_AVCodec *codec, uint32_t index, OH_AVMemory *data,
OH_AVCodecBufferAttr *attr, void *userData);
* @brief When OH_AVCodec needs new input data during the running process,
* the function pointer will be called and carry an available buffer to fill in the new input data.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param index The index corresponding to the newly available input buffer.
* @param buffer New available input buffer.
* @param userData The data that the user rely on to execute the callback.
* @since 11
*/
typedef void (*OH_AVCodecOnNeedInputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData);
* @brief When new output data is generated during the operation of OH_AVCodec, the function pointer will be
* called and carry a buffer containing the new output data.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param codec OH_AVCodec instance
* @param index The index corresponding to the new output buffer.
* @param buffer Buffer containing the new output buffer.
* @param userData The data that the user rely on to execute the callback.
* @since 11
*/
typedef void (*OH_AVCodecOnNewOutputBuffer)(OH_AVCodec *codec, uint32_t index, OH_AVBuffer *buffer, void *userData);
* @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this
* structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the
* normal operation of OH_AVCodec.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError}
* @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged}
* @param onNeedInputData Monitoring codec requires input data, refer to {@link OH_AVCodecOnNeedInputData}
* @param onNeedOutputData Monitor codec to generate output data, refer to {@link OH_AVCodecOnNewOutputData}
* @deprecated since 11
* @useinstead OH_AVCodecCallback
* @since 9
* @version 1.0
*/
typedef struct OH_AVCodecAsyncCallback {
OH_AVCodecOnError onError;
OH_AVCodecOnStreamChanged onStreamChanged;
OH_AVCodecOnNeedInputData onNeedInputData;
OH_AVCodecOnNewOutputData onNeedOutputData;
} OH_AVCodecAsyncCallback;
* @brief A collection of all asynchronous callback function pointers in OH_AVCodec. Register an instance of this
* structure to the OH_AVCodec instance, and process the information reported through the callback to ensure the
* normal operation of OH_AVCodec.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param onError Monitor OH_AVCodec operation errors, refer to {@link OH_AVCodecOnError}
* @param onStreamChanged Monitor codec stream information, refer to {@link OH_AVCodecOnStreamChanged}
* @param onNeedInputBuffer Monitoring codec requires input buffer, refer to {@link OH_AVCodecOnNeedInputBuffer}
* @param onNewOutputBuffer Monitor codec to generate output buffer, refer to {@link OH_AVCodecOnNewOutputBuffer}
* @since 11
*/
typedef struct OH_AVCodecCallback {
OH_AVCodecOnError onError;
OH_AVCodecOnStreamChanged onStreamChanged;
OH_AVCodecOnNeedInputBuffer onNeedInputBuffer;
OH_AVCodecOnNewOutputBuffer onNewOutputBuffer;
} OH_AVCodecCallback;
* @brief The function pointer will be called to get sequence media data.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param data OH_AVBuffer buffer to fill.
* @param length Expected to read size.
* @param pos Current read offset.
* @return Actual size of data read to the buffer.
* @since 12
*/
typedef int32_t (*OH_AVDataSourceReadAt)(OH_AVBuffer *data, int32_t length, int64_t pos);
* @brief User customized data source.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
typedef struct OH_AVDataSource {
* @brief Total size of the data source.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
int64_t size;
* @brief Callback interface for reading data from datasource.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
OH_AVDataSourceReadAt readAt;
} OH_AVDataSource;
* @brief The function pointer will be called to get sequence media data.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @param data OH_AVBuffer buffer to fill.
* @param length Expected to read size.
* @param pos Current read offset.
* @param userData User-defined data.
* @return Actual size of data read to the buffer.
* @since 20
*/
typedef int32_t (*OH_AVDataSourceReadAtExt)(OH_AVBuffer *data, int32_t length, int64_t pos, void* userData);
* @brief User customized data source.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
typedef struct OH_AVDataSourceExt {
* @brief Total size of the data source.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
int64_t size;
* @brief Callback interface for reading data from datasource.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
OH_AVDataSourceReadAtExt readAt;
} OH_AVDataSourceExt;
* @brief Enumerates the MIME types of video mpeg2 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG2;
* @brief Enumerates the mime types of video avc codec.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_AVC;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AAC;
* @brief Enumerates the MIME type of video MSVIDEO1 codec.
*
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MSVIDEO1;
* @brief Enumerates the MIME type of video VC-1 codec.
*
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VC1;
* @brief Enumerates the MIME type of video WVC1 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_WVC1;
* @brief Enumerates the MIME type of video MJPEG codec.
*
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MJPEG;
* @brief Enumerates the MIME type of video av1 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_AV1;
* @brief Enumerates the MIME type of video vp8 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VP8;
* @brief Enumerates the MIME type of video vp9 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VP9;
* @brief Enumerates the MIME type of video dvvideo codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_DVVIDEO;
* @brief Enumerates the MIME type of video rawvideo codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_RAWVIDEO;
* @brief Enumerates the MIME types of audio and video codecs
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_FLAC;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VORBIS;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_MPEG;
* @brief Enumerates the mime types of video hevc codec.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
* @version 1.0
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_HEVC;
* @brief Enumerates the types of audio and video muxer
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @deprecated since 11
* @since 10
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4;
* @brief Enumerates the MIME type of video mpeg1 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG1;
* @brief brief Enumerates the Mime type of video mpeg4 part2 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_MPEG4_PART2;
* @brief Enumerates the MIME types of video codecs
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_H263;
* @brief Enumerates the MIME type of video WMV3 codec.
*
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_WMV3;
* @brief Enumerates the MIME type of video rv30 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_RV30;
* @brief Enumerates the MIME type of video rv40 codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_RV40;
* @brief Enumerates the MIME type of video CINEPAK codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_CINEPAK;
* @brief Enumerates the types of audio and video muxer
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
extern const char *OH_AVCODEC_MIMETYPE_IMAGE_JPG;
extern const char *OH_AVCODEC_MIMETYPE_IMAGE_PNG;
extern const char *OH_AVCODEC_MIMETYPE_IMAGE_BMP;
* @brief Enumerates the MIME types of audio codecs
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 11
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_VIVID;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_NB;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AMR_WB;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS;
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU;
* @brief Enumerates the MIME type of audio low bitrate voice codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC;
* @brief Enumerates the MIME type of audio ape codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_APE;
* @brief Enumerates the MIME type of versatile video coding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_AVCODEC_MIMETYPE_VIDEO_VVC;
* @brief Enumerates the MIME type of subtitle srt.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_SRT;
* @brief Enumerates the mime type of subtitle webvtt.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_AVCODEC_MIMETYPE_SUBTITLE_WEBVTT;
* @brief Enumerates the MIME type of audio raw stream.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 18
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_RAW;
* @brief Enumerates the mime types of audio G711 A-law codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711A;
* @brief Enumerates the mime types of audio GSM_MS codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_GSM_MS;
* @brief Enumerates the mime types of audio Enhanced AC-3 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_EAC3;
* @brief Enumerates the mime types of audio AC-3 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_AC3;
* @brief Enumerates the mime types of ALAC(Apple Lossless Audio Codec).
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_ALAC;
* @brief Enumerates the mime types of audio GSM codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_GSM;
* @brief Enumerates the mime types of windows media audio 1 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_WMAV1;
* @brief Enumerates the mime types of windows media audio 2 codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_WMAV2;
* @brief Enumerates the mime types of windows media audio 9 professional codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 22
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_WMAPRO;
* @brief Enumerates the mime types of audio ILBC(Internet Low Bitrate Codec).
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_ILBC;
* @brief Enumerates the mime types of audio TrueHD codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_TRUEHD;
* @brief Enumerates the mime types of audio TwinVQ codec.
*
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_TWINVQ;
* @brief Enumerates the mime types of audio DVAUDIO codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_DVAUDIO;
* @brief Enumerates the mime types of audio DTS codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_DTS;
* @brief Enumerates the mime types of audio COOK codec.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 23
*/
extern const char *OH_AVCODEC_MIMETYPE_AUDIO_COOK;
* @brief Key for timeStamp in surfacebuffer, value type is int64_t.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
* @deprecated since 14
*/
extern const char *OH_ED_KEY_TIME_STAMP;
* @deprecated since 14
*/
extern const char *OH_ED_KEY_EOS;
* @brief Provides the uniform key for storing the media description.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
*/
extern const char *OH_MD_KEY_TRACK_TYPE;
extern const char *OH_MD_KEY_CODEC_MIME;
extern const char *OH_MD_KEY_DURATION;
extern const char *OH_MD_KEY_BITRATE;
* @brief Key for maximum bitrate, value type is int64_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_MAX_BITRATE;
extern const char *OH_MD_KEY_MAX_INPUT_SIZE;
extern const char *OH_MD_KEY_WIDTH;
extern const char *OH_MD_KEY_HEIGHT;
extern const char *OH_MD_KEY_PIXEL_FORMAT;
extern const char *OH_MD_KEY_AUDIO_SAMPLE_FORMAT;
extern const char *OH_MD_KEY_FRAME_RATE;
extern const char *OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE;
extern const char *OH_MD_KEY_PROFILE;
extern const char *OH_MD_KEY_AUD_CHANNEL_COUNT;
extern const char *OH_MD_KEY_AUD_SAMPLE_RATE;
* @brief Key for the interval of key frame, value type is int32_t, the unit is milliseconds.
* This key is optional and only used for video encoding. A negative value means no key frames
* are requested after the first frame. A zero value means a stream containing all key frames is requested.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
*/
extern const char *OH_MD_KEY_I_FRAME_INTERVAL;
* This key is only used in video decoding Surface mode.
*/
extern const char *OH_MD_KEY_ROTATION;
* @brief Key for video transform type, value type is int32_t, see {@link OH_NativeBuffer_TransformType}.
*
* This key is used to set the surface transform for video decoders (surface mode).
* If not specified, the default value is 0 ({@link NATIVEBUFFER_ROTATE_NONE}).
* This key and {@link OH_MD_KEY_ROTATION} are mutually exclusive. If both are provided,
* OH_MD_KEY_VIDEO_TRANSFORM_TYPE takes precedence.
* Note that the degrees specified in {@link OH_NativeBuffer_TransformType} represent counter-clockwise rotation,
* which are opposite to the direction of rotation defined by {@link OH_MD_KEY_ROTATION}.
* The correspondence is:
* - {@link NATIVEBUFFER_ROTATE_NONE} => same as OH_MD_KEY_ROTATION = 0
* - {@link NATIVEBUFFER_ROTATE_90} => same as OH_MD_KEY_ROTATION = 270
* - {@link NATIVEBUFFER_ROTATE_180} => same as OH_MD_KEY_ROTATION = 180
* - {@link NATIVEBUFFER_ROTATE_270} => same as OH_MD_KEY_ROTATION = 90
*
* @since 22
*/
extern const char *OH_MD_KEY_VIDEO_TRANSFORM_TYPE;
* @brief Provides the uniform key for storing the media description.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
extern const char *OH_MD_KEY_RANGE_FLAG;
extern const char *OH_MD_KEY_COLOR_PRIMARIES;
*/
extern const char *OH_MD_KEY_TRANSFER_CHARACTERISTICS;
*/
extern const char *OH_MD_KEY_MATRIX_COEFFICIENTS;
* It is used when OH_VideoEncoder_SetParameter is called or takes effect immediately with the frame. */
extern const char *OH_MD_KEY_REQUEST_I_FRAME;
* can be obtained based on the capability query interface @OH_AVCapability_GetEncoderQualityRange, this key is only
* supported for encoders that are configured in constant quality mode */
extern const char *OH_MD_KEY_QUALITY;
* @brief Key for the desired encoding quality, value type is int32_t, this key is only
* supported for encoders that are configured in Stable Quality RateControl, the higher
* values generally result in more efficient(smaller-sized) encoding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_SQR_FACTOR;
* In video, SPS/PPS is transferred. In audio, extraData is transferred. */
extern const char *OH_MD_KEY_CODEC_CONFIG;
extern const char *OH_MD_KEY_TITLE;
extern const char *OH_MD_KEY_ARTIST;
extern const char *OH_MD_KEY_ALBUM;
extern const char *OH_MD_KEY_ALBUM_ARTIST;
extern const char *OH_MD_KEY_DATE;
extern const char *OH_MD_KEY_COMMENT;
extern const char *OH_MD_KEY_GENRE;
extern const char *OH_MD_KEY_COPYRIGHT;
extern const char *OH_MD_KEY_LANGUAGE;
extern const char *OH_MD_KEY_DESCRIPTION;
extern const char *OH_MD_KEY_LYRICS;
extern const char *OH_MD_KEY_TRACK_COUNT;
extern const char *OH_MD_KEY_CHANNEL_LAYOUT;
extern const char *OH_MD_KEY_BITS_PER_CODED_SAMPLE;
* The aac format is divided into ADTS format and LATM format.
* Where 0 represents LATM format and 1 represents ADTS format. */
extern const char *OH_MD_KEY_AAC_IS_ADTS;
extern const char *OH_MD_KEY_SBR;
extern const char *OH_MD_KEY_COMPLIANCE_LEVEL;
extern const char *OH_MD_KEY_IDENTIFICATION_HEADER;
extern const char *OH_MD_KEY_SETUP_HEADER;
* @brief Key for video scale type, value type is int32_t, see @OH_ScalingMode.
* It is recommended to directly call the @OH_NativeWindow_NativeWindowSetScalingModeV2 interface for setting.
* This key is optional and only used for video decoding in Surface mode.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
* @deprecated 14
* @useinstead OH_NativeWindow_NativeWindowSetScalingModeV2
*/
extern const char *OH_MD_KEY_SCALING_MODE;
extern const char *OH_MD_MAX_INPUT_BUFFER_COUNT;
extern const char *OH_MD_MAX_OUTPUT_BUFFER_COUNT;
* @brief Provides the uniform key for storing the media description.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 11
*/
extern const char *OH_MD_KEY_AUDIO_COMPRESSION_LEVEL;
* Demuxer and muxer are supported. */
extern const char *OH_MD_KEY_VIDEO_IS_HDR_VIVID;
extern const char *OH_MD_KEY_AUDIO_OBJECT_NUMBER;
extern const char *OH_MD_KEY_AUDIO_VIVID_METADATA;
* @brief Key for querying the maximum long-term reference count of video encoder, value type is int32_t.
* You should query the count through interface {@link OH_AVCapability_GetFeatureProperties}
* with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT;
* @brief Key for enable the temporal scalability mode, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
* The default value is 0. To query supported, you should use the interface {@link OH_AVCapability_IsFeatureSupported}
* with enum {@link VIDEO_ENCODER_TEMPORAL_SCALABILITY}. This is an optional key that applies only to video encoding.
* It is used in Configure state.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_TEMPORAL_SCALABILITY;
* @brief Key for describing the interval size at the base layer in temporal group of picture,
* value type is int32_t. It takes effect only when temporal level scale is enable.
* This is an optional key that applies only to video encoding. It is used in Configure state.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_SIZE;
* @brief Key for describing the reference mode in temporal group of picture, value type is int32_t, see enum
* {@link OH_TemporalGopReferenceMode}. It takes effect only when temporal level scale is enabled.
* This is an optional key that applies only to video encoding. It is used in Configure state.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_GOP_REFERENCE_MODE;
* @brief Key for the temporal layer ID within a Group of Pictures (GOP), the value type is int32_t.
* It is specific to video encoders and is available only when temporal level sacle is enabled.
* To retrieve the value associated with this key:
* 1. Obtain the encoded stream information (AVBuffer) via
* {@link OH_AVCodecOnNewOutputBuffer} or {@link OH_VideoEncoder_GetOutputBuffer}.
* 2. Retrieve the parameter information (AVFormat) from the buffer
* using {@link OH_AVBuffer_GetParameter}.
* 3. Use {@link OH_AVFormat_GetIntValue} with this key to get the corresponding value.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_TEMPORAL_LAYER_ID;
* @brief Key for describing the downsampling width in video encoder preprocess, value type is int32_t.
*
* It is used in configure or set parameter.
* This key must be used with {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_HEIGHT} together.
*
* Using restrictions:
* 1. The downsampling width and height must be configured or set together.
* If only one of them is configured, {@link AV_ERR_INVALID_VAL} will be returned.
* 2. When the downsampling width and height are the same and qualified as zero, the downsampling is disabled.
* 3. When the downsampling width and height are within the supported range, the downsampling is enabled.
* It's recommended to query the supported downsampling range through
* the interface {@link OH_AVCapability_IsVideoSizeSupported}.
* 4. When the downsampling width and height are not within the supported range,
* {@link AV_ERR_INVALID_VAL} will be returned.
* 5. Cannot be used together with crop parameters ({@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_TOP}, {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_RIGHT},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_BOTTOM}).
* If both downsampling and crop parameters are set through {@link OH_VideoEncoder_Configure} or
* {@link OH_VideoEncoder_SetParameter}, {@link AV_ERR_INVALID_VAL} will be returned.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_WIDTH;
* @brief Key for describing the downsampling height in video encoder preprocess, value type is int32_t.
*
* It is used in configure or set parameter.
* This key must be used with {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_WIDTH} together.
* Refer to {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_WIDTH} for more details on usage and restrictions.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_HEIGHT;
* @brief Key for describing the left-coordinate (x) of the crop rectangle in video encoder preprocess,
* value type is int32_t.
*
* The value represents the left-most column included in the crop frame, where column indices start at 0.
* The Caller must use "left, top, right, bottom" together to define the crop rectangle, corresponding to:
* - {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT}
* - {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_TOP}
* - {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_RIGHT}
* - {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_BOTTOM}
* (left, top) is the coordinate of the top-left corner of the crop rectangle.
* (right, bottom) is the coordinate of the bottom-right corner of the crop rectangle.
* The width and height of the crop rectangle can be calculated as:
* - width = right - left + 1
* - height = bottom - top + 1
*
* Using restrictions:
* 1. Crop left, top, right, bottom must be configured together. If only part of them is configured,
* {@link AV_ERR_INVALID_VAL} will be returned.
* 2. When crop left, top, right, bottom are all 0, the crop is disabled.
* 3. When the crop width, height are within the supported range, the crop is enabled.
* It's recommended to query the supported crop range through
* the interface {@link OH_AVCapability_IsVideoSizeSupported}.
* 4. When the crop values are not within the supported range,
* {@link AV_ERR_INVALID_VAL} will be returned.
* 5. Cannot be used together with downsampling parameters
* ({@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_WIDTH},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_HEIGHT}).
* If both crop and downsampling parameters are set through {@link OH_VideoEncoder_Configure} or
* {@link OH_VideoEncoder_SetParameter}, {@link AV_ERR_INVALID_VAL} will be returned.
* 6. When crop is enabled, the encoder will only encode the cropped area of the input frame.
* The content outside the crop rectangle will be discarded and not participate in encoding.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT;
* @brief Key for describing the top-coordinate (y) of the crop rectangle in video encoder preprocess,
* value type is int32_t.
*
* The value represents the top-most row included in the crop frame, where row indices start at 0.
* Refer to {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT} for more details on usage and restrictions.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_TOP;
* @brief Key for describing the right-coordinate (x) of the crop rectangle in video encoder preprocess,
* value type is int32_t.
*
* The value represents the right-most column included in the crop frame, where column indices start at 0.
* Refer to {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT} for more details on usage and restrictions.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_RIGHT;
* @brief Key for describing the bottom-coordinate (y) of the crop rectangle in video encoder preprocess,
* value type is int32_t.
*
* The value represents the bottom-most row included in the crop frame, where row indices start at 0.
* Refer to {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT} for more details on usage and restrictions.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_BOTTOM;
* @brief Key for describing the drop frame rate in video encoder preprocess, value type is double.
*
* It is used in configure or set parameter.
* The caller must ensure original frame rate is set, refer to {@link OH_MD_KEY_FRAME_RATE}.
* The value precision is retained to 2 decimal places using round half up.
*
* Using restrictions:
* 1. When value is set to 0.0, the drop frame is disabled.
* 2. When value is set to positive value and less than original frame rate,
* it will drop frames to match the set frame rate.
* 3. When value is set to negative value or equal to or greater than original frame rate,
* {@link AV_ERR_INVALID_VAL} will be returned.
* 4. Can be used together with downsampling parameters
* ({@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_WIDTH},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_DOWNSAMPLING_HEIGHT}).
* 5. Can be used together with crop parameters
* ({@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_LEFT},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_TOP},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_RIGHT},
* {@link OH_MD_KEY_VIDEO_ENCODER_PREPROC_CROP_BOTTOM}).
* 6. Processing order when combined: drop frame will be executed first, then downsampling or crop.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PREPROC_DROP_TO_FRAME_RATE;
* @brief Key for describing the count of used long-term reference frames, value type is int32_t, must be within the
* supported range. To get supported range, you should query whether the capability is supported through the interface
* {@link OH_AVCapability_GetFeatureProperties} with enum {@link VIDEO_ENCODER_LONG_TERM_REFERENCE}, otherwise, not set
* the key. This is an optional key that applies only to video encoding. It is used in Configure state.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_LTR_FRAME_COUNT;
* @brief Key for describing mark this frame as a long term reference frame, value type is int32_t (0 or 1): 1 is mark,
* 0 otherwise. It takes effect only when the number of used long term reference frames is configured. This is an
* optional key that applies only to video encoding input loop. It takes effect immediately.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_MARK_LTR;
* @brief Key for describing the long term reference frame poc referenced by this frame, value type is int32_t. This is
* an optional key that applies only to video encoding input loop. It takes effect immediately.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_PER_FRAME_USE_LTR;
* @brief Key for whether the frame corresponding to output buffer in OH_AVBuffer is a long-term reference frame,
* value type is int32_t (0 or 1): 1 is LTR,0 otherwise. This is an optional key that applies only
* to video encoding output loop. It indicates the attribute of the frame.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_PER_FRAME_IS_LTR;
* @brief Key for describing the frame poc, value type is int32_t. This is an optional key that applies only to video
* encoding output loop. It indicates the attribute of the frame.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_PER_FRAME_POC;
* @brief Key for describing the top-coordinate (y) of the crop rectangle, value type is int32_t. This is the top-most
* row included in the crop frame, where row indices start at 0. This key is only used for video decoding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_CROP_TOP;
* @brief Key for describing the bottom-coordinate (y) of the crop rectangle, value type is int32_t. This is the
* bottom-most row included in the crop frame, where row indices start at 0. This key is only used for video decoding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_CROP_BOTTOM;
* @brief Key for describing the left-coordinate (x) of the crop rectangle, value type is int32_t.
* This is the left-most column included in the crop frame, where column indices start at 0.
* This key is only used for video decoding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_CROP_LEFT;
* @brief Key for describing the right-coordinate (x) of the crop rectangle, value type is int32_t. This is the
* right-most column included in the crop frame, where column indices start at 0.
* This key is only used for video decoding.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_CROP_RIGHT;
* @brief Key for describing the stride of the video buffer layout, value type is int32_t. Stride (or row increment) is
* the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the
* stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format,
* though it is generally undefined and depends on the device and release.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_STRIDE;
* @brief Key for describing the plane height of a multi-planar (YUV) video buffer layout, value type is int32_t.
* Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from
* the top of the Y plane to the top of the U plane in the buffer. In essence the offset of the U plane
* is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format,
* though it is generally undefined and depends on the device and release.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_SLICE_HEIGHT;
* @brief Key for describing the valid picture width of the video, value type is int32_t.
* Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription}
* or {@link OH_AVCodecOnStreamChanged}.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_PIC_WIDTH;
* @brief Key for describing the valid picture height of the video, value type is int32_t.
* Get the value from an OH_AVFormat instance, which obtained by calling {@link OH_VideoDecoder_GetOutputDescription}
* or {@link OH_AVCodecOnStreamChanged}.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_PIC_HEIGHT;
* @brief Key to enable the low latency mode, value type is int32_t (0 or 1):1 is enabled, 0 otherwise.
* If enabled, the video decoder doesn't hold input and output data more than required by
* the codec standards. This is an optional key that applies only to video decoder.
* It is used in Configure state.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENABLE_LOW_LATENCY;
* @brief Key for describing the maximum quantization parameter allowed for video encoder, value type is int32_t.
* It is used in configure/setparameter or takes effect immediately with the frame.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MAX;
* @brief Key for describing the minimum quantization parameter allowed for video encoder, value type is int32_t.
* It is used in configure/setparameter or takes effect immediately with the frame.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_MIN;
* @brief Key for describing the video frame averge quantization parameter, value type is int32_t.
* Indicate the average qp value of the current frame encoding block, which is output with OH_AVBuffer.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_QP_AVERAGE;
* @brief Key for describing video frame mean squared error, value type is double.
* Indicate the MSE statistics of the current frame encoding block, which is output with OH_AVBuffer.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_MSE;
* @brief Key for decoding timestamp corresponding to the sample of audio, video, or subtitles carried in OH_AVBuffer,
* in microseconds, value type is int64_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_DECODING_TIMESTAMP;
* @brief Key for duration corresponding to the sample of audio, video, or subtitles carried in OH_AVBuffer,
* in microseconds, value type is int64_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_BUFFER_DURATION;
* @brief Key for sample aspect ratio, value type is double.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_SAR;
* @brief Key for start time of the first frame in the media file in microseconds, value type is int64_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_START_TIME;
* @brief Key for start time of track in microseconds, value type is int64_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_TRACK_START_TIME;
* @brief Key for setting the output color space of video decoder. The value type is int32_t.
* The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in
* {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured,
* the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709.
* If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns
* {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}.
* If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will
* be reported by callback function {@link OH_AVCodecOnError}.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE;
* @brief Key for describing if enable VRR or not, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
* This is an optional key that applies only to video decoder. It is used in configure.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 14
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_ENABLE_VRR;
* @brief Key applies only when configuring a video encoder in surface mode, value type is int32_t.
* If no new frame became available since the last frame submitted to the encoder,
* it will submit the previous frame repeatedly in milliseconds. It is used in configure.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 18
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER;
* @brief Key for describing the maximum count that the frame previously submitted to the encoder will be
* repeated, in case no new frame has been available since, value type is int32_t. This key takes effect only when
* {@link VIDEO_ENCODER_REPEAT_PREVIOUS_FRAME_AFTER} is valid. It is used in configure.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 18
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_PREVIOUS_MAX_COUNT;
* @brief Key for creation timestamp of a media file, value type is string.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 14
*/
extern const char *OH_MD_KEY_CREATION_TIME;
* @brief Key to set the region of interest(ROI) parameters. Value type is string in the format
* "Top1,Left1-Bottom1,Right1[=Params1];Top2,Left2-Bottom2,Right2[=Params2];".
*
* Each "Top,Left-Bottom,Right" represents the coordinate information of one ROI.
* The "[=Params]" is optional.
* The format of "[=Params]" varies by version:
* 1. Prior to version 26.0.0: Only a single int32_t value representing the
* quantization parameter offset is supported (e.g., "=Offset").
* 2. Since version 26.0.0: A Key-Value format is additionally supported and recommended.
* It uses comma-separated key-value pairs (e.g., "=dqp:-6,slb:1").
* Supported keys:
* - "dqp": Quantization parameter offset.
* - "slb": Semantic label. The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}.
*
* If "=Params" is omitted entirely, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=dqp:-6;",
* the encoder will use the default parameters to perform the ROI encoding on the first ROI and
* use the specified parameters on the second ROI.
* Note that the number of ROIs that can be applied simultaneously does not exceed six, and the total area must
* not exceed one-fifth of the total image area.
*
* This is an optional key that applies only to video encoder.
* It is used in running process and is set with each frame.
* In surface mode, it is used in {@link OH_VideoEncoder_OnNeedInputParameter}.
* In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}.
*
* @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoMetadata_AppendRoiString} to format
* and append ROI configurations safely instead of concatenating the string manually.
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS;
* @brief Key for the decision of setting moov in front or not, value type is int32_t.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_ENABLE_MOOV_FRONT;
* @brief Key to enable B-frame encoding, value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
*
* This is an optional key that applies only to video encoder, default is 0.\n
* If enabled, the video encoder will use B-frame, the decode order will be different from the display order.\n
* For unsupported platforms, Configuring this key will have no effect.\n
* Platform capability can be checked via {@link OH_AVCapability_IsFeatureSupported} with
* {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n
* It's only used in configuration phase.\n
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME;
* @brief Key for describing the maximum B-frame count of video encoder, value type is int32_t.
*
* Note: This key is only for querying the capability of the codec currently.
* Usage specifications:
* 1. Check feature support via {@link OH_AVCapability_IsFeatureSupported} with
* {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n
* 2. Obtain OH_AVFormat handle via {@link OH_AVCapability_GetFeatureProperties} with
* {@link OH_AVCapabilityFeature::VIDEO_ENCODER_B_FRAME}.\n
* 3. Get maximum B-frame count via {@link OH_AVFormat_GetIntValue} with this key.\n
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES;
* @brief Key to enable Bitrate Control Based on Presentation Time Stamp(PTS),
* value type is int32_t (0 or 1):1 is enabled, 0 otherwise.
*
* This is an optional key that applies only to video encoder, default is 0.
* If enabled, the PTS information must be carried in each video frame and sent to the encoder.
* It is used in configure.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_PTS_BASED_RATECONTROL;
* @brief Key for describing the reference relationship between tracks, value type is int32_t*.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_REFERENCE_TRACK_IDS;
* @brief Key for describing the track reference type, value type is string.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_TRACK_REFERENCE_TYPE;
* @brief Key for describing the track description, value type is string.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_TRACK_DESCRIPTION;
* @brief Key to enable synchronous mode, value type is (0 or 1): 1 is enabled, 0 otherwise.
*
* This is an optional key, default is 0.\n
* When enabled:
* - Callbacks should NOT be set for codecs
* - Buffer query APIs must be used instead
* - Only used in configuration phase
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 20
*/
extern const char *OH_MD_KEY_ENABLE_SYNC_MODE;
* @brief Key for specifying whether to output a blank frame during video decoder shutdown,
* value type is int32_t (0 or 1): 1 is enabled, 0 otherwise.
*
* This is an optional key, only used when configuring a video decoder in surface mode.\n
* By default, this feature is disabled (0).\n
* When enabled, the video decoder will output a blank frame (typically black)
* when stop or release to ensure a smooth transition to no-signal state on display devices.\n
* This prevents display retention or flickering caused by abrupt termination.\n
*
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_BLANK_FRAME_ON_SHUTDOWN;
* @brief Key for querying native buffer pixel formats for video codec operations, value type is int32_t.
* The value represents pixel formats defined in {@link OH_NativeBuffer_Format}.
*
* This key serves two primary purposes:
* 1. Runtime decoder output: Get current output format via {@link OH_VideoDecoder_GetOutputDescription}
* (or {@link OH_AVCodecOnStreamChanged} events)
* 2. Runtime encoder input: Get current input format via {@link OH_VideoEncoder_GetInputDescription}
*
* @since 22
*/
extern const char *OH_MD_KEY_VIDEO_NATIVE_BUFFER_FORMAT;
* @brief Key for specifying the number of bytes per audio packet. The value type is int32_t.
*
* This key is required only for Windows Media audio decoders. The supported decoder MIME types
* include {@link OH_AVCODEC_MIMETYPE_AUDIO_WMAV1}, {@link OH_AVCODEC_MIMETYPE_AUDIO_WMAV2},
* and {@link OH_AVCODEC_MIMETYPE_AUDIO_WMAPRO}.
*
* @since 22
*/
extern const char *OH_MD_KEY_BLOCK_ALIGN;
* @brief Key for skip samples of audio frame. value type is a uint8_t pointer.
*
* @since 23
*/
extern const char *OH_MD_KEY_BUFFER_SKIP_SAMPLES_INFO;
* @brief Key to enable {@link OH_MD_KEY_BUFFER_SKIP_SAMPLES_INFO} in audio decoder,
* value type is int32_t (0 or 1):1 is enabled, 0 is disabled.
*
* This is an optional key, default is 0.
*
* @since 24
*/
extern const char *OH_MD_KEY_ENABLE_BUFFER_SKIP_SAMPLES;
* @brief Key for latitude, value type is float, The range is [-90.0, 90.0].
* Represents the latitude of the geographic location.
*
* @since 24
*/
extern const char *OH_MD_KEY_LATITUDE;
* @brief Key for longitude, value type is float, The range is [-180.0, 180.0].
* Represents the longitude of the geographic location.
*
* @since 24
*/
extern const char *OH_MD_KEY_LONGITUDE;
* @brief Key for altitude, value type is float.
* This is an optional key. Represents the altitude of the geographic location.
*
* @since 24
*/
extern const char *OH_MD_KEY_ALTITUDE;
* @brief Key for setting the Audio Vivid signal input format.
*
* Required for Audio Vivid encoder. Specifies the signal format of input data.
* The value should be from {@link OH_AudioVividSignalFormat}.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_VIVID_SIGNAL_FORMAT;
* @brief Key for setting the soundbed channel layout.
*
* Configures the channel layout for soundbed. The value should be from {@link OH_AudioChannelLayout}.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_SOUNDBED_LAYOUT;
* @brief Key for setting the soundbed bitrate in bits per second.
*
* Configures the bitrate for soundbed channels. The actual bitrate may be adjusted by the encoder
* based on codec capabilities and constraints.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_SOUNDBED_BITRATE;
* @brief Key for setting the audio object bitrate in bits per second.
*
* Configures the bitrate for audio objects. The actual bitrate may be adjusted by the encoder
* based on codec capabilities and constraints.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_OBJECT_BITRATE;
* @brief Key for setting the video decoding frame retention mode. The value type is int32_t.
*
* The value represents a frame retention mode defined in {@link OH_FrameRetentionMode}.
* Please refer to the enumeration definition for detailed descriptions of each mode
* and their behaviors.This key can be configured via the {@link OH_VideoDecoder_Configure} and
* {@link OH_VideoDecoder_SetParameter} interfaces.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_FRAME_RETENTION_MODE;
* @brief Key for setting the video decoding frame retention ratio. The value type is double.
*
* This parameter takes effect when {@link OH_MD_KEY_VIDEO_DECODER_FRAME_RETENTION_MODE} is set to
* {@link OH_FrameRetentionMode#OH_FRAME_RETENTION_MODE_UNIFORM}, or when the retention mode is not
* configured (implicitly defaulting to uniform behavior). This configuration is ignored ONLY when
* the retention mode is explicitly set to {@link OH_FrameRetentionMode#OH_FRAME_RETENTION_MODE_ADAPTIVE}
* or {@link OH_FrameRetentionMode#OH_FRAME_RETENTION_MODE_FULL}.
* The valid range is [0.01, 1.0] (where 1.0 means all frames retained and 0.01 is the minimum limit);
* any value outside this range is considered invalid and will be ignored. This key can be configured
* via the {@link OH_VideoDecoder_Configure} and {@link OH_VideoDecoder_SetParameter} interfaces.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_FRAME_RETENTION_RATIO;
* @brief Key for configuring the video decoder playback speed. The value type is double.
*
* This key specifies the target playback speed of the video. It is primarily recommended
* for use in conjunction with {@link OH_FrameRetentionMode#OH_FRAME_RETENTION_MODE_ADAPTIVE}
* to assist the adaptive algorithm in accurately evaluating the perceptual impact of frame
* drops. The value must be strictly greater than 0.0, with recommended standard values
* including 0.5, 0.75, 1.0 (normal speed), 1.25, 1.5, 2.0, and 3.0; any value less than
* or equal to 0.0 is considered invalid. This key can be configured via the
* {@link OH_VideoDecoder_Configure} and {@link OH_VideoDecoder_SetParameter} interfaces.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_SPEED;
* @brief Key for setting or querying the maximum input buffer size (in bytes) for audio codec, value type is int32_t.
*
* This key is used to configure or retrieve the maximum size of the input buffer for audio codec.
* The actual buffer size is limited by the codec implementation. Setting a value larger than the
* codec's maximum supported size can not take effect.
* This configuration is optional. If not set, the codec will use its default buffer size.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_MAX_INPUT_BUFFER_SIZE;
* @brief Key for configuring the PTS output mode of the audio encoder.
*
* Sets the PTS output behavior mode. The value type is int32_t from {@link OH_AudioEncoderPTSMode}.
* Optional. Defaults to {@link OH_AUDIO_ENCODER_PTS_MODE_DEFAULT} if not set.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_ENCODER_PTS_MODE;
* @brief Key for enabling sample format conversion in the audio encoder.
* Optional. The value type is int32_t (0 or 1). 1 is enabled, 0 is disabled. Defaults to 0.
*
* The audio encoder supports only a limited number of sample formats. After this configuration is enabled, if
* an unsupported sampling format is used, the audio encoder will convert the sample format to an supported one for
* encoding. The supported sample formats before conversion are as follows: {@link SAMPLE_U8}, {@link SAMPLE_S16LE},
* {@link SAMPLE_S24LE}, {@link SAMPLE_S32LE}, {@link SAMPLE_F32LE}.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_AUDIO_ENCODER_ENABLE_SAMPLE_FORMAT_CONVERT;
* @brief Key to enable the decoder to output frames in decoding order,
* value type is int32_t (0 or 1): 1 is enabled, 0 disabled.
*
* This is an optional key that applies only to video decoder and is only used in configure.
* By default, this feature is disabled (0).
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_IN_DECODING_ORDER;
* @brief Key for querying the number of pending frames in the video encoder.
*
* It is used in {@link OH_VideoEncoder_GetInputDescription}.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_NUMBER_OF_PENDING_FRAMES;
* @brief Key to set the maximum number of frames that a compressor is allowed to hold before it must output a
* compressed frame.
*
* It is used in {@link OH_VideoEncoder_Configure}.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_FRAME_DELAY_COUNT;
* @brief Key to repeat headers before sync frames, value type is int32_t (0 or 1): 1 is enabled, 0 disabled.
*
* This is an optional key that applies only to video encoder and is only used in configure.
* By default, this feature is disabled (0).
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_REPEAT_HEADER_BEFORE_SYNC_FRAMES;
* @brief Media type.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
*/
typedef enum OH_MediaType {
MEDIA_TYPE_AUD = 0,
MEDIA_TYPE_VID = 1,
* @since 12
*/
MEDIA_TYPE_SUBTITLE = 2,
* @since 20
*/
MEDIA_TYPE_TIMED_METADATA = 5,
* @since 20
*/
MEDIA_TYPE_AUXILIARY = 6,
} OH_MediaType;
* @brief AAC Profile
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
*/
typedef enum OH_AACProfile {
AAC_PROFILE_LC = 0,
* @since 14
*/
AAC_PROFILE_HE = 3,
* @since 14
*/
AAC_PROFILE_HE_V2 = 4,
} OH_AACProfile;
* @brief AVC Profile
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 9
* @version 1.0
*/
typedef enum OH_AVCProfile {
AVC_PROFILE_BASELINE = 0,
AVC_PROFILE_HIGH = 4,
AVC_PROFILE_MAIN = 8,
} OH_AVCProfile;
* @brief MPEG2 Profile
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_MPEG2Profile {
MPEG2_PROFILE_SIMPLE = 0,
MPEG2_PROFILE_MAIN = 1,
MPEG2_PROFILE_SNR_SCALABLE = 2,
MPEG2_PROFILE_SPATIALLY_SCALABLE = 3,
MPEG2_PROFILE_HIGH = 4,
MPEG2_PROFILE_422 = 5,
} OH_MPEG2Profile;
* @brief MPEG4 Profile
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_MPEG4Profile {
MPEG4_PROFILE_SIMPLE = 0,
MPEG4_PROFILE_SIMPLE_SCALABLE = 1,
MPEG4_PROFILE_CORE = 2,
MPEG4_PROFILE_MAIN = 3,
MPEG4_PROFILE_N_BIT = 4,
MPEG4_PROFILE_HYBRID = 5,
MPEG4_PROFILE_BASIC_ANIMATED_TEXTURE = 6,
MPEG4_PROFILE_SCALABLE_TEXTURE = 7,
MPEG4_PROFILE_SIMPLE_FA = 8,
MPEG4_PROFILE_ADVANCED_REAL_TIME_SIMPLE = 9,
MPEG4_PROFILE_CORE_SCALABLE = 10,
MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 11,
MPEG4_PROFILE_ADVANCED_CORE = 12,
MPEG4_PROFILE_ADVANCED_SCALABLE_TEXTURE = 13,
MPEG4_PROFILE_ADVANCED_SIMPLE = 17,
} OH_MPEG4Profile;
* @brief H263 Profile
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_H263Profile {
H263_PROFILE_BASELINE = 0,
H263_PROFILE_VERSION_1_BACKWARD_COMPATIBILITY = 2,
} OH_H263Profile;
* @brief WMV3 Profile
*
* @since 22
*/
typedef enum OH_WMV3Profile {
WMV3_PROFILE_SIMPLE = 0,
WMV3_PROFILE_MAIN = 1
} OH_WMV3Profile;
* @brief HEVC Profile
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_HEVCProfile {
HEVC_PROFILE_MAIN = 0,
HEVC_PROFILE_MAIN_10 = 1,
HEVC_PROFILE_MAIN_STILL = 2,
* @deprecated since 14
*/
HEVC_PROFILE_MAIN_10_HDR10 = 3,
* @deprecated since 14
*/
HEVC_PROFILE_MAIN_10_HDR10_PLUS = 4,
} OH_HEVCProfile;
* @brief AV1 Profile
*
* @since 23
*/
typedef enum OH_AV1Profile {
AV1_PROFILE_MAIN = 0,
AV1_PROFILE_HIGH = 1,
AV1_PROFILE_PROFESSIONAL = 2,
} OH_AV1Profile;
* @brief AV1 Level.
*
* @since 23
*/
typedef enum OH_AV1Level {
AV1_LEVEL_20 = 0,
AV1_LEVEL_21 = 1,
AV1_LEVEL_22 = 2,
AV1_LEVEL_23 = 3,
AV1_LEVEL_30 = 4,
AV1_LEVEL_31 = 5,
AV1_LEVEL_32 = 6,
AV1_LEVEL_33 = 7,
AV1_LEVEL_40 = 8,
AV1_LEVEL_41 = 9,
AV1_LEVEL_42 = 10,
AV1_LEVEL_43 = 11,
AV1_LEVEL_50 = 12,
AV1_LEVEL_51 = 13,
AV1_LEVEL_52 = 14,
AV1_LEVEL_53 = 15,
AV1_LEVEL_60 = 16,
AV1_LEVEL_61 = 17,
AV1_LEVEL_62 = 18,
AV1_LEVEL_63 = 19,
AV1_LEVEL_70 = 20,
AV1_LEVEL_71 = 21,
AV1_LEVEL_72 = 22,
AV1_LEVEL_73 = 23,
} OH_AV1Level;
* @brief VVC Profile: A specified subset of the syntax of VVC.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 15
*/
typedef enum OH_VVCProfile {
VVC_PROFILE_MAIN_10 = 1,
VVC_PROFILE_MAIN_12 = 2,
VVC_PROFILE_MAIN_12_INTRA = 10,
VVC_PROFILE_MULTI_MAIN_10 = 17,
VVC_PROFILE_MAIN_10_444 = 33,
VVC_PROFILE_MAIN_12_444 = 34,
VVC_PROFILE_MAIN_16_444 = 36,
VVC_PROFILE_MAIN_12_444_INTRA = 42,
VVC_PROFILE_MAIN_16_444_INTRA = 44,
VVC_PROFILE_MULTI_MAIN_10_444 = 49,
VVC_PROFILE_MAIN_10_STILL = 65,
VVC_PROFILE_MAIN_12_STILL = 66,
VVC_PROFILE_MAIN_10_444_STILL = 97,
VVC_PROFILE_MAIN_12_444_STILL = 98,
VVC_PROFILE_MAIN_16_444_STILL = 100,
} OH_VVCProfile;
* @brief VC-1 Profile
*
* @since 22
*/
typedef enum OH_VC1Profile {
VC1_PROFILE_SIMPLE = 0,
VC1_PROFILE_MAIN = 1,
VC1_PROFILE_ADVANCED = 2,
} OH_VC1Profile;
* @brief VP9 Profile
*
* @since 23
*/
typedef enum OH_VP9Profile {
VP9_PROFILE_0 = 0,
VP9_PROFILE_1 = 1,
VP9_PROFILE_2 = 2,
VP9_PROFILE_3 = 3,
} OH_VP9Profile;
* @brief WVC1 Profile
*
* @since 23
*/
typedef enum OH_WVC1Profile {
WVC1_PROFILE_ADVANCED = 0,
} OH_WVC1Profile;
* @brief Enumerates the muxer output file format.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_AVOutputFormat {
AV_OUTPUT_FORMAT_DEFAULT = 0,
AV_OUTPUT_FORMAT_MPEG_4 = 2,
AV_OUTPUT_FORMAT_M4A = 6,
* The muxer output amr file format.
* @since 12
*/
AV_OUTPUT_FORMAT_AMR = 8,
* The muxer output mp3 file format.
* @since 12
*/
AV_OUTPUT_FORMAT_MP3 = 9,
* The muxer output wav file format.
* @since 12
*/
AV_OUTPUT_FORMAT_WAV = 10,
* The muxer output aac file format.
* @since 18
*/
AV_OUTPUT_FORMAT_AAC = 11,
* The muxer output flac file format.
* @since 20
*/
AV_OUTPUT_FORMAT_FLAC = 12,
* The muxer output ogg file format.
* @since 23
*/
AV_OUTPUT_FORMAT_OGG = 13,
* The muxer output flv file format.
* @since 26.0.0
*/
AV_OUTPUT_FORMAT_FLV = 14,
} OH_AVOutputFormat;
* @brief Seek Mode.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_AVSeekMode {
SEEK_MODE_NEXT_SYNC = 0,
SEEK_MODE_PREVIOUS_SYNC,
SEEK_MODE_CLOSEST_SYNC,
} OH_AVSeekMode;
* @brief Scaling Mode, only used in Surface mode.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
* @deprecated since 14
* @useinstead OHScalingModeV2
*/
typedef enum OH_ScalingMode {
* @deprecated since 14
* @useinstead OH_SCALING_MODE_SCALE_TO_WINDOW_V2
*/
SCALING_MODE_SCALE_TO_WINDOW = 1,
* @deprecated since 14
* @useinstead OH_SCALING_MODE_SCALE_CROP_V2
*/
SCALING_MODE_SCALE_CROP = 2,
} OH_ScalingMode;
* @brief enum Audio Bits Per Coded Sample.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_BitsPerSample {
SAMPLE_U8 = 0,
SAMPLE_S16LE = 1,
SAMPLE_S24LE = 2,
SAMPLE_S32LE = 3,
SAMPLE_F32LE = 4,
SAMPLE_U8P = 5,
SAMPLE_S16P = 6,
SAMPLE_S24P = 7,
SAMPLE_S32P = 8,
SAMPLE_F32P = 9,
INVALID_WIDTH = -1
} OH_BitsPerSample;
* @brief Color Primary.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_ColorPrimary {
COLOR_PRIMARY_BT709 = 1,
COLOR_PRIMARY_UNSPECIFIED = 2,
COLOR_PRIMARY_BT470_M = 4,
COLOR_PRIMARY_BT601_625 = 5,
COLOR_PRIMARY_BT601_525 = 6,
COLOR_PRIMARY_SMPTE_ST240 = 7,
COLOR_PRIMARY_GENERIC_FILM = 8,
COLOR_PRIMARY_BT2020 = 9,
COLOR_PRIMARY_SMPTE_ST428 = 10,
COLOR_PRIMARY_P3DCI = 11,
COLOR_PRIMARY_P3D65 = 12,
} OH_ColorPrimary;
* @brief Transfer Characteristic, both encoding and decoding are supported.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_TransferCharacteristic {
TRANSFER_CHARACTERISTIC_BT709 = 1,
TRANSFER_CHARACTERISTIC_UNSPECIFIED = 2,
TRANSFER_CHARACTERISTIC_GAMMA_2_2 = 4,
TRANSFER_CHARACTERISTIC_GAMMA_2_8 = 5,
TRANSFER_CHARACTERISTIC_BT601 = 6,
TRANSFER_CHARACTERISTIC_SMPTE_ST240 = 7,
TRANSFER_CHARACTERISTIC_LINEAR = 8,
TRANSFER_CHARACTERISTIC_LOG = 9,
TRANSFER_CHARACTERISTIC_LOG_SQRT = 10,
TRANSFER_CHARACTERISTIC_IEC_61966_2_4 = 11,
TRANSFER_CHARACTERISTIC_BT1361 = 12,
TRANSFER_CHARACTERISTIC_IEC_61966_2_1 = 13,
TRANSFER_CHARACTERISTIC_BT2020_10BIT = 14,
TRANSFER_CHARACTERISTIC_BT2020_12BIT = 15,
TRANSFER_CHARACTERISTIC_PQ = 16,
TRANSFER_CHARACTERISTIC_SMPTE_ST428 = 17,
TRANSFER_CHARACTERISTIC_HLG = 18,
} OH_TransferCharacteristic;
* @brief Matrix Coefficient, both encoding and decoding are supported.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_MatrixCoefficient {
MATRIX_COEFFICIENT_IDENTITY = 0,
MATRIX_COEFFICIENT_BT709 = 1,
MATRIX_COEFFICIENT_UNSPECIFIED = 2,
MATRIX_COEFFICIENT_FCC = 4,
MATRIX_COEFFICIENT_BT601_625 = 5,
MATRIX_COEFFICIENT_BT601_525 = 6,
MATRIX_COEFFICIENT_SMPTE_ST240 = 7,
MATRIX_COEFFICIENT_YCGCO = 8,
MATRIX_COEFFICIENT_BT2020_NCL = 9,
MATRIX_COEFFICIENT_BT2020_CL = 10,
MATRIX_COEFFICIENT_SMPTE_ST2085 = 11,
MATRIX_COEFFICIENT_CHROMATICITY_NCL = 12,
MATRIX_COEFFICIENT_CHROMATICITY_CL = 13,
MATRIX_COEFFICIENT_ICTCP = 14,
} OH_MatrixCoefficient;
* @brief MPEG2 Level.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_MPEG2Level {
MPEG2_LEVEL_LOW = 0,
MPEG2_LEVEL_MAIN = 1,
MPEG2_LEVEL_HIGH_1440 = 2,
MPEG2_LEVEL_HIGH = 3,
}OH_MPEG2Level;
* @brief MPEG4 Level.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_MPEG4Level {
MPEG4_LEVEL_0 = 0,
MPEG4_LEVEL_0B = 1,
MPEG4_LEVEL_1 = 2,
MPEG4_LEVEL_2 = 3,
MPEG4_LEVEL_3 = 4,
MPEG4_LEVEL_3B = 5,
MPEG4_LEVEL_4 = 6,
MPEG4_LEVEL_4A = 7,
MPEG4_LEVEL_5 = 8,
MPEG4_LEVEL_6 = 9,
}OH_MPEG4Level;
* @brief H263 Level.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 17
*/
typedef enum OH_H263Level {
H263_LEVEL_10 = 0,
H263_LEVEL_20 = 1,
H263_LEVEL_30 = 2,
H263_LEVEL_40 = 3,
H263_LEVEL_45 = 4,
H263_LEVEL_50 = 5,
H263_LEVEL_60 = 6,
H263_LEVEL_70 = 7
} OH_H263Level;
* @brief WMV3 Level
*
* @since 22
*/
typedef enum OH_WMV3Level {
WMV3_LEVEL_LOW = 0,
WMV3_LEVEL_MEDIUM = 1,
WMV3_LEVEL_HIGH = 2
} OH_WMV3Level;
* @brief AVC Level.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
typedef enum OH_AVCLevel {
AVC_LEVEL_1 = 0,
AVC_LEVEL_1b = 1,
AVC_LEVEL_11 = 2,
AVC_LEVEL_12 = 3,
AVC_LEVEL_13 = 4,
AVC_LEVEL_2 = 5,
AVC_LEVEL_21 = 6,
AVC_LEVEL_22 = 7,
AVC_LEVEL_3 = 8,
AVC_LEVEL_31 = 9,
AVC_LEVEL_32 = 10,
AVC_LEVEL_4 = 11,
AVC_LEVEL_41 = 12,
AVC_LEVEL_42 = 13,
AVC_LEVEL_5 = 14,
AVC_LEVEL_51 = 15,
AVC_LEVEL_52 = 16,
AVC_LEVEL_6 = 17,
AVC_LEVEL_61 = 18,
AVC_LEVEL_62 = 19,
} OH_AVCLevel;
* @brief HEVC Level.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
typedef enum OH_HEVCLevel {
HEVC_LEVEL_1 = 0,
HEVC_LEVEL_2 = 1,
HEVC_LEVEL_21 = 2,
HEVC_LEVEL_3 = 3,
HEVC_LEVEL_31 = 4,
HEVC_LEVEL_4 = 5,
HEVC_LEVEL_41 = 6,
HEVC_LEVEL_5 = 7,
HEVC_LEVEL_51 = 8,
HEVC_LEVEL_52 = 9,
HEVC_LEVEL_6 = 10,
HEVC_LEVEL_61 = 11,
HEVC_LEVEL_62 = 12,
} OH_HEVCLevel;
* @brief VVC Level: A defined set of constraints on the values that may be taken by the syntax elements and variables
* of VVC, or the value of a transform coefficient prior to scaling.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 15
*/
typedef enum OH_VVCLevel {
VVC_LEVEL_1 = 16,
VVC_LEVEL_2 = 32,
VVC_LEVEL_21 = 35,
VVC_LEVEL_3 = 48,
VVC_LEVEL_31 = 51,
VVC_LEVEL_4 = 64,
VVC_LEVEL_41 = 67,
VVC_LEVEL_5 = 80,
VVC_LEVEL_51 = 83,
VVC_LEVEL_52 = 86,
VVC_LEVEL_6 = 96,
VVC_LEVEL_61 = 99,
VVC_LEVEL_62 = 102,
VVC_LEVEL_63 = 105,
VVC_LEVEL_155 = 255,
} OH_VVCLevel;
* @brief VC-1 Level.
*
* @since 22
*/
typedef enum OH_VC1Level {
VC1_LEVEL_L0 = 0,
VC1_LEVEL_L1 = 1,
VC1_LEVEL_L2 = 2,
VC1_LEVEL_L3 = 3,
VC1_LEVEL_L4 = 4,
VC1_LEVEL_LOW = 5,
VC1_LEVEL_MEDIUM = 6,
VC1_LEVEL_HIGH = 7,
} OH_VC1Level;
* @brief VP9 Level.
*
* @since 23
*/
typedef enum OH_VP9Level {
VP9_LEVEL_1 = 0,
VP9_LEVEL_11 = 1,
VP9_LEVEL_2 = 2,
VP9_LEVEL_21 = 3,
VP9_LEVEL_3 = 4,
VP9_LEVEL_31 = 5,
VP9_LEVEL_4 = 6,
VP9_LEVEL_41 = 7,
VP9_LEVEL_5 = 8,
VP9_LEVEL_51 = 9,
VP9_LEVEL_52 = 10,
VP9_LEVEL_6 = 11,
VP9_LEVEL_61 = 12,
VP9_LEVEL_62 = 13,
} OH_VP9Level;
* @brief WVC1 Level.
*
* @since 23
*/
typedef enum OH_WVC1Level {
WVC1_LEVEL_L0 = 0,
WVC1_LEVEL_L1 = 1,
WVC1_LEVEL_L2 = 2,
WVC1_LEVEL_L3 = 3,
WVC1_LEVEL_L4 = 4,
} OH_WVC1Level;
* @brief The bitrate mode of encoder.
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 10
*/
typedef enum OH_BitrateMode {
BITRATE_MODE_CBR = 0,
BITRATE_MODE_VBR = 1,
BITRATE_MODE_CQ = 2,
* @since 20
*/
BITRATE_MODE_SQR = 3,
* @since 26.0.0
*/
BITRATE_MODE_CBR_HIGH_QUALITY = 4
} OH_BitrateMode;
* @brief The reference mode in temporal group of picture.
*
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 12
*/
typedef enum OH_TemporalGopReferenceMode {
ADJACENT_REFERENCE = 0,
JUMP_REFERENCE = 1,
* enhance layer. The temporal group of pictures must be power of 2. */
UNIFORMLY_SCALED_REFERENCE = 2,
} OH_TemporalGopReferenceMode;
* @brief The video decoding frame retention mode.
*
* @since 26.0.0
*/
typedef enum OH_FrameRetentionMode {
* Full frame retention mode. The decoder operates in a transparent passthrough state,
* retaining 100% of the input frames and effectively disabling the frame dropping feature.
* All underlying visual perception algorithms are completely bypassed, resulting in
* zero algorithmic overhead.
* @since 26.0.0
*/
OH_FRAME_RETENTION_MODE_FULL = 0,
* Adaptive frame retention mode. The decoder dynamically analyzes video characteristics to drop frames with the
* least perceptual impact, preserving visual smoothness with minimal degradation to the playback experience.
* For optimal algorithmic accuracy, it is highly recommended to explicitly configure
* the current playback speed via {@link OH_MD_KEY_VIDEO_DECODER_SPEED}.
* @since 26.0.0
*/
OH_FRAME_RETENTION_MODE_ADAPTIVE,
* Uniform frame retention mode. Retains frames evenly according to a user-configured retention ratio
* (configured via {@link OH_MD_KEY_VIDEO_DECODER_FRAME_RETENTION_RATIO}).
* If the retention ratio is not explicitly configured, the decoder limits the output to a maximum of 30 fps.
* @since 26.0.0
*/
OH_FRAME_RETENTION_MODE_UNIFORM
} OH_FrameRetentionMode;
* @brief Enum for the PTS mode of audio encoder.
*
* @since 26.0.0
*/
typedef enum OH_AudioEncoderPTSMode {
* Default PTS mode. Different encoders may perform differently.
* @since 26.0.0
*/
OH_AUDIO_ENCODER_PTS_MODE_DEFAULT = 0,
* PTS starts from zero.
* @since 26.0.0
*/
OH_AUDIO_ENCODER_PTS_MODE_ZERO_START = 1,
* PTS starts from the first input PTS.
* @since 26.0.0
*/
OH_AUDIO_ENCODER_PTS_MODE_FIRST_INPUT_START = 2,
} OH_AudioEncoderPTSMode;
#ifdef __cplusplus
}
#endif
#endif