diff --git a/multimedia/media/media_js_standard/audioDecoder/Test.json b/multimedia/media/media_js_standard/audioDecoder/Test.json index e25486fa9ec9c78b674479dcfb4fc8ef8d201493..cedb3b5ec0230c70770278febb34a65d8c720c67 100644 --- a/multimedia/media/media_js_standard/audioDecoder/Test.json +++ b/multimedia/media/media_js_standard/audioDecoder/Test.json @@ -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 diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js index 129175686ac14084147e1133b69557bb1f6e3be8..5a4a48f318984dd7344ac994cf1ae6ec6bd32997 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderEnumTest.test.js @@ -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 diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js index 50b5714edb21725afe4564a9848210e5e3acbc39..8f6460db4c7a739aa23e09e2ec770aadbd1a6df6 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js @@ -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; diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js index 543190cf33e5eac6fc0e992e1cb8a7534991bbcd..1435aa48de9aa6e03773375612121610e39d038a 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js @@ -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; diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js index a514982f2dcb7549287402f279e5ed303ca5b953..926ac674e426507d78dda9c0c8f63859fd209bad 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js @@ -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; diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js index 2ed0b3c0d015bf6c87f5974b94a082f2e3c7530d..e2b4045b6f1d8b1c74284efdef1133271d702d32 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js @@ -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; diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js index ee2519dc91440a9b35c66ec64d9f29fb5d6edc8f..da33ba37d62dd45112ea22be4664d2951a295347 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderMultiInstancesTest.test.js @@ -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); diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js index f35a92310e9552e32ee3b7fb074b47914e6e05a8..e4e3f7335636a849b58f2b348e6d87de8b07af4c 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js index 3d25e8b2939a0413effe1ca658c5d0697540f5dd..6e3027aae10b4d861bec67d28791041f5ecf16c9 100644 --- a/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/audioEncoder/Test.json b/multimedia/media/media_js_standard/audioEncoder/Test.json index dea08584c4e4fffff1fc9a42a2b0f4a4439d4e72..62300221edec1a5541149a57498ef4bc2797b78f 100644 --- a/multimedia/media/media_js_standard/audioEncoder/Test.json +++ b/multimedia/media/media_js_standard/audioEncoder/Test.json @@ -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 diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js index e402127e680468c96d75726bae74bafd3764f6da..e753a2628cdad5b70ad8e4f63c7b6cc303b5b612 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js @@ -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', () => { diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js index 931b14668745c24ac9938053f9d6b8280b3d23c6..e47d8deb645d7d1261b96845aaec3baaff657184 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js @@ -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"); diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js index c2822a102d62f20b40daa8d5343363a4b8e1b17d..9ad976b9b8fba72f4832be24d3f1ead67e2ab40d 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderMultiInstancesTest.test.js @@ -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); diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js index e819a741b78a2cb4aa952b8e77618b35a175a70f..9c3d8eb55b6eae68a5a22b57ab804a6cbe1645c4 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js index 9b8dbae6a0b45838168c7f38936a2d811a62840b..b9d3cade53dcbeeb72953a7949397a9eb3ffc114 100644 --- a/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js +++ b/multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/audioPlayer/BUILD.gn b/multimedia/media/media_js_standard/audioPlayer/BUILD.gn index 5b1d783ea81cf4d8864630a92dbd233d608cac42..9bad2266c231f6eeaa907b53225551208e22a528 100644 --- a/multimedia/media/media_js_standard/audioPlayer/BUILD.gn +++ b/multimedia/media/media_js_standard/audioPlayer/BUILD.gn @@ -1,4 +1,4 @@ -# 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/Test.json b/multimedia/media/media_js_standard/audioPlayer/Test.json index ddb68ab0978381fd8d182cbb1804c48d4d2977e5..8d705ef062a1f50e917474387d1415222f66a863 100644 --- a/multimedia/media/media_js_standard/audioPlayer/Test.json +++ b/multimedia/media/media_js_standard/audioPlayer/Test.json @@ -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 } ] } diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java b/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java index c3adacfc7a7e0e86651b857ee2f6e857d5c173be..84cb3efd1dba0d92d906a3624192afd6b887499a 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java b/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java index 956bc88979f54b82cf83932c34081ad9f26e8588..a735d0a33e16bdb4ae0194d12fb865e64207b88e 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js index dab1e8146b5f31325a3aaed0c1fbb9a6c73b39d3..e423f4bce4698ec1d7dc86c3eea3990a5e7b1085 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css index 9fbc8868aac904db047906f6407339108a857414..5bd7567028568bd522193b2519d545ca6dcf397d 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.css @@ -1,18 +1,3 @@ -/* - * 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; diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml index e886a71e3b847d80047843e600b38e9c4164b116..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.hml @@ -1,18 +1,3 @@ - -
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js index fe1249a61c8e9e35c04a6292b40ab0cd02ac9a66..a0719cee588ac4b0f56efbf784b19647bc6645de 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js index e5393d50d3f615b14680a5b7dd433259e3977c48..7ac6af3fe49e7bbfaf3f510f8894599cead42251 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js index 8c430d985412dc75c2e75147bbca35e67f1a023e..859f90b139bc8577df881b9e94405a0526458a55 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioAPI.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js index f689bd12899a9b1792623c1cc88b3e82cc970fcb..801d08eb4d1400e83f5230bee098d55994cc34fe 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFUNC.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js index 02074a01721be4935e75b154b5aef299eb77f0e0..1582a5c86ad979d9afafe37cf2e85ee746ca5c67 100644 --- a/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js +++ b/multimedia/media/media_js_standard/audioPlayer/src/main/js/test/PlayerLocalTestAudioFormat.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/BUILD.gn b/multimedia/media/media_js_standard/audioRecorder/BUILD.gn index b641f9f7ed7f6655167d398653abb13127126dc5..a91e5e187679606dfa492f8fccb693accbf14dd1 100644 --- a/multimedia/media/media_js_standard/audioRecorder/BUILD.gn +++ b/multimedia/media/media_js_standard/audioRecorder/BUILD.gn @@ -1,4 +1,4 @@ -# 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java b/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java index c3adacfc7a7e0e86651b857ee2f6e857d5c173be..84cb3efd1dba0d92d906a3624192afd6b887499a 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MainAbility.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java b/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java index 956bc88979f54b82cf83932c34081ad9f26e8588..a735d0a33e16bdb4ae0194d12fb865e64207b88e 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/java/ohos/acts/multimedia/audio/audioplayer/MyApplication.java @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js index dab1e8146b5f31325a3aaed0c1fbb9a6c73b39d3..e423f4bce4698ec1d7dc86c3eea3990a5e7b1085 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css index 9fbc8868aac904db047906f6407339108a857414..5bd7567028568bd522193b2519d545ca6dcf397d 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.css @@ -1,18 +1,3 @@ -/* - * 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; diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml index e886a71e3b847d80047843e600b38e9c4164b116..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.hml @@ -1,18 +1,3 @@ - -
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js index fe1249a61c8e9e35c04a6292b40ab0cd02ac9a66..a0719cee588ac4b0f56efbf784b19647bc6645de 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js index 25073b11e603ac7d224c3de8d770b8372000f4e3..6b6f59b9674d6ace7248b46f8dff3d622223651e 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/AudioRecorderEnumTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js index fcb3354f0954336f401b5bee469fec62114663ce..12ac9395c2d6c4995b88034cad7b35f26e2824a3 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js index 712f1feaa4375c98b4fe025a5594916bb0763cf7..0d624cf3016a4f1a61a712546cdb7a029f574aba 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioAPI.test.js @@ -1,5 +1,5 @@ /* - * 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); diff --git a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js index e88bfb7f11c0eb23aabee2c167e46a1046954b0c..01c91211913ddd3c39733777807a3ebd84c6930a 100644 --- a/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js +++ b/multimedia/media/media_js_standard/audioRecorder/src/main/js/test/RecorderLocalTestAudioFUNC.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/BUILD.gn b/multimedia/media/media_js_standard/videoDecoder/BUILD.gn index 8bb072212852ab76136869f84f11452dfe04a712..be6b25abd83ba672f5b3e4fe10764157e7146263 100644 --- a/multimedia/media/media_js_standard/videoDecoder/BUILD.gn +++ b/multimedia/media/media_js_standard/videoDecoder/BUILD.gn @@ -1,4 +1,4 @@ -# 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/Test.json b/multimedia/media/media_js_standard/videoDecoder/Test.json index 1597d451ac2c51b5244e919e17a92e5e8c6e6010..0c35c8551dfed5a5116eb34efc8f7dd6094c7f8f 100644 --- a/multimedia/media/media_js_standard/videoDecoder/Test.json +++ b/multimedia/media/media_js_standard/videoDecoder/Test.json @@ -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 diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..830070d196d86b127cea947d168bfd116f446205 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css index 5bd7567028568bd522193b2519d545ca6dcf397d..c9195944a956c0d5628c701b7a3d9d2ed525cd2d 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.css @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml index bd41a500e2ef4d3c7a11f37611a403e5bb2bfc43..9e58ed9e321b3f22e771122b4783b0f9f60cba2f 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js index ac3d0fc9c890432e49e4a9ef0ea52922903b5a4f..5d5b9ac7ed3e0c336cf20d8b7d2393877c91ebe5 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/display/display.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css index 5bd7567028568bd522193b2519d545ca6dcf397d..c3517ad1592bddda252d0f8d5a736dd41181a026 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.css @@ -1,4 +1,19 @@ -.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; diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..8d0e2061b88c99c91488405f0f2ead0c77de1a9e 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js index 06e991ff50e322e9b6acf33010b6c32bc168e200..cfb5ff123bbbf4f57d7b111779e4b5f176a4bcec 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js index f2c67228b658f481d739a9206cfe207e3c55cc61..9c483bbcee238f77265fbadbbc5a8b82ae1b01e7 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js index 6c2ac9bf254f696969cce4d1feedd90d1f465a38..75dbb360e1ec75aff75e46feea6371f5db339081 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js @@ -1,5 +1,5 @@ /* - * 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'); diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js index f67f03ef82b1c72409c5089b50aee0ebff406635..3ad753e550772026f4a08c71cf523f4e367bb81a 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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'); diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js index 2abefa06ac4664459139a85d11d0ae06726d6fa3..1a62ba4ab25f963ba78a5cac3a826a0121354657 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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; diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js index 0ef3478d564148726b73f49519e92549427ef2f1..9d48c158cdf56dc2a8fee428c3f4f5c13ab96a83 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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()); }); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js index 606a3c2f2f657b6f671c27e5ff07c0c4138908b2..72336909cbbce00674ca2f725bea44b0cec8de28 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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()); }); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js index aedb2ddfe3f1cee2176472763e7b95fe7e3d4570..9dd52372dd8439b0b3b885ee712ff0527469d5ba 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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'); diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js index 02076de3985b4808a96aed8d3d8248557f8d16d0..1a2f651a134a5049680158e50aaddc30b128a896 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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'); diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js index 56ebc6776ea3d497b2f03193d7bf897311e908ea..7ad1caf9be468689cfeb4be52dd66bb78dbfbc83 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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()); }); } diff --git a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js index c2e258df264e452d1d38f546dc2386ca0099a3fa..a186f706378885be11a74b1bc36dc166f022a1fa 100644 --- a/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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()); }); } diff --git a/multimedia/media/media_js_standard/videoEncoder/BUILD.gn b/multimedia/media/media_js_standard/videoEncoder/BUILD.gn index b0500e8e282dafafe1310dedd61ba108b94bed28..73b133096551a9872c3dcfdb64277c9021418eb1 100644 --- a/multimedia/media/media_js_standard/videoEncoder/BUILD.gn +++ b/multimedia/media/media_js_standard/videoEncoder/BUILD.gn @@ -1,4 +1,4 @@ -# 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 diff --git a/multimedia/media/media_js_standard/videoEncoder/Test.json b/multimedia/media/media_js_standard/videoEncoder/Test.json index 205dd92efbeac607087a427bcbdd664f2b78ae60..15a97d2650435f1296b8e8e0cdcde4834bda4b87 100644 --- a/multimedia/media/media_js_standard/videoEncoder/Test.json +++ b/multimedia/media/media_js_standard/videoEncoder/Test.json @@ -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 diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..830070d196d86b127cea947d168bfd116f446205 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css index 5bd7567028568bd522193b2519d545ca6dcf397d..c9195944a956c0d5628c701b7a3d9d2ed525cd2d 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.css @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..8d0e2061b88c99c91488405f0f2ead0c77de1a9e 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.hml @@ -1,3 +1,18 @@ + +
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js index a0719cee588ac4b0f56efbf784b19647bc6645de..67f8b8567ccc4932331b7a18a6b947340d84fb40 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js index 56660c7fdb235060e27230d814968940ac4a9b95..72138c4d9be898c15f23a2f946b6bc7bf2b1754b 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderEnumTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js index fbc8246fd54a223d20f7507ad50ca9eaf371a3f5..38350041825a2db37e486595f6fb760085d32311 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js @@ -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 { diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js index 50cdc815a74847fd027e229eaea65a1fa8ade39d..1d4d12af690eb36116830e77d2e28e8fb37ba258 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js @@ -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); } diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js index dc7450cb7248236c3d1eff378164bb1734c520a4..0403589fc289429332beefa3a40c3c6fc99c47e3 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js index 0603dfb13da4d25d3ef5d9751cad7d654e3d219a..932c357bcf9f5447e9c509d4c7367751c333e43c 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityCallbackTest.test.js @@ -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); } diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js index 16ea7a48d9500e812848bfedd67e24e2631aa007..0626e4ee4d752034f94b4fc341230cf5670bb0ab 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareReliabilityPromiseTest.test.js @@ -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); }); } diff --git a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js index a6749a7be944107c32f1af004972d01f3bf9e50e..e89bca1138e58b3b73020a0d8f134a64046794ef 100644 --- a/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoHardwareEncoderEnumTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/BUILD.gn b/multimedia/media/media_js_standard/videoPlayer/BUILD.gn index 2798964f112d856d337086251d06a611cb532034..95e552cd258b3924fd639505fb4101a7f0e82c64 100644 --- a/multimedia/media/media_js_standard/videoPlayer/BUILD.gn +++ b/multimedia/media/media_js_standard/videoPlayer/BUILD.gn @@ -1,4 +1,4 @@ -# 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" diff --git a/multimedia/media/media_js_standard/videoPlayer/Test.json b/multimedia/media/media_js_standard/videoPlayer/Test.json index 38a50cf8af9bff0b9d6e71a0df80837d2cee2bac..093ca77fba50c168c25df46e2b802fa6f79b1c11 100644 --- a/multimedia/media/media_js_standard/videoPlayer/Test.json +++ b/multimedia/media/media_js_standard/videoPlayer/Test.json @@ -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 } ] } diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js index 830070d196d86b127cea947d168bfd116f446205..e423f4bce4698ec1d7dc86c3eea3990a5e7b1085 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css index c9195944a956c0d5628c701b7a3d9d2ed525cd2d..5bd7567028568bd522193b2519d545ca6dcf397d 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.css @@ -1,18 +1,3 @@ -/* - * 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; diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml index 2f5e3fb8abcfb8ab867384ce3bb3f7e5e51cf0b6..72f3c770a73984065efff437c147e907694a536f 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.hml @@ -1,18 +1,3 @@ - -
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js index 592512fd26805933b92a56ed3b50f7ab8a065226..94aded985271b85ad43586be3dde56fac3fbd3a9 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js index cae717499517589076015af33115a3db41d70026..322b7acdb9d754cd8af5be58d82063229ab7de40 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js index a86b723ee3b2ded97836d20601d1e9a2e6a055e3..54786070f9f7ffc1ab6527d695b9499e216bd6b7 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerAPICallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js index 41d2c346912fe28e356d650ea441db04bf5e2f25..3ae970e2bac4ef58dcee4a944187adc76b4a6b74 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerEnumTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js index e21d92d3cf4ec7af29396d04e366f73a2bcf8be1..7d1da3e15f5886b8fd2fcce88cb6001ecf186c33 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js index 1161dffe57bae880ce9f26ce3adc8d3aea28d475..178a4d1506fa0f01ec803c2fb955e1ef93afc065 100644 --- a/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoPlayer/src/main/js/test/VideoPlayerFuncPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoRecorder/BUILD.gn b/multimedia/media/media_js_standard/videoRecorder/BUILD.gn index ffa1ae7e2a45a36a2c98bd5497e2368244f8de25..4c0c226998958413ea7301ec2e170aa4b3a75acb 100644 --- a/multimedia/media/media_js_standard/videoRecorder/BUILD.gn +++ b/multimedia/media/media_js_standard/videoRecorder/BUILD.gn @@ -1,4 +1,4 @@ -# 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" diff --git a/multimedia/media/media_js_standard/videoRecorder/Test.json b/multimedia/media/media_js_standard/videoRecorder/Test.json index f8008548a863d063356c4d7cb90a33e8036acb83..c8c2aac4fd94fce8f3d04d39e8e1e0c815f4a478 100644 --- a/multimedia/media/media_js_standard/videoRecorder/Test.json +++ b/multimedia/media/media_js_standard/videoRecorder/Test.json @@ -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 diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js index 830070d196d86b127cea947d168bfd116f446205..e423f4bce4698ec1d7dc86c3eea3990a5e7b1085 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css index df9cfd9f99a4ccebb48d316a717eed3ef5bfb644..5bd7567028568bd522193b2519d545ca6dcf397d 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.css @@ -1,18 +1,3 @@ -/* - * 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; diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml index 6892123992c660d987c2b58eb133e13504ab2072..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.hml @@ -1,18 +1,3 @@ - -
{{ $t('strings.hello') }} {{ title }} diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js index 67f8b8567ccc4932331b7a18a6b947340d84fb40..a0719cee588ac4b0f56efbf784b19647bc6645de 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/default/pages/index/index.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js index 9f6a6e773a7777bad58414117d2450acb2e98941..b894eaf3c4c64b6e10712d20013a9e1832a82c33 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js index cb16d1e41a989422c70adcf81a517f589b23964f..31020098e88eed3267aa34d15be2f72bc694d678 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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 diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js index eb0e015b21270154dde12077e9184d0517cfdebf..790e3d5800d1e29dff96c293debdfbadd1472995 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js @@ -1,5 +1,5 @@ /* - * 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); diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js index 62ab246181c1811f714327bb50db1663bd7391b2..c6c98e99b030ca7d59738cf1ec574b910aa6c496 100644 --- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js +++ b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js @@ -1,5 +1,5 @@ /* - * 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') {