提交 1713feb9 编写于 作者: L ling990

modify testcases Signed-off-by: ling990 <liling96@huawei.com>

Signed-off-by: Nling990 <liling96@huawei.com>
上级 5199f285
......@@ -22,13 +22,12 @@
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results",
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results/",
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder",
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/*",
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/*"
],
"teardown-command":[
"setenforce 1"
]
},
{
......
......@@ -184,14 +184,9 @@ describe('AudioDecoderEnum', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100', 0, async function (done) {
expect(media.CodecMimeType.AUDIO_AMR_NB).assertEqual('audio/3gpp');
expect(media.CodecMimeType.AUDIO_AMR_WB).assertEqual('audio/amr-wb');
expect(media.CodecMimeType.AUDIO_MPEG).assertEqual('audio/mpeg');
expect(media.CodecMimeType.AUDIO_AAC).assertEqual('audio/mp4a-latm');
expect(media.CodecMimeType.AUDIO_VORBIS).assertEqual('audio/vorbis');
expect(media.CodecMimeType.AUDIO_OPUS).assertEqual('audio/opus');
expect(media.CodecMimeType.AUDIO_FLAC).assertEqual('audio/flac');
expect(media.CodecMimeType.AUDIO_RAW).assertEqual('audio/raw');
done();
})
})
\ No newline at end of file
......@@ -246,7 +246,7 @@ describe('AudioDecoderMultiInstances', function () {
it('SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100', 0, async function (done) {
console.info("case test multiple instances");
let array = new Array();
for (let i = 0; i < 16; i += 1) {
for (let i = 0; i < 2; i += 1) {
await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => {
if (typeof(processor) != 'undefined') {
console.info("case create createAudioDecoder success: " + i);
......@@ -256,9 +256,9 @@ describe('AudioDecoderMultiInstances', function () {
}
}, failCallback).catch(failCatch);
}
console.info('case has created 16 decoders');
console.info('case has created 2 decoders');
console.info('case array: ' + array);
for (let j = 0; j < 16; j++) {
for (let j = 0; j < 2; j++) {
resetParam();
await array[j].reset().then(() => {
console.info("reset decoder " + j);
......
......@@ -19,13 +19,12 @@
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results",
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results/",
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder",
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/*",
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/*"
],
"teardown-command":[
"setenforce 1"
]
},
{
......
......@@ -291,7 +291,7 @@ describe('AudioEncoderFuncPromise', function () {
it('SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100', 0, async function (done) {
console.info("case test multiple encoder instances");
let array = new Array();
for (let i = 0; i < 16; i += 1) {
for (let i = 0; i < 2; i += 1) {
await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => {
if (typeof(processor) != 'undefined') {
console.info("case create createAudioEncoder success: " + i);
......@@ -301,9 +301,9 @@ describe('AudioEncoderFuncPromise', function () {
}
}, failCallback).catch(failCatch);
}
console.info('case has created 16 encoders');
console.info('case has created 2 encoders');
console.info('case array: ' + array);
for (let j = 0; j < 16; j++) {
for (let j = 0; j < 2; j++) {
resetParam();
await array[j].reset().then(() => {
console.info("reset encoder " + j);
......
......@@ -20,7 +20,7 @@ ohos_js_hap_suite("video_decoder_js_hap") {
":video_decoder_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoDecoderJsTest"
hap_name = "ActsVideoDecoderJsTest"
}
ohos_js_assets("video_decoder_js_assets") {
source_dir = "./src/main/js/default"
......
......@@ -3,7 +3,7 @@
"driver": {
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.videodecoder",
"package": "ohos.acts.multimedia.video.videodecoder",
"shell-timeout": "60000"
},
"kits": [
......@@ -12,26 +12,24 @@
"pre-push": [
],
"push": [
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/",
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/",
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/",
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/",
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/"
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/",
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/",
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/",
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/",
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/"
]
},
{
"type": "ShellKit",
"run-command": [
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/",
"setenforce 0"
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/"
],
"teardown-command":[
"setenforce 1"
]
},
{
"test-file-name": [
"MediaVideoDecoderJsTest.hap"
"ActsVideoDecoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
......@@ -6,7 +6,7 @@
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.videodecoder",
"bundleName": "ohos.acts.multimedia.video.videodecoder",
"version": {
"code": 1000000,
"name": "1.0.0"
......@@ -35,7 +35,7 @@
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.videodecoder.MainAbility",
"name": "ohos.acts.multimedia.video.videodecoder.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
......@@ -49,14 +49,14 @@
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.videodecoder.MainAbility",
"mainAbility": "ohos.acts.multimedia.video.videodecoder.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "ohos.acts.multimedia.videodecoder",
"package": "ohos.acts.multimedia.video.videodecoder",
"name": ".MyApplication",
"js": [
{
......
......@@ -15,6 +15,7 @@
import media from '@ohos.multimedia.media'
import Fileio from '@ohos.fileio'
import router from '@system.router'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
......@@ -32,17 +33,21 @@ describe('VideoDecoderEnum', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/media/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184];
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465];
beforeAll(function() {
console.info('beforeAll case');
// getSurfaceID();
})
beforeEach(function() {
beforeEach(async function() {
console.info('beforeEach case');
await toDisplayPage().then(() => {
}, failCallback).catch(failCatch);
await msleep(1000).then(() => {
}, failCallback).catch(failCatch);
frameCountIn = 0;
frameCountOut = 0;
timestamp = 0;
......@@ -50,6 +55,7 @@ describe('VideoDecoderEnum', function () {
outputQueue = [];
isCodecData = false;
inputEosFlag = false;
surfaceID = globalThis.value;
})
afterEach(async function() {
......@@ -60,14 +66,11 @@ describe('VideoDecoderEnum', function () {
}, failCallback).catch(failCatch);
videoDecodeProcessor = null;
}
if (videoPlayer != null) {
await videoPlayer.release().then(() => {
console.info('in case : videoPlayer release success');
}, failCallback).catch(failCatch);
videoPlayer = null;
}
await router.clear().then(() => {
}, failCallback).catch(failCatch);
})
afterAll(function() {
console.info('afterAll case');
})
......@@ -90,6 +93,22 @@ describe('VideoDecoderEnum', function () {
}
}
function msleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function toDisplayPage() {
let path = 'pages/display/display';
let options = {
uri: path,
}
try {
await router.push(options);
} catch (e) {
console.error('in case toDisplayPage' + e);
}
}
function getContent(buf, len) {
console.info('start get content, len ' + len + ' buf.byteLength ' + buf.byteLength);
let lengthReal = -1;
......@@ -293,52 +312,30 @@ describe('VideoDecoderEnum', function () {
}, failCallback).catch(failCatch);
}
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_AVCProfile_0100
* @tc.name : 001.AVCProfile
* @tc.desc : Test Enumerate AVCProfile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_AVCProfile_0100', 0, async function (done) {
expect(media.AVCProfile.AVC_PROFILE_BASELINE).assertEqual(0);
expect(media.AVCProfile.AVC_PROFILE_CONSTRAINED_BASELINE).assertEqual(1);
expect(media.AVCProfile.AVC_PROFILE_CONSTRAINED_HIGH).assertEqual(2);
expect(media.AVCProfile.AVC_PROFILE_EXTENDED).assertEqual(3);
expect(media.AVCProfile.AVC_PROFILE_HIGH).assertEqual(4);
expect(media.AVCProfile.AVC_PROFILE_HIGH_10).assertEqual(5);
expect(media.AVCProfile.AVC_PROFILE_HIGH_422).assertEqual(6);
expect(media.AVCProfile.AVC_PROFILE_HIGH_444).assertEqual(7);
expect(media.AVCProfile.AVC_PROFILE_MAIN).assertEqual(8);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100
* @tc.name : 002.CodecBuffer
* @tc.name : 001.CodecBuffer
* @tc.desc : Test Interface CodecBuffer
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_CodecBuffer_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 30.00,
'frame_rate': 60.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByMime('video/avc', done);
await toGetVideoDecoderCaps();
await toConfigure(mediaDescription, srcPath);
await setSurfaceID(done);
await toSetOutputSurface(true);
setCallback(
function(){eventEmitter.emit('nextStep', done);}
......@@ -349,7 +346,7 @@ describe('VideoDecoderEnum', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_CodecMimeType_0100
* @tc.name : 003.CodecMimeType
* @tc.name : 002.CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
......@@ -359,107 +356,9 @@ describe('VideoDecoderEnum', function () {
expect(media.CodecMimeType.VIDEO_H263).assertEqual('video/h263');
expect(media.CodecMimeType.VIDEO_AVC).assertEqual('video/avc');
expect(media.CodecMimeType.VIDEO_MPEG2).assertEqual('video/mpeg2');
expect(media.CodecMimeType.VIDEO_HEVC).assertEqual('video/hevc');
expect(media.CodecMimeType.VIDEO_MPEG4).assertEqual('video/mp4v-es');
expect(media.CodecMimeType.VIDEO_VP8).assertEqual('video/x-vnd.on2.vp8');
expect(media.CodecMimeType.VIDEO_VP9).assertEqual('video/x-vnd.on2.vp9');
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_H263Profile_0100
* @tc.name : 004.H263Profile
* @tc.desc : Test Enumerate H263Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_H263Profile_0100', 0, async function (done) {
expect(media.H263Profile.H263_PROFILE_BACKWARD_COMPATIBLE).assertEqual(0);
expect(media.H263Profile.H263_PROFILE_BASELINE).assertEqual(1);
expect(media.H263Profile.H263_PROFILE_H320_CODING).assertEqual(2);
expect(media.H263Profile.H263_PROFILE_HIGH_COMPRESSION).assertEqual(3);
expect(media.H263Profile.H263_PROFILE_HIGH_LATENCY).assertEqual(4);
expect(media.H263Profile.H263_PROFILE_ISW_V2).assertEqual(5);
expect(media.H263Profile.H263_PROFILE_ISW_V3).assertEqual(6);
expect(media.H263Profile.H263_PROFILE_INTERLACE).assertEqual(7);
expect(media.H263Profile.H263_PROFILE_INTERNET).assertEqual(8);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG2Profile_0100
* @tc.name : 006.MPEG2Profile
* @tc.desc : Test Enumerate MPEG2Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG2Profile_0100', 0, async function (done) {
expect(media.MPEG2Profile.MPEG2_PROFILE_422).assertEqual(0);
expect(media.MPEG2Profile.MPEG2_PROFILE_HIGH).assertEqual(1);
expect(media.MPEG2Profile.MPEG2_PROFILE_MAIN).assertEqual(2);
expect(media.MPEG2Profile.MPEG2_PROFILE_SNR).assertEqual(3);
expect(media.MPEG2Profile.MPEG2_PROFILE_SIMPLE).assertEqual(4);
expect(media.MPEG2Profile.MPEG2_PROFILE_SPATIAL).assertEqual(5);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG4Profile_0100
* @tc.name : 007.MPEG4Profile
* @tc.desc : Test Enumerate MPEG4Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_MPEG4Profile_0100', 0, async function (done) {
expect(media.MPEG4Profile.MPEG4_PROFILE_ADVANCED_CODING).assertEqual(0);
expect(media.MPEG4Profile.MPEG4_PROFILE_ADVANCED_CORE).assertEqual(1);
expect(media.MPEG4Profile.MPEG4_PROFILE_ADVANCED_REAL_TIME).assertEqual(2);
expect(media.MPEG4Profile.MPEG4_PROFILE_ADVANCED_SCALABLE).assertEqual(3);
expect(media.MPEG4Profile.MPEG4_PROFILE_ADVANCED_SIMPLE).assertEqual(4);
expect(media.MPEG4Profile.MPEG4_PROFILE_BASIC_ANIMATED).assertEqual(5);
expect(media.MPEG4Profile.MPEG4_PROFILE_CORE).assertEqual(6);
expect(media.MPEG4Profile.MPEG4_PROFILE_CORE_SCALABLE).assertEqual(7);
expect(media.MPEG4Profile.MPEG4_PROFILE_HYBRID).assertEqual(8);
expect(media.MPEG4Profile.MPEG4_PROFILE_MAIN).assertEqual(9);
expect(media.MPEG4Profile.MPEG4_PROFILE_NBIT).assertEqual(10);
expect(media.MPEG4Profile.MPEG4_PROFILE_SCALABLE_TEXXTURE).assertEqual(11);
expect(media.MPEG4Profile.MPEG4_PROFILE_SIMPLE).assertEqual(12);
expect(media.MPEG4Profile.MPEG4_PROFILE_SIMPLE_FBA).assertEqual(13);
expect(media.MPEG4Profile.MPEG4_PROFILE_SIMPLE_FACE).assertEqual(14);
expect(media.MPEG4Profile.MPEG4_PROFILE_SIMPLE_SCALABLE).assertEqual(15);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_VideoPixelFormat_0100
* @tc.name : 009.VideoPixelFormat
* @tc.desc : Test Enumerate VideoPixelFormat
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_VideoPixelFormat_0100', 0, async function (done) {
expect(media.VideoPixelFormat.YUVI420).assertEqual(1);
expect(media.VideoPixelFormat.NV12).assertEqual(2);
expect(media.VideoPixelFormat.NV21).assertEqual(3);
expect(media.VideoPixelFormat.SURFACE_FORMAT).assertEqual(4);
done();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_ENUM_VP8Profile_0100
* @tc.name : 010.VP8Profile
* @tc.desc : Test Enumerate VP8Profile
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_ENUM_VP8Profile_0100', 0, async function (done) {
expect(media.VP8Profile.VP8_PROFILE_MAIN).assertEqual(0);
done();
})
})
......@@ -31,15 +31,24 @@ describe('VideoDecoderFuncCallbackTest', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
const H263_FRAME_SIZE =
[ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244,
5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165,
......@@ -122,13 +131,16 @@ describe('VideoDecoderFuncCallbackTest', function () {
console.info(`in case error failCallback called, errMessage is ${error.message}`);
expect(err).assertUndefined();
}
let failCatch = function(err) {
console.info(`in case error failCatch called,errMessage is ${error.message}`);
expect(err).assertUndefined();
}
function msleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function toDisplayPage() {
let path = 'pages/display/display';
let options = {
......@@ -140,6 +152,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console.error('in case toDisplayPage' + e);
}
}
function readFile(path){
console.info('in case : read file start execution');
try {
......@@ -343,51 +356,19 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_H264_CALLBACK_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'pixel_format': 4,
'frame_rate': 30.00,
'max_input_size': 150000,
}
media.createVideoDecoderByMime('video/avc', (err, processor) => {
expect(err).assertUndefined();
console.info('in case : createVideoDecoderByMime success');
videoDecodeProcessor = processor;
eventEmitter.emit('configure', mediaDescription, srcPath,
function() {
eventEmitter.emit('stop', done);
},
done);
});
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_H263_CALLBACK_0100
* @tc.name : 001.basic Video decode function
* @tc.desc : start-> EOS -> stop -> reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_H263_CALLBACK_0100', 0, async function (done) {
ES_FRAME_SIZE = H263_FRAME_SIZE;
let srcPath = BASIC_PATH + 'h263_1408_1152.es';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/h263',
'width': 1408,
'height': 1152,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 60.00,
'max_input_size': 150000,
}
media.createVideoDecoderByMime('video/h263', (err, processor) => {
media.createVideoDecoderByMime('video/avc', (err, processor) => {
expect(err).assertUndefined();
console.info('in case : createVideoDecoderByMime success');
videoDecodeProcessor = processor;
......
......@@ -32,15 +32,24 @@ describe('VideoDecoderFuncPromiseTest', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
const H263_FRAME_SIZE =
[ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244,
5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165,
......@@ -341,50 +350,19 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_H264_PROMISE_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'pixel_format': 4,
'frame_rate': 30.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByMime('video/avc', done);
await toGetVideoDecoderCaps();
await toConfigure(mediaDescription, srcPath);
await toSetOutputSurface(true);
setCallback(
function(){eventEmitter.emit('nextStep', done);}
);
await toPrepare();
await toStart();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_H263_PROMISE_0100
* @tc.name : 001.basic Video decode function
* @tc.desc : start-> EOS -> stop -> reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_H263_PROMISE_0100', 0, async function (done) {
ES_FRAME_SIZE = H263_FRAME_SIZE;
let srcPath = BASIC_PATH + 'h263_1408_1152.es';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/h263',
'width': 1408,
'height': 1152,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 60.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByMime('video/h263', done);
await toCreateVideoDecoderByMime('video/avc', done);
await toGetVideoDecoderCaps();
await toConfigure(mediaDescription, srcPath);
await toSetOutputSurface(true);
......@@ -466,16 +444,16 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 30.00,
'frame_rate': 60.00,
'max_input_size': 150000,
}
let array = new Array();
......
......@@ -46,26 +46,34 @@ describe('VideoDecoderReliCallbackTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 30,
'frame_rate': 60,
'max_input_size': 150000,
}
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
let ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
beforeAll(function() {
console.info('beforeAll case');
})
......
......@@ -46,25 +46,34 @@ describe('VideoDecoderReliPromiseTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 4,
'frame_rate': 30,
'frame_rate': 60,
'max_input_size': 150000,
}
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
let ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
const H264_FRAME_SIZE_60FPS_320 =
[2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
beforeAll(function() {
console.info('beforeAll case');
})
......
......@@ -31,7 +31,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_240 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
......@@ -65,13 +65,6 @@ describe('VideoDecoderFuncCallbackTest', function () {
295, 213, 170, 3568, 305, 198, 166, 3641, 297, 172, 148, 3608, 301, 200, 159, 3693, 322, 209, 166, 3453,
318, 206, 162, 3696, 341, 200, 176, 3386, 320, 192, 176, 3903, 373, 207, 187, 3305, 361, 200, 202, 3110,
367, 220, 197, 2357, 332, 196, 201, 1827, 377, 187, 199, 860, 472, 173, 223, 238];
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
const H263_FRAME_SIZE =
[ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244,
5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165,
......@@ -336,50 +329,19 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H264_CALLBACK_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'pixel_format': 3,
'frame_rate': 30.00,
'max_input_size': 150000,
}
media.createVideoDecoderByName('avdec_h264', (err, processor) => {
expect(err).assertUndefined();
console.info('in case : createVideoDecoderByName success');
videoDecodeProcessor = processor;
eventEmitter.emit('configure', mediaDescription, srcPath,
function() {
eventEmitter.emit('stop', done);
}, done);
});
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H263_CALLBACK_0100
* @tc.name : 001.basic Video decode function
* @tc.desc : start-> EOS -> stop -> reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H263_CALLBACK_0100', 0, async function (done) {
ES_FRAME_SIZE = H263_FRAME_SIZE;
let srcPath = BASIC_PATH + 'h263_1408_1152.es';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/h263',
'width': 1408,
'height': 1152,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'max_input_size': 150000,
}
media.createVideoDecoderByName('avdec_h263', (err, processor) => {
media.createVideoDecoderByName('avdec_h264', (err, processor) => {
expect(err).assertUndefined();
console.info('in case : createVideoDecoderByName success');
videoDecodeProcessor = processor;
......@@ -461,14 +423,14 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_01_0600', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'max_input_size': 150000,
......@@ -523,16 +485,16 @@ describe('VideoDecoderFuncCallbackTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_CALLBACK_01_0700', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 30.00,
'frame_rate': 60.00,
'max_input_size': 150000,
}
eventEmitter.on('stop_for_callback_01_0700', (done) => {
......
......@@ -32,7 +32,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_240 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
......@@ -66,13 +66,6 @@ describe('VideoDecoderFuncPromiseTest', function () {
295, 213, 170, 3568, 305, 198, 166, 3641, 297, 172, 148, 3608, 301, 200, 159, 3693, 322, 209, 166, 3453,
318, 206, 162, 3696, 341, 200, 176, 3386, 320, 192, 176, 3903, 373, 207, 187, 3305, 361, 200, 202, 3110,
367, 220, 197, 2357, 332, 196, 201, 1827, 377, 187, 199, 860, 472, 173, 223, 238];
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
const H263_FRAME_SIZE =
[ 96618, 3515, 4132, 4336, 4646, 3497, 4430, 5437, 7560, 4613, 4876, 4734, 53617, 4079, 4507, 5222, 6244,
5843, 6601, 6622, 6751, 6539, 7666, 7706, 53977, 7311, 12906, 10308, 26791, 15983, 34794, 22110, 37165,
......@@ -338,49 +331,19 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H264_PROMISE_0100', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'pixel_format': 3,
'frame_rate': 30.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByName('avdec_h264', done);
await toConfigure(mediaDescription, srcPath);
await toSetOutputSurface(true);
setCallback(
function(){eventEmitter.emit('nextStep', done);}
);
await toPrepare();
await toStart();
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H263_PROMISE_0100
* @tc.name : 001.basic Video decode function
* @tc.desc : start-> EOS -> stop -> reset
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_H263_PROMISE_0100', 0, async function (done) {
ES_FRAME_SIZE = H263_FRAME_SIZE;
let srcPath = BASIC_PATH + 'h263_1408_1152.es';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/h263',
'width': 1408,
'height': 1152,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByName('avdec_h263', done);
await toCreateVideoDecoderByName('avdec_h264', done);
await toConfigure(mediaDescription, srcPath);
await toSetOutputSurface(true);
setCallback(
......@@ -459,16 +422,16 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_01_0600', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 30.00,
'frame_rate': 60.00,
'max_input_size': 150000,
}
await toCreateVideoDecoderByName('avdec_h264', done);
......@@ -519,14 +482,14 @@ describe('VideoDecoderFuncPromiseTest', function () {
* @tc.level : Level0
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_DECODER_FUNCTION_PROMISE_01_0700', 0, async function (done) {
ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
ES_FRAME_SIZE = H264_FRAME_SIZE_240;
isCodecData = true;
let srcPath = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
let srcPath = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'max_input_size': 150000,
......
......@@ -46,26 +46,34 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 30,
'frame_rate': 60,
'max_input_size': 150000,
}
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
let ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
beforeAll(function() {
console.info('beforeAll case');
})
......
......@@ -46,25 +46,35 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_1920_1080_30fps_3s.h264';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
'codec_mime': 'video/avc',
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 30,
'frame_rate': 60,
'max_input_size': 150000,
}
const H264_FRAME_SIZE_30FPS_1080 =
[ 3491, 115184, 9423, 1046, 19038, 2059, 2306, 28773, 4815, 1670, 31464, 6322, 2969, 3518, 38279, 8419, 4463,
4554, 35457, 7848, 3870, 4235, 32523, 7606, 3992, 4132, 58148, 10144, 7625, 6051, 38774, 8929, 5309, 5784,
45250, 8696, 5511, 5224, 36732, 8221, 4885, 5103, 40075, 9799, 5259, 5373, 39394, 10406, 5016, 5572, 60935,
13292, 6469, 7040, 45344, 12370, 5825, 6712, 47052, 12502, 6800, 7453, 52653, 14088, 7257, 8931, 46638, 13277,
7612, 8663, 44022, 13672, 7763, 7784, 51638, 14118, 8112, 6458, 41013, 12910, 6759, 6974, 38409, 12813, 6785,
6934, 33390, 12910, 6825, 6954, 21092, 13599, 6968, 7937];
let ES_FRAME_SIZE = H264_FRAME_SIZE_30FPS_1080;
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465, 321, 72, 472, 68, 76, 79, 509, 90, 677, 88, 956, 99, 347, 77, 452, 681, 81, 1263, 94, 106, 97,
998, 97, 797, 93, 1343, 150, 116, 117, 926, 1198, 128, 110, 78, 1582, 158, 135, 112, 1588, 165, 132,
128, 1697, 168, 149, 117, 1938, 170, 141, 142, 1830, 106, 161, 122, 1623, 160, 154, 156, 1998, 230,
177, 139, 1650, 186, 128, 134, 1214, 122, 1411, 120, 1184, 128, 1591, 195, 145, 105, 1587, 169, 140,
118, 1952, 177, 150, 161, 1437, 159, 123, 1758, 180, 165, 144, 1936, 214, 191, 175, 2122, 180, 179,
160, 1927, 161, 184, 119, 1973, 218, 210, 129, 1962, 196, 127, 154, 2308, 173, 127, 1572, 142, 122,
2065, 262, 159, 206, 2251, 269, 179, 170, 2056, 308, 168, 191, 2090, 303, 191, 110, 1932, 272, 162,
122, 1877, 245, 167, 141, 1908, 294, 162, 118, 1493, 132, 1782, 273, 184, 133, 1958, 274, 180, 149,
2070, 216, 169, 143, 1882, 224, 149, 139, 1749, 277, 184, 139, 2141, 197, 170, 140, 2002, 269, 162,
140, 1862, 202, 179, 131, 1868, 214, 164, 140, 1546, 226, 150, 130, 1707, 162, 146, 1824, 181, 147,
130, 1898, 209, 143, 131, 1805, 180, 148, 106, 1776, 147, 141, 1572, 177, 130, 105, 1776, 178, 144,
122, 1557, 142, 124, 114, 1436, 143, 126, 1326, 127, 1755, 169, 127, 105, 1807, 177, 131, 134, 1613,
187, 137, 136, 1314, 134, 118, 2005, 194, 129, 147, 1566, 185, 132, 131, 1236, 174, 137, 106, 11049,
574, 126, 1242, 188, 130, 119, 1450, 187, 137, 141, 1116, 124, 1848, 138, 122, 1605, 186, 127, 140,
1798, 170, 124, 121, 1666, 157, 128, 130, 1678, 135, 118, 1804, 169, 135, 125, 1837, 168, 124, 124];
let ES_FRAME_SIZE = H264_FRAME_SIZE_60FPS_320;
beforeAll(function() {
console.info('beforeAll case');
})
......
......@@ -17,13 +17,12 @@
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results",
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results/",
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder",
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/*",
"setenforce 0"
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/*"
],
"teardown-command":[
"setenforce 1"
]
},
{
......
......@@ -272,9 +272,9 @@ describe('videoEncoderSoftwareMultiInstances', function () {
console.info("case test multiple encoder instances");
let savepath = BASIC_PATH + '0100.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......
......@@ -268,10 +268,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let mime = 'video/mp4v-es';
let mediaDescription = {
"codec_mime": 'video/mp4v-es',
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60,
'frame_rate': 30,
}
media.getMediaCapability((err, mediaCaps) => {
expect(err).assertUndefined();
......@@ -329,10 +329,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0100.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
finalFrameId = 50;
media.createVideoEncoderByName(name, (err, processor) => {
......@@ -365,10 +365,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0200.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
reStart = true;
media.createVideoEncoderByName(name, (err, processor) => {
......@@ -401,10 +401,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0300.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
finalFrameId = 50;
reStart = true;
......@@ -438,10 +438,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0400.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
finalFrameId = 50;
media.createVideoEncoderByName(name, (err, processor) => {
......@@ -474,10 +474,10 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0500.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
media.createVideoEncoderByName(name, (err, processor) => {
expect(err).assertUndefined();
......@@ -509,15 +509,15 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
let decPath = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0600.es';
let name= 'avenc_mpeg4';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60.00,
'frame_rate': 30.00,
}
let decPath2 = BASIC_PATH + 'SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_FUNCTION_CALLBACK_01_0600_2.es';
let mediaDescription2 = {
'width': 1920,
'height': 1080,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 30.00,
}
......
......@@ -331,9 +331,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test stop after last frame");
let savepath = BASIC_PATH + '0000.es';
let name= 'avenc_mpeg4';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"codec_mime": 'video/mp4v-es',
"width": width,
......@@ -396,9 +396,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test stop at runnning state and reset");
let savepath = BASIC_PATH + '0100.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -435,9 +435,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("test stop at end of stream and restart");
let savepath = BASIC_PATH + '0200.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -475,9 +475,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("test stop at runnning state and restart");
let savepath = BASIC_PATH + '0300.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -516,16 +516,16 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test flush at running state");
let savepath = BASIC_PATH + '0400.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
"pixel_format": 3,
"frame_rate" : framerate,
}
frameTotal = 1000;
frameTotal = 500;
await toCreateByMime(mime, done);
await toGetVideoEncoderCaps(width, height);
toCreateStream();
......@@ -536,7 +536,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
await toPrepare();
toStartStream();
await toStart();
await sleep(1000);
await sleep(500);
await toFlush();
})
......@@ -552,9 +552,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test flush at end of stream");
let savepath = BASIC_PATH + '0500.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -574,7 +574,6 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream();
await toStart();
await sleep(5000);
toStopStream();
resetParam();
toSetStreamParam(width, height, framerate, frameTotal);
toStartStream();
......@@ -592,9 +591,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test reconfigure");
let savepath = BASIC_PATH + '0600.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -614,10 +613,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream();
await toStart();
await sleep(5000);
toStopStream();
resetParam();
width = 720;
height = 480;
width = 320;
height = 240;
framerate = 30;
let mediaDescription2 = {
"width": width,
......@@ -647,9 +645,9 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info("case test recreate videoencoder");
let savepath = BASIC_PATH + '0700.es';
let mime = 'video/mp4v-es';
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -669,11 +667,10 @@ describe('videoSoftwareEncoderFuncPromise', function () {
toStartStream();
await toStart();
await sleep(5000);
toStopStream();
await toRelease();
resetParam();
width = 720;
height = 480;
width = 320;
height = 240;
framerate = 30;
let mediaDescription2 = {
"width": width,
......
......@@ -53,10 +53,10 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
const ROOT = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results/';
const BASIC_PATH = ROOT + 'video_reliability_callback_';
let mediaDescription = {
'width': 720,
'height': 480,
'width': 320,
'height': 240,
'pixel_format': 3,
'frame_rate': 60,
'frame_rate': 30,
}
beforeAll(function() {
console.info('beforeAll case');
......@@ -1447,14 +1447,14 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
})
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOOPLOOP_CALLBACK_0100
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_CALLBACK_0100
* @tc.name : 001. total loop for 50 times
* @tc.desc : Reliability Test
* @tc.size : MediumTest
* @tc.type : Reliability
* @tc.level : Level2
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CREATE-RELEASE_CALLBACK_0100', 0, async function (done) {
it('SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_TOTALLOOP_CALLBACK_0100', 0, async function (done) {
let name = 'avenc_mpeg4';
let events = require('events');
let eventEmitter = new events.EventEmitter();
......
......@@ -49,9 +49,9 @@ describe('videoEncoderReliabilityPromise', function () {
const WAITFORALLOUTS = 14;
const JUDGE_EOS = 15;
const WAITTIME = 3000;
let width = 720;
let height = 480;
let framerate = 60;
let width = 320;
let height = 240;
let framerate = 30;
let mediaDescription = {
"width": width,
"height": height,
......@@ -75,9 +75,9 @@ describe('videoEncoderReliabilityPromise', function () {
sawOutputEOS = false;
needGetMediaDes = false;
workdoneAtEOS = false;
width = 720;
height = 480;
framerate = 60;
width = 320;
height = 240;
framerate = 30;
frameTotal = 100;
})
......@@ -459,7 +459,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_CONFIGURE_PROMISE_0200', 0, async function (done) {
let savepath = BASIC_PATH + 'configure_0200.es';
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, CONFIGURE, ERROR, STOPSTREAM, END);
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, CONFIGURE, ERROR, END);
createVideoEncoder(savepath, mySteps, done);
})
......@@ -590,7 +590,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0200', 0, async function (done) {
let savepath = BASIC_PATH + 'prepare_0200.es';
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, STOPSTREAM, END);
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, END);
createVideoEncoder(savepath, mySteps, done);
})
......@@ -604,7 +604,7 @@ describe('videoEncoderReliabilityPromise', function () {
*/
it('SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_API_PREPARE_PROMISE_0300', 0, async function (done) {
let savepath = BASIC_PATH + 'prepare_0300.es';
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, PREPARE, ERROR, STOPSTREAM, END);
let mySteps = new Array(CONFIGURE, GETSURFACE, SETSTREAMPARAM, PREPARE, PREPARE, ERROR, END);
createVideoEncoder(savepath, mySteps, done);
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册