From ce44337fe9cc35dc70dd27cc723664d9f13c01f7 Mon Sep 17 00:00:00 2001 From: zhangguorong Date: Tue, 23 Aug 2022 15:20:31 +0800 Subject: [PATCH] fix: correct codec code check Signed-off-by: zhangguorong --- codec/hdi_service/codec_proxy/codec_proxy.c | 14 +++++++++----- codec/hdi_service/codec_service_stub/codec_stub.c | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/codec/hdi_service/codec_proxy/codec_proxy.c b/codec/hdi_service/codec_proxy/codec_proxy.c index 41974863d6..9a0174eca9 100644 --- a/codec/hdi_service/codec_proxy/codec_proxy.c +++ b/codec/hdi_service/codec_proxy/codec_proxy.c @@ -216,12 +216,14 @@ static int32_t CodecProxyCreate(struct ICodec *self, const char* name, CODEC_HAN } int32_t ret = CodecProxyCall(self, CMD_CODEC_CREATE, data, reply); if (ret != HDF_SUCCESS) { - HDF_LOGE("%{public}s: call failed! error code is %{public}d", __func__, ret); + HDF_LOGE("%{public}s: call create failed! error code is %{public}d", __func__, ret); CodecProxySBufRecycle(data, reply); return ret; } if (!HdfSbufReadUint64(reply, (uint64_t *)handle)) { - ret = HDF_ERR_INVALID_PARAM; + HDF_LOGE("%{public}s: read handle failed!", __func__); + CodecProxySBufRecycle(data, reply); + return HDF_ERR_INVALID_PARAM; } CodecProxySBufRecycle(data, reply); return ret; @@ -257,12 +259,14 @@ static int32_t CodecCreateByType(struct ICodec *self, CodecType type, AvCodecMim } ret = CodecProxyCall(self, CMD_CODEC_CREATE_BY_TYPE, data, reply); if (ret != HDF_SUCCESS) { - HDF_LOGE("%{public}s: call failed! error code is %{public}d", __func__, ret); + HDF_LOGE("%{public}s: call CreateByType failed! error code is %{public}d", __func__, ret); CodecProxySBufRecycle(data, reply); return ret; } if (!HdfSbufReadUint64(reply, (uint64_t *)handle)) { - ret = HDF_ERR_INVALID_PARAM; + HDF_LOGE("%{public}s: failed to read handle!", __func__); + CodecProxySBufRecycle(data, reply); + return HDF_ERR_INVALID_PARAM; } CodecProxySBufRecycle(data, reply); return ret; @@ -676,7 +680,7 @@ static int32_t CodecProxyDequeueInputParseReply(struct HdfSBuf *reply, int32_t * return HDF_SUCCESS; } -int32_t CodecProxyDequeueInput(struct ICodec *self, CODEC_HANDLETYPE handle, +static int32_t CodecProxyDequeueInput(struct ICodec *self, CODEC_HANDLETYPE handle, uint32_t timeoutMs, int32_t *acquireFd, CodecBuffer *inputData) { struct HdfSBuf *data = NULL; diff --git a/codec/hdi_service/codec_service_stub/codec_stub.c b/codec/hdi_service/codec_service_stub/codec_stub.c index 16ab4f272a..3293f4c8a3 100644 --- a/codec/hdi_service/codec_service_stub/codec_stub.c +++ b/codec/hdi_service/codec_service_stub/codec_stub.c @@ -138,6 +138,7 @@ static int32_t SerCodecCreate(struct HdfDeviceIoClient *client, struct HdfSBuf * static int32_t SerCodecCreateByType(struct HdfDeviceIoClient *client, struct HdfSBuf *data, struct HdfSBuf *reply) { + (void)client; int32_t errNum; CodecType type; AvCodecMime mime; @@ -381,6 +382,8 @@ static int32_t SerCodecStop(struct HdfDeviceIoClient *client, struct HdfSBuf *da static int32_t SerCodecReset(struct HdfDeviceIoClient *client, struct HdfSBuf *data, struct HdfSBuf *reply) { + (void)client; + (void)reply; uint64_t handle = 0; if (!HdfSbufReadUint64(data, &handle)) { HDF_LOGE("%{public}s: read handle data failed!", __func__); @@ -667,7 +670,7 @@ static int32_t HandleRequestCmdExt(struct HdfDeviceIoClient *client, int cmdId, } } -int32_t HandleRequestCmd(struct HdfDeviceIoClient *client, int cmdId, +static int32_t HandleRequestCmd(struct HdfDeviceIoClient *client, int cmdId, struct HdfSBuf *data, struct HdfSBuf *reply) { switch (cmdId) { -- Gitee