From 688022efce18fe9964cd2b7ad9a3ca76b2905056 Mon Sep 17 00:00:00 2001 From: Tryanks Date: Thu, 4 Jan 2024 13:10:52 +0800 Subject: [PATCH] init commit --- CHANGELOG.md | 0 LICENSE | 21 +++++++++++++++++++++ README.md | 3 +++ go.mod | 3 +++ mpi.go | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 go.mod create mode 100644 mpi.go diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4b44b91 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Tryanks + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..38ead6c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Go rkcodec + +TODO... \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..35311fb --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module rkcodec + +go 1.21 diff --git a/mpi.go b/mpi.go new file mode 100644 index 0000000..bfbab93 --- /dev/null +++ b/mpi.go @@ -0,0 +1,46 @@ +package rkcodec + +//#cgo pkg-config: rockchip_mpp +//##include +import "C" + +type MppFrame struct { + c *C.struct_MppFrame +} + +type MppCtx struct { + c *C.struct_MppCtx +} + +type MppApi struct { + c *C.struct_MppApi +} + +type MpiCmd C.enum_MpiCmd + +const ( + MpiCmdBase = MpiCmd(C.MPI_CMD_BASE) + MpiDecSetParserSplitMode = MpiCmd(C.MPI_DEC_SET_PARSER_SPLIT_MODE) + MppDecSetImmediateOut = MpiCmd(C.MPP_DEC_SET_IMMEDIATE_OUT) + MppSetInputBlock = MpiCmd(C.MPP_SET_INPUT_BLOCK) + MppSetInputTimeout = MpiCmd(C.MPP_SET_INPUT_TIMEOUT) + MppSetOutputBlock = MpiCmd(C.MPP_SET_OUTPUT_BLOCK) + MppSetOutputTimeout = MpiCmd(C.MPP_SET_OUTPUT_TIMEOUT) +) + +type MppCtxType C.enum_MppCtxType + +const ( + MppCtxTypeDecoder = MppCtxType(C.MPP_CTX_DEC) + MppCtxTypeEncoder = MppCtxType(C.MPP_CTX_ENC) +) + +type MppCodingType C.enum_MppCodingType + +const ( + MppCodingTypeAVC = MppCodingType(C.MPP_VIDEO_CodingAVC) + MppCodingTypeHEVC = MppCodingType(C.MPP_VIDEO_CodingHEVC) + MppCodingTypeVP8 = MppCodingType(C.MPP_VIDEO_CodingVP8) + MppCodingTypeVP9 = MppCodingType(C.MPP_VIDEO_CodingVP9) + MppCodingTypeMJPEG = MppCodingType(C.MPP_VIDEO_CodingMJPEG) +)