Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3318109d
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看板
提交
3318109d
编写于
10月 25, 2021
作者:
O
openharmony_ci
提交者:
Gitee
10月 25, 2021
浏览文件
操作
浏览文件
下载
差异文件
!975 【媒体子系统】解决3518视频播放用例失败
Merge pull request !975 from apperception/master
上级
a796de4a
6035ac71
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
908 addition
and
311 deletion
+908
-311
multimedia_lite/media_lite_posix/player_native/BUILD.gn
multimedia_lite/media_lite_posix/player_native/BUILD.gn
+7
-1
multimedia_lite/media_lite_posix/player_native/Test.json
multimedia_lite/media_lite_posix/player_native/Test.json
+3
-0
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerAudioTest.cpp
...lite_posix/player_native/src/ActsMediaPlayerAudioTest.cpp
+305
-309
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerTest.h
.../media_lite_posix/player_native/src/ActsMediaPlayerTest.h
+42
-1
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerVideoTest.cpp
...lite_posix/player_native/src/ActsMediaPlayerVideoTest.cpp
+551
-0
未找到文件。
multimedia_lite/media_lite_posix/player_native/BUILD.gn
浏览文件 @
3318109d
...
@@ -11,11 +11,17 @@
...
@@ -11,11 +11,17 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import("//build/lite/config/subsystem/aafwk/config.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("ActsMediaPlayerTest") {
hcpptest_suite("ActsMediaPlayerTest") {
suite_name = "acts"
suite_name = "acts"
sources = [ "src/ActsMediaPlayerTest.cpp" ]
sources = [ "src/ActsMediaPlayerAudioTest.cpp" ]
if (ohos_kernel_type == "liteos_a" &&
enable_ohos_appexecfwk_feature_ability == true) {
sources += [ "src/ActsMediaPlayerVideoTest.cpp" ]
}
ldflags = [ "-lstdc++" ]
ldflags = [ "-lstdc++" ]
ldflags += [ "-lm" ]
ldflags += [ "-lm" ]
if (ohos_kernel_type == "linux") {
if (ohos_kernel_type == "linux") {
...
...
multimedia_lite/media_lite_posix/player_native/Test.json
浏览文件 @
3318109d
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
{
{
"source"
:
"testcases/multimedia"
,
"source"
:
"testcases/multimedia"
,
"target"
:
"/test_root/multimedia"
"target"
:
"/test_root/multimedia"
},{
"source"
:
"resource/multimedia"
,
"target"
:
"/test_root/multimedia"
}
}
]
]
}
}
...
...
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerTest.cpp
→
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayer
Audio
Test.cpp
浏览文件 @
3318109d
此差异已折叠。
点击以展开。
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerTest.h
浏览文件 @
3318109d
...
@@ -15,9 +15,18 @@
...
@@ -15,9 +15,18 @@
#ifndef PLAYER_LITE_TEST_H
#ifndef PLAYER_LITE_TEST_H
#define PLAYER_LITE_TEST_H
#define PLAYER_LITE_TEST_H
#include <sys/prctl.h>
#include <fcntl.h>
#include <climits>
#include "securec.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "source.h"
#include "player.h"
#include "player.h"
#include "format.h"
#include "fstream"
#include "iostream"
#include "thread"
#include "unistd.h"
namespace
OHOS
{
namespace
OHOS
{
using
OHOS
::
Media
::
Player
;
using
OHOS
::
Media
::
Player
;
...
@@ -35,11 +44,43 @@ using namespace testing::ext;
...
@@ -35,11 +44,43 @@ using namespace testing::ext;
const
int
FILE_PATH_LEN
=
2048
;
const
int
FILE_PATH_LEN
=
2048
;
class
StreamSourceSample
;
using
TestSample
=
struct
TagTestSample
{
using
TestSample
=
struct
TagTestSample
{
std
::
shared_ptr
<
Player
>
adaptr
;
std
::
shared_ptr
<
Player
>
adaptr
;
pthread_t
process
;
pthread_mutex_t
mutex
;
int32_t
isThreadRunning
;
int32_t
sourceType
;
char
filePath
[
FILE_PATH_LEN
];
char
filePath
[
FILE_PATH_LEN
];
std
::
shared_ptr
<
StreamSourceSample
>
streamSample
;
};
using
IdleBuffer
=
struct
TagIdleBuffer
{
size_t
idx
;
size_t
offset
;
size_t
size
;
};
};
class
StreamSourceSample
:
public
StreamSource
{
public:
StreamSourceSample
(
void
);
~
StreamSourceSample
(
void
);
void
OnBufferAvailable
(
size_t
index
,
size_t
offset
,
size_t
size
);
void
SetStreamCallback
(
const
std
::
shared_ptr
<
StreamCallback
>
&
callback
);
uint8_t
*
GetBufferAddress
(
size_t
idx
);
void
QueueBuffer
(
size_t
index
,
size_t
offset
,
size_t
size
,
int64_t
timestampUs
,
uint32_t
flags
);
int
GetAvailableBuffer
(
IdleBuffer
*
buffer
);
std
::
weak_ptr
<
StreamCallback
>
m_callBack
;
pthread_mutex_t
m_mutex
;
private:
std
::
vector
<
IdleBuffer
>
aviableBuffer
;
};
void
*
StreamProcess
(
const
void
*
arg
);
void
SetSchParam
(
void
);
const
int32_t
HI_SUCCESS
=
0
;
const
int32_t
HI_FAILURE
=
-
1
;
static
TagTestSample
g_tagTestSample
;
static
TagTestSample
g_tagTestSample
;
static
Surface
*
g_surface
=
Surface
::
CreateSurface
();
static
Surface
*
g_surface
=
Surface
::
CreateSurface
();
}
// namespace OHOS
}
// namespace OHOS
...
...
multimedia_lite/media_lite_posix/player_native/src/ActsMediaPlayerVideoTest.cpp
0 → 100644
浏览文件 @
3318109d
/*
* Copyright (C) 2020-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.
*/
#include "ActsMediaPlayerTest.h"
namespace
OHOS
{
const
string
g_avFileName
=
"1080P_25fps.mp4"
;
static
void
InitSurface
()
{
OHOS
::
g_surface
->
SetUserData
(
"region_position_x"
,
"0"
);
OHOS
::
g_surface
->
SetUserData
(
"region_position_y"
,
"0"
);
OHOS
::
g_surface
->
SetUserData
(
"region_width"
,
"720"
);
OHOS
::
g_surface
->
SetUserData
(
"region_height"
,
"540"
);
}
class
ActsMediaPlayerVideoTest
:
public
testing
::
Test
{
protected:
// SetUpTestCase:The preset action of the test suite is executed before the first TestCase
static
void
SetUpTestCase
(
void
)
{
}
// TearDownTestCase:The test suite cleanup action is executed after the last TestCase
static
void
TearDownTestCase
(
void
)
{
}
// SetUp:Execute before each test case
virtual
void
SetUp
()
{
g_tagTestSample
.
adaptr
=
std
::
make_shared
<
Player
>
();
InitSurface
();
}
// TearDown:Execute after each test case
virtual
void
TearDown
()
{
}
};
static
int32_t
FileCheck
(
const
string
&
argv
)
{
const
char
*
ptr
=
argv
.
c_str
();
if
(
strlen
(
ptr
)
<
FILE_PATH_LEN
&&
realpath
(
argv
.
c_str
(),
g_tagTestSample
.
filePath
)
==
nullptr
)
{
printf
(
"realpath input file failed, errno: %d!
\n
"
,
errno
);
return
-
1
;
}
return
0
;
}
static
int32_t
CreateAndSetSource
()
{
std
::
string
uri
(
g_tagTestSample
.
filePath
);
Source
source
(
uri
);
int32_t
ret
=
g_tagTestSample
.
adaptr
->
SetSource
(
source
);
string
ret1
=
source
.
GetSourceUri
();
return
ret
;
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0100
* @tc.name : Video Prepare Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_001
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
true
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0200
* @tc.name : Video Prepare Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_002
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0300
* @tc.name : Video Play Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_003
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
sleep
(
1
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
true
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0400
* @tc.name : Video Stop Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_004
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
std
::
shared_ptr
<
PlayerCallback
>
cb
;
g_tagTestSample
.
adaptr
->
SetPlayerCallback
(
cb
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
2
);
ret
=
g_tagTestSample
.
adaptr
->
Stop
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
false
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0500
* @tc.name : Video Stop Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_005
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Stop
();
EXPECT_EQ
(
HI_FAILURE
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0600
* @tc.name : Video Pause Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_006
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
2
);
ret
=
g_tagTestSample
.
adaptr
->
Pause
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
false
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0700
* @tc.name : Video Pause Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_007
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Pause
();
EXPECT_EQ
(
HI_FAILURE
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0800
* @tc.name : Video GetCurrentTime Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_008
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
1
);
int64_t
currentPosition
;
ret
=
g_tagTestSample
.
adaptr
->
GetCurrentTime
(
currentPosition
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_0900
* @tc.name : Video GetCurrentTime Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_009
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int64_t
currentPosition
;
ret
=
g_tagTestSample
.
adaptr
->
GetCurrentTime
(
currentPosition
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
1
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
true
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1000
* @tc.name : Video GetDuration Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_010
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
1
);
ret
=
g_tagTestSample
.
adaptr
->
Pause
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Rewind
(
1
,
PLAYER_SEEK_NEXT_SYNC
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int64_t
currentPosition
;
ret
=
g_tagTestSample
.
adaptr
->
GetCurrentTime
(
currentPosition
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1100
* @tc.name : Video Rewind Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_011
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
1
);
ret
=
g_tagTestSample
.
adaptr
->
Pause
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Rewind
(
4
,
PLAYER_SEEK_NEXT_SYNC
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1200
* @tc.name : Video GetDuration Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_012
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int64_t
duration
;
ret
=
g_tagTestSample
.
adaptr
->
GetDuration
(
duration
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1300
* @tc.name : Video GetVideoSurfaceSize Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_013
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int32_t
videoWidth
;
ret
=
g_tagTestSample
.
adaptr
->
GetVideoWidth
(
videoWidth
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int32_t
videoHeight
;
ret
=
g_tagTestSample
.
adaptr
->
GetVideoHeight
(
videoHeight
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1400
* @tc.name : Video GetVideoSurfaceSize Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_014
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int32_t
videoWidth
;
ret
=
g_tagTestSample
.
adaptr
->
GetVideoWidth
(
videoWidth
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1500
* @tc.name : Video GetVideoSurfaceSize Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_015
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
int32_t
videoHeight
;
ret
=
g_tagTestSample
.
adaptr
->
GetVideoHeight
(
videoHeight
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1600
* @tc.name : Video Reset Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_016
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
2
);
ret
=
g_tagTestSample
.
adaptr
->
Reset
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1700
* @tc.name : Video Reset Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_017
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Reset
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1800
* @tc.name : Video Release Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_018
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
2
);
ret
=
g_tagTestSample
.
adaptr
->
Release
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_1900
* @tc.name : Video EnableSingleLooping Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_019
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
loop
=
true
;
ret
=
g_tagTestSample
.
adaptr
->
EnableSingleLooping
(
loop
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
sleep
(
1
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
true
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
sleep
(
1
);
}
/* *
* @tc.number : SUB_MEDIA_PLAYER_PLAY_2000
* @tc.name : Video EnableSingleLooping Test.
* @tc.desc : [C- SOFTWARE -0200]
*/
HWTEST_F
(
ActsMediaPlayerVideoTest
,
player_lite_video_test_020
,
Level1
)
{
int32_t
ret
=
FileCheck
(
g_avFileName
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
CreateAndSetSource
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Prepare
();
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
SetVideoSurface
(
g_surface
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
ret
=
g_tagTestSample
.
adaptr
->
Play
();
sleep
(
1
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
loop
=
true
;
ret
=
g_tagTestSample
.
adaptr
->
EnableSingleLooping
(
loop
);
EXPECT_EQ
(
HI_SUCCESS
,
ret
);
bool
flag
=
g_tagTestSample
.
adaptr
->
IsPlaying
();
EXPECT_EQ
(
true
,
flag
);
g_tagTestSample
.
adaptr
->
Release
();
}
}
// OHOS
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录