Commit b13a7d7e authored by Linshizhi's avatar Linshizhi

Enable debug info.

parent a885f3f2
......@@ -108,6 +108,7 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
rgbaFrame->width = cc->width;
avpicture_fill((AVPicture*)rgbaFrame, data, AV_PIX_FMT_RGBA, width_, height_);
auto start = std::chrono::system_clock::now();
//转换的YUV数据存放在frame
int outSliceH = sws_scale(swsCtx, (const uint8_t* const*)rgbaFrame->data, rgbaFrame->linesize, 0, height_,
frame->data, frame->linesize);
......@@ -117,17 +118,17 @@ EM_PORT_API(int) encode(uint8_t *data, uint8_t *buffer, uint32_t size, uint32_t
return 3;
}
frame->pts = timescale / framerate_ * frameIndex;
frame->pict_type = AV_PICTURE_TYPE_I;
++frameIndex;
auto start = std::chrono::system_clock::now();
// Encode
ret = avcodec_send_frame(cc, frame);
if (ret < 0) {
fprintf(stderr, "Fail to encoding\n");
}
ret = getPackets(buffer, size, osize);
auto end = std::chrono::system_clock::now();
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
elapsed_seconds.count(),
total.count());
return getPackets(buffer, size, osize);
return ret;
}
/* Ret Values:
......
......@@ -17,10 +17,10 @@ THIRD_DIR=${WORKPATH}/lib/third/build
FFMPEG_PROTO=${WORKPATH}/src/protos/src
WASM_DIR=${WORKPATH}/src/wasms
ENCODER_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"
#MUXER_DEBUG="-O1 -g -fno-inline -gseparate-dwarf=muxer.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/muxer.debug.wasm"
#ENCODER_DEBUG="-O3"
#MUXER_DEBUG="-O3"
ENCODER_DEBUG="-O3 -g -fno-inline -gseparate-dwarf=encoder.debug.wasm -s SEPARATE_DWARF_URL=http://localhost:9876/encoder.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"
BUILD_DIR=${WORKPATH}/Build
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment