提交 54e144a1 编写于 作者: B bayanxing

code check

Signed-off-by: Nbayanxing <bayanxing@kaihong.com>
上级 0933a8f7
...@@ -18,15 +18,13 @@ import * as mediaTestBase from './MediaTestBase.js'; ...@@ -18,15 +18,13 @@ import * as mediaTestBase from './MediaTestBase.js';
async function idleCallBack(avRecorder) { async function idleCallBack(avRecorder) {
console.info('case createAVRecorder called'); console.info('case createAVRecorder called');
await media.createAVRecorder().then((recorder) => { await media.createAVRecorder((error, recorder) => {
if (recorder != null) { if (recorder != null) {
avRecorder = recorder; avRecorder = recorder;
console.info('createAVRecorder success'); console.info('createAVRecorder success');
} else { } else {
console.info('createAVRecorder fail'); console.info(`createAVRecorder fail, error:${error}`);
} }
}).catch((error) => {
console.info(`createAVRecorder catchCallback, error:${error}`);
}); });
return avRecorder; return avRecorder;
} }
...@@ -87,7 +85,7 @@ export async function getInputSurfacePromise(avRecorder) { ...@@ -87,7 +85,7 @@ export async function getInputSurfacePromise(avRecorder) {
let surfaceID = null; let surfaceID = null;
if (typeof(avRecorder) == 'undefined') { if (typeof(avRecorder) == 'undefined') {
return; return;
} }
await avRecorder.getInputSurface().then((surfaceId) => { await avRecorder.getInputSurface().then((surfaceId) => {
console.info('getInputSurface success'); console.info('getInputSurface success');
surfaceID = surfaceId; surfaceID = surfaceId;
...@@ -387,7 +385,6 @@ export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime, ...@@ -387,7 +385,6 @@ export async function avRecorderWithCallBack(avConfig, avRecorder, recorderTime,
export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime); await startPromise(avRecorder, recorderTime);
...@@ -404,7 +401,6 @@ export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime ...@@ -404,7 +401,6 @@ export async function avRecorderWithCallBack2(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime); await startPromise(avRecorder, recorderTime);
...@@ -422,7 +418,6 @@ export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime ...@@ -422,7 +418,6 @@ export async function avRecorderWithCallBack3(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime); await startPromise(avRecorder, recorderTime);
...@@ -438,7 +433,6 @@ export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime ...@@ -438,7 +433,6 @@ export async function avRecorderWithCallBack4(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack5(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack5(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime); await startPromise(avRecorder, recorderTime);
...@@ -471,7 +465,6 @@ export async function avRecorderWithCallBack6(avConfig, avRecorder, recorderTime ...@@ -471,7 +465,6 @@ export async function avRecorderWithCallBack6(avConfig, avRecorder, recorderTime
export async function avRecorderWithCallBack7(avConfig, avRecorder, recorderTime, done) { export async function avRecorderWithCallBack7(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
await startPromise(avRecorder, recorderTime); await startPromise(avRecorder, recorderTime);
...@@ -1198,7 +1191,6 @@ export async function setCreate2ReleaseOnCallback(avRecorder, avConfig, loopTime ...@@ -1198,7 +1191,6 @@ export async function setCreate2ReleaseOnCallback(avRecorder, avConfig, loopTime
} }
export async function avRecorderLoopCreate2ReleaseWithCallback(avRecorder, avConfig, loopTimes, done) { export async function avRecorderLoopCreate2ReleaseWithCallback(avRecorder, avConfig, loopTimes, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
setCreate2ReleaseOnCallback(avRecorder, loopTimes, done) setCreate2ReleaseOnCallback(avRecorder, loopTimes, done)
...@@ -1253,7 +1245,6 @@ export async function setPrepare2StopOnCallback(avRecorder, done) { ...@@ -1253,7 +1245,6 @@ export async function setPrepare2StopOnCallback(avRecorder, done) {
} }
export async function avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, done) { export async function avRecorderLoopPrepare2StopWithCallback(avConfig, avRecorder, done) {
avRecorder = await idle(avRecorder); avRecorder = await idle(avRecorder);
console.info('case avConfig.url is ' + avConfig.url); console.info('case avConfig.url is ' + avConfig.url);
await preparePromise(avRecorder, avConfig); await preparePromise(avRecorder, avConfig);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册