Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
76a59d20
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
76a59d20
编写于
4月 11, 2022
作者:
L
ling990
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify testcases Signed-off-by: ling990 <liling96@huawei.com>
Signed-off-by:
N
ling990
<
ling990@qq.com
>
上级
37fb879c
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
177 addition
and
177 deletion
+177
-177
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
...r/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
...er/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
+15
-15
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
.../main/js/test/AudioDecoderReliabilityCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
...der/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
+16
-16
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
...oder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
+16
-16
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
.../main/js/test/AudioEncoderReliabilityCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
...c/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
...ideoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
...der/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
...der/src/main/js/test/VideoDecoderReliCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
...oder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
...main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
+4
-4
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
.../main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
+4
-4
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
...r/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
+11
-11
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
...main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
+11
-11
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
.../main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
+11
-11
未找到文件。
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -45,9 +45,9 @@ describe('AudioDecoderFormatCallback', function () {
let
isVorbis
=
false
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -99,8 +99,8 @@ describe('AudioDecoderFormatCallback', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -150,29 +150,29 @@ describe('AudioDecoderFormatCallback', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
writeSync
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
writeSync
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.writeSync buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.writeSync buffer error is
'
+
e
);
...
...
@@ -183,7 +183,7 @@ describe('AudioDecoderFormatCallback', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFormatPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -44,9 +44,9 @@ describe('AudioDecoderFormatPromise', function () {
let
isVorbis
=
false
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -108,8 +108,8 @@ describe('AudioDecoderFormatPromise', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -159,29 +159,29 @@ describe('AudioDecoderFormatPromise', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
writeSync
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
writeSync
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.writeSync buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.writeSync buffer error is
'
+
e
);
...
...
@@ -192,7 +192,7 @@ describe('AudioDecoderFormatPromise', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -136,9 +136,9 @@ describe('AudioDecoderFuncCallback', function () {
let
ES_LENGTH
=
1500
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -300,8 +300,8 @@ describe('AudioDecoderFuncCallback', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -351,29 +351,29 @@ describe('AudioDecoderFuncCallback', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
writeSync
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
writeSync
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.writeSync buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.writeSync buffer error is
'
+
e
);
...
...
@@ -384,7 +384,7 @@ describe('AudioDecoderFuncCallback', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderFuncPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -136,9 +136,9 @@ describe('AudioDecoderFuncPromise', function () {
let
ES_LENGTH
=
1500
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -310,8 +310,8 @@ describe('AudioDecoderFuncPromise', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -361,29 +361,29 @@ describe('AudioDecoderFuncPromise', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
writeSync
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
writeSync
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.writeSync buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.writeSync buffer error is
'
+
e
);
...
...
@@ -394,7 +394,7 @@ describe('AudioDecoderFuncPromise', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -147,7 +147,7 @@ describe('AudioDecoderReliabilityCallback', function () {
"
sample_rate
"
:
44100
,
"
audio_sample_format
"
:
1
,
};
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -310,8 +310,8 @@ describe('AudioDecoderReliabilityCallback', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -320,7 +320,7 @@ describe('AudioDecoderReliabilityCallback', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioDecoder/src/main/js/test/AudioDecoderReliabilityPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -149,7 +149,7 @@ describe('AudioDecoderReliabilityPromise', function () {
"
audio_sample_format
"
:
1
,
};
let
expectError
=
false
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -331,8 +331,8 @@ describe('AudioDecoderReliabilityPromise', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -341,7 +341,7 @@ describe('AudioDecoderReliabilityPromise', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -45,9 +45,9 @@ describe('AudioEncoderFuncCallback', function () {
let
ES_LENGTH
=
1500
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -119,8 +119,8 @@ describe('AudioEncoderFuncCallback', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -170,22 +170,22 @@ describe('AudioEncoderFuncCallback', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
...
...
@@ -193,7 +193,7 @@ describe('AudioEncoderFuncCallback', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -211,7 +211,7 @@ describe('AudioEncoderFuncCallback', function () {
try
{
let
head
=
new
ArrayBuffer
(
7
);
addADTStoPacket
(
head
,
len
);
let
res
=
fileio
.
write
(
fd
_
Write
,
head
,
{
length
:
7
});
let
res
=
fileio
.
write
(
fdWrite
,
head
,
{
length
:
7
});
console
.
info
(
'
case fileio.write head success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write head error is
'
+
e
);
...
...
@@ -220,7 +220,7 @@ describe('AudioEncoderFuncCallback', function () {
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
write
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
write
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.write buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write buffer error is
'
+
e
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderFuncPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -45,9 +45,9 @@ describe('AudioEncoderFuncPromise', function () {
let
ES_LENGTH
=
1500
;
let
readpath
;
let
savepath
;
let
fd
_
Read
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdRead
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -129,8 +129,8 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -180,22 +180,22 @@ describe('AudioEncoderFuncPromise', function () {
}
let
fetchWriteFileResult
=
await
mediaTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
...
...
@@ -203,7 +203,7 @@ describe('AudioEncoderFuncPromise', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -220,7 +220,7 @@ describe('AudioEncoderFuncPromise', function () {
try
{
let
head
=
new
ArrayBuffer
(
7
);
addADTStoPacket
(
head
,
len
);
let
res
=
fileio
.
write
(
fd
_
Write
,
head
,
{
length
:
7
});
let
res
=
fileio
.
write
(
fdWrite
,
head
,
{
length
:
7
});
console
.
info
(
'
case fileio.write head success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write head error is
'
+
e
);
...
...
@@ -229,7 +229,7 @@ describe('AudioEncoderFuncPromise', function () {
function
writeFile
(
path
,
buf
,
len
)
{
try
{
let
res
=
fileio
.
write
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
write
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.write buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write buffer error is
'
+
e
);
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -59,7 +59,7 @@ describe('AudioEncoderReliabilityCallback', function () {
"
sample_rate
"
:
44100
,
"
audio_sample_format
"
:
1
,
};
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -133,8 +133,8 @@ describe('AudioEncoderReliabilityCallback', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -143,7 +143,7 @@ describe('AudioEncoderReliabilityCallback', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/audioEncoder/src/main/js/test/AudioEncoderReliabilityPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -60,7 +60,7 @@ describe('AudioEncoderReliabilityPromise', function () {
"
audio_sample_format
"
:
1
,
};
let
expectError
=
false
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -150,8 +150,8 @@ describe('AudioEncoderReliabilityPromise', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -160,7 +160,7 @@ describe('AudioEncoderReliabilityPromise', function () {
console
.
info
(
'
read file start execution
'
);
try
{
console
.
info
(
'
filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderEnumTest.test.js
浏览文件 @
76a59d20
...
...
@@ -39,7 +39,7 @@ describe('VideoDecoderEnum', function () {
const
H264_FRAME_SIZE_60FPS_320
=
[
2106
,
11465
];
let
readpath
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -92,7 +92,7 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
error
(
'
in case readFile
'
+
e
);
}
...
...
@@ -322,8 +322,8 @@ describe('VideoDecoderEnum', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
let
mediaDescription
=
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -92,7 +92,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
295
,
206
,
264
,
349
,
4071
,
242
,
296
,
271
,
231
,
307
,
265
,
254
,
267
,
317
,
232
,
348
,
4077
,
259
,
222
,
268
,
235
,
324
,
266
,
256
,
312
,
246
,
248
,
325
,
4000
,
266
,
201
,
230
,
293
,
264
,
265
,
273
,
301
,
304
,
253
,
266
,
3978
,
228
,
232
,
250
,
248
,
281
,
219
,
243
,
293
,
287
,
253
,
328
,
3719
];
let
fd
_
Read
;
let
fdRead
;
let
readpath
;
beforeAll
(
function
()
{
...
...
@@ -164,8 +164,8 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -174,7 +174,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderFuncPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -93,7 +93,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
295
,
206
,
264
,
349
,
4071
,
242
,
296
,
271
,
231
,
307
,
265
,
254
,
267
,
317
,
232
,
348
,
4077
,
259
,
222
,
268
,
235
,
324
,
266
,
256
,
312
,
246
,
248
,
325
,
4000
,
266
,
201
,
230
,
293
,
264
,
265
,
273
,
301
,
304
,
253
,
266
,
3978
,
228
,
232
,
250
,
248
,
281
,
219
,
243
,
293
,
287
,
253
,
328
,
3719
];
let
fd
_
Read
;
let
fdRead
;
let
readpath
;
beforeAll
(
function
()
{
...
...
@@ -163,8 +163,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -173,7 +173,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -75,7 +75,7 @@ describe('VideoDecoderReliCallbackTest', function () {
574
,
126
,
1242
,
188
,
130
,
119
,
1450
,
187
,
137
,
141
,
1116
,
124
,
1848
,
138
,
122
,
1605
,
186
,
127
,
140
,
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -151,7 +151,7 @@ describe('VideoDecoderReliCallbackTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -422,8 +422,8 @@ describe('VideoDecoderReliCallbackTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
media
.
createVideoDecoderByMime
(
mime
,
(
err
,
processor
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderReliPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -75,7 +75,7 @@ describe('VideoDecoderReliPromiseTest', function () {
574
,
126
,
1242
,
188
,
130
,
119
,
1450
,
187
,
137
,
141
,
1116
,
124
,
1848
,
138
,
122
,
1605
,
186
,
127
,
140
,
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -157,7 +157,7 @@ describe('VideoDecoderReliPromiseTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -419,8 +419,8 @@ describe('VideoDecoderReliPromiseTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
media
.
createVideoDecoderByMime
(
mime
).
then
((
processor
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -108,7 +108,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
295
,
206
,
264
,
349
,
4071
,
242
,
296
,
271
,
231
,
307
,
265
,
254
,
267
,
317
,
232
,
348
,
4077
,
259
,
222
,
268
,
235
,
324
,
266
,
256
,
312
,
246
,
248
,
325
,
4000
,
266
,
201
,
230
,
293
,
264
,
265
,
273
,
301
,
304
,
253
,
266
,
3978
,
228
,
232
,
250
,
248
,
281
,
219
,
243
,
293
,
287
,
253
,
328
,
3719
];
let
fd
_
Read
;
let
fdRead
;
let
readpath
;
beforeAll
(
function
()
{
...
...
@@ -178,8 +178,8 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -188,7 +188,7 @@ describe('VideoDecoderFuncCallbackTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareFuncPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -109,7 +109,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
295
,
206
,
264
,
349
,
4071
,
242
,
296
,
271
,
231
,
307
,
265
,
254
,
267
,
317
,
232
,
348
,
4077
,
259
,
222
,
268
,
235
,
324
,
266
,
256
,
312
,
246
,
248
,
325
,
4000
,
266
,
201
,
230
,
293
,
264
,
265
,
273
,
301
,
304
,
253
,
266
,
3978
,
228
,
232
,
250
,
248
,
281
,
219
,
243
,
293
,
287
,
253
,
328
,
3719
];
let
fd
_
Read
;
let
fdRead
;
let
readpath
;
beforeAll
(
function
()
{
...
...
@@ -179,8 +179,8 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
}
...
...
@@ -189,7 +189,7 @@ describe('VideoDecoderFuncPromiseTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -75,7 +75,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
574
,
126
,
1242
,
188
,
130
,
119
,
1450
,
187
,
137
,
141
,
1116
,
124
,
1848
,
138
,
122
,
1605
,
186
,
127
,
140
,
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -151,7 +151,7 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -431,8 +431,8 @@ describe('VideoDecoderSoftwareReliCallbackTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
media
.
createVideoDecoderByName
(
name
,
(
err
,
processor
)
=>
{
...
...
multimedia/media/media_js_standard/videoDecoder/src/main/js/test/VideoDecoderSoftwareReliPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -75,7 +75,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
574
,
126
,
1242
,
188
,
130
,
119
,
1450
,
187
,
137
,
141
,
1116
,
124
,
1848
,
138
,
122
,
1605
,
186
,
127
,
140
,
1798
,
170
,
124
,
121
,
1666
,
157
,
128
,
130
,
1678
,
135
,
118
,
1804
,
169
,
135
,
125
,
1837
,
168
,
124
,
124
];
let
ES_FRAME_SIZE
=
H264_FRAME_SIZE_60FPS_320
;
let
fd
_
Read
;
let
fdRead
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
...
...
@@ -157,7 +157,7 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
console
.
info
(
'
case read file start execution
'
);
try
{
console
.
info
(
'
case filepath:
'
+
path
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fd
_
Read
,
'
rb
'
);
readStreamSync
=
fileio
.
fdopenStreamSync
(
fdRead
,
'
rb
'
);
}
catch
(
e
)
{
console
.
info
(
e
);
}
...
...
@@ -428,8 +428,8 @@ describe('VideoDecoderSoftwareReliPromiseTest', function () {
console
.
info
(
'
case error fileDescriptor undefined, open file fail
'
);
done
();
}
else
{
fd
_
Read
=
res
.
fd
;
console
.
info
(
"
case fd
_Read is:
"
+
fd_
Read
);
fdRead
=
res
.
fd
;
console
.
info
(
"
case fd
Read is:
"
+
fd
Read
);
}
})
media
.
createVideoDecoderByName
(
name
).
then
((
processor
)
=>
{
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderMultiInstancesTest.test.js
浏览文件 @
76a59d20
...
...
@@ -38,8 +38,8 @@ describe('videoEncoderSoftwareMultiInstances', function () {
let
flushAtEOS
=
false
;
let
sawOutputEOS
=
false
;
let
needGetMediaDes
=
false
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaLibraryTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -148,28 +148,28 @@ describe('videoEncoderSoftwareMultiInstances', function () {
}
let
fetchWriteFileResult
=
await
mediaLibraryTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
buf
,
len
)
{
try
{
let
res
=
fileio
.
write
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
write
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.write buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write buffer error is
'
+
e
);
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncCallbackTest.test.js
浏览文件 @
76a59d20
...
...
@@ -37,8 +37,8 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
const
eventEmitter
=
new
events
.
EventEmitter
();
const
ROOT
=
'
/data/app/el1/bundle/results/
'
;
const
BASIC_PATH
=
ROOT
+
'
video_func_callback_
'
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaLibraryTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -137,28 +137,28 @@ describe('VideoEncoderSoftwareFuncCallbackTest', function () {
}
let
fetchWriteFileResult
=
await
mediaLibraryTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
buf
,
len
)
{
try
{
let
res
=
fileio
.
write
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
write
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.write buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write buffer error is
'
+
e
);
...
...
multimedia/media/media_js_standard/videoEncoder/src/main/js/test/VideoEncoderSoftwareFuncPromiseTest.test.js
浏览文件 @
76a59d20
...
...
@@ -35,8 +35,8 @@ describe('videoSoftwareEncoderFuncPromise', function () {
let
flushAtEOS
=
false
;
let
sawOutputEOS
=
false
;
let
needGetMediaDes
=
false
;
let
fd
_
Write
;
let
fileAsset
_Write
;
let
fdWrite
;
let
fileAsset
;
const
context
=
featureAbility
.
getContext
();
const
mediaLibraryTest
=
mediaLibrary
.
getMediaLibrary
(
context
);
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
...
...
@@ -157,28 +157,28 @@ describe('videoSoftwareEncoderFuncPromise', function () {
}
let
fetchWriteFileResult
=
await
mediaLibraryTest
.
getFileAssets
(
fetchOp
);
console
.
info
(
'
[mediaLibrary] case getFdWrite getFileAssets() success
'
);
fileAsset
_Write
=
await
fetchWriteFileResult
.
getAllObject
();
fileAsset
=
await
fetchWriteFileResult
.
getAllObject
();
console
.
info
(
'
[mediaLibrary] case getFdWrite getAllObject() success
'
);
fd
_Write
=
await
fileAsset_Write
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
_Write is
'
+
fd_
Write
);
fd
Write
=
await
fileAsset
[
0
].
open
(
'
Rw
'
);
console
.
info
(
'
[mediaLibrary] case getFdWrite fd
Write is
'
+
fd
Write
);
}
}
async
function
closeFdWrite
()
{
if
(
fileAsset
_Write
!=
null
)
{
await
fileAsset
_Write
[
0
].
close
(
fd_
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_Write success, fd is
'
+
fd_
Write
);
if
(
fileAsset
!=
null
)
{
await
fileAsset
[
0
].
close
(
fd
Write
).
then
(()
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
Write success, fd is
'
+
fd
Write
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
[mediaLibrary] case close fd
_
Write failed
'
);
console
.
info
(
'
[mediaLibrary] case close fdWrite failed
'
);
});
}
else
{
console
.
info
(
'
[mediaLibrary] case fileAsset
_Write
is null
'
);
console
.
info
(
'
[mediaLibrary] case fileAsset is null
'
);
}
}
function
writeFile
(
buf
,
len
)
{
try
{
let
res
=
fileio
.
write
(
fd
_
Write
,
buf
,
{
length
:
len
});
let
res
=
fileio
.
write
(
fdWrite
,
buf
,
{
length
:
len
});
console
.
info
(
'
case fileio.write buffer success
'
);
}
catch
(
e
)
{
console
.
info
(
'
case fileio.write buffer error is
'
+
e
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录