Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
20b7ecfa
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
20b7ecfa
编写于
10月 14, 2021
作者:
Z
z_apperception
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<zhaochen69@huawei.com>
Signed-off-by:
N
z_apperception
<
zhaochen69@huawei.com
>
上级
07ce031c
变更
4
展开全部
显示空白变更内容
内联
并排
Showing
4 changed file
with
1888 addition
and
190 deletion
+1888
-190
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
+10
-2
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.cpp
..._lite_posix/recorder_native/src/ActsMediaRecorderTest.cpp
+1830
-0
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
...ia_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
+48
-0
multimedia_lite/media_lite_posix/recorder_native/src/include/ActsMediaRecorderTest.h
...posix/recorder_native/src/include/ActsMediaRecorderTest.h
+0
-188
未找到文件。
multimedia_lite/media_lite_posix/recorder_native/BUILD.gn
浏览文件 @
20b7ecfa
...
@@ -15,11 +15,19 @@ import("//test/xts/tools/lite/build/suite_lite.gni")
...
@@ -15,11 +15,19 @@ import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaRecorderTest") {
hcpptest_suite("ActsMediaRecorderTest") {
suite_name = "acts"
suite_name = "acts"
sources = [ "src/
testcase/ActsMediaRecorderNDK
Test.cpp" ]
sources = [ "src/
ActsMediaRecorder
Test.cpp" ]
include_dirs = [
include_dirs = [
"src
/include
",
"src",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//test/xts/acts/multimedia_lite/utils_posix/common/include",
"//third_party/bounds_checking_function/include",
"//drivers/peripheral/codec/interfaces/include",
"//foundation/multimedia/utils/lite/hals",
"//foundation/multimedia/media_lite/test/unittest/recorder_lite",
"//foundation/multimedia/media_lite/interfaces/kits/recorder_lite",
"//foundation/multimedia/media_lite/frameworks/recorder_lite",
"//foundation/multimedia/media_lite/frameworks/recorder_lite/recoder_sink/include",
"//foundation/multimedia/media_lite/frameworks/recorder_lite/recoder_source/include",
]
]
deps = [
deps = [
...
...
multimedia_lite/media_lite_posix/recorder_native/src/
testcase/ActsMediaRecorderNDK
Test.cpp
→
multimedia_lite/media_lite_posix/recorder_native/src/
ActsMediaRecorder
Test.cpp
100755 → 100644
浏览文件 @
20b7ecfa
此差异已折叠。
点击以展开。
multimedia_lite/media_lite_posix/recorder_native/src/ActsMediaRecorderTest.h
0 → 100644
浏览文件 @
20b7ecfa
/*
* Copyright (C) 2021 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.
*/
#ifndef RECORDER_LITE_TEST_H
#define RECORDER_LITE_TEST_H
#include "gtest/gtest.h"
#include "recorder.h"
using
OHOS
::
Media
::
RecorderCallback
;
namespace
OHOS
{
class
RecoderLiteTest
:
public
testing
::
Test
{
public:
// SetUpTestCase: before all testcasee
static
void
SetUpTestCase
(
void
);
// TearDownTestCase: after all testcase
static
void
TearDownTestCase
(
void
);
// SetUp
void
SetUp
(
void
);
// TearDown
void
TearDown
(
void
);
void
OnError
(
const
int32_t
errorType
,
const
int32_t
errorCode
);
void
OnInfo
(
const
int32_t
type
,
const
int32_t
extra
);
};
namespace
Media
{
class
TestVideoRecorderCallback
:
public
RecorderCallback
{
public:
void
OnError
(
int32_t
errorType
,
int32_t
errorCode
);
void
OnInfo
(
int32_t
type
,
int32_t
extra
);
};
}
}
#endif // RECORDER_LITE_TEST_H
multimedia_lite/media_lite_posix/recorder_native/src/include/ActsMediaRecorderTest.h
已删除
100755 → 0
浏览文件 @
07ce031c
/*
* Copyright (c) 2021 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.
*/
#ifndef ACTS_MEDIA_RECODER_TEST_H
#define ACTS_MEDIA_RECODER_TEST_H
#include <unistd.h>
#include "recorder.h"
#include "gtest/gtest.h"
#include "camera_kit.h"
#include "TestCaseParse.h"
#include "ActsTestMediaUtils.h"
#define TESTCASECOUNT 38
const
string
g_testPath
;
const
string
g_recordFilePath
;
static
int32_t
g_fdNull
=
-
1
;
// fd is null
static
int32_t
g_sleepTime
=
1
;
using
namespace
std
;
using
namespace
OHOS
;
using
namespace
OHOS
::
Media
;
using
namespace
testing
::
ext
;
/* *
* creat camera device callback
*/
class
SampleCameraDeviceCallback
:
public
CameraDeviceCallback
{
public:
SampleCameraDeviceCallback
()
{
cout
<<
"camera device call back created"
<<
endl
;
}
~
SampleCameraDeviceCallback
()
{
cout
<<
"camera device call back destroyed"
<<
endl
;
}
/* *
* camera statu changed
*/
void
OnCameraStatus
(
std
::
string
cameraId
,
int32_t
status
)
override
;
};
/* *
* create FrameStateCallback
*/
class
SampleFrameStateCallback
:
public
FrameStateCallback
{
void
OnFrameFinished
(
Camera
&
camera
,
FrameConfig
&
fc
,
FrameResult
&
result
)
override
;
void
OnFrameError
(
Camera
&
camera
,
FrameConfig
&
frameConfig
,
int32_t
errorCode
,
FrameResult
&
frameResult
)
override
;
};
/* *
* create CameraStateCallback
*/
class
SampleCameraStateMng
:
public
CameraStateCallback
{
public:
SampleCameraStateMng
()
=
delete
;
SampleCameraStateMng
(
EventHandler
&
eventHandler
)
:
eventHandler
(
eventHandler
)
{}
~
SampleCameraStateMng
()
{
CloseRecorder
();
if
(
cam_
!=
nullptr
)
{
cam_
->
Release
();
}
}
// close Recorder
void
CloseRecorder
();
// 相机创建成功
void
OnCreated
(
Camera
&
c
)
override
;
// 相机创建失败
void
OnCreateFailed
(
const
std
::
string
cameraId
,
int32_t
errorCode
)
override
{
cout
<<
"CameraStateCallback OnCreateFailed
\n
"
<<
endl
;
}
void
OnReleased
(
Camera
&
c
)
override
{
cout
<<
"CameraStateCallback OnReleased
\n
"
<<
endl
;
}
void
OnConfigured
(
Camera
&
c
)
override
{
cout
<<
"CameraStateCallback OnConfigured
\n
"
<<
endl
;
}
void
OnConfigureFailed
(
const
std
::
string
cameraId
,
int32_t
errorCode
)
override
{
cout
<<
"CameraStateCallback OnConfigureFailed
\n
"
<<
endl
;
}
// 创建Reorder
int32_t
SampleCreateRecorder
(
TestCase
&
ft
);
// 准备录像
int32_t
PrepareRecorder
();
// 开始录像
int32_t
StartRecord
();
/* *
* 开始预览
*/
int32_t
StartPreview
();
/* *
* 拍照,并保存文件
*/
int32_t
Capture
();
/* *
* 停止录像
*/
int32_t
Stop
();
private:
enum
State
:
int32_t
{
STATE_IDLE
,
STATE_RUNNING
,
STATE_BUTT
};
State
previewState_
=
STATE_IDLE
;
State
recordState_
=
STATE_IDLE
;
EventHandler
&
eventHandler
;
Recorder
*
recorder_
=
nullptr
;
Camera
*
cam_
=
nullptr
;
int32_t
recordFd_
=
g_fdNull
;
SampleFrameStateCallback
fsCb_
;
};
/* *
* Media Recorder test
*/
class
ActsMediaRecorderTest
:
public
testing
::
Test
{
public:
/* *
* @tc.setup:This is before test class
*/
static
void
SetUpTestCase
(
void
);
/* *
* @tc.setup:This is after test class
*/
static
void
TearDownTestCase
(
void
);
/* *
* @tc.setup:This is before test case
*/
virtual
void
SetUp
(
void
);
/* *
* @tc.setup:This is after test case
*/
virtual
void
TearDown
(
void
);
/* *
* Create CameraKit
*/
virtual
void
CreateCameraKit
(
void
);
/* *
* release Camera
*/
virtual
void
ReleaseCameraKit
(
void
);
CameraKit
*
cameraKit_
;
string
camId
;
};
#endif // ACTS_MEDIA_RECODER_TEST_H
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录