From 04da689692ec7cd3ef0f315c9c00d9051cefdd10 Mon Sep 17 00:00:00 2001 From: Pradeep Venkatasubbarao Date: Mon, 1 Sep 2014 09:33:10 +0530 Subject: [PATCH 1/1] videnc2: Adding encoding completion msgs Signed-off-by: Pradeep Venkatasubbarao --- videnc2test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/videnc2test.c b/videnc2test.c index 014b511..5fcb293 100644 --- a/videnc2test.c +++ b/videnc2test.c @@ -1131,6 +1131,7 @@ int main(int argc, char * *argv) in_cnt++; MSG("n == -1 - go to shutdown"); + printf("Encoding completed successfully\n"); goto shutdown; } else { @@ -1138,6 +1139,7 @@ int main(int argc, char * *argv) encObj.inBufs->numPlanes = 0; eof = 1; MSG("n == 0 - go to shutdown"); + printf("Encoding completed successfully\n"); goto shutdown; @@ -1171,6 +1173,7 @@ int main(int argc, char * *argv) if( XDM_ISFATALERROR(h264enc_outArgs->videnc2OutArgs.extendedError) ) { ERROR("process returned error: %d\n", err); ERROR("extendedError: %08x", h264enc_outArgs->videnc2OutArgs.extendedError); + printf("Encoding Error\n"); goto shutdown; } else if( eof ) { ERROR("Codec_process returned err=%d, extendedError=%08x", err, h264enc_outArgs->videnc2OutArgs.extendedError); @@ -1197,6 +1200,7 @@ int main(int argc, char * *argv) if( err < 0 ) { //TODO error handling on MPEG4/H.263 ERROR("Codec_process returned err=%d, extendedError=%08x", err, mpeg4enc_outArgs->videnc2OutArgs.extendedError); + printf("Encoding Error\n"); goto shutdown; } MSG("\n bytesGenerated %d", mpeg4enc_outArgs->videnc2OutArgs.bytesGenerated); @@ -1211,7 +1215,10 @@ int main(int argc, char * *argv) /* get the output buffer and write it to file */ if( bytesGenerated ) { // write the frames to output file based on the value of frames_to_write on how many frames to write. - if( out_cnt > encObj.nframes ) goto shutdown; + if( out_cnt > encObj.nframes ){ + printf("Encoding completed successfully\n"); + goto shutdown; + } INFO("Dumping frame %d", out_cnt); write_output(&encObj, bytesGenerated); } @@ -1221,6 +1228,5 @@ int main(int argc, char * *argv) } shutdown: encoder_deinit(&encObj); - INFO("Encoding complete...\n"); return 0; } -- 2.39.2