mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-12-26 11:17:44 +01:00
refactor[mpp]: Refactor C++ mpp to C
Change-Id: Icfe26b36d066b32355bda919e605e165399c0781 Signed-off-by: Yanjun Liao <yanjun.liao@rock-chips.com>
This commit is contained in:
parent
9a079f8c6f
commit
60dfbcaace
18 changed files with 1723 additions and 1695 deletions
|
|
@ -40,10 +40,10 @@ add_subdirectory(hal)
|
|||
# add mpp implement
|
||||
# ----------------------------------------------------------------------------
|
||||
set (MPP_SRC
|
||||
mpp_info.cpp
|
||||
mpp.cpp
|
||||
mpp_impl.cpp
|
||||
mpi.cpp
|
||||
mpp_info.c
|
||||
mpp.c
|
||||
mpp_impl.c
|
||||
mpi.c
|
||||
)
|
||||
|
||||
set(MPP_VERSION "0")
|
||||
|
|
@ -63,7 +63,7 @@ endif()
|
|||
set_target_properties(${MPP_SHARED} PROPERTIES FOLDER "mpp")
|
||||
set_target_properties(${MPP_SHARED} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
target_link_libraries(${MPP_SHARED} mpp_codec mpp_hal mpp_vproc kmpp
|
||||
${BEGIN_WHOLE_ARCHIVE} mpp_base kmpp_base osal ${END_WHOLE_ARCHIVE})
|
||||
${BEGIN_WHOLE_ARCHIVE} mpp_base kmpp_base osal ${END_WHOLE_ARCHIVE} m)
|
||||
|
||||
# build static library
|
||||
add_library(${MPP_STATIC} STATIC ${MPP_SRC})
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
# add mpp_dec implement
|
||||
# ----------------------------------------------------------------------------
|
||||
add_library(mpp_codec OBJECT
|
||||
mpp_enc_impl.cpp
|
||||
mpp_enc_v2.cpp
|
||||
enc_impl.cpp
|
||||
mpp_dec_no_thread.cpp
|
||||
mpp_dec_normal.cpp
|
||||
mpp_dec.cpp
|
||||
mpp_enc_impl.c
|
||||
mpp_enc_v2.c
|
||||
enc_impl.c
|
||||
mpp_dec_no_thread.c
|
||||
mpp_dec_normal.c
|
||||
mpp_dec.c
|
||||
mpp_parser.c
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2010 Rockchip Electronics S.LSI 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) 2010 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "enc_impl"
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_dec"
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2022 Rockchip Electronics 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) 2022 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_dec_nt"
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_dec"
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_enc"
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_enc"
|
||||
116
mpp/inc/mpp.h
116
mpp/inc/mpp.h
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#ifndef __MPP_H__
|
||||
|
|
@ -26,6 +15,10 @@
|
|||
#include "kmpp_obj.h"
|
||||
#include "kmpp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MPP_DBG_FUNCTION (0x00000001)
|
||||
#define MPP_DBG_PACKET (0x00000002)
|
||||
#define MPP_DBG_FRAME (0x00000004)
|
||||
|
|
@ -101,40 +94,8 @@ typedef enum MppIOMode_e {
|
|||
* +--------------+ +-----------+ +-----------+ +--------------+
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class Mpp
|
||||
{
|
||||
public:
|
||||
Mpp(MppCtx ctx = NULL);
|
||||
~Mpp();
|
||||
MPP_RET init(MppCtxType type, MppCodingType coding);
|
||||
|
||||
MPP_RET start();
|
||||
MPP_RET stop();
|
||||
|
||||
MPP_RET pause();
|
||||
MPP_RET resume();
|
||||
|
||||
MPP_RET put_packet(MppPacket packet);
|
||||
MPP_RET get_frame(MppFrame *frame);
|
||||
MPP_RET get_frame_noblock(MppFrame *frame);
|
||||
|
||||
MPP_RET put_frame(MppFrame frame);
|
||||
MPP_RET get_packet(MppPacket *packet);
|
||||
|
||||
MPP_RET poll(MppPortType type, MppPollType timeout);
|
||||
MPP_RET dequeue(MppPortType type, MppTask *task);
|
||||
MPP_RET enqueue(MppPortType type, MppTask task);
|
||||
|
||||
MPP_RET decode(MppPacket packet, MppFrame *frame);
|
||||
|
||||
MPP_RET reset();
|
||||
MPP_RET control(MpiCmd cmd, MppParam param);
|
||||
|
||||
MPP_RET notify(RK_U32 flag);
|
||||
MPP_RET notify(MppBufferGroup group);
|
||||
|
||||
typedef struct Mpp {
|
||||
/* Public members that were previously public in C++ class */
|
||||
MppList *mPktIn;
|
||||
MppList *mPktOut;
|
||||
MppList *mFrmIn;
|
||||
|
|
@ -204,8 +165,6 @@ public:
|
|||
/* kmpp infos */
|
||||
Kmpp *mKmpp;
|
||||
KmppObj mVencInitKcfg;
|
||||
private:
|
||||
void clear();
|
||||
|
||||
MppCtxType mType;
|
||||
MppCodingType mCoding;
|
||||
|
|
@ -222,26 +181,57 @@ private:
|
|||
RK_U32 mImmediateOut;
|
||||
/* backup extra packet for seek */
|
||||
MppPacket mExtraPacket;
|
||||
} Mpp;
|
||||
|
||||
MPP_RET control_mpp(MpiCmd cmd, MppParam param);
|
||||
MPP_RET control_osal(MpiCmd cmd, MppParam param);
|
||||
MPP_RET control_codec(MpiCmd cmd, MppParam param);
|
||||
MPP_RET control_dec(MpiCmd cmd, MppParam param);
|
||||
MPP_RET control_enc(MpiCmd cmd, MppParam param);
|
||||
MPP_RET control_isp(MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_ctx_create(Mpp **mpp, MppCtx ctx);
|
||||
MPP_RET mpp_ctx_destroy(Mpp *mpp);
|
||||
MPP_RET mpp_ctx_init(Mpp *mpp, MppCtxType type, MppCodingType coding);
|
||||
void mpp_clear(Mpp *mpp);
|
||||
|
||||
/* for special encoder async io mode */
|
||||
MPP_RET put_frame_async(MppFrame frame);
|
||||
MPP_RET get_packet_async(MppPacket *packet);
|
||||
/* Control functions */
|
||||
MPP_RET mpp_start(Mpp *mpp);
|
||||
MPP_RET mpp_stop(Mpp *mpp);
|
||||
MPP_RET mpp_pause(Mpp *mpp);
|
||||
MPP_RET mpp_resume(Mpp *mpp);
|
||||
|
||||
void set_io_mode(MppIoMode mode);
|
||||
/* Data processing functions */
|
||||
MPP_RET mpp_put_packet(Mpp *mpp, MppPacket packet);
|
||||
MPP_RET mpp_get_frame(Mpp *mpp, MppFrame *frame);
|
||||
MPP_RET mpp_get_frame_noblock(Mpp *mpp, MppFrame *frame);
|
||||
|
||||
Mpp(const Mpp &);
|
||||
Mpp &operator=(const Mpp &);
|
||||
};
|
||||
MPP_RET mpp_put_frame(Mpp *mpp, MppFrame frame);
|
||||
MPP_RET mpp_get_packet(Mpp *mpp, MppPacket *packet);
|
||||
|
||||
/* Task queue functions */
|
||||
MPP_RET mpp_poll(Mpp *mpp, MppPortType type, MppPollType timeout);
|
||||
MPP_RET mpp_dequeue(Mpp *mpp, MppPortType type, MppTask *task);
|
||||
MPP_RET mpp_enqueue(Mpp *mpp, MppPortType type, MppTask task);
|
||||
|
||||
extern "C" {
|
||||
/* Decode function */
|
||||
MPP_RET mpp_decode(Mpp *mpp, MppPacket packet, MppFrame *frame);
|
||||
|
||||
/* System functions */
|
||||
MPP_RET mpp_reset(Mpp *mpp);
|
||||
MPP_RET mpp_control(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
|
||||
/* Notification functions */
|
||||
MPP_RET mpp_notify_flag(Mpp *mpp, RK_U32 flag);
|
||||
MPP_RET mpp_notify_group(Mpp *mpp, MppBufferGroup group);
|
||||
|
||||
MPP_RET mpp_control_mpp(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_control_osal(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_control_codec(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_control_dec(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_control_enc(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
MPP_RET mpp_control_isp(Mpp *mpp, MpiCmd cmd, MppParam param);
|
||||
|
||||
/* for special encoder async io mode */
|
||||
MPP_RET mpp_put_frame_async(Mpp *mpp, MppFrame frame);
|
||||
MPP_RET mpp_get_packet_async(Mpp *mpp, MppPacket *packet);
|
||||
|
||||
void mpp_set_io_mode(Mpp *mpp, MppIoMode mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ set (MPP_LEGACY_SRC
|
|||
vpu_mem_legacy.c
|
||||
rk_list.cpp
|
||||
ppOp.cpp
|
||||
../mpp_info.cpp
|
||||
../mpp_info.c
|
||||
)
|
||||
|
||||
set(VPU_VERSION "0")
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpi"
|
||||
|
|
@ -117,7 +106,7 @@ static MPP_RET mpi_decode(MppCtx ctx, MppPacket packet, MppFrame *frame)
|
|||
if (frame)
|
||||
*frame = NULL;
|
||||
|
||||
ret = p->ctx->decode(packet, frame);
|
||||
ret = mpp_decode(p->ctx, packet, frame);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -141,7 +130,7 @@ static MPP_RET mpi_decode_put_packet(MppCtx ctx, MppPacket packet)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->put_packet(packet);
|
||||
ret = mpp_put_packet(p->ctx, packet);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -165,7 +154,7 @@ static MPP_RET mpi_decode_get_frame(MppCtx ctx, MppFrame *frame)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->get_frame(frame);
|
||||
ret = mpp_get_frame(p->ctx, frame);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -213,7 +202,7 @@ static MPP_RET mpi_encode_put_frame(MppCtx ctx, MppFrame frame)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->put_frame(frame);
|
||||
ret = mpp_put_frame(p->ctx, frame);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -237,7 +226,7 @@ static MPP_RET mpi_encode_get_packet(MppCtx ctx, MppPacket *packet)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->get_packet(packet);
|
||||
ret = mpp_get_packet(p->ctx, packet);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -296,7 +285,7 @@ static MPP_RET mpi_poll(MppCtx ctx, MppPortType type, MppPollType timeout)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->poll(type, timeout);
|
||||
ret = mpp_poll(p->ctx, type, timeout);
|
||||
if (ret > 0)
|
||||
ret = MPP_OK;
|
||||
} while (0);
|
||||
|
|
@ -322,7 +311,7 @@ static MPP_RET mpi_dequeue(MppCtx ctx, MppPortType type, MppTask *task)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->dequeue(type, task);
|
||||
ret = mpp_dequeue(p->ctx, type, task);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -346,7 +335,7 @@ static MPP_RET mpi_enqueue(MppCtx ctx, MppPortType type, MppTask task)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->enqueue(type, task);
|
||||
ret = mpp_enqueue(p->ctx, type, task);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -364,7 +353,7 @@ static MPP_RET mpi_reset(MppCtx ctx)
|
|||
if (ret)
|
||||
break;;
|
||||
|
||||
ret = p->ctx->reset();
|
||||
ret = mpp_reset(p->ctx);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -382,7 +371,7 @@ static MPP_RET mpi_control(MppCtx ctx, MpiCmd cmd, MppParam param)
|
|||
if (ret)
|
||||
break;;
|
||||
|
||||
ret = p->ctx->control(cmd, param);
|
||||
ret = mpp_control(p->ctx, cmd, param);
|
||||
} while (0);
|
||||
|
||||
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||
|
|
@ -433,10 +422,10 @@ MPP_RET mpp_create(MppCtx *ctx, MppApi **mpi)
|
|||
}
|
||||
|
||||
memset(p, 0, sizeof(*p));
|
||||
p->ctx = new Mpp(p);
|
||||
if (NULL == p->ctx) {
|
||||
ret = mpp_ctx_create(&p->ctx, p);
|
||||
if (ret || NULL == p->ctx) {
|
||||
mpp_free(p);
|
||||
mpp_err_f("failed to new Mpp\n");
|
||||
mpp_err_f("failed to create Mpp context ret %d\n", ret);
|
||||
ret = MPP_ERR_MALLOC;
|
||||
break;
|
||||
}
|
||||
|
|
@ -472,7 +461,7 @@ MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding)
|
|||
break;
|
||||
}
|
||||
|
||||
ret = p->ctx->init(type, coding);
|
||||
ret = mpp_ctx_init(p->ctx, type, coding);
|
||||
p->type = type;
|
||||
p->coding = coding;
|
||||
} while (0);
|
||||
|
|
@ -494,7 +483,7 @@ MPP_RET mpp_destroy(MppCtx ctx)
|
|||
return ret;
|
||||
|
||||
if (p->ctx)
|
||||
delete p->ctx;
|
||||
mpp_ctx_destroy(p->ctx);
|
||||
|
||||
mpp_free(p);
|
||||
} while (0);
|
||||
|
|
@ -519,7 +508,7 @@ MPP_RET mpp_check_support_format(MppCtxType type, MppCodingType coding)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void mpp_show_support_format()
|
||||
void mpp_show_support_format(void)
|
||||
{
|
||||
RK_U32 i = 0;
|
||||
|
||||
|
|
@ -566,7 +555,7 @@ static MppFrameFormatInfo color_list[] = {
|
|||
{ MPP_FMT_RGBA8888, "RGBA8888" },
|
||||
};
|
||||
|
||||
void mpp_show_color_format()
|
||||
void mpp_show_color_format(void)
|
||||
{
|
||||
RK_U32 i = 0;
|
||||
|
||||
1439
mpp/mpp.cpp
1439
mpp/mpp.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -1,18 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_impl"
|
||||
|
|
@ -69,35 +57,36 @@ typedef struct MppDumpImpl_t {
|
|||
RK_U32 idx;
|
||||
} MppDumpImpl;
|
||||
|
||||
typedef union OpsArgs_u {
|
||||
struct MppOpsInitArg_t {
|
||||
MppCtxType type;
|
||||
MppCodingType coding;
|
||||
} init_arg;
|
||||
|
||||
struct MppOpsPktArg_t {
|
||||
RK_U32 offset; // offset in packet file
|
||||
RK_U32 length; // pakcet length
|
||||
RK_S64 pts;
|
||||
} pkt_arg;
|
||||
|
||||
struct MppOpsFrmArg_t {
|
||||
RK_U32 fd;
|
||||
RK_U32 info_change;
|
||||
RK_U32 error;
|
||||
RK_U32 discard;
|
||||
RK_S64 pts;
|
||||
} frm_arg;
|
||||
|
||||
struct MppOpCtrlArg_t {
|
||||
MpiCmd cmd;
|
||||
} ctrl_arg;
|
||||
} OpsArgs;
|
||||
|
||||
typedef struct MppOpsInfo_t {
|
||||
RK_U32 idx;
|
||||
RK_U32 id;
|
||||
RK_S64 time;
|
||||
|
||||
union OpsArgs_u {
|
||||
struct MppOpsInitArg_t {
|
||||
MppCtxType type;
|
||||
MppCodingType coding;
|
||||
};
|
||||
|
||||
struct MppOpsPktArg_t {
|
||||
RK_U32 offset; // offset in packet file
|
||||
RK_U32 length; // pakcet length
|
||||
RK_S64 pts;
|
||||
};
|
||||
|
||||
struct MppOpsFrmArg_t {
|
||||
RK_U32 fd;
|
||||
RK_U32 info_change;
|
||||
RK_U32 error;
|
||||
RK_U32 discard;
|
||||
RK_S64 pts;
|
||||
};
|
||||
|
||||
struct MppOpCtrlArg_t {
|
||||
MpiCmd cmd;
|
||||
};
|
||||
};
|
||||
RK_U32 idx;
|
||||
RK_U32 id;
|
||||
RK_S64 time;
|
||||
OpsArgs args;
|
||||
} MppOpsInfo;
|
||||
|
||||
/*
|
||||
|
|
@ -147,7 +136,7 @@ static RK_U8 fetch_data(RK_U32 fmt, RK_U8 *line, RK_U32 num)
|
|||
value = line[num];
|
||||
}
|
||||
|
||||
return RK_U8(value);
|
||||
return (RK_U8)value;
|
||||
}
|
||||
|
||||
static void rearrange_pix(RK_U8 *tmp_line, RK_U8 *base, RK_U32 n)
|
||||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics 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) 2015 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_info"
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
# add mpp video process implement
|
||||
# ----------------------------------------------------------------------------
|
||||
add_library(mpp_vproc STATIC mpp_dec_vproc.cpp mpp_vproc_dev.c)
|
||||
add_library(mpp_vproc STATIC mpp_dec_vproc.c mpp_vproc_dev.c)
|
||||
target_link_libraries(mpp_vproc vproc_rga vproc_iep vproc_iep2 ${VPROC_VDPP} mpp_base)
|
||||
|
||||
add_subdirectory(rga)
|
||||
|
|
|
|||
|
|
@ -1,17 +1,6 @@
|
|||
/* SPDX-License-Identifier: Apache-2.0 OR MIT */
|
||||
/*
|
||||
* Copyright 2020 Rockchip Electronics 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) 2020 Rockchip Electronics Co., Ltd.
|
||||
*/
|
||||
|
||||
#define MODULE_TAG "mpp_dec_vproc"
|
||||
|
|
@ -90,7 +79,7 @@ typedef struct MppDecVprocCtxImpl_t {
|
|||
IepCtx iep_ctx;
|
||||
iep_com_ctx *com_ctx;
|
||||
IepCmdParamDeiCfg dei_cfg;
|
||||
iep2_api_info dei_info;
|
||||
struct iep2_api_info dei_info;
|
||||
|
||||
VprocTaskStatus task_status;
|
||||
VprocTaskWait task_wait;
|
||||
|
|
@ -278,7 +267,7 @@ static MPP_RET dec_vproc_set_dei_v1(MppDecVprocCtx *vproc_ctx, MppFrame frm)
|
|||
if (ret)
|
||||
mpp_log_f("IEP_CMD_INIT failed %d\n", ret);
|
||||
|
||||
IepCap_t *cap = NULL;
|
||||
struct IepCap_t *cap = NULL;
|
||||
ret = ctx->com_ctx->ops->control(ctx->iep_ctx, IEP_CMD_QUERY_CAP, &cap);
|
||||
if (ret)
|
||||
mpp_log_f("IEP_CMD_QUERY_CAP failed %d\n", ret);
|
||||
|
|
@ -12,7 +12,7 @@ set_target_properties(vproc_vdpp PROPERTIES FOLDER "mpp/vproc/vdpp")
|
|||
add_subdirectory(test)
|
||||
|
||||
# libvdpp.so for hwpq
|
||||
add_library(vdpp SHARED hwpq_vdpp_proc.c ../../mpp_info.cpp)
|
||||
add_library(vdpp SHARED hwpq_vdpp_proc.c ../../mpp_info.c)
|
||||
set_target_properties(vdpp PROPERTIES FOLDER "mpp/vproc/vdpp")
|
||||
set_target_properties(vdpp PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
target_link_libraries(vdpp osal mpp_base kmpp_base vproc_vdpp m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue