mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 09:06:50 +08:00
[mpi_dec_test]: Support jpeg loop decoding
usage: -n -1 Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: Ic184142f771b1e9c68344b3162e491f18d4d33fc
This commit is contained in:
@@ -411,10 +411,14 @@ static int decode_advanced(MpiDecLoopData *data)
|
|||||||
size_t read_size = fread(buf, 1, data->packet_size, data->fp_input);
|
size_t read_size = fread(buf, 1, data->packet_size, data->fp_input);
|
||||||
|
|
||||||
if (read_size != data->packet_size || feof(data->fp_input)) {
|
if (read_size != data->packet_size || feof(data->fp_input)) {
|
||||||
mpp_log("%p found last packet\n", ctx);
|
if (data->frame_num < 0) {
|
||||||
|
clearerr(data->fp_input);
|
||||||
// setup eos flag
|
rewind(data->fp_input);
|
||||||
data->eos = pkt_eos = 1;
|
} else {
|
||||||
|
mpp_log("%p found last packet\n", ctx);
|
||||||
|
// setup eos flag
|
||||||
|
data->eos = pkt_eos = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset pos
|
// reset pos
|
||||||
@@ -478,7 +482,13 @@ static int decode_advanced(MpiDecLoopData *data)
|
|||||||
if (mpp_frame_get_eos(frame_out))
|
if (mpp_frame_get_eos(frame_out))
|
||||||
mpp_log("%p found eos frame\n", ctx);
|
mpp_log("%p found eos frame\n", ctx);
|
||||||
}
|
}
|
||||||
|
if (data->frame_num > 0 && data->frame_count < data->frame_num) {
|
||||||
|
data->eos = 0;
|
||||||
|
clearerr(data->fp_input);
|
||||||
|
rewind(data->fp_input);
|
||||||
|
} else {
|
||||||
|
data->eos = 1;
|
||||||
|
}
|
||||||
/* output queue */
|
/* output queue */
|
||||||
ret = mpi->enqueue(ctx, MPP_PORT_OUTPUT, task);
|
ret = mpi->enqueue(ctx, MPP_PORT_OUTPUT, task);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Reference in New Issue
Block a user