mirror of
https://gitee.com/openharmony/multimedia_av_codec
synced 2024-12-11 17:16:02 +00:00
!17 删除内部拓展错误码,修改为北向接口错误码
Merge pull request !17 from WestYao/dev_dfx_why
This commit is contained in:
commit
3d25140a6b
@ -16,111 +16,113 @@
|
||||
#include "avcodec_errors.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "native_averrors.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AVCodec {
|
||||
using ErrorMessageFunc = std::function<std::string(const std::string& param1, const std::string& param2)>;
|
||||
const std::map<AVCodecServiceErrCode, std::string> AVCS_ERRCODE_INFOS = {
|
||||
{AVCSERR_OK, "success"},
|
||||
{AVCSERR_NO_MEMORY, "no memory"},
|
||||
{AVCSERR_INVALID_OPERATION, "operation not be permitted"},
|
||||
{AVCSERR_INVALID_VAL, "invalid argument"},
|
||||
{AVCSERR_UNKNOWN, "unkown error"},
|
||||
{AVCSERR_SERVICE_DIED, "avcodec service died"},
|
||||
{AVCSERR_CREATE_REC_ENGINE_FAILED, "create recorder engine failed"},
|
||||
{AVCSERR_CREATE_PLAYER_ENGINE_FAILED, "create player engine failed"},
|
||||
{AVCSERR_CREATE_AVMETADATAHELPER_ENGINE_FAILED, "create avmetadatahelper engine failed"},
|
||||
{AVCSERR_INVALID_STATE, "the state is not support this operation"},
|
||||
{AVCSERR_UNSUPPORT, "unsupport interface"},
|
||||
{AVCSERR_UNSUPPORT_AUD_SRC_TYPE, "unsupport audio source type"},
|
||||
{AVCSERR_UNSUPPORT_AUD_SAMPLE_RATE, "unsupport audio sample rate"},
|
||||
{AVCSERR_UNSUPPORT_AUD_CHANNEL_NUM, "unsupport audio channel"},
|
||||
{AVCSERR_UNSUPPORT_AUD_ENC_TYPE, "unsupport audio encoder type"},
|
||||
{AVCSERR_UNSUPPORT_AUD_PARAMS, "unsupport audio params(other params)"},
|
||||
{AVCSERR_UNSUPPORT_VID_SRC_TYPE, "unsupport video source type"},
|
||||
{AVCSERR_UNSUPPORT_VID_ENC_TYPE, "unsupport video encoder type"},
|
||||
{AVCSERR_UNSUPPORT_VID_PARAMS, "unsupport video params(other params)"},
|
||||
{AVCSERR_UNSUPPORT_CONTAINER_TYPE, "unsupport container format type"},
|
||||
{AVCSERR_UNSUPPORT_PROTOCOL_TYPE, "unsupport protocol type"},
|
||||
{AVCSERR_UNSUPPORT_VID_DEC_TYPE, "unsupport video decoder type"},
|
||||
{AVCSERR_UNSUPPORT_AUD_DEC_TYPE, "unsupport audio decoder type"},
|
||||
{AVCSERR_UNSUPPORT_STREAM, "internal data stream error"},
|
||||
{AVCSERR_UNSUPPORT_FILE, "this appears to be a text file"},
|
||||
{AVCSERR_UNSUPPORT_SOURCE, "unsupport source type"},
|
||||
{AVCSERR_AUD_ENC_FAILED, "audio encode failed"},
|
||||
{AVCSERR_AUD_RENDER_FAILED, "audio render failed"},
|
||||
{AVCSERR_VID_ENC_FAILED, "video encode failed"},
|
||||
{AVCSERR_AUD_DEC_FAILED, "audio decode failed"},
|
||||
{AVCSERR_VID_DEC_FAILED, "video decode failed"},
|
||||
{AVCSERR_MUXER_FAILED, "stream avmuxer failed"},
|
||||
{AVCSERR_DEMUXER_FAILED, "stream demuxer or parser failed"},
|
||||
{AVCSERR_OPEN_FILE_FAILED, "open file failed"},
|
||||
{AVCSERR_FILE_ACCESS_FAILED, "read or write file failed"},
|
||||
{AVCSERR_START_FAILED, "audio or video start failed"},
|
||||
{AVCSERR_PAUSE_FAILED, "audio or video pause failed"},
|
||||
{AVCSERR_STOP_FAILED, "audio or video stop failed"},
|
||||
{AVCSERR_SEEK_FAILED, "audio or video seek failed"},
|
||||
{AVCSERR_NETWORK_TIMEOUT, "network timeout"},
|
||||
{AVCSERR_NOT_FIND_CONTAINER, "not find a demuxer"},
|
||||
{AVCSERR_EXTEND_START, "extend start error code"},
|
||||
{AVCS_ERR_OK, "success"},
|
||||
{AVCS_ERR_NO_MEMORY, "no memory"},
|
||||
{AVCS_ERR_INVALID_OPERATION, "operation not be permitted"},
|
||||
{AVCS_ERR_INVALID_VAL, "invalid argument"},
|
||||
{AVCS_ERR_UNKNOWN, "unkown error"},
|
||||
{AVCS_ERR_SERVICE_DIED, "avcodec service died"},
|
||||
{AVCS_ERR_CREATE_AVCODEC_SUB_SERVICE_FAILED, "create avcodec sub service failed"},
|
||||
{AVCS_ERR_CREATE_MUXER_SUB_SERVICE_FAILED, "create muxer sub service failed"},
|
||||
{AVCS_ERR_CREATE_DEMUXER_SUB_SERVICE_FAILED, "create demuxer sub service failed"},
|
||||
{AVCS_ERR_INVALID_STATE, "the state is not support this operation"},
|
||||
{AVCS_ERR_UNSUPPORT, "unsupport interface"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_SRC_TYPE, "unsupport audio source type"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_SAMPLE_RATE, "unsupport audio sample rate"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_CHANNEL_NUM, "unsupport audio channel"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_ENC_TYPE, "unsupport audio encoder type"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_PARAMS, "unsupport audio params(other params)"},
|
||||
{AVCS_ERR_UNSUPPORT_VID_SRC_TYPE, "unsupport video source type"},
|
||||
{AVCS_ERR_UNSUPPORT_VID_ENC_TYPE, "unsupport video encoder type"},
|
||||
{AVCS_ERR_UNSUPPORT_VID_PARAMS, "unsupport video params(other params)"},
|
||||
{AVCS_ERR_UNSUPPORT_CONTAINER_TYPE, "unsupport container format type"},
|
||||
{AVCS_ERR_UNSUPPORT_PROTOCOL_TYPE, "unsupport protocol type"},
|
||||
{AVCS_ERR_UNSUPPORT_VID_DEC_TYPE, "unsupport video decoder type"},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_DEC_TYPE, "unsupport audio decoder type"},
|
||||
{AVCS_ERR_UNSUPPORT_STREAM, "internal data stream error"},
|
||||
{AVCS_ERR_UNSUPPORT_FILE, "this appears to be a text file"},
|
||||
{AVCS_ERR_UNSUPPORT_SOURCE, "unsupport source type"},
|
||||
{AVCS_ERR_AUD_ENC_FAILED, "audio encode failed"},
|
||||
{AVCS_ERR_AUD_RENDER_FAILED, "audio render failed"},
|
||||
{AVCS_ERR_VID_ENC_FAILED, "video encode failed"},
|
||||
{AVCS_ERR_AUD_DEC_FAILED, "audio decode failed"},
|
||||
{AVCS_ERR_VID_DEC_FAILED, "video decode failed"},
|
||||
{AVCS_ERR_MUXER_FAILED, "stream avmuxer failed"},
|
||||
{AVCS_ERR_DEMUXER_FAILED, "stream demuxer or parser failed"},
|
||||
{AVCS_ERR_OPEN_FILE_FAILED, "open file failed"},
|
||||
{AVCS_ERR_FILE_ACCESS_FAILED, "read or write file failed"},
|
||||
{AVCS_ERR_START_FAILED, "audio or video start failed"},
|
||||
{AVCS_ERR_PAUSE_FAILED, "audio or video pause failed"},
|
||||
{AVCS_ERR_STOP_FAILED, "audio or video stop failed"},
|
||||
{AVCS_ERR_SEEK_FAILED, "audio or video seek failed"},
|
||||
{AVCS_ERR_NETWORK_TIMEOUT, "network timeout"},
|
||||
{AVCS_ERR_NOT_FIND_CONTAINER, "not find a demuxer"},
|
||||
{AVCS_ERR_EXTEND_START, "extend start error code"},
|
||||
};
|
||||
|
||||
const std::map<AVCodecServiceErrCode, AVCodecServiceExtErrCode> AVCSERRCODE_TO_EXTERRORCODE = {
|
||||
{AVCSERR_OK, AVCSERR_EXT_OK},
|
||||
{AVCSERR_NO_MEMORY, AVCSERR_EXT_NO_MEMORY},
|
||||
{AVCSERR_INVALID_OPERATION, AVCSERR_EXT_OPERATE_NOT_PERMIT},
|
||||
{AVCSERR_INVALID_VAL, AVCSERR_EXT_INVALID_VAL},
|
||||
{AVCSERR_UNKNOWN, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_SERVICE_DIED, AVCSERR_EXT_SERVICE_DIED},
|
||||
{AVCSERR_CREATE_REC_ENGINE_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_CREATE_PLAYER_ENGINE_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_INVALID_STATE, AVCSERR_EXT_INVALID_STATE},
|
||||
{AVCSERR_UNSUPPORT, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_SRC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_SAMPLE_RATE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_CHANNEL_NUM, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_ENC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_PARAMS, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_VID_SRC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_VID_ENC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_VID_PARAMS, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_CONTAINER_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_PROTOCOL_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_VID_DEC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_AUD_DEC_TYPE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_STREAM, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_FILE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_UNSUPPORT_SOURCE, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_AUD_RENDER_FAILED, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_AUD_ENC_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_VID_ENC_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_AUD_DEC_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_VID_DEC_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_MUXER_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_DEMUXER_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_OPEN_FILE_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_FILE_ACCESS_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_START_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_PAUSE_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_STOP_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_SEEK_FAILED, AVCSERR_EXT_UNKNOWN},
|
||||
{AVCSERR_NETWORK_TIMEOUT, AVCSERR_EXT_TIMEOUT},
|
||||
{AVCSERR_NOT_FIND_CONTAINER, AVCSERR_EXT_UNSUPPORT},
|
||||
{AVCSERR_EXTEND_START, AVCSERR_EXT_EXTEND_START},
|
||||
const std::map<AVCodecServiceErrCode, OH_AVErrCode> AVCSERRCODE_TO_OHAVCODECERRCODE = {
|
||||
{AVCS_ERR_OK, AVCODEC_ERR_OK},
|
||||
{AVCS_ERR_NO_MEMORY, AVCODEC_ERR_NO_MEMORY},
|
||||
{AVCS_ERR_INVALID_OPERATION, AVCODEC_ERR_OPERATE_NOT_PERMIT},
|
||||
{AVCS_ERR_INVALID_VAL, AVCODEC_ERR_INVALID_VAL},
|
||||
{AVCS_ERR_UNKNOWN, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_SERVICE_DIED, AVCODEC_ERR_SERVICE_DIED},
|
||||
{AVCS_ERR_CREATE_AVCODEC_SUB_SERVICE_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_CREATE_MUXER_SUB_SERVICE_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_CREATE_DEMUXER_SUB_SERVICE_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_INVALID_STATE, AVCODEC_ERR_INVALID_STATE},
|
||||
{AVCS_ERR_UNSUPPORT, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_SRC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_SAMPLE_RATE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_CHANNEL_NUM, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_ENC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_PARAMS, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_VID_SRC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_VID_ENC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_VID_PARAMS, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_CONTAINER_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_PROTOCOL_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_VID_DEC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_AUD_DEC_TYPE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_STREAM, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_FILE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_UNSUPPORT_SOURCE, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_AUD_RENDER_FAILED, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_AUD_ENC_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_VID_ENC_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_AUD_DEC_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_VID_DEC_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_MUXER_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_DEMUXER_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_OPEN_FILE_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_FILE_ACCESS_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_START_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_PAUSE_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_STOP_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_SEEK_FAILED, AVCODEC_ERR_UNKNOWN},
|
||||
{AVCS_ERR_NETWORK_TIMEOUT, AVCODEC_ERR_TIMEOUT},
|
||||
{AVCS_ERR_NOT_FIND_CONTAINER, AVCODEC_ERR_UNSUPPORT},
|
||||
{AVCS_ERR_EXTEND_START, AVCODEC_ERR_EXTEND_START},
|
||||
};
|
||||
|
||||
const std::map<AVCodecServiceExtErrCode, std::string> AVCSEXTERRCODE_INFOS = {
|
||||
{AVCSERR_EXT_OK, "success"},
|
||||
{AVCSERR_EXT_NO_MEMORY, "no memory"},
|
||||
{AVCSERR_EXT_OPERATE_NOT_PERMIT, "operation not be permitted"},
|
||||
{AVCSERR_EXT_INVALID_VAL, "invalid argument"},
|
||||
{AVCSERR_EXT_IO, "IO error"},
|
||||
{AVCSERR_EXT_TIMEOUT, "network timeout"},
|
||||
{AVCSERR_EXT_UNKNOWN, "unkown error"},
|
||||
{AVCSERR_EXT_SERVICE_DIED, "avcodec service died"},
|
||||
{AVCSERR_EXT_INVALID_STATE, "the state is not support this operation"},
|
||||
{AVCSERR_EXT_UNSUPPORT, "unsupport interface"},
|
||||
{AVCSERR_EXT_EXTEND_START, "extend err start"},
|
||||
const std::map<OH_AVErrCode, std::string> OHAVCODECERRCODE_INFOS = {
|
||||
{AVCODEC_ERR_OK, "success"},
|
||||
{AVCODEC_ERR_NO_MEMORY, "no memory"},
|
||||
{AVCODEC_ERR_OPERATE_NOT_PERMIT, "operation not be permitted"},
|
||||
{AVCODEC_ERR_INVALID_VAL, "invalid argument"},
|
||||
{AVCODEC_ERR_IO, "IO error"},
|
||||
{AVCODEC_ERR_TIMEOUT, "network timeout"},
|
||||
{AVCODEC_ERR_UNKNOWN, "unkown error"},
|
||||
{AVCODEC_ERR_SERVICE_DIED, "avcodec service died"},
|
||||
{AVCODEC_ERR_INVALID_STATE, "the state is not support this operation"},
|
||||
{AVCODEC_ERR_UNSUPPORT, "unsupport interface"},
|
||||
{AVCODEC_ERR_EXTEND_START, "extend err start"},
|
||||
};
|
||||
|
||||
std::string ErrorMessageOk(const std::string& param1, const std::string& param2)
|
||||
@ -198,45 +200,45 @@ std::string AVCSErrorToString(AVCodecServiceErrCode code)
|
||||
return AVCS_ERRCODE_INFOS.at(code);
|
||||
}
|
||||
|
||||
if (code > AVCSERR_EXTEND_START) {
|
||||
return "extend error:" + std::to_string(static_cast<int32_t>(code - AVCSERR_EXTEND_START));
|
||||
if (code > AVCODEC_ERR_EXTEND_START) {
|
||||
return "extend error:" + std::to_string(static_cast<int32_t>(code - AVCODEC_ERR_EXTEND_START));
|
||||
}
|
||||
|
||||
return "invalid error code:" + std::to_string(static_cast<int32_t>(code));
|
||||
}
|
||||
|
||||
std::string AVCSExtErrorToString(AVCodecServiceExtErrCode code)
|
||||
std::string OHAVErrCodeToString(OH_AVErrCode code)
|
||||
{
|
||||
if (AVCSEXTERRCODE_INFOS.count(code) != 0) {
|
||||
return AVCSEXTERRCODE_INFOS.at(code);
|
||||
if (OHAVCODECERRCODE_INFOS.count(code) != 0) {
|
||||
return OHAVCODECERRCODE_INFOS.at(code);
|
||||
}
|
||||
|
||||
if (code > AVCSERR_EXT_EXTEND_START) {
|
||||
return "extend error:" + std::to_string(static_cast<int32_t>(code - AVCSERR_EXTEND_START));
|
||||
if (code > AVCODEC_ERR_EXTEND_START) {
|
||||
return "extend error:" + std::to_string(static_cast<int32_t>(code - AVCODEC_ERR_EXTEND_START));
|
||||
}
|
||||
|
||||
return "invalid error code:" + std::to_string(static_cast<int32_t>(code));
|
||||
}
|
||||
|
||||
std::string AVCSErrorToExtErrorString(AVCodecServiceErrCode code)
|
||||
std::string AVCSErrorToOHAVErrCodeString(AVCodecServiceErrCode code)
|
||||
{
|
||||
if (AVCS_ERRCODE_INFOS.count(code) != 0 && AVCSERRCODE_TO_EXTERRORCODE.count(code) != 0) {
|
||||
AVCodecServiceExtErrCode extCode = AVCSERRCODE_TO_EXTERRORCODE.at(code);
|
||||
if (AVCSEXTERRCODE_INFOS.count(extCode) != 0) {
|
||||
return AVCSEXTERRCODE_INFOS.at(extCode);
|
||||
if (AVCS_ERRCODE_INFOS.count(code) != 0 && AVCSERRCODE_TO_OHAVCODECERRCODE.count(code) != 0) {
|
||||
OH_AVErrCode extCode = AVCSERRCODE_TO_OHAVCODECERRCODE.at(code);
|
||||
if (OHAVCODECERRCODE_INFOS.count(extCode) != 0) {
|
||||
return OHAVCODECERRCODE_INFOS.at(extCode);
|
||||
}
|
||||
}
|
||||
|
||||
return "unkown error";
|
||||
}
|
||||
|
||||
AVCodecServiceExtErrCode AVCSErrorToExtError(AVCodecServiceErrCode code)
|
||||
OH_AVErrCode AVCSErrorToOHAVErrCode(AVCodecServiceErrCode code)
|
||||
{
|
||||
if (AVCS_ERRCODE_INFOS.count(code) != 0 && AVCSERRCODE_TO_EXTERRORCODE.count(code) != 0) {
|
||||
return AVCSERRCODE_TO_EXTERRORCODE.at(code);
|
||||
if (AVCS_ERRCODE_INFOS.count(code) != 0 && AVCSERRCODE_TO_OHAVCODECERRCODE.count(code) != 0) {
|
||||
return AVCSERRCODE_TO_OHAVCODECERRCODE.at(code);
|
||||
}
|
||||
|
||||
return AVCSERR_EXT_UNKNOWN;
|
||||
return AVCODEC_ERR_UNKNOWN;
|
||||
}
|
||||
|
||||
} // namespace AVCodec
|
||||
|
@ -1,15 +1,15 @@
|
||||
# Copyright (c) 2022 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.
|
||||
# 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.
|
||||
|
||||
domain: AVCODEC
|
||||
|
||||
@ -26,4 +26,4 @@ AVCODEC_STATE:
|
||||
PID: {type: INT32, desc: The pid of the AVCODEC_STATE event}
|
||||
UID: {type: INT32, desc: The uid of the AVCODEC_STATE event}
|
||||
MODULE: {type: STRING, desc: module name}
|
||||
STATE: {type: STRING, desc: current state}
|
||||
STATE: {type: STRING, desc: current state}
|
||||
|
@ -76,25 +76,10 @@ typedef enum AVCodecServiceErrCode : ErrCode {
|
||||
AVCS_ERR_EXTEND_START = AVCS_ERR_OFFSET + 0xF000, // extend err start.
|
||||
} AVCodecServiceErrCode;
|
||||
|
||||
// avcodec api error code
|
||||
typedef enum AVCodecServiceExtErrCode : ErrCode {
|
||||
AVCS_ERR_EXT_OK = 0,
|
||||
AVCS_ERR_EXT_NO_MEMORY = 1, // no memory.
|
||||
AVCS_ERR_EXT_OPERATE_NOT_PERMIT = 2, // opertation not be permitted.
|
||||
AVCS_ERR_EXT_INVALID_VAL = 3, // invalid argument.
|
||||
AVCS_ERR_EXT_IO = 4, // IO error.
|
||||
AVCS_ERR_EXT_TIMEOUT = 5, // network timeout.
|
||||
AVCS_ERR_EXT_UNKNOWN = 6, // unknown error.
|
||||
AVCS_ERR_EXT_SERVICE_DIED = 7, // avcodec service died.
|
||||
AVCS_ERR_EXT_INVALID_STATE = 8, // the state is not support this operation.
|
||||
AVCS_ERR_EXT_UNSUPPORT = 9, // unsupport interface.
|
||||
AVCS_ERR_EXT_EXTEND_START = 100, // extend err start.
|
||||
} AVCodecServiceExtErrCode;
|
||||
|
||||
__attribute__((visibility("default"))) std::string AVCSErrorToString(AVCodecServiceErrCode code);
|
||||
__attribute__((visibility("default"))) std::string AVCSExtErrorToString(AVCodecServiceExtErrCode code);
|
||||
__attribute__((visibility("default"))) std::string AVCSErrorToExtErrorString(AVCodecServiceErrCode code);
|
||||
__attribute__((visibility("default"))) AVCodecServiceExtErrCode AVCSErrorToExtError(AVCodecServiceErrCode code);
|
||||
__attribute__((visibility("default"))) std::string OHAVErrCodeToString(OH_AVErrCode code);
|
||||
__attribute__((visibility("default"))) std::string AVCSErrorToOHAVErrCodeString(AVCodecServiceErrCode code);
|
||||
__attribute__((visibility("default"))) OH_AVErrCode AVCSErrorToOHAVErrCode(AVCodecServiceErrCode code);
|
||||
|
||||
} // namespace AVCodec
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user