mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 09:06:50 +08:00
[mpi_dec_multi_test]: Add quiet flag to disable log
Change-Id: Iea28d4377212e4c18a91f30762ae8ec135702c16 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -59,6 +59,9 @@ typedef struct {
|
|||||||
RK_S64 first_frm;
|
RK_S64 first_frm;
|
||||||
RK_S32 frame_num;
|
RK_S32 frame_num;
|
||||||
FileReader reader;
|
FileReader reader;
|
||||||
|
|
||||||
|
/* runtime flag */
|
||||||
|
RK_U32 quiet;
|
||||||
} MpiDecCtx;
|
} MpiDecCtx;
|
||||||
|
|
||||||
/* For each instance thread return value */
|
/* For each instance thread return value */
|
||||||
@@ -93,6 +96,7 @@ static int multi_dec_simple(MpiDecCtx *data)
|
|||||||
data->eos = pkt_eos = reader_read(reader, &buf, &read_size);
|
data->eos = pkt_eos = reader_read(reader, &buf, &read_size);
|
||||||
if (pkt_eos) {
|
if (pkt_eos) {
|
||||||
if (data->frame_num < 0) {
|
if (data->frame_num < 0) {
|
||||||
|
if (!data->quiet)
|
||||||
mpp_log("%p loop again\n", ctx);
|
mpp_log("%p loop again\n", ctx);
|
||||||
reader_rewind(reader);
|
reader_rewind(reader);
|
||||||
data->eos = pkt_eos = 0;
|
data->eos = pkt_eos = 0;
|
||||||
@@ -197,12 +201,18 @@ static int multi_dec_simple(MpiDecCtx *data)
|
|||||||
if (!data->first_frm)
|
if (!data->first_frm)
|
||||||
data->first_frm = mpp_time();
|
data->first_frm = mpp_time();
|
||||||
|
|
||||||
err_info = mpp_frame_get_errinfo(frame) | mpp_frame_get_discard(frame);
|
if (!data->quiet) {
|
||||||
|
err_info = mpp_frame_get_errinfo(frame) |
|
||||||
|
mpp_frame_get_discard(frame);
|
||||||
if (err_info) {
|
if (err_info) {
|
||||||
mpp_log("decoder_get_frame get err info:%d discard:%d.\n",
|
mpp_log("decoder_get_frame get err info:%d discard:%d.\n",
|
||||||
mpp_frame_get_errinfo(frame), mpp_frame_get_discard(frame));
|
mpp_frame_get_errinfo(frame),
|
||||||
|
mpp_frame_get_discard(frame));
|
||||||
}
|
}
|
||||||
mpp_log("decode_get_frame get frame %d\n", data->frame_count);
|
mpp_log("decode_get_frame get frame %d\n",
|
||||||
|
data->frame_count);
|
||||||
|
}
|
||||||
|
|
||||||
data->frame_count++;
|
data->frame_count++;
|
||||||
if (data->fp_output && !err_info)
|
if (data->fp_output && !err_info)
|
||||||
dump_mpp_frame_to_file(frame, data->fp_output);
|
dump_mpp_frame_to_file(frame, data->fp_output);
|
||||||
@@ -510,6 +520,7 @@ void* multi_dec_decode(void *cmd_ctx)
|
|||||||
dec_ctx->frame_count = 0;
|
dec_ctx->frame_count = 0;
|
||||||
dec_ctx->frame_num = cmd->frame_num;
|
dec_ctx->frame_num = cmd->frame_num;
|
||||||
dec_ctx->reader = reader;
|
dec_ctx->reader = reader;
|
||||||
|
dec_ctx->quiet = cmd->quiet;
|
||||||
|
|
||||||
RK_S64 t_s, t_e;
|
RK_S64 t_s, t_e;
|
||||||
|
|
||||||
|
@@ -332,6 +332,10 @@ RK_S32 mpi_dec_test_parse_options(int argc, char **argv, MpiDecTestCmd* cmd)
|
|||||||
goto PARSE_OPINIONS_OUT;
|
goto PARSE_OPINIONS_OUT;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case 'q' : {
|
||||||
|
cmd->quiet = 1;
|
||||||
|
optindex--;
|
||||||
|
} break;
|
||||||
default : {
|
default : {
|
||||||
mpp_err("skip invalid opt %c\n", *opt);
|
mpp_err("skip invalid opt %c\n", *opt);
|
||||||
} break;
|
} break;
|
||||||
|
@@ -36,6 +36,7 @@ typedef struct {
|
|||||||
RK_U32 width;
|
RK_U32 width;
|
||||||
RK_U32 height;
|
RK_U32 height;
|
||||||
RK_U32 debug;
|
RK_U32 debug;
|
||||||
|
RK_U32 quiet;
|
||||||
|
|
||||||
RK_U32 have_input;
|
RK_U32 have_input;
|
||||||
RK_U32 have_output;
|
RK_U32 have_output;
|
||||||
|
Reference in New Issue
Block a user