修改muxer静态检查规范

Signed-off-by: cailei <cailei24@huawei.com>
This commit is contained in:
cailei 2023-05-09 16:01:27 +08:00
parent 758a8e69d2
commit 0ebe7f92c2
30 changed files with 749 additions and 932 deletions

View File

@ -1,216 +0,0 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: NextLine
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

73
OAT.xml Normal file
View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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.
Notes:
This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun.
-->
<!-- OAT(OSS Audit Tool) configuration guide:
basedir: Root dir, the basedir + project path is the real source file location.
licensefile:
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
tasklist(only for batch mode):
1. task: Define oat check thread, each task will start a new thread.
2. task name: Only an name, no practical effect.
3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
5. task project: Projects to be checked, the path field define the source root dir of the project.
policyList:
1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
3. policyitem type:
"compatibility" is used to check license compatibility in the specified path;
"license" is used to check source license header in the specified path;
"copyright" is used to check source copyright header in the specified path;
"import" is used to check source dependency in the specified path, such as import ... ,include ...
"filetype" is used to check file type in the specified path, supported file types: archive, binary
"filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
7. policyitem filefilter: Used to bind filefilter which define filter rules.
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
Note:If the text contains special characters, please escape them according to the following rules:
" == &gt;
& == &gt;
' == &gt;
< == &gt;
> == &gt;
-->
<configuration>
<oatconfig>
<licensefile></licensefile>
<policylist>
<policy name="projectPolicy" desc="">
</policy>
</policylist>
<filefilterlist>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" >
<filteritem type="filepath" name="figures/.*" desc="architecture figure binary."/>
</filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" >
<filteritem type="filepath" name="test/.*" desc="Resource, config and certification binary."/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>

View File

@ -14,7 +14,7 @@
"subsystem": "multimedia",
"syscap": [
"SystemCapability.Multimedia.Avcodec.Core",
"SystemCapability.Multimedia.Media.Muxer"
"SystemCapability.Multimedia.Media.Muxer",
"SystemCapability.Multimedia.Avcodec.AudioDemuxer",
"SystemCapability.Multimedia.Avcodec.AudioEncoder",
"SystemCapability.Multimedia.Avcodec.AudioDecoder",

View File

@ -97,7 +97,7 @@ OH_AVErrCode OH_AVDemuxer_CopyNextSample(OH_AVDemuxer *demuxer, uint32_t *trackI
CHECK_AND_RETURN_RET_LOG(bufferInfo != nullptr, AV_ERR_INVALID_VAL, "Copy sample failed because input attr is nullptr!");
struct DemuxerObject *demuxerObj = reinterpret_cast<DemuxerObject *>(demuxer);
CHECK_AND_RETURN_RET_LOG(demuxerObj->demuxer_ != nullptr, AV_ERR_INVALID_VAL, "New DemuxerObject failed when copy sample!")
CHECK_AND_RETURN_RET_LOG(demuxerObj->demuxer_ != nullptr, AV_ERR_INVALID_VAL, "New DemuxerObject failed when copy sample!");
struct AVCodecBufferInfo bufferInfoInner;
// enum AVCodecBufferFlag bufferFlag = static_cast<enum AVCodecBufferFlag>(attr.flags);
@ -121,7 +121,7 @@ OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t mSeconds, OH
CHECK_AND_RETURN_RET_LOG(mSeconds >= 0, AV_ERR_INVALID_VAL, "Seek failed because input mSeconds is negative!");
struct DemuxerObject *demuxerObj = reinterpret_cast<DemuxerObject *>(demuxer);
CHECK_AND_RETURN_RET_LOG(demuxerObj->demuxer_ != nullptr, AV_ERR_INVALID_VAL, "New DemuxerObject failed when seek!")
CHECK_AND_RETURN_RET_LOG(demuxerObj->demuxer_ != nullptr, AV_ERR_INVALID_VAL, "New DemuxerObject failed when seek!");
int32_t ret = demuxerObj->demuxer_->SeekToTime(mSeconds, static_cast<AVSeekMode>(mode));
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AV_ERR_OPERATE_NOT_PERMIT, "demuxer_ SeekToTime failed!");

BIN
gn Normal file

Binary file not shown.

View File

@ -119,6 +119,7 @@ config("av_codec_packege_include") {
"$av_codec_root_dir/services/services/source/ipc/",
"$av_codec_root_dir/services/services/source/server/",
"$av_codec_root_dir/services/utils/include/",
# "$av_codec_root_dir/services/services/codecbase/",
# "$av_codec_root_dir/services/services/codecbase/server/",
# "$av_codec_root_dir/services/services/codecbase/server/include/",
@ -208,25 +209,23 @@ config("av_codec_client_public_config") {
ohos_shared_library("av_codec_client") {
install_enable = true
public_configs = [
":av_codec_client_local_config",
":av_codec_client_ipc_config",
":av_codec_client_public_config",
":av_codec_packege_include",
]
configs = [
public_configs = [
":av_codec_client_local_config",
":av_codec_client_ipc_config",
":av_codec_client_public_config",
":av_codec_packege_include",
]
configs = [ ":av_codec_packege_include" ]
sources = [
# "$av_codec_root_dir/frameworks/native/avsource/avsource_impl.cpp",
"$av_codec_root_dir/frameworks/native/common/avcodec_errors.cpp",
"$av_codec_root_dir/services/services/common/avsharedmemory_ipc.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/client/avcodec_client.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_listener_stub.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_parcel.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp",
# "$av_codec_root_dir/frameworks/native/avsource/avsource_impl.cpp",
"$av_codec_root_dir/frameworks/native/common/avcodec_errors.cpp",
"$av_codec_root_dir/services/services/common/avsharedmemory_ipc.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/client/avcodec_client.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_listener_stub.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_parcel.cpp",
"$av_codec_root_dir/services/services/sa_avcodec/ipc/avcodec_service_proxy.cpp",
]
if (multimedia_av_codec_support_codec) {
sources += [
@ -249,44 +248,42 @@ ohos_shared_library("av_codec_client") {
}
if (multimedia_av_codec_support_demuxer) {
sources += [
"$av_codec_root_dir/frameworks/native/avdemuxer/avdemuxer_impl.cpp",
"$av_codec_root_dir/services/services/demuxer/client/demuxer_client.cpp",
"$av_codec_root_dir/services/services/demuxer/ipc/demuxer_service_proxy.cpp",
"$av_codec_root_dir/frameworks/native/avdemuxer/avdemuxer_impl.cpp",
"$av_codec_root_dir/services/services/demuxer/client/demuxer_client.cpp",
"$av_codec_root_dir/services/services/demuxer/ipc/demuxer_service_proxy.cpp",
]
}
if (multimedia_av_codec_support_source) {
sources += [
"$av_codec_root_dir/frameworks/native/avsource/avsource_impl.cpp",
"$av_codec_root_dir/services/services/source/client/source_client.cpp",
"$av_codec_root_dir/services/services/source/ipc/source_service_proxy.cpp",
"$av_codec_root_dir/frameworks/native/avsource/avsource_impl.cpp",
"$av_codec_root_dir/services/services/source/client/source_client.cpp",
"$av_codec_root_dir/services/services/source/ipc/source_service_proxy.cpp",
]
}
if (multimedia_av_codec_support_muxer) {
if (multimedia_av_codec_support_muxer) {
sources += [
"$av_codec_root_dir/frameworks/native/avmuxer/avmuxer_impl.cpp",
"$av_codec_root_dir/services/services/muxer/client/muxer_client.cpp",
"$av_codec_root_dir/services/services/muxer/ipc/muxer_service_proxy.cpp",
]
}
}
deps = [
"$av_codec_root_dir/services/utils:av_codec_format",
"//third_party/bounds_checking_function:libsec_static",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_format",
"//third_party/bounds_checking_function:libsec_static",
]
if (multimedia_av_codec_support_codeclist) {
deps += [
"$av_codec_root_dir/services/engine:av_codec_engine_package",
]
deps += [ "$av_codec_root_dir/services/engine:av_codec_engine_package" ]
}
external_deps = [
"c_utils:utils",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface",
"ipc:ipc_single",
"samgr:samgr_proxy",
"c_utils:utils",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_single",
"samgr:samgr_proxy",
]
subsystem_name = "multimedia"

View File

@ -18,11 +18,11 @@ group("capi_packages") {
deps = []
if (multimedia_av_codec_support_capi) {
deps += [
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_core",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_codec",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avmuxer",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avdemuxer",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avmuxer",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avsource",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_codec",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_core",
]
}
}
@ -148,6 +148,7 @@ config("av_codec_capi_config") {
"$av_codec_root_dir/services/services/source/ipc/",
"$av_codec_root_dir/services/services/source/server/",
"$av_codec_root_dir/services/utils/include/",
# "$av_codec_root_dir/services/services/codecbase/",
# "$av_codec_root_dir/services/services/codecbase/server/",
# "$av_codec_root_dir/services/services/codecbase/server/include/",
@ -185,7 +186,7 @@ ohos_shared_library("native_av_codec_core") {
}
configs = [ ":av_codec_capi_config" ]
sources = [
"$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
"$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
@ -193,7 +194,7 @@ ohos_shared_library("native_av_codec_core") {
if (multimedia_av_codec_support_codeclist) {
sources += [
# "$av_codec_root_dir/frameworks/native/capi/common/native_avcapability.cpp",
# "$av_codec_root_dir/frameworks/native/capi/common/native_avcapability.cpp",
]
}
@ -222,9 +223,9 @@ ohos_shared_library("native_av_codec_codec") {
}
sources = [
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_decoder.cpp",
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_audio_encoder.cpp",
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_decoder.cpp",
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_video_encoder.cpp",
]
@ -233,15 +234,15 @@ ohos_shared_library("native_av_codec_codec") {
deps = [
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_core",
"$av_codec_root_dir/services/utils:av_codec_format",
]
external_deps = [
"c_utils:utils",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
]
output_extension = "so"
subsystem_name = "multimedia"
@ -252,10 +253,9 @@ ohos_shared_library("native_av_codec_avmuxer") {
install_enable = true
sources = [
"$av_codec_root_dir/frameworks/native/capi/avcodec/native_avcodec_base.cpp",
"$av_codec_root_dir/frameworks/native/capi/avmuxer/native_avmuxer.cpp",
"$av_codec_root_dir/frameworks/native/capi/common/native_avformat.cpp",
"$av_codec_root_dir/frameworks/native/capi/common/native_avmemory.cpp",
"$av_codec_root_dir/frameworks/native/capi/avmuxer/native_avmuxer.cpp",
]
public_configs = [ ":av_codec_capi_config" ]
@ -284,15 +284,15 @@ ohos_shared_library("native_av_codec_avdemuxer") {
deps = [
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_core",
"$av_codec_root_dir/services/utils:av_codec_format",
]
external_deps = [
"c_utils:utils",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
]
output_extension = "so"
subsystem_name = "multimedia"
@ -309,17 +309,17 @@ ohos_shared_library("native_av_codec_avsource") {
deps = [
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_core",
"$av_codec_root_dir/services/utils:av_codec_format",
]
external_deps = [
"c_utils:utils",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
]
output_extension = "so"
subsystem_name = "multimedia"
part_name = "av_codec"
}
}

View File

@ -17,6 +17,6 @@ group("av_codec_services_package") {
deps = [
"etc:av_codec_service.cfg",
"services:av_codec_service",
"utils:av_codec_service_utils"
"utils:av_codec_service_utils",
]
}

View File

@ -28,7 +28,7 @@ ohos_shared_library("av_codec_service_dfx") {
debug = false
}
sources = [
sources = [
"avcodec_dfx.cpp",
"avcodec_log_dump.cpp",
"avcodec_xcollie.cpp",

View File

@ -16,8 +16,7 @@ import("//foundation/multimedia/av_codec/config.gni")
group("av_codec_engine_package") {
deps = [
"codec:av_codec_engine_codec",
"plugin:av_codec_plugin",
"codec:av_codec_engine_codec"
]
]
}

View File

@ -1,68 +1,66 @@
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
ohos_static_library("av_codec_codec_base"){
cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wfloat-equal",
"-Wdate-time",
"-Werror",
"-Wno-deprecated-declarations",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
ohos_static_library("av_codec_codec_base") {
cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wfloat-equal",
"-Wdate-time",
"-Werror",
"-Wno-deprecated-declarations",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
include_dirs=[
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//third_party/ffmpeg",
]
include_dirs = [
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//third_party/ffmpeg",
]
sources=[
"$av_codec_root_dir/services/engine/base/codecbase.cpp"
]
sources = [ "$av_codec_root_dir/services/engine/base/codecbase.cpp" ]
deps=[
"//third_party/ffmpeg:libohosffmpeg",
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
]
deps = [
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
"//third_party/ffmpeg:libohosffmpeg",
]
public_deps= [
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
]
external_deps = [
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface"
]
public_deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_format",
]
subsystem_name = "multimedia"
part_name = "av_codec"
}
external_deps = [
"graphic_standard:surface",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
]
subsystem_name = "multimedia"
part_name = "av_codec"
}

View File

@ -18,5 +18,5 @@ group("av_codec_engine_codec") {
deps = [
"audio:av_codec_audio_ffmpeg_codec",
"video:av_codec_video_ffmpeg_codec",
]
]
}

View File

@ -1,89 +1,88 @@
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
ohos_static_library("av_codec_audio_ffmpeg_codec"){
cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wfloat-equal",
"-Wdate-time",
"-Werror",
"-Wno-deprecated-declarations",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
ohos_static_library("av_codec_audio_ffmpeg_codec") {
cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wfloat-equal",
"-Wdate-time",
"-Werror",
"-Wno-deprecated-declarations",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
include_dirs=[
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/factory",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/codec/include/audio",
"$av_codec_root_dir/services/engine/codec/include/audio/decoder",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//third_party/ffmpeg",
]
include_dirs = [
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/factory",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/codec/include/audio",
"$av_codec_root_dir/services/engine/codec/include/audio/decoder",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//third_party/ffmpeg",
]
sources=[
#"$av_codec_root_dir/services/services/codec/server/codec_factory.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_buffer_info.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_buffers_manager.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_codec_worker.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_ffmpeg_adapter.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_aac_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_flac_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_mp3_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_vorbis_decoder_plugin.cpp",
]
sources = [
#"$av_codec_root_dir/services/services/codec/server/codec_factory.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_buffer_info.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_buffers_manager.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_codec_worker.cpp",
"$av_codec_root_dir/services/engine/codec/audio/audio_ffmpeg_adapter.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_aac_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_flac_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_mp3_decoder_plugin.cpp",
"$av_codec_root_dir/services/engine/codec/audio/decoder/audio_ffmpeg_vorbis_decoder_plugin.cpp",
]
deps=[
"//third_party/ffmpeg:libohosffmpeg",
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
]
deps = [
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
"//third_party/ffmpeg:libohosffmpeg",
]
public_deps= [
"//commonlibrary/c_utils/base:utils",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"//third_party/bounds_checking_function:libsec_static"
]
external_deps = [
"c_utils:utils",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface"
]
public_deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"//commonlibrary/c_utils/base:utils",
"//third_party/bounds_checking_function:libsec_static",
]
subsystem_name = "multimedia"
part_name = "av_codec"
external_deps = [
"c_utils:utils",
"graphic_standard:surface",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
]
}
subsystem_name = "multimedia"
part_name = "av_codec"
}

View File

@ -1,63 +1,60 @@
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
ohos_static_library("av_codec_video_ffmpeg_codec"){
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
include_dirs=[
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"//foundation/graphic/graphic_2d/interfaces/inner_api/common",
"//foundation/graphic/graphic_2d/utils/sync_fence/export",
"//drivers/peripheral/display/interfaces/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//third_party/ffmpeg",
]
ohos_static_library("av_codec_video_ffmpeg_codec") {
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
include_dirs = [
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/dfx/include",
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"//foundation/graphic/graphic_2d/interfaces/inner_api/common",
"//foundation/graphic/graphic_2d/utils/sync_fence/export",
"//drivers/peripheral/display/interfaces/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//third_party/ffmpeg",
]
defines = []
defines += av_codec_defines
sources=[
"$av_codec_root_dir/services/engine/codec/video/fcodec.cpp",
]
sources = [ "$av_codec_root_dir/services/engine/codec/video/fcodec.cpp" ]
deps=[
"//third_party/ffmpeg:libohosffmpeg",
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
]
deps = [
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
"$av_codec_root_dir/services/engine/common:av_codec_engine_common",
"//third_party/ffmpeg:libohosffmpeg",
]
public_deps= [
"//commonlibrary/c_utils/base:utils",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"//third_party/bounds_checking_function:libsec_static",
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/utils:sync_fence",
]
external_deps = [
"c_utils:utils",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"graphic_standard:surface"
]
public_deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"//commonlibrary/c_utils/base:utils",
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/utils:sync_fence",
"//third_party/bounds_checking_function:libsec_static",
]
subsystem_name = "multimedia"
part_name = "av_codec"
external_deps = [
"c_utils:utils",
"graphic_standard:surface",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
]
}
subsystem_name = "multimedia"
part_name = "av_codec"
}

View File

@ -57,25 +57,21 @@ config("av_codec_engine_codeclist_config") {
}
ohos_static_library("av_codec_engine_codeclist") {
configs = [
":av_codec_engine_codeclist_config",
]
configs = [ ":av_codec_engine_codeclist_config" ]
sources = [
"codec_ability_singleton.cpp",
"codeclist_core.cpp",
"codeclist_builder.cpp",
"codeclist_core.cpp",
]
deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
]
external_deps = [
"hiviewdfx_hilog_native:libhilog",
]
external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
subsystem_name = "multimedia"
part_name = "av_codec"

View File

@ -1,54 +1,50 @@
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
ohos_static_library("av_codec_engine_common"){
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
ohos_static_library("av_codec_engine_common") {
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
include_dirs=[
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/common",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"$av_codec_root_dir/services/dfx/include",
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api/",
"//foundation/graphic/graphic_2d/utils/sync_fence/export",
"//drivers/peripheral/display/interfaces/include",
"//third_party/ffmpeg",
"$av_codec_root_dir/interfaces/kits/c",
]
include_dirs = [
"//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include",
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/common",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"$av_codec_root_dir/services/dfx/include",
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api/",
"//foundation/graphic/graphic_2d/utils/sync_fence/export",
"//drivers/peripheral/display/interfaces/include",
"//third_party/ffmpeg",
"$av_codec_root_dir/interfaces/kits/c",
]
sources = [
"$av_codec_root_dir/services/engine/common/codec_utils.cpp",
"$av_codec_root_dir/services/engine/common/share_memory.cpp",
"$av_codec_root_dir/services/engine/common/surface_memory.cpp",
]
public_deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"//commonlibrary/c_utils/base:utils",
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/utils:sync_fence",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/ffmpeg:libohosffmpeg",
]
sources=[
"$av_codec_root_dir/services/engine/common/share_memory.cpp",
"$av_codec_root_dir/services/engine/common/surface_memory.cpp",
"$av_codec_root_dir/services/engine/common/codec_utils.cpp",
]
public_deps= [
"//commonlibrary/c_utils/base:utils",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"//third_party/bounds_checking_function:libsec_static",
"//foundation/graphic/graphic_2d:libsurface",
"//foundation/graphic/graphic_2d/utils:sync_fence",
"//third_party/ffmpeg:libohosffmpeg",
]
external_deps = [
"c_utils:utils",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog"
]
}
external_deps = [
"c_utils:utils",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
]
}

View File

@ -1,38 +1,34 @@
# 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
# 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.
#
# 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.
#
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
config("plugin_presets") {
include_dirs = [
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/plugin/core",
"$av_codec_root_dir/services/engine/plugin/interface",
"$av_codec_root_dir/services/engine/source/hst_releated",
"//third_party/bounds_checking_function/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
]
}
group("av_codec_plugin") {
deps = [
"plugins:av_codec_plugin_store",
]
}
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
config("plugin_presets") {
include_dirs = [
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/plugin/core",
"$av_codec_root_dir/services/engine/plugin/interface",
"$av_codec_root_dir/services/engine/source/hst_releated",
"//third_party/bounds_checking_function/include",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
]
}
group("av_codec_plugin") {
deps = [ "plugins:av_codec_plugin_store" ]
}

View File

@ -17,4 +17,4 @@ group("av_codec_plugin_store") {
deps = []
deps += [ "muxer/ffmpeg_muxer:plugin_muxer_ffmpeg" ]
deps += [ "demuxer/ffmpeg_demuxer:plugin_demuxer_ffmpeg" ]
}
}

View File

@ -21,22 +21,17 @@ group("plugin_demuxer_ffmpeg") {
# standard
import("//build/ohos.gni")
ohos_shared_library("av_codec_plugin_FFmpegDemuxer") {
sources = [
"ffmpeg_demuxer_plugin.cpp",
]
sources = [ "ffmpeg_demuxer_plugin.cpp" ]
include_dirs = [
"//third_party/ffmpeg",
]
include_dirs = [ "//third_party/ffmpeg" ]
public_configs = [
"$av_codec_root_dir/services/engine/plugin:plugin_presets",
]
public_configs =
[ "$av_codec_root_dir/services/engine/plugin:plugin_presets" ]
public_deps = [
"//third_party/bounds_checking_function:libsec_static",
"$av_codec_root_dir/services/utils:av_codec_format",
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/ffmpeg:libohosffmpeg",
]

View File

@ -26,18 +26,15 @@ ohos_shared_library("av_codec_plugin_FFmpegMuxer") {
"ffmpeg_utils.cpp",
]
include_dirs = [
"//third_party/ffmpeg",
]
include_dirs = [ "//third_party/ffmpeg" ]
public_configs = [
"$av_codec_root_dir/services/engine/plugin:plugin_presets",
]
public_configs =
[ "$av_codec_root_dir/services/engine/plugin:plugin_presets" ]
public_deps = [
"$av_codec_root_dir/services/utils:av_codec_format",
"//third_party/bounds_checking_function:libsec_static",
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/ffmpeg:libohosffmpeg",
]

View File

@ -253,7 +253,7 @@ int32_t Source::SetTrackFormat(const Format &format, uint32_t trackIndex)
AVStream *stream = formatContext_->streams[trackIndex];
CHECK_AND_RETURN_RET_LOG(stream != nullptr, AVCS_ERR_INVALID_OPERATION, "streams %{public}d is nullptr!", trackIndex)
CHECK_AND_RETURN_RET_LOG(stream != nullptr, AVCS_ERR_INVALID_OPERATION, "streams %{public}d is nullptr!", trackIndex);
Format::FormatDataMap formatMap = format.GetFormatMap();
AVDictionary *streamMetadata = stream->metadata;
@ -280,7 +280,7 @@ int32_t Source::SetTrackFormat(const Format &format, uint32_t trackIndex)
int32_t Source::GetSourceFormat(Format &format)
{
AVCODEC_LOGI("Source::GetFormat is on call");
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_INVALID_OPERATION, "formatContext_ is nullptr!")
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_INVALID_OPERATION, "formatContext_ is nullptr!");
Format::FormatDataMap formatMap = format.GetFormatMap();
int32_t ret;
@ -420,7 +420,7 @@ int32_t Source::GetTrackFormat(Format &format, uint32_t trackIndex)
AVCODEC_LOGI("Source::GetTrackFormat is on call");
int ret=-1;
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_INVALID_OPERATION, "GetTrackFormat failed, formatContext_ is nullptr!")
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_INVALID_OPERATION, "GetTrackFormat failed, formatContext_ is nullptr!");
if ( trackIndex < 0 || trackIndex >= static_cast<uint32_t>(formatContext_->nb_streams)) {
AVCODEC_LOGE("trackIndex is invalid!");
return AVCS_ERR_INVALID_VAL;
@ -481,7 +481,7 @@ int32_t Source::Create(std::string& uri)
{
AVCODEC_LOGI("Source::Create is called");
int32_t ret = LoadDynamicPlugin(uri);
CHECK_AND_RETURN_RET_LOG(ret != AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when load source plugin!")
CHECK_AND_RETURN_RET_LOG(ret != AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when load source plugin!");
std::shared_ptr<MediaSource> mediaSource = std::make_shared<MediaSource>(uri);
AVCODEC_LOGD("mediaSource Init: %{public}s", mediaSource->GetSourceUri().c_str());
@ -491,18 +491,18 @@ int32_t Source::Create(std::string& uri)
}
Status pluginRet = sourcePlugin_->SetSource(mediaSource);
CHECK_AND_RETURN_RET_LOG(pluginRet == Status::OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when set data source for plugin!")
CHECK_AND_RETURN_RET_LOG(pluginRet == Status::OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when set data source for plugin!");
ret = LoadDemuxerList();
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when load demuxerlist!")
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when load demuxerlist!");
ret = SniffInputFormat(uri);
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when find input format!")
CHECK_AND_RETURN_RET_LOG(inputFormat_ != nullptr, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when find input format, cannnot match any input format!")
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when find input format!");
CHECK_AND_RETURN_RET_LOG(inputFormat_ != nullptr, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when find input format, cannnot match any input format!");
ret = InitAVFormatContext();
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when parse source info!")
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when init AVFormatContext!")
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when parse source info!");
CHECK_AND_RETURN_RET_LOG(formatContext_ != nullptr, AVCS_ERR_CREATE_SOURCE_SUB_SERVICE_FAILED, "create source failed when init AVFormatContext!");
return AVCS_ERR_OK;
}

View File

@ -119,6 +119,7 @@ config("av_codec_service_config") {
"$av_codec_root_dir/services/services/codec/client",
"$av_codec_root_dir/services/services/codec/ipc",
"$av_codec_root_dir/services/services/codec/server",
# "$av_codec_root_dir/services/services/codecbase/",
# "$av_codec_root_dir/services/services/codecbase/server/",
# "$av_codec_root_dir/services/services/codecbase/server/include/",
@ -153,7 +154,6 @@ config("av_codec_service_config") {
"$av_codec_root_dir/services/utils/include/",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"//third_party/ffmpeg",
]
if (target_cpu == "arm64") {
@ -194,7 +194,7 @@ ohos_shared_library("av_codec_service") {
cfi_cross_dso = true
debug = true
}
configs = [
":av_codec_service_config",
"$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
@ -202,25 +202,24 @@ ohos_shared_library("av_codec_service") {
sources = [
"$av_codec_root_dir/frameworks/native/common/avcodec_errors.cpp",
"$av_codec_root_dir/services/engine/muxer/muxer_engine_impl.cpp",
"$av_codec_root_dir/services/engine/plugin/core/muxer.cpp",
"$av_codec_root_dir/services/engine/plugin/core/muxer_factory.cpp",
"$av_codec_root_dir/services/engine/plugin/core/plugin_loader.cpp",
"common/avsharedmemory_ipc.cpp",
"sa_avcodec/ipc/avcodec_listener_proxy.cpp",
"sa_avcodec/ipc/avcodec_parcel.cpp",
"sa_avcodec/ipc/avcodec_service_stub.cpp",
"sa_avcodec/server/avcodec_server.cpp",
"sa_avcodec/server/avcodec_server_manager.cpp",
"$av_codec_root_dir/services/engine/muxer/muxer_engine_impl.cpp",
"$av_codec_root_dir/services/engine/plugin/core/muxer_factory.cpp",
"$av_codec_root_dir/services/engine/plugin/core/muxer.cpp",
"$av_codec_root_dir/services/engine/plugin/core/plugin_loader.cpp",
]
if (multimedia_av_codec_support_codec) {
sources += [
"codec/ipc/codec_listener_proxy.cpp",
"codec/ipc/codec_service_stub.cpp",
"codec/server/codec_server.cpp",
"codec/server/codec_factory.cpp",
"codec/server/codec_server.cpp",
]
}
if (multimedia_av_codec_support_codeclist) {
@ -238,36 +237,34 @@ ohos_shared_library("av_codec_service") {
}
if (multimedia_av_codec_support_demuxer) {
sources += [
"demuxer/ipc/demuxer_service_stub.cpp",
"demuxer/server/demuxer_server.cpp",
"$av_codec_root_dir/services/engine/demuxer/demuxer_engine_impl.cpp",
"$av_codec_root_dir/services/engine/factory/demuxer_factory.cpp",
"$av_codec_root_dir/services/engine/plugin/core/demuxer.cpp",
# "$av_codec_root_dir/services/engine/plugin/core/plugin_loader.cpp",
"demuxer/ipc/demuxer_service_stub.cpp",
"demuxer/server/demuxer_server.cpp",
# "$av_codec_root_dir/services/engine/plugin/core/plugin_loader.cpp",
]
}
if (multimedia_av_codec_support_source) {
sources += [
"$av_codec_root_dir/services/engine/source/hst_releated/media_source.cpp",
"$av_codec_root_dir/services/engine/source/hst_releated/plugin_buffer.cpp",
"$av_codec_root_dir/services/engine/source/source.cpp",
"$av_codec_root_dir/services/engine/source/source_engine_impl.cpp",
"source/ipc/source_service_stub.cpp",
"source/server/source_server.cpp",
"$av_codec_root_dir/services/engine/source/source_engine_impl.cpp",
"$av_codec_root_dir/services/engine/source/hst_releated/plugin_buffer.cpp",
"$av_codec_root_dir/services/engine/source/hst_releated/media_source.cpp",
"$av_codec_root_dir/services/engine/source/source.cpp",
]
}
deps = [
"$av_codec_root_dir/services/dfx:av_codec_service_dfx",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"$av_codec_root_dir/services/engine:av_codec_engine_package",
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
"$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec",
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/services/utils:av_codec_service_utils",
"//third_party/ffmpeg:libohosffmpeg",
]
@ -279,10 +276,10 @@ ohos_shared_library("av_codec_service") {
external_deps = [
"c_utils:utils",
"ipc:ipc_single",
"hiviewdfx_hilog_native:libhilog",
"safwk:system_ability_fwk",
"graphic_standard:surface",
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_single",
"safwk:system_ability_fwk",
]
subsystem_name = "multimedia"

View File

@ -46,8 +46,8 @@ ohos_shared_library("av_codec_service_utils") {
cfi_cross_dso = true
debug = false
}
include_dirs = [
include_dirs = [
"//commonlibrary/c_utils/base/include",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
@ -59,9 +59,9 @@ include_dirs = [
"avdatasrcmemory.cpp",
"avsharedmemorybase.cpp",
"avsharedmemorypool.cpp",
"task_thread.cpp"
"task_thread.cpp",
]
cflags = [
"-std=c++17",
"-fno-rtti",

View File

@ -27,14 +27,14 @@ group("av_codec_unit_test") {
deps = []
if (multimedia_av_codec_support_test) {
deps += [
"unittest:av_audio_unit_test",
"unittest:av_video_unit_test",
"unittest/avcodec_test:acodec_capi_unit_test",
"unittest/avcodec_test:vcodec_capi_unit_test",
"unittest/avmuxer_test:avmuxer_capi_unit_test",
"unittest/avmuxer_test:avmuxer_inner_unit_test",
"unittest/format_test:avformat_capi_unit_test",
"unittest/format_test:avformat_inner_unit_test",
"unittest:av_video_unit_test",
"unittest:av_audio_unit_test",
"unittest/avcodec_test:acodec_capi_unit_test",
"unittest/avcodec_test:vcodec_capi_unit_test",
]
}
}

View File

@ -58,31 +58,31 @@ ohos_executable("av_codec_demo") {
]
cflags_cc = cflags
cflags_cc += ["-std=c++17"]
cflags_cc += [ "-std=c++17" ]
sources = [
"$av_codec_root_dir/test/nativedemo/av_codec_demo.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_demo_base.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_demo.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_demo_base.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_demo_common.c",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_engine_demo.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_ffmpeg_demo.cpp",
"$av_codec_root_dir/test/nativedemo/avmuxer/avmuxer_demo_common.c",
"$av_codec_root_dir/test/nativedemo/avmuxer/native_avmuxer_demo.c",
"./audio_demo/avcodec_audio_encoder_inner_demo.cpp",
"./audio_demo/avcodec_audio_decoder_demo.cpp",
"./audio_demo/avcodec_audio_encoder_demo.cpp",
"./video_demo/videodec_ffmpeg_demo.cpp"
"./audio_demo/avcodec_audio_encoder_inner_demo.cpp",
"./video_demo/videodec_ffmpeg_demo.cpp",
]
deps = [
"//third_party/ffmpeg:libohosffmpeg",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avmuxer",
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/interfaces/kits/c:capi_packages",
"$av_codec_root_dir/interfaces/kits/c:native_av_codec_avmuxer",
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"$av_codec_root_dir/services/services:av_codec_service",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/interfaces/kits/c:capi_packages",
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"//third_party/bounds_checking_function:libsec_static"
"//third_party/bounds_checking_function:libsec_static",
"//third_party/ffmpeg:libohosffmpeg",
]
external_deps = [

View File

@ -12,56 +12,51 @@
import("//build/ohos.gni")
import("//foundation/multimedia/av_codec/config.gni")
ohos_shared_library("napitest")
{
sources = [
"napitest_middle.cpp",
"napitest.cpp",
"tool_utility.cpp",
"$av_codec_root_dir/test/nativedemo/video_demo/videodec_ffmpeg_demo.cpp",
]
include_dirs = [
".",
"$av_codec_root_dir/test/nativedemo/video_demo",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api/surface",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"//third_party/node/src",
"//third_party/ffmpeg",
]
deps=[
"//foundation/arkui/napi:ace_napi",
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
]
ohos_shared_library("napitest") {
sources = [
"$av_codec_root_dir/test/nativedemo/video_demo/videodec_ffmpeg_demo.cpp",
"napitest.cpp",
"napitest_middle.cpp",
"tool_utility.cpp",
]
include_dirs = [
".",
"$av_codec_root_dir/test/nativedemo/video_demo",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/services/dfx/include",
"//foundation/graphic/graphic_2d/interfaces/inner_api/surface",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"//third_party/node/src",
"//third_party/ffmpeg",
]
deps = [
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
"//foundation/arkui/napi:ace_napi",
]
remove_configs = [ "//build/config/compiler:no_rtti" ]
remove_configs = [ "//build/config/compiler:no_rtti" ]
cflags=[
]
cflags_cc=[
"-frtti",
]
ldflags = [
]
cflags = []
cflags_cc = [ "-frtti" ]
ldflags = []
public_deps = [
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
"//third_party/ffmpeg:libohosffmpeg",
]
public_deps = [
"$av_codec_root_dir/services/engine/base:av_codec_codec_base",
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
"//third_party/ffmpeg:libohosffmpeg",
]
external_deps = [ "graphic_standard:surface" ]
# 指定库生成路径
relative_install_dir = "module"
external_deps = [ "graphic_standard:surface" ]
# 子系统及其组件, 后面会引用
part_name = "napitest_interface"
subsystem_name = "napitest"
# 指定库生成路径
relative_install_dir = "module"
# 子系统及其组件, 后面会引用
part_name = "napitest_interface"
subsystem_name = "napitest"
}

View File

@ -18,8 +18,8 @@ AV_CODE_ROOT_DIR = "$av_codec_root_dir"
module_output_path = "av_codec"
av_codec_unittest_include_dirs = [
"$AV_CODE_ROOT_DIR/interfaces/inner_api/native",
"$AV_CODE_ROOT_DIR/interfaces/interfaces/inner_api/native",
"$AV_CODE_ROOT_DIR/interfaces/inner_api/native",
"$AV_CODE_ROOT_DIR/interfaces/interfaces/inner_api/native",
]
av_codec_unittest_cflags = [
@ -46,85 +46,76 @@ av_codec_unittest_cflags = [
##################################################################################################################
ohos_unittest("av_video_unit_test") {
module_out_path = module_output_path
include_dirs = av_codec_unittest_include_dirs
include_dirs += [
"./",
"//third_party/ffmpeg",
"//commonlibrary/c_utils/base/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/utils/include",
]
module_out_path = module_output_path
include_dirs = av_codec_unittest_include_dirs
include_dirs += [
"./",
"//third_party/ffmpeg",
"//commonlibrary/c_utils/base/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//foundation/graphic/graphic_2d/interfaces/inner_api",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/codec/include/video",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/utils/include",
]
cflags = av_codec_unittest_cflags
cflags = av_codec_unittest_cflags
cflags_cc = cflags
cflags_cc = cflags
public_configs = [
]
public_configs = []
if (multimedia_av_codec_support_test) {
sources = [ "./video_test/fcodec_unit_test.cpp" ]
}
if (multimedia_av_codec_support_test) {
sources = [
"./video_test/fcodec_unit_test.cpp",
]
}
public_deps = [ "$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec" ]
public_deps = [
"$av_codec_root_dir/services/engine/codec/video:av_codec_video_ffmpeg_codec",
]
resource_config_file = "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
ohos_unittest("av_audio_unit_test") {
module_out_path = module_output_path
include_dirs = av_codec_unittest_include_dirs
include_dirs += [
"./",
"//third_party/ffmpeg",
"//commonlibrary/c_utils/base/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/codec/include/audio",
"$av_codec_root_dir/services/engine/factory",
]
module_out_path = module_output_path
include_dirs = av_codec_unittest_include_dirs
include_dirs += [
"./",
"//third_party/ffmpeg",
"//commonlibrary/c_utils/base/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//foundation/graphic/graphic_2d/frameworks/surface/include",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/services/engine/common/include",
"$av_codec_root_dir/services/engine/base/include",
"$av_codec_root_dir/services/utils/include",
"$av_codec_root_dir/services/engine/codec/include/audio",
"$av_codec_root_dir/services/engine/factory",
]
cflags = av_codec_unittest_cflags
cflags = av_codec_unittest_cflags
cflags_cc = cflags
cflags_cc = cflags
public_configs = [
]
public_configs = []
if (multimedia_av_codec_support_test) {
sources = [
"./audio_test/audio_decoder_unit_test.cpp",
]
}
if (multimedia_av_codec_support_test) {
sources = [ "./audio_test/audio_decoder_unit_test.cpp" ]
}
deps = [
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/services/services:av_codec_service",
"$av_codec_root_dir/services/utils:av_codec_format",
"$av_codec_root_dir/interfaces/kits/c:capi_packages",
"$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec",
"$av_codec_root_dir/services/services:av_codec_service",
]
deps = [
"$av_codec_root_dir/interfaces/inner_api/native:av_codec_client",
"$av_codec_root_dir/interfaces/kits/c:capi_packages",
"$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec",
"$av_codec_root_dir/services/services:av_codec_service",
"$av_codec_root_dir/services/services:av_codec_service",
"$av_codec_root_dir/services/utils:av_codec_format",
]
external_deps = [
"graphic_standard:surface"
]
external_deps = [ "graphic_standard:surface" ]
resource_config_file = "$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}

View File

@ -110,7 +110,8 @@ ohos_unittest("vcodec_native_unit_test") {
"//foundation/window/window_manager/wm:libwm",
]
resource_config_file = "//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
resource_config_file =
"//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
@ -148,7 +149,8 @@ ohos_unittest("acodec_native_unit_test") {
"//foundation/window/window_manager/wm:libwm",
]
resource_config_file = "//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
resource_config_file =
"//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
@ -178,7 +180,8 @@ ohos_unittest("avcodec_list_native_unit_test") {
"//foundation/multimedia/av_codec/interfaces/inner_api/native:av_codec_client",
]
resource_config_file = "//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
resource_config_file =
"//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
@ -239,14 +242,17 @@ ohos_unittest("vcodec_capi_unit_test") {
"//foundation/graphic/graphic_2d/frameworks/surface:surface",
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
"//foundation/multimedia/av_codec/interfaces/inner_api/native:av_codec_client",
"//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_codec",
# "//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_codecbase",
"//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_core",
"//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_codec",
# "//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_venc",
"//foundation/window/window_manager/wm:libwm",
]
resource_config_file = "//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
resource_config_file =
"//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
@ -275,16 +281,17 @@ ohos_unittest("acodec_capi_unit_test") {
deps = [
"//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
"//foundation/multimedia/av_codec/interfaces/inner_api/native:av_codec_client",
# "//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_adec",
"//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_codec",
# "//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_codecbase",
"//foundation/multimedia/av_codec/interfaces/kits/c:native_av_codec_core",
"//foundation/window/window_manager/wm:libwm",
]
resource_config_file = "//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
resource_config_file =
"//foundation/multimedia/av_codec/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################

View File

@ -1,100 +1,100 @@
# 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
# 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.
import("//build/test.gni")
import("//foundation/multimedia/av_codec/config.gni")
module_output_path = "av_codec"
avmuxer_unittest_cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wdate-time",
"-Werror",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
#################################################################################################################muxer
ohos_unittest("avmuxer_capi_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./capi",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/test/unittest/format_test",
"$av_codec_root_dir/test/unittest/format_test/capi",
]
cflags = avmuxer_unittest_cflags
if (multimedia_av_codec_support_muxer) {
sources = [
"$av_codec_root_dir/test/unittest/format_test/capi/avformat_capi_mock.cpp",
"$av_codec_root_dir/test/unittest/format_test/capi/avformat_capi_mock_factory.cpp",
"./avmuxer_sample.cpp",
"./avmuxer_unit_test.cpp",
"./capi/avmuxer_capi_mock.cpp",
"./capi/avmuxer_capi_mock_factory.cpp",
]
}
deps = [ "$av_codec_root_dir/interfaces/kits/c:capi_packages" ]
external_deps = [ "av_codec:av_codec_client" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
#################################################################################################################muxer
ohos_unittest("avmuxer_inner_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./inner",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/test/unittest/format_test",
"$av_codec_root_dir/test/unittest/format_test/inner",
]
cflags = avmuxer_unittest_cflags
if (multimedia_av_codec_support_muxer) {
sources = [
"$av_codec_root_dir/test/unittest/format_test/inner/avformat_inner_mock.cpp",
"$av_codec_root_dir/test/unittest/format_test/inner/avformat_inner_mock_factory.cpp",
"./avmuxer_sample.cpp",
"./avmuxer_unit_test.cpp",
"./inner/avmuxer_inner_mock.cpp",
"./inner/avmuxer_inner_mock_factory.cpp",
]
}
external_deps = [ "av_codec:av_codec_client" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
import("//build/test.gni")
import("//foundation/multimedia/av_codec/config.gni")
module_output_path = "av_codec"
avmuxer_unittest_cflags = [
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wdate-time",
"-Werror",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
#################################################################################################################muxer
ohos_unittest("avmuxer_capi_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./capi",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/test/unittest/format_test",
"$av_codec_root_dir/test/unittest/format_test/capi",
]
cflags = avmuxer_unittest_cflags
if (multimedia_av_codec_support_muxer) {
sources = [
"$av_codec_root_dir/test/unittest/format_test/capi/avformat_capi_mock.cpp",
"$av_codec_root_dir/test/unittest/format_test/capi/avformat_capi_mock_factory.cpp",
"./avmuxer_sample.cpp",
"./avmuxer_unit_test.cpp",
"./capi/avmuxer_capi_mock.cpp",
"./capi/avmuxer_capi_mock_factory.cpp",
]
}
deps = [ "$av_codec_root_dir/interfaces/kits/c:capi_packages" ]
external_deps = [ "av_codec:av_codec_client" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
#################################################################################################################muxer
ohos_unittest("avmuxer_inner_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./inner",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
"$av_codec_root_dir/test/unittest/format_test",
"$av_codec_root_dir/test/unittest/format_test/inner",
]
cflags = avmuxer_unittest_cflags
if (multimedia_av_codec_support_muxer) {
sources = [
"$av_codec_root_dir/test/unittest/format_test/inner/avformat_inner_mock.cpp",
"$av_codec_root_dir/test/unittest/format_test/inner/avformat_inner_mock_factory.cpp",
"./avmuxer_sample.cpp",
"./avmuxer_unit_test.cpp",
"./inner/avmuxer_inner_mock.cpp",
"./inner/avmuxer_inner_mock_factory.cpp",
]
}
external_deps = [ "av_codec:av_codec_client" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}

View File

@ -1,85 +1,85 @@
# 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
# 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.
import("//build/test.gni")
import("//foundation/multimedia/av_codec/config.gni")
module_output_path = "av_codec"
avcodec_unittest_cflags = [
"-std=c++17",
"-frtti",
"-fexceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wdate-time",
"-Werror",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
##################################################################################################################
ohos_unittest("avformat_capi_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./capi",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
]
cflags = avcodec_unittest_cflags
if (multimedia_av_codec_support_codec) {
sources = [
"./avformat_unit_test.cpp",
"./capi/avformat_capi_mock.cpp",
"./capi/avformat_capi_mock_factory.cpp",
]
}
deps = [ "$av_codec_root_dir/interfaces/kits/c:capi_packages" ]
public_deps = [ "$av_codec_root_dir/services/utils:av_codec_format" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
ohos_unittest("avformat_inner_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./inner",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
]
cflags = avcodec_unittest_cflags
sources = [
"./avformat_unit_test.cpp",
"./inner/avformat_inner_mock.cpp",
"./inner/avformat_inner_mock_factory.cpp",
]
public_deps = [ "$av_codec_root_dir/services/utils:av_codec_format" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
import("//build/test.gni")
import("//foundation/multimedia/av_codec/config.gni")
module_output_path = "av_codec"
avcodec_unittest_cflags = [
"-std=c++17",
"-frtti",
"-fexceptions",
"-Wall",
"-fno-common",
"-fstack-protector-strong",
"-Wshadow",
"-FPIC",
"-FS",
"-O2",
"-D_FORTIFY_SOURCE=2",
"-fvisibility=hidden",
"-Wformat=2",
"-Wdate-time",
"-Werror",
"-Wextra",
"-Wimplicit-fallthrough",
"-Wsign-compare",
"-Wunused-parameter",
]
##################################################################################################################
ohos_unittest("avformat_capi_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./capi",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
]
cflags = avcodec_unittest_cflags
if (multimedia_av_codec_support_codec) {
sources = [
"./avformat_unit_test.cpp",
"./capi/avformat_capi_mock.cpp",
"./capi/avformat_capi_mock_factory.cpp",
]
}
deps = [ "$av_codec_root_dir/interfaces/kits/c:capi_packages" ]
public_deps = [ "$av_codec_root_dir/services/utils:av_codec_format" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}
##################################################################################################################
ohos_unittest("avformat_inner_unit_test") {
module_out_path = module_output_path
include_dirs = [
"./",
"./inner",
"$av_codec_root_dir/interfaces/inner_api/native",
"$av_codec_root_dir/interfaces/kits/c",
]
cflags = avcodec_unittest_cflags
sources = [
"./avformat_unit_test.cpp",
"./inner/avformat_inner_mock.cpp",
"./inner/avformat_inner_mock_factory.cpp",
]
public_deps = [ "$av_codec_root_dir/services/utils:av_codec_format" ]
resource_config_file =
"$av_codec_root_dir/test/unittest/resources/ohos_test.xml"
}