未验证 提交 fdfc1554 编写于 作者: O openharmony_ci 提交者: Gitee

!2369 api modify

Merge pull request !2369 from ling990/ling990
......@@ -4,9 +4,16 @@
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.audio.audiodecoder",
"shell-timeout": "60000"
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAudioDecoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
......@@ -19,7 +26,7 @@
"./resource/audio/audioDecode/vorbis.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/"
]
},
{
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audiodecoder/results",
......@@ -29,13 +36,6 @@
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsAudioDecoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
}
\ No newline at end of file
......@@ -131,37 +131,9 @@ describe('AudioDecoderEnum', function () {
done();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100
* @tc.name : 003.AudioRawFormat
* @tc.desc : Test Enumerate AudioRawFormat
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
*/
it('SUB_MEDIA_AUDIO_DECODER_ENUM_AudioRawFormat_0100', 0, async function (done) {
expect(media.AudioRawFormat.AUDIO_PCM_S8).assertEqual(1);
expect(media.AudioRawFormat.AUDIO_PCM_8).assertEqual(2);
expect(media.AudioRawFormat.AUDIO_PCM_S16_BE).assertEqual(3);
expect(media.AudioRawFormat.AUDIO_PCM_S16_LE).assertEqual(4);
expect(media.AudioRawFormat.AUDIO_PCM_16_BE).assertEqual(5);
expect(media.AudioRawFormat.AUDIO_PCM_16_LE).assertEqual(6);
expect(media.AudioRawFormat.AUDIO_PCM_S24_BE).assertEqual(7);
expect(media.AudioRawFormat.AUDIO_PCM_S24_LE).assertEqual(8);
expect(media.AudioRawFormat.AUDIO_PCM_24_BE).assertEqual(9);
expect(media.AudioRawFormat.AUDIO_PCM_24_LE).assertEqual(10);
expect(media.AudioRawFormat.AUDIO_PCM_S32_BE).assertEqual(11);
expect(media.AudioRawFormat.AUDIO_PCM_S32_LE).assertEqual(12);
expect(media.AudioRawFormat.AUDIO_PCM_32_BE).assertEqual(13);
expect(media.AudioRawFormat.AUDIO_PCM_32_LE).assertEqual(14);
expect(media.AudioRawFormat.AUDIO_PCM_F32_BE).assertEqual(15);
expect(media.AudioRawFormat.AUDIO_PCM_F32_LE).assertEqual(16);
done();
})
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_AVCodecType_0100
* @tc.name : 004.AVCodecType
* @tc.name : 003.AVCodecType
* @tc.desc : Test Enumerate AVCodecType
* @tc.size : MediumTest
* @tc.type : Function test
......@@ -177,7 +149,7 @@ describe('AudioDecoderEnum', function () {
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_ENUM_CodecMimeType_0100
* @tc.name : 005.CodecMimeType
* @tc.name : 004.CodecMimeType
* @tc.desc : Test Enumerate CodecMimeType
* @tc.size : MediumTest
* @tc.type : Function test
......
......@@ -134,7 +134,7 @@ describe('AudioDecoderFormatCallback', function () {
timestamp += ES[frameCnt]/samplerate;
}
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject, () => {
audioDecodeProcessor.pushInputData(inputobject, () => {
console.info('queueInput success');
})
}
......@@ -165,7 +165,7 @@ describe('AudioDecoderFormatCallback', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.log("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject, () => {
audioDecodeProcessor.freeOutputBuffer(outputobject, () => {
console.info('release output success');
})
}
......@@ -173,12 +173,12 @@ describe('AudioDecoderFormatCallback', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info("inputBufferAvailable");
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info("outputBufferAvailable");
if (needGetMediaDes) {
audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
......@@ -193,7 +193,7 @@ describe('AudioDecoderFormatCallback', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -213,7 +213,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'aac_01.pcm';
needGetMediaDes = true;
......@@ -330,7 +330,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'aac_02.pcm';
needGetMediaDes = true;
......@@ -447,7 +447,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'flac_01.pcm';
needGetMediaDes = true;
......@@ -521,7 +521,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'flac_02.pcm';
needGetMediaDes = true;
......@@ -595,7 +595,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'mp3_01.pcm';
needGetMediaDes = true;
......@@ -656,7 +656,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'mp3_02.pcm';
needGetMediaDes = true;
......@@ -717,7 +717,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'vorbis_01.pcm';
needGetMediaDes = true;
......@@ -821,7 +821,7 @@ describe('AudioDecoderFormatCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'vorbis_02.pcm';
needGetMediaDes = true;
......
......@@ -144,7 +144,7 @@ describe('AudioDecoderFormatPromise', function () {
timestamp += ES[frameCnt]/samplerate;
}
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject).then(() => {
audioDecodeProcessor.pushInputData(inputobject).then(() => {
console.info("queueInput success")
})
}
......@@ -173,7 +173,7 @@ describe('AudioDecoderFormatPromise', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.log("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject).then(() => {
audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
})
}
......@@ -181,12 +181,12 @@ describe('AudioDecoderFormatPromise', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info("inputBufferAvailable");
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info("outputBufferAvailable");
if (needGetMediaDes) {
audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
......@@ -200,7 +200,7 @@ describe('AudioDecoderFormatPromise', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -218,7 +218,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'aac_01.pcm';
needGetMediaDes = true;
......@@ -316,7 +316,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'aac_02.pcm';
needGetMediaDes = true;
......@@ -414,7 +414,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'flac_01.pcm';
needGetMediaDes = true;
......@@ -470,7 +470,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'flac_02.pcm';
needGetMediaDes = true;
......@@ -526,7 +526,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'mp3_01.pcm';
needGetMediaDes = true;
......@@ -567,7 +567,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'mp3_02.pcm';
needGetMediaDes = true;
......@@ -608,7 +608,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'vorbis_01.pcm';
needGetMediaDes = true;
......@@ -693,7 +693,7 @@ describe('AudioDecoderFormatPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + 'vorbis_02.pcm';
needGetMediaDes = true;
......
......@@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () {
}
timestamp += ES[frameCnt]/samplerate;
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject, () => {
audioDecodeProcessor.pushInputData(inputobject, () => {
console.info('queueInput success');
})
}
......@@ -411,7 +411,7 @@ describe('AudioDecoderFuncCallback', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject, () => {
audioDecodeProcessor.freeOutputBuffer(outputobject, () => {
console.info('release output success');
})
}
......@@ -419,12 +419,12 @@ describe('AudioDecoderFuncCallback', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needGetMediaDes){
audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
......@@ -440,7 +440,7 @@ describe('AudioDecoderFuncCallback', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -460,7 +460,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
workdoneAtEOS = true;
needGetMediaDes = true;
......@@ -541,7 +541,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
eosframenum = 500;
workdoneAtEOS = true;
......@@ -612,7 +612,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
workdoneAtEOS = true;
let savepath = BASIC_PATH + '0200.pcm';
......@@ -678,7 +678,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
eosframenum = 200;
flushAtEOS = true;
......@@ -737,7 +737,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0400.pcm';
eventEmitter.on('getAudioDecoderCaps', () => {
......@@ -819,7 +819,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
eosframenum = 200;
let savepath = BASIC_PATH + '0500.pcm';
......@@ -898,7 +898,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
eosframenum = 200;
resetAtEOS = true;
......@@ -906,7 +906,7 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 16000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let hasreconfigured = false;
eventEmitter.on('getAudioDecoderCaps', () => {
......@@ -996,12 +996,12 @@ describe('AudioDecoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let hasrecreate = false;
eosframenum = 200;
......
......@@ -380,7 +380,7 @@ describe('AudioDecoderFuncPromise', function () {
}
timestamp += ES[frameCnt]/samplerate;
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject).then(() => {
audioDecodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -409,7 +409,7 @@ describe('AudioDecoderFuncPromise', function () {
writeFile(savapath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject).then(() => {
audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -417,12 +417,12 @@ describe('AudioDecoderFuncPromise', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
console.info("outputbuffer.flags: " + outBuffer.flags);
if (needGetMediaDes) {
......@@ -437,7 +437,7 @@ describe('AudioDecoderFuncPromise', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -455,7 +455,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0000.pcm';
workdoneAtEOS = true;
......@@ -513,7 +513,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0100.pcm';
eosframenum = 500;
......@@ -553,7 +553,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0200.pcm';
workdoneAtEOS = true;
......@@ -598,7 +598,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0300.pcm';
eosframenum = 200;
......@@ -637,7 +637,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0400.pcm';
await media.createAudioDecoderByMime('audio/mp4a-latm').then((processor) => {
......@@ -687,7 +687,7 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0500.pcm';
eosframenum = 200;
......@@ -741,12 +741,12 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 16000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0600.pcm';
eosframenum = 200;
......@@ -818,12 +818,12 @@ describe('AudioDecoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 4,
"audio_sample_format": 1,
}
let savepath = BASIC_PATH + '0700.pcm';
eosframenum = 200;
......
......@@ -173,7 +173,7 @@ describe('AudioDecoderMultiInstances', function () {
}
timestamp += ES[frameCnt]/samplerate;
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject).then(() => {
audioDecodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -202,7 +202,7 @@ describe('AudioDecoderMultiInstances', function () {
writeFile(savapath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject).then(() => {
audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -210,12 +210,12 @@ describe('AudioDecoderMultiInstances', function () {
function setCallback(audioDecodeProcessor, savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(audioDecodeProcessor, inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
console.info("outputbuffer.flags: " + outBuffer.flags);
if (needGetMediaDes) {
......@@ -230,14 +230,14 @@ describe('AudioDecoderMultiInstances', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_DECODER_MULTIINSTANCE_0100
* @tc.name : 001.create 16 decoder
* @tc.name : 001.create multiple decoders
* @tc.desc : basic decode function
* @tc.size : MediumTest
* @tc.type : Function test
......@@ -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,8 @@ describe('AudioDecoderMultiInstances', function () {
}
}, failCallback).catch(failCatch);
}
console.info('case has created 16 decoders');
console.info('case array: ' + array);
for (let j = 0; j < 16; j++) {
console.info('case has created multiple decoders');
for (let j = 0; j < 2; j++) {
resetParam();
await array[j].reset().then(() => {
console.info("reset decoder " + j);
......
......@@ -144,7 +144,7 @@ describe('AudioDecoderReliabilityCallback', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
};
beforeAll(function() {
......@@ -520,7 +520,7 @@ describe('AudioDecoderReliabilityCallback', function () {
}
timestamp += ES[frameCnt]/samplerate;
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject, () => {
audioDecodeProcessor.pushInputData(inputobject, () => {
console.info('queueInput success');
})
}
......@@ -541,7 +541,7 @@ describe('AudioDecoderReliabilityCallback', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject, () => {
audioDecodeProcessor.freeOutputBuffer(outputobject, () => {
console.info('release output success');
})
}
......@@ -549,12 +549,12 @@ describe('AudioDecoderReliabilityCallback', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needGetMediaDes) {
audioDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
......@@ -570,7 +570,7 @@ describe('AudioDecoderReliabilityCallback', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......
......@@ -145,7 +145,7 @@ describe('AudioDecoderReliabilityPromise', function () {
let mediaDescription = {
"channel_count": 2,
"sample_rate": 44100,
"audio_raw_format": 4,
"audio_sample_format": 1,
};
let expectError = false;
......@@ -522,7 +522,7 @@ describe('AudioDecoderReliabilityPromise', function () {
}
timestamp += ES[frameCnt]/samplerate;
frameCnt += 1;
audioDecodeProcessor.queueInput(inputobject).then(() => {
audioDecodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -544,7 +544,7 @@ describe('AudioDecoderReliabilityPromise', function () {
writeFile(savapath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioDecodeProcessor.releaseOutput(outputobject).then(() => {
audioDecodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -552,12 +552,12 @@ describe('AudioDecoderReliabilityPromise', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioDecodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioDecodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioDecodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioDecodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needGetMediaDes) {
audioDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
......@@ -571,7 +571,7 @@ describe('AudioDecoderReliabilityPromise', function () {
audioDecodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioDecodeProcessor.on('outputFormatChanged',(format) => {
audioDecodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......
......@@ -4,9 +4,16 @@
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.audio.audioencoder",
"shell-timeout": "60000"
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAudioEncoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
......@@ -16,7 +23,7 @@
"./resource/audio/audioEncode/S32LE_2.pcm ->/data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/"
]
},
{
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.audio.audioencoder/results",
......@@ -26,13 +33,6 @@
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsAudioEncoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
}
\ No newline at end of file
......@@ -224,7 +224,7 @@ describe('AudioEncoderFuncCallback', function () {
}
timestamp += 23;
frameCnt += 1;
audioEncodeProcessor.queueInput(inputobject, () => {
audioEncodeProcessor.pushInputData(inputobject, () => {
console.info('queueInput success');
})
}
......@@ -252,7 +252,7 @@ describe('AudioEncoderFuncCallback', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioEncodeProcessor.releaseOutput(outputobject, () => {
audioEncodeProcessor.freeOutputBuffer(outputobject, () => {
console.info('release output success');
})
}
......@@ -260,12 +260,12 @@ describe('AudioEncoderFuncCallback', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioEncodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioEncodeProcessor.on('needInputData', async(inBuffer) => {
console.info('case inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('case outputBufferAvailable');
if (needGetMediaDes) {
audioEncodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
......@@ -281,7 +281,7 @@ describe('AudioEncoderFuncCallback', function () {
audioEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioEncodeProcessor.on('outputFormatChanged',(format) => {
audioEncodeProcessor.on('streamChanged',(format) => {
console.info('case Output format changed: ' + format);
});
}
......@@ -301,7 +301,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let mediaDescription2 = {
"codec_mime": 'audio/mp4a-latm',
......@@ -384,7 +384,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0100.es';
eosframenum = 500;
......@@ -442,7 +442,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0200.es';
workdoneAtEOS = true;
......@@ -508,7 +508,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0300.es';
eosframenum = 500;
......@@ -566,7 +566,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0400.es';
eventEmitter.on('getAudioEncoderCaps', () => {
......@@ -648,7 +648,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0500.es';
eosframenum = 100;
......@@ -727,7 +727,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + 'callback0600.es';
eosframenum = 100;
......@@ -735,7 +735,7 @@ describe('AudioEncoderFuncCallback', function () {
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let hasreconfigured = false;
eventEmitter.on('getAudioEncoderCaps', () => {
......
......@@ -231,7 +231,7 @@ describe('AudioEncoderFuncPromise', function () {
}
timestamp += 23;
frameCnt += 1;
audioEncodeProcessor.queueInput(inputobject).then(() => {
audioEncodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -260,7 +260,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioEncodeProcessor.releaseOutput(outputobject).then(() => {
audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -268,12 +268,12 @@ describe('AudioEncoderFuncPromise', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioEncodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioEncodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueInputs(inputQueue);
});
audioEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needgetMediaDes) {
audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
......@@ -288,7 +288,7 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioEncodeProcessor.on('outputFormatChanged',(format) => {
audioEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -306,7 +306,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let mediaDescription2 = {
"codec_mime": 'audio/mp4a-latm',
......@@ -371,7 +371,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0100.es';
eosframenum = 500;
......@@ -410,7 +410,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0200.es';
workdoneAtEOS = true;
......@@ -455,7 +455,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0300.es';
eosframenum = 500;
......@@ -494,7 +494,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0400.es';
await media.createAudioEncoderByMime('audio/mp4a-latm').then((processor) => {
......@@ -544,7 +544,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0500.es';
eosframenum = 100;
......@@ -598,7 +598,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
let savepath = BASIC_PATH + '0600.es';
eosframenum = 100;
......@@ -625,7 +625,7 @@ describe('AudioEncoderFuncPromise', function () {
let mediaDescription2 = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
}
await sleep(10000).then(() => {
console.info("start configure 2");
......
......@@ -218,7 +218,7 @@ describe('AudioEncoderFuncPromise', function () {
}
timestamp += 23;
frameCnt += 1;
audioEncodeProcessor.queueInput(inputobject).then(() => {
audioEncodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -247,7 +247,7 @@ describe('AudioEncoderFuncPromise', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioEncodeProcessor.releaseOutput(outputobject).then(() => {
audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -255,12 +255,12 @@ describe('AudioEncoderFuncPromise', function () {
function setCallback(audioEncodeProcessor, savepath, done) {
console.info('case callback');
audioEncodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioEncodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueInputs(audioEncodeProcessor, inputQueue);
});
audioEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needgetMediaDes) {
audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
......@@ -275,14 +275,14 @@ describe('AudioEncoderFuncPromise', function () {
audioEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioEncodeProcessor.on('outputFormatChanged',(format) => {
audioEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
/* *
* @tc.number : SUB_MEDIA_AUDIO_ENCODER_MULTIINSTANCE_0100
* @tc.name : 001.create 16 encoder
* @tc.name : 001.create multiple encoder2
* @tc.desc : basic encode function
* @tc.size : MediumTest
* @tc.type : Function test
......@@ -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,8 @@ describe('AudioEncoderFuncPromise', function () {
}
}, failCallback).catch(failCatch);
}
console.info('case has created 16 encoders');
console.info('case array: ' + array);
for (let j = 0; j < 16; j++) {
console.info('case has created multiple encoders');
for (let j = 0; j < 2; j++) {
resetParam();
await array[j].reset().then(() => {
console.info("reset encoder " + j);
......
......@@ -56,7 +56,7 @@ describe('AudioEncoderSTTCallback', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
};
beforeAll(function() {
......@@ -368,7 +368,7 @@ describe('AudioEncoderSTTCallback', function () {
}
timestamp += 23;
frameCnt += 1;
audioEncodeProcessor.queueInput(inputobject, () => {
audioEncodeProcessor.pushInputData(inputobject, () => {
console.info('queueInput success');
})
}
......@@ -390,7 +390,7 @@ describe('AudioEncoderSTTCallback', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioEncodeProcessor.releaseOutput(outputobject, () => {
audioEncodeProcessor.freeOutputBuffer(outputobject, () => {
console.info('release output success');
})
}
......@@ -398,12 +398,12 @@ describe('AudioEncoderSTTCallback', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioEncodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioEncodeProcessor.on('needInputData', async(inBuffer) => {
console.info('case inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueAllInputs(inputQueue);
});
audioEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('case outputBufferAvailable');
if (needGetMediaDes) {
audioEncodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
......@@ -419,7 +419,7 @@ describe('AudioEncoderSTTCallback', function () {
audioEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioEncodeProcessor.on('outputFormatChanged',(format) => {
audioEncodeProcessor.on('streamChanged',(format) => {
console.info('case Output format changed: ' + format);
});
}
......
......@@ -56,7 +56,7 @@ describe('AudioEncoderSTTPromise', function () {
let mediaDescription = {
"channel_count": 1,
"sample_rate": 48000,
"audio_raw_format": 16,
"audio_sample_format": 3,
};
let expectError = false;
......@@ -372,7 +372,7 @@ describe('AudioEncoderSTTPromise', function () {
}
timestamp += 23;
frameCnt += 1;
audioEncodeProcessor.queueInput(inputobject).then(() => {
audioEncodeProcessor.pushInputData(inputobject).then(() => {
console.info('case queueInput success');
});
}
......@@ -395,7 +395,7 @@ describe('AudioEncoderSTTPromise', function () {
writeFile(savepath, outputobject.data, outputobject.length);
console.info("write to file success");
}
audioEncodeProcessor.releaseOutput(outputobject).then(() => {
audioEncodeProcessor.freeOutputBuffer(outputobject).then(() => {
console.info('release output success');
});
}
......@@ -403,12 +403,12 @@ describe('AudioEncoderSTTPromise', function () {
function setCallback(savepath, done) {
console.info('case callback');
audioEncodeProcessor.on('inputBufferAvailable', async(inBuffer) => {
audioEncodeProcessor.on('needInputData', async(inBuffer) => {
console.info('inputBufferAvailable');
inputQueue.push(inBuffer);
await enqueueInputs(inputQueue);
});
audioEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
audioEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (needGetMediaDes) {
audioEncodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
......@@ -423,7 +423,7 @@ describe('AudioEncoderSTTPromise', function () {
audioEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
audioEncodeProcessor.on('outputFormatChanged',(format) => {
audioEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......
# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
# 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
......
......@@ -2,11 +2,18 @@
"description": "Configuration for audioPlayer Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.audio.audioplayer",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAudioPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
......@@ -44,13 +51,6 @@
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsAudioPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2021-2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
# 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2021-2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......@@ -216,9 +216,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
*/
it('SUB_MEDIA_RECORDER_createAudioRecorder_API_0100', 0, async function (done) {
audioConfig.uri = fdPath;
let testAudioRecorder;
expect(testAudioRecorder).assertNull();
let testAudioRecorder = undefined;
testAudioRecorder= media.createAudioRecorder();
expect(testAudioRecorder != undefined).assertTrue();
done();
......@@ -233,6 +231,7 @@ describe('RecorderLocalTestAudioAPI', function () {
* @tc.level : Level2
*/
it('SUB_MEDIA_RECORDER_AudioRecorder_Prepare_API_0100', 0, async function (done) {
audioConfig.uri = fdPath;
let testAudioRecorder= media.createAudioRecorder();
expect(testAudioRecorder != null).assertTrue();
testAudioRecorder.prepare(audioConfig);
......
/*
* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* 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
......
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Copyright (C) 2022 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
......
......@@ -4,35 +4,36 @@
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.video.videodecoder",
"shell-timeout": "60000"
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsVideoDecoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./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/"
"./resource/media/es/out_1920_1080_30fps_3s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/",
"./resource/media/es/h263_1408_1152.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/",
"./resource/media/es/MPEG2_720_480.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/",
"./resource/media/es/mpeg4_320_240.es ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/",
"./resource/media/es/out_320_240_10s.h264 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/"
]
},
{
{
"type": "ShellKit",
"run-command": [
"mkdir -p /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/"
"chmod 777 -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder",
"chmod 777 /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/*"
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsVideoDecoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......
.container {
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
align-items: center;
......
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -33,7 +33,7 @@ describe('VideoDecoderEnum', function () {
let surfaceID = '';
const events = require('events');
const eventEmitter = new events.EventEmitter();
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
let ES_FRAME_SIZE = [];
const H264_FRAME_SIZE_60FPS_320 =
[ 2106, 11465];
......@@ -167,7 +167,7 @@ describe('VideoDecoderEnum', function () {
console.info('in case: setParameter success ');
}, failCallback).catch(failCatch);
}
videoDecodeProcessor.queueInput(inputObject).then(() => {
videoDecodeProcessor.pushInputData(inputObject).then(() => {
console.info('in case: queueInput success ');
}, failCallback).catch(failCatch);
}
......@@ -183,7 +183,7 @@ describe('VideoDecoderEnum', function () {
return;
}
frameCountOut++;
await videoDecodeProcessor.releaseOutput(outputObject, true).then(() => {
await videoDecodeProcessor.freeOutputBuffer(outputObject).then(() => {
console.log('in case: release output count:' + frameCountOut);
}, failCallback).catch(failCatch);
}
......@@ -191,7 +191,7 @@ describe('VideoDecoderEnum', function () {
function setCallback(nextStep){
console.info('in case: setCallback in');
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
expect(inBuffer.index !== undefined).assertTrue();
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
expect(inBuffer.data !== undefined).assertTrue();
......@@ -208,7 +208,7 @@ describe('VideoDecoderEnum', function () {
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
videoDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
console.info('get outputMediaDescription : ' + MediaDescription);
......@@ -223,7 +223,7 @@ describe('VideoDecoderEnum', function () {
console.info('in case: err.code is ' + err.code);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
console.info('in case: setCallback out');
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -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.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
let ES_FRAME_SIZE = [];
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,
......@@ -209,7 +209,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console.info('in case: setParameter success ');
});
}
videoDecodeProcessor.queueInput(inputObject, (err) => {
videoDecodeProcessor.pushInputData(inputObject, (err) => {
if (typeof (err) == 'undefined') {
console.info('in case: queueInput success ');
} else {
......@@ -229,7 +229,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true, (err) => {
videoDecodeProcessor.renderOutputData(outputObject, (err) => {
if (typeof (err) == 'undefined') {
console.log('in case: release output count:' + frameCountOut);
} else {
......@@ -241,13 +241,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function setCallback(nextStep){
console.info('in case: setCallback in');
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
videoDecodeProcessor.getOutputMediaDescription((err, MediaDescription) => {
expect(err).assertUndefined();
......@@ -261,7 +261,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
console.info('in case: setCallback out');
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -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.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
let ES_FRAME_SIZE = [];
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,
......@@ -219,7 +219,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console.info('in case: setParameter success ');
}, failCallback).catch(failCatch);
}
videoDecodeProcessor.queueInput(inputObject).then(() => {
videoDecodeProcessor.pushInputData(inputObject).then(() => {
console.info('in case: queueInput success ');
}, failCallback).catch(failCatch);
}
......@@ -235,7 +235,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return;
}
frameCountOut++;
await videoDecodeProcessor.releaseOutput(outputObject, true).then(() => {
await videoDecodeProcessor.renderOutputData(outputObject).then(() => {
console.log('in case: release output count:' + frameCountOut);
}, failCallback).catch(failCatch);
}
......@@ -243,13 +243,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function setCallback(nextStep){
console.info('in case: setCallback in');
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
videoDecodeProcessor.getOutputMediaDescription().then((MediaDescription) => {
console.info('get outputMediaDescription : ' + MediaDescription);
......@@ -262,7 +262,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
console.info('in case: setCallback out');
......@@ -437,8 +437,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_DECODER_MULTIINSTANCE_PROMISE_0100
* @tc.name : 001.creat 16 video decoder
* @tc.desc : creat 16 video decoder
* @tc.name : 001.creat multiple video decoders
* @tc.desc : creat multiple video decoders
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level0
......@@ -458,7 +458,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
}
let array = new Array();
eventEmitter.on('releaseAllDecoder', async () => {
for (let j = 0; j < 15; j++) {
for (let j = 0; j < 3; j++) {
await array[j].release().then(() => {
array[j] = null;
}, failCallback).catch(failCatch);
......@@ -469,11 +469,11 @@ describe('VideoDecoderFuncPromiseTest', function () {
videoDecodeProcessor = null;
done();
})
for (let i = 0; i < 16; i++) {
for (let i = 0; i < 3; i++) {
await media.createVideoDecoderByMime('video/avc').then((processor) => {
if (typeof (processor) != 'undefined') {
console.info('in case : createVideoDecoderByMime success');
if (i == 15) {
if (i == 2) {
videoDecodeProcessor = processor;
} else {
array[i] = processor;
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -46,7 +46,7 @@ describe('VideoDecoderReliCallbackTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
......@@ -197,7 +197,7 @@ describe('VideoDecoderReliCallbackTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject, (err) => {
videoDecodeProcessor.pushInputData(inputObject, (err) => {
console.info('in case: queueInput success ');
})
}
......@@ -215,7 +215,7 @@ describe('VideoDecoderReliCallbackTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true, () => {
videoDecodeProcessor.renderOutputData(outputObject, () => {
console.log('in case: release output count:' + frameCountOut);
})
}
......@@ -397,13 +397,13 @@ describe('VideoDecoderReliCallbackTest', function () {
}
function setCallback(nextStep){
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
await dequeueOutputs(nextStep);
......@@ -413,7 +413,7 @@ describe('VideoDecoderReliCallbackTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -46,7 +46,7 @@ describe('VideoDecoderReliPromiseTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
......@@ -202,7 +202,7 @@ describe('VideoDecoderReliPromiseTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject).then(() => {
videoDecodeProcessor.pushInputData(inputObject).then(() => {
console.info('in case: queueInput success ');
}, caseCallback).catch(failCatch);
}
......@@ -221,7 +221,7 @@ describe('VideoDecoderReliPromiseTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true).then(() => {
videoDecodeProcessor.renderOutputData(outputObject).then(() => {
console.info('in case: release output success');
console.log('in case: release output count:' + frameCountOut);
}, caseCallback).catch(failCatch);
......@@ -394,13 +394,13 @@ describe('VideoDecoderReliPromiseTest', function () {
}
function setCallback(nextStep){
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
await dequeueOutputs(nextStep);
......@@ -410,7 +410,7 @@ describe('VideoDecoderReliPromiseTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged', (format) => {
videoDecodeProcessor.on('streamChanged', (format) => {
console.info('in case: Output format changed: ' + format.toString());
});
}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -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.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
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,
......@@ -213,7 +213,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject, (err) => {
videoDecodeProcessor.pushInputData(inputObject, (err) => {
if (typeof (err) == 'undefined') {
console.info('in case: queueInput success ');
......@@ -234,7 +234,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true, (err) => {
videoDecodeProcessor.renderOutputData(outputObject, (err) => {
if (typeof (err) == 'undefined') {
console.log('in case: release output count:' + frameCountOut);
} else {
......@@ -246,13 +246,13 @@ describe('VideoDecoderFuncCallbackTest', function () {
function setCallback(nextStep){
console.info('in case: setCallback in');
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
dequeueOutputs(nextStep);
......@@ -262,7 +262,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
console.info('in case: setCallback out');
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -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.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
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,
......@@ -215,7 +215,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject).then(() => {
videoDecodeProcessor.pushInputData(inputObject).then(() => {
console.info('in case: queueInput success ');
}, failCallback).catch(failCatch);
}
......@@ -231,7 +231,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
return;
}
frameCountOut++;
await videoDecodeProcessor.releaseOutput(outputObject, true).then(() => {
await videoDecodeProcessor.renderOutputData(outputObject).then(() => {
console.log('in case: release output count:' + frameCountOut);
}, failCallback).catch(failCatch);
}
......@@ -239,13 +239,13 @@ describe('VideoDecoderFuncPromiseTest', function () {
function setCallback(nextStep){
console.info('in case: setCallback in');
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
await dequeueOutputs(nextStep);
......@@ -255,7 +255,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
console.info('in case: setCallback out');
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
......@@ -197,7 +197,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject, (err) => {
videoDecodeProcessor.pushInputData(inputObject, (err) => {
console.info('in case: queueInput success ');
})
}
......@@ -215,7 +215,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true, () => {
videoDecodeProcessor.renderOutputData(outputObject, () => {
console.log('in case: release output count:' + frameCountOut);
})
}
......@@ -398,13 +398,13 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
}
function setCallback(nextStep){
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
await dequeueOutputs(nextStep);
......@@ -414,7 +414,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged',(format) => {
videoDecodeProcessor.on('streamChanged',(format) => {
console.info('in case: Output format changed: ' + format.toString());
});
}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......@@ -46,7 +46,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
let inputEosFlag = false;
let workdoneAtEOS = false;
let surfaceID = '';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/shared/';
const BASIC_PATH = '/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videodecoder/';
const SRCPATH = BASIC_PATH + 'out_320_240_10s.h264';
let mediaDescription = {
'track_type': 1,
......@@ -204,7 +204,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
} else {
inputObject.flags = 4;
}
videoDecodeProcessor.queueInput(inputObject).then(() => {
videoDecodeProcessor.pushInputData(inputObject).then(() => {
console.info('in case: queueInput success ');
}, caseCallback).catch(failCatch);
}
......@@ -223,7 +223,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
return;
}
frameCountOut++;
videoDecodeProcessor.releaseOutput(outputObject, true).then(() => {
videoDecodeProcessor.renderOutputData(outputObject).then(() => {
console.info('in case: release output success');
console.log('in case: release output count:' + frameCountOut);
}, caseCallback).catch(failCatch);
......@@ -397,13 +397,13 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
}
function setCallback(nextStep){
videoDecodeProcessor.on('inputBufferAvailable', async (inBuffer) => {
videoDecodeProcessor.on('needInputData', async (inBuffer) => {
console.info('in case: inputBufferAvailable inBuffer.index: '+ inBuffer.index);
inputQueue.push(inBuffer);
await enqueueInputs();
});
videoDecodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoDecodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
outputQueue.push(outBuffer);
await dequeueOutputs(nextStep);
......@@ -413,7 +413,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
console.info('in case: error called,errName is' + err);
});
videoDecodeProcessor.on('outputFormatChanged', (format) => {
videoDecodeProcessor.on('streamChanged', (format) => {
console.info('in case: Output format changed: ' + format.toString());
});
}
......
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Copyright (C) 2022 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
......
......@@ -4,9 +4,16 @@
"type": "JSUnitTest",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.video.videoencoder",
"shell-timeout": "60000"
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsVideoEncoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
......@@ -14,7 +21,7 @@
"push": [
]
},
{
{
"type": "ShellKit",
"run-command": [
"rm -R /data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoencoder/results",
......@@ -24,13 +31,6 @@
],
"teardown-command":[
]
},
{
"test-file-name": [
"ActsVideoEncoderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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
......
......@@ -122,7 +122,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
console.info('not last frame, write data to file');
writeFile(path, outputObject.data, outputObject.length);
console.info("write to file success");
videoEncodeProcessor.releaseOutput(outputObject).then(() => {
videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => {
console.info('release output success');
});
}
......@@ -131,7 +131,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
function setCallback(path, nextStep) {
console.info('case callback');
videoEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
videoEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
console.info('outBuffer.flags: ' + outBuffer.flags);
if (needGetMediaDes) {
......@@ -148,7 +148,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
videoEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
videoEncodeProcessor.on('outputFormatChanged',(format) => {
videoEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......@@ -262,7 +262,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_SOFTWARE_ENCODER_MULTIINSTANCE_0100
* @tc.name : 001.create 16 encoder
* @tc.name : 001.create multiple encoders
* @tc.desc : basic encode function
* @tc.size : MediumTest
* @tc.type : Function test
......@@ -284,7 +284,7 @@ describe('videoEncoderSoftwareMultiInstances', function () {
let array = new Array();
eventEmitter.once('nextStep', async () => {
for (let j = 1; j < 16; j++) {
for (let j = 1; j < 3; j++) {
await array[j].release().then(() => {
console.info("case release encoder " + j);
array[j] = null;
......@@ -303,11 +303,11 @@ describe('videoEncoderSoftwareMultiInstances', function () {
toStartStream();
await toStart();
}
for (let i = 1; i <= 16; i += 1) {
for (let i = 1; i <= 3; i += 1) {
await media.createVideoEncoderByMime(mime).then((processor) => {
if (typeof(processor) != 'undefined') {
console.info("case create createVideoEncoder success: " + i);
if (i == 16) {
if (i == 3) {
videoEncodeProcessor = processor;
runCase();
} else {
......
......@@ -94,7 +94,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
frameCountOut++;
writeFile(path, outputObject.data, outputObject.length);
videoEncodeProcessor.releaseOutput(outputObject, (err) => {
videoEncodeProcessor.freeOutputBuffer(outputObject, (err) => {
if (typeof(err) == 'undefined') {
console.log('in case release output count:' + frameCountOut);
} else {
......@@ -112,7 +112,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
function setCallback(path, nextStep) {
console.info('case callback');
videoEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
videoEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
if (stopBuffer == false) {
outputQueue.push(outBuffer);
......@@ -123,7 +123,7 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
videoEncodeProcessor.on('error',(err) => {
console.info('in case error called, errName is' + err);
});
videoEncodeProcessor.on('outputFormatChanged',(format) => {
videoEncodeProcessor.on('streamChanged',(format) => {
if (typeof(format) != undefined) {
printDescription(format);
}
......
......@@ -129,7 +129,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
console.info('not last frame, write data to file');
writeFile(path, outputObject.data, outputObject.length);
console.info("write to file success");
videoEncodeProcessor.releaseOutput(outputObject).then(() => {
videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => {
console.info('release output success');
});
}
......@@ -138,7 +138,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
function setCallback(path, done) {
console.info('case callback');
videoEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
videoEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
console.info('outBuffer.flags: ' + outBuffer.flags);
if (needGetMediaDes) {
......@@ -155,7 +155,7 @@ describe('videoSoftwareEncoderFuncPromise', function () {
videoEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
videoEncodeProcessor.on('outputFormatChanged',(format) => {
videoEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......
......@@ -129,7 +129,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
frameCountOut++;
writeFile(path, outputObject.data, outputObject.length);
videoEncodeProcessor.releaseOutput(outputObject, (err) => {
videoEncodeProcessor.freeOutputBuffer(outputObject, (err) => {
if (typeof(err) == 'undefined') {
console.debug('in case release output count:' + frameCountOut);
} else {
......@@ -146,7 +146,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
}
}
function setCallback(path, nextStep) {
videoEncodeProcessor.on('outputBufferAvailable', async (outBuffer) => {
videoEncodeProcessor.on('newOutputData', async (outBuffer) => {
console.info('in case: outputBufferAvailable outBuffer.index: '+ outBuffer.index);
if (stopBuffer == false) {
outputQueue.push(outBuffer);
......@@ -158,7 +158,7 @@ describe('VideoEncoderSoftwareReliCallbackTest', function () {
console.info('in case: error called,errName is' + err);
});
videoEncodeProcessor.on('outputFormatChanged', (format) => {
videoEncodeProcessor.on('streamChanged', (format) => {
if (typeof(format) != undefined) {
printDescription(format);
}
......
......@@ -246,7 +246,7 @@ describe('videoEncoderReliabilityPromise', function () {
} else {
writeFile(path, outputObject.data, outputObject.length);
console.info("write to file success");
videoEncodeProcessor.releaseOutput(outputObject).then(() => {
videoEncodeProcessor.freeOutputBuffer(outputObject).then(() => {
console.info('release output success');
frameCountOut++;
console.log('release output count:' + frameCountOut);
......@@ -257,7 +257,7 @@ describe('videoEncoderReliabilityPromise', function () {
function setCallback(path, done) {
console.info('case callback');
videoEncodeProcessor.on('outputBufferAvailable', async(outBuffer) => {
videoEncodeProcessor.on('newOutputData', async(outBuffer) => {
console.info('outputBufferAvailable');
console.info('outBuffer.flags :' + outBuffer.flags);
if (needGetMediaDes) {
......@@ -274,7 +274,7 @@ describe('videoEncoderReliabilityPromise', function () {
videoEncodeProcessor.on('error',(err) => {
console.info('case error called,errName is' + err);
});
videoEncodeProcessor.on('outputFormatChanged',(format) => {
videoEncodeProcessor.on('streamChanged',(format) => {
console.info('Output format changed: ' + format);
});
}
......
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2022 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) 2022 Huawei Device Co., Ltd.
# 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
......@@ -26,7 +26,7 @@ ohos_js_hap_suite("video_player_js_hap") {
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoPlayerJsTest"
hap_name = "ActsVideoPlayerJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
......
......@@ -7,6 +7,13 @@
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsVideoPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"pre-push": [
......@@ -15,19 +22,12 @@
"./resource/audio/H264_AAC.mp4 ->/data/accounts/account_0/appdata/ohos.acts.multimedia.video.videoplayer/"
]
},
{
{
"type": "ShellKit",
"run-command": [
],
"teardown-command":[
]
},
{
"test-file-name": [
"VideoPlayerJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
# Copyright (C) 2022 Huawei Device Co., Ltd.
# 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
......@@ -24,7 +24,7 @@ ohos_js_hap_suite("video_recorder_js_hap") {
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "VideoRecorderJsTest"
hap_name = "ActsVideoRecorderJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
......
......@@ -2,7 +2,7 @@
"description": "Configuration for videoRecorder Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "1000000",
"test-timeout": "2000000",
"package": "ohos.acts.multimedia.video.videorecorder",
"shell-timeout": "60000"
},
......@@ -16,7 +16,7 @@
},
{
"test-file-name": [
"VideoRecorderJsTest.hap"
"ActsVideoRecorderJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 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.
*/
.container {
flex-direction: column;
justify-content: center;
......
<!--
Copyright (c) 2022 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.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......@@ -55,13 +55,13 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoFrameHeight : 480,
videoFrameRate : 10
}
// orientationHint 0, 90, 180, 270
// rotation 0, 90, 180, 270
let videoConfig = {
audioSourceType : 1,
videoSourceType : 0,
profile : configFile,
url : 'file:///data/media/01.mp4',
orientationHint : 0,
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
......@@ -81,7 +81,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
videoSourceType : 0,
profile : onlyVideoProfile,
url : 'file:///data/media/01.mp4',
orientationHint : 0,
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
......@@ -728,7 +728,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
* @tc.name : 19.orientationHint 90 (callback)
* @tc.name : 19.rotation 90 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -737,7 +737,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900', 0, async function (done) {
await getFd('37.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 90;
videoConfig.rotation = 90;
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
START_EVENT, RELEASE_EVENT, END_EVENT);
......@@ -746,7 +746,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
* @tc.name : 20.orientationHint 180 (callback)
* @tc.name : 20.rotation 180 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -755,7 +755,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000', 0, async function (done) {
await getFd('38.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 180;
videoConfig.rotation = 180;
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
......@@ -763,7 +763,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
* @tc.name : 21.orientationHint 270 (callback)
* @tc.name : 21.rotation 270 (callback)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -772,7 +772,7 @@ describe('VideoRecorderFuncCallbackTest', function () {
it('SUB_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100', 0, async function (done) {
await getFd('39.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 270;
videoConfig.rotation = 270;
let videoRecorder = null;
let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT, END_EVENT);
eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
......
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* 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
......@@ -46,7 +46,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType : 0,
profile : configFile,
url : 'file:///data/media/01.mp4',
orientationHint : 0,
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
......@@ -66,7 +66,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
videoSourceType : 0,
profile : onlyVideoProfile,
url : 'file:///data/media/01.mp4',
orientationHint : 0,
rotation : 0,
location : { latitude : 30, longitude : 130 },
maxSize : 100,
maxDuration : 500
......@@ -1263,7 +1263,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900
* @tc.name : 19.orientationHint 90 (promise)
* @tc.name : 19.rotation 90 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -1275,7 +1275,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let videoOutput;
await getFd('40.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 90;
videoConfig.rotation = 90;
await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') {
......@@ -1312,7 +1312,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000
* @tc.name : 20.orientationHint 180 (promise)
* @tc.name : 20.rotation 180 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -1324,7 +1324,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let videoOutput;
await getFd('41.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 180;
videoConfig.rotation = 180;
await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') {
......@@ -1361,7 +1361,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
/* *
* @tc.number : SUB_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100
* @tc.name : 21.orientationHint 270 (promise)
* @tc.name : 21.rotation 270 (promise)
* @tc.desc : Audio recordr control test
* @tc.size : MediumTest
* @tc.type : Function
......@@ -1373,7 +1373,7 @@ describe('VideoRecorderFuncPromiseTest', function () {
let videoOutput;
await getFd('42.mp4');
videoConfig.url = fdPath;
videoConfig.orientationHint = 270;
videoConfig.rotation = 270;
await media.createVideoRecorder().then((recorder) => {
console.info('case createVideoRecorder called');
if (typeof (recorder) != 'undefined') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册