提交 143bd1d9 编写于 作者: L ling990

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

Signed-off-by: Nling990 <liling96@huawei.com>
上级 9e4101ba
......@@ -324,6 +324,8 @@ describe('AudioDecoderFunc', function () {
}
async function flushWork() {
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info("case flush at inputeos success");
......@@ -640,6 +642,8 @@ describe('AudioDecoderFunc', function () {
})
});
eventEmitter.on('flush', () => {
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info(`case flush after 2s`);
......
......@@ -326,6 +326,8 @@ describe('AudioDecoderFunc', function () {
}
async function flushWork() {
inputQueue = [];
outputQueue = [];
await audioDecodeProcessor.flush().then(() => {
console.info("case flush at inputeos success");
resetParam();
......@@ -568,6 +570,8 @@ describe('AudioDecoderFunc', function () {
console.info("case start success");
}, failCallback).catch(failCatch);
await sleep(3000).then(() => {
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.flush().then(() => {
console.info("case flush after 5s");
}, failCallback).catch(failCatch);
......
......@@ -123,6 +123,8 @@ describe('AudioDecoderMultiInstances', function () {
}
async function flushWork(audioDecodeProcessor) {
inputQueue = [];
outputQueue = [];
await audioDecodeProcessor.flush().then(() => {
console.info("case flush at inputeos success");
resetParam();
......
......@@ -283,6 +283,8 @@ describe('AudioDecoderReliabilityCallback', function () {
timestamp = 0;
sawInputEOS = false;
sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
}
function createAudioDecoder(savepath, mySteps, done) {
......@@ -398,6 +400,8 @@ describe('AudioDecoderReliabilityCallback', function () {
case FLUSH:
mySteps.shift();
console.info(`case to flush`);
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info(`case flush 1`);
......
......@@ -303,6 +303,8 @@ describe('AudioDecoderReliabilityPromise', function () {
timestamp = 0;
sawInputEOS = false;
sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
}
function createAudioDecoder(savepath, mySteps, done) {
......@@ -409,6 +411,8 @@ describe('AudioDecoderReliabilityPromise', function () {
case FLUSH:
mySteps.shift();
console.info(`case to flush`);
inputQueue = [];
outputQueue = [];
audioDecodeProcessor.flush().then(() => {
console.info(`case flush 1`);
if (flushAtEOS) {
......
......@@ -166,6 +166,8 @@ describe('AudioEncoderFuncCallback', function () {
}
async function flushWork() {
inputQueue = [];
outputQueue = [];
audioEncodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info("case flush at inputeos success");
......@@ -290,7 +292,6 @@ describe('AudioEncoderFuncCallback', function () {
*/
it('SUB_MEDIA_AUDIO_ENCODER_FUNCTION_CALLBACK_00_0100', 0, async function (done) {
console.info("test set EOS after last frame and reset");
let events = require('events');
let eventEmitter = new events.EventEmitter();
let mediaDescription = {
......@@ -356,7 +357,7 @@ describe('AudioEncoderFuncCallback', function () {
}
})
})
media.createAudioEncoderByName('avdec_aac', (err, processor) => {
media.createAudioEncoderByName('avenc_aac', (err, processor) => {
expect(err).assertUndefined();
console.info(`case createAudioEncoder by mime 1`);
audioEncodeProcessor = processor;
......@@ -473,6 +474,8 @@ describe('AudioEncoderFuncCallback', function () {
})
});
eventEmitter.on('flush', () => {
inputQueue = [];
outputQueue = [];
audioEncodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info(`case flush after 5s`);
......
......@@ -174,6 +174,8 @@ describe('AudioEncoderFuncPromise', function () {
}
async function flushWork() {
inputQueue = [];
outputQueue = [];
await audioEncodeProcessor.flush().then(() => {
console.info("case flush at inputeos success");
resetParam();
......@@ -427,6 +429,8 @@ describe('AudioEncoderFuncPromise', function () {
console.info("case start success")
}, failCallback).catch(failCatch);
await sleep(5000).then(() => {
inputQueue = [];
outputQueue = [];
audioEncodeProcessor.flush().then(() => {
console.info("case flush after 5s")
}, failCallback).catch(failCatch);
......@@ -627,7 +631,7 @@ describe('AudioEncoderFuncPromise', function () {
}, failCallback).catch(failCatch);
let savepath2 = BASIC_PATH + '0601.txt';
workdoneAtEOS = true;
setCallback(audioEncodeProcessor, savepath2, done);
setCallback(savepath2, done);
await audioEncodeProcessor.prepare().then(() => {
console.info("prepare2 success");
}, failCallback).catch(failCatch);
......
......@@ -166,6 +166,8 @@ describe('AudioEncoderFuncPromise', function () {
}
async function flushWork(audioEncodeProcessor) {
inputQueue = [];
outputQueue = [];
await audioEncodeProcessor.flush().then(() => {
console.info("case flush at inputeos success");
resetParam();
......
......@@ -106,6 +106,8 @@ describe('AudioEncoderSTTCallback', function () {
timestamp = 0;
sawInputEOS = false;
sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
}
function createAudioEncoder(savepath, mySteps, done) {
......@@ -247,6 +249,8 @@ describe('AudioEncoderSTTCallback', function () {
case FLUSH:
mySteps.shift();
console.info(`case to flush`);
inputQueue = [];
outputQueue = [];
audioEncodeProcessor.flush((err) => {
expect(err).assertUndefined();
console.info(`case flush 1`);
......
......@@ -123,6 +123,8 @@ describe('AudioEncoderSTTPromise', function () {
timestamp = 0;
sawInputEOS = false;
sawOutputEOS = false;
inputQueue = [];
outputQueue = [];
}
function createAudioEncoder(savepath, mySteps, done) {
......@@ -257,6 +259,8 @@ describe('AudioEncoderSTTPromise', function () {
case FLUSH:
mySteps.shift();
console.info(`case to flush`);
inputQueue = [];
outputQueue = [];
audioEncodeProcessor.flush().then(() => {
console.info(`case flush 1`);
if (flushAtEOS) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册