Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ParaEncode
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ParaEncode
Commits
b13a7d7e
Commit
b13a7d7e
authored
May 13, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable debug info.
parent
a885f3f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
encoder.cc
src/wasms/encoder.cc
+4
-3
wasm-build.sh
wasm-build.sh
+4
-4
No files found.
src/wasms/encoder.cc
View file @
b13a7d7e
...
@@ -108,6 +108,7 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
...
@@ -108,6 +108,7 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
rgbaFrame
->
width
=
cc
->
width
;
rgbaFrame
->
width
=
cc
->
width
;
avpicture_fill
((
AVPicture
*
)
rgbaFrame
,
data
,
AV_PIX_FMT_RGBA
,
width_
,
height_
);
avpicture_fill
((
AVPicture
*
)
rgbaFrame
,
data
,
AV_PIX_FMT_RGBA
,
width_
,
height_
);
auto
start
=
std
::
chrono
::
system_clock
::
now
();
//转换的YUV数据存放在frame
//转换的YUV数据存放在frame
int
outSliceH
=
sws_scale
(
swsCtx
,
(
const
uint8_t
*
const
*
)
rgbaFrame
->
data
,
rgbaFrame
->
linesize
,
0
,
height_
,
int
outSliceH
=
sws_scale
(
swsCtx
,
(
const
uint8_t
*
const
*
)
rgbaFrame
->
data
,
rgbaFrame
->
linesize
,
0
,
height_
,
frame
->
data
,
frame
->
linesize
);
frame
->
data
,
frame
->
linesize
);
...
@@ -117,17 +118,17 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
...
@@ -117,17 +118,17 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
return
3
;
return
3
;
}
}
frame
->
pts
=
timescale
/
framerate_
*
frameIndex
;
frame
->
pts
=
timescale
/
framerate_
*
frameIndex
;
frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
++
frameIndex
;
++
frameIndex
;
auto
start
=
std
::
chrono
::
system_clock
::
now
();
// Encode
// Encode
ret
=
avcodec_send_frame
(
cc
,
frame
);
ret
=
avcodec_send_frame
(
cc
,
frame
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Fail to encoding
\n
"
);
fprintf
(
stderr
,
"Fail to encoding
\n
"
);
}
}
ret
=
getPackets
(
buffer
,
size
,
osize
);
auto
end
=
std
::
chrono
::
system_clock
::
now
();
auto
end
=
std
::
chrono
::
system_clock
::
now
();
std
::
chrono
::
duration
<
double
>
elapsed_seconds
=
end
-
start
;
std
::
chrono
::
duration
<
double
>
elapsed_seconds
=
end
-
start
;
...
@@ -138,7 +139,7 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
...
@@ -138,7 +139,7 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
elapsed_seconds
.
count
(),
elapsed_seconds
.
count
(),
total
.
count
());
total
.
count
());
return
getPackets
(
buffer
,
size
,
osize
)
;
return
ret
;
}
}
/* Ret Values:
/* Ret Values:
...
...
wasm-build.sh
View file @
b13a7d7e
...
@@ -17,10 +17,10 @@ THIRD_DIR=${WORKPATH}/lib/third/build
...
@@ -17,10 +17,10 @@ THIRD_DIR=${WORKPATH}/lib/third/build
FFMPEG_PROTO
=
${
WORKPATH
}
/src/protos/src
FFMPEG_PROTO
=
${
WORKPATH
}
/src/protos/src
WASM_DIR
=
${
WORKPATH
}
/src/wasms
WASM_DIR
=
${
WORKPATH
}
/src/wasms
ENCODER_DEBUG
=
"-O3"
#
ENCODER_DEBUG="-O3"
MUXER_DEBUG
=
"-O3"
#
MUXER_DEBUG="-O3"
#ENCODER_DEBUG="-O1
-g -fno-inline -gseparate-dwarf=encoder.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/encoder.debug.wasm"
ENCODER_DEBUG
=
"-O3
-g -fno-inline -gseparate-dwarf=encoder.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/encoder.debug.wasm"
#MUXER_DEBUG="-O1
-g -fno-inline -gseparate-dwarf=muxer.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/muxer.debug.wasm"
MUXER_DEBUG
=
"-O3
-g -fno-inline -gseparate-dwarf=muxer.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/muxer.debug.wasm"
#DEBUG="-g2"
#DEBUG="-g2"
BUILD_DIR
=
${
WORKPATH
}
/Build
BUILD_DIR
=
${
WORKPATH
}
/Build
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment