/*
 * Copyright (c) 2023-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.
 */

#ifndef STATUS_H
#define STATUS_H

#include <cstdint> // NOLINT: using int32_t in this file

namespace OHOS {
namespace Media {
// 需要参考OH的错误码编码规范来写,模块+错误码,常见具体错误是有固定定义
// 后续再定义北向接口 MfErrCode,那么它应该是Status的子集。
/**
* @enum Api Return Status.
*
* @since 1.0
* @version 1.0
*/
enum struct Status : int32_t {
    END_OF_STREAM = 1,         ///< Read source when end of stream
    OK = 0,                    ///< The execution result is correct.
    NO_ERROR = OK,             ///< Same as Status::OK
    ERROR_UNKNOWN = -1,        ///< An unknown error occurred.
    ERROR_PLUGIN_ALREADY_EXISTS = -2, ///< The plugin already exists, usually occurs when in plugin registered.
    ERROR_INCOMPATIBLE_VERSION =
        -3, ///< Incompatible version, may occur during plugin registration or function calling.
    ERROR_NO_MEMORY = -4,           ///< The system memory is insufficient.
    ERROR_WRONG_STATE = -5,         ///< The function is called in an invalid state.
    ERROR_UNIMPLEMENTED = -6,       ///< This method or interface is not implemented.
    ERROR_INVALID_PARAMETER = -7,   ///< The plugin does not support this parameter.
    ERROR_INVALID_DATA = -8,        ///< The value is not in the valid range.
    ERROR_MISMATCHED_TYPE = -9,     ///< Mismatched data type
    ERROR_TIMED_OUT = -10,          ///< Operation timeout.
    ERROR_UNSUPPORTED_FORMAT = -11, ///< The plugin not support this format/name.
    ERROR_NOT_ENOUGH_DATA = -12,    ///< Not enough data when read from source.
    ERROR_NOT_EXISTED = -13,        ///< Source is not existed.
    ERROR_AGAIN = -14,              ///< Operation is not available right now, should try again later.
    ERROR_PERMISSION_DENIED = -15,  ///< Permission denied.
    ERROR_NULL_POINTER = -16,       ///< Null pointer.
    ERROR_INVALID_OPERATION = -17,  ///< Invalid operation.
    ERROR_CLIENT = -18,             ///< Http client error
    ERROR_SERVER = -19,             ///< Http server error
    ERROR_DELAY_READY = -20,        ///< Delay ready event
    ERROR_INVALID_STATE = -21,
    ERROR_AUDIO_INTERRUPT = -22,
    ERROR_ONE_TRACK_SEGMENT_EOS = -23,
    ERROR_EARLY_STOP = -24,
    ERROR_MPEG4_DEMUXER_UNSUPPORTED_FORMAT = -25,
    ERROR_INVALID_BUFFER_SIZE = 0xF001,
    ERROR_UNEXPECTED_MEMORY_TYPE = 0xF002,
    ERROR_CREATE_BUFFER = 0xF003,
    ERROR_NULL_POINT_BUFFER = 0xF004,
    ERROR_INVALID_BUFFER_ID = 0xF005,
    ERROR_INVALID_BUFFER_STATE = 0xF006,
    ERROR_NO_FREE_BUFFER = 0xF007,
    ERROR_NO_DIRTY_BUFFER = 0xF008,
    ERROR_NO_CONSUMER_LISTENER = 0xF009,
    ERROR_NULL_BUFFER_QUEUE = 0xF00A,
    ERROR_WAIT_TIMEOUT = 0xF00B,
    ERROR_OUT_OF_RANGE = 0xF00C,
    ERROR_NULL_SURFACE = 0xF00D,
    ERROR_SURFACE_INNER = 0xF00E,
    ERROR_NULL_SURFACE_BUFFER = 0xF00F,
    ERROR_DRM_DECRYPT_FAILED = 0xF010,
    ERROR_NO_TRACK = 0xF011,
    ERROR_GET_INPUT_SURFACE_FAILED = 0xF012,
    ERROR_SET_OUTPUT_SURFACE_FAILED = 0xF013,
    ERROR_AUD_ENC_FAILED = 0xF014,
    ERROR_VID_RESIZE_FAILED = 0xF015,
    ERROR_PACKET_CONVERT_FAILED = 0xF016,
    ERROR_VID_DEC_INIT_FAILED = 0xF017,
    ERROR_AUD_DEC_INIT_FAILED = 0xF018,
    ERROR_VID_DEC_CONFIGURE_FAILED = 0xF019,
    ERROR_AUD_DEC_CONFIGURE_FAILED = 0xF01A,
    ERROR_VID_ENHANCER_CONFIGURE_FAILED = 0xF01B,
    ERROR_NO_VALID_TRACK_FOUND = 0xF01C,
    ERROR_VID_ENC_FAILED = 0xF01D,
    ERROR_VID_ENC_INIT_FAILED = 0xF01E,
    ERROR_VID_ENC_START_FAILED = 0xF01F,
    ERROR_VID_ENC_STOP_FAILED = 0xF020,
    ERROR_AUD_ENC_INIT_FAILED = 0xF021,
    ERROR_AUD_ENC_START_FAILED = 0xF022,
    ERROR_AUD_ENC_STOP_FAILED = 0xF023,
    ERROR_AUD_FAILED = 0xF024,
    ERROR_AUD_INIT_FAILED = 0xF025,
    ERROR_AUD_START_FAILED = 0xF026,
    ERROR_AUD_STOP_FAILED = 0xF027,
    ERROR_MUXER_FAILED = 0xF028,
    ERROR_MUXER_INIT_FAILED = 0xF029,
    ERROR_MUXER_START_FAILED = 0xF02A,
    ERROR_MUXER_STOP_FAILED = 0xF02B,
    ERROR_FRAMEWORK_ERR = 0xF02C,
    ERROR_INVALID_VAL = 0xF02D,
    ERROR_OPEN_FILE_FAILED = 0xF02E,
    ERROR_FILE_ACCESS_FAILED = 0xF02F,
    ERROR_INVALID_TIMESTAMP = 0xF030,

    ERROR_IPC_WRITE_INTERFACE_TOKEN = 0xF101,
    ERROR_IPC_SEND_REQUEST = 0xF102,

    ERROR_NOT_SEI_FORAMT = 0xF201,
};
} // namespace Media
} // namespace OHOS
#endif // STATUS_H