diff --git a/inc/mpp_frame.h b/inc/mpp_frame.h index a9e0f534..4c4ebdf7 100644 --- a/inc/mpp_frame.h +++ b/inc/mpp_frame.h @@ -138,6 +138,7 @@ extern "C" { */ MPP_RET mpp_frame_init(MppFrame *frame); MPP_RET mpp_frame_deinit(MppFrame frame); +MppFrame mpp_frame_get_next(MppFrame frame); /* * normal parameter diff --git a/mpp/mpp_frame.cpp b/mpp/mpp_frame.cpp index f087a05e..3809ec53 100644 --- a/mpp/mpp_frame.cpp +++ b/mpp/mpp_frame.cpp @@ -64,3 +64,14 @@ MPP_RET mpp_frame_deinit(MppFrame frame) return MPP_OK; } +MppFrame mpp_frame_get_next(MppFrame frame) +{ + if (NULL == frame) { + mpp_err("mpp_frame_get_next invalid NULL pointer input\n"); + return NULL; + } + + MppFrameImpl *p = (MppFrameImpl *)frame; + return (MppFrame)p->next; +} + diff --git a/mpp/mpp_frame_impl.h b/mpp/mpp_frame_impl.h index 03c99a8b..55281240 100644 --- a/mpp/mpp_frame_impl.h +++ b/mpp/mpp_frame_impl.h @@ -19,7 +19,9 @@ #include "mpp_frame.h" -typedef struct { +typedef struct MppFrameImpl_t MppFrameImpl; + +struct MppFrameImpl_t { /* * dimension parameter for display */ @@ -65,7 +67,12 @@ typedef struct { * buffer information */ MppBuffer buffer; -} MppFrameImpl; + + /* + * pointer for multiple frame output at one time + */ + MppFrameImpl *next; +}; /* diff --git a/test/mpi_test.c b/test/mpi_test.c index fa4d452c..ab91aaa6 100644 --- a/test/mpi_test.c +++ b/test/mpi_test.c @@ -93,10 +93,15 @@ int main() } if (dec_out) { - // TODO: diaplay function called here + // interface may output multiple frame at one time + do { + MppFrame next = mpp_frame_get_next(dec_out); - mpp_frame_deinit(dec_out); - dec_out = NULL; + // TODO: diaplay function called here + + mpp_frame_deinit(dec_out); + dec_out = next; + } while (dec_out); } mpp_packet_deinit(dec_in); @@ -125,8 +130,15 @@ int main() } if (dec_out) { - mpp_frame_deinit(dec_out); - dec_out = NULL; + // interface may output multiple frame at one time + do { + MppFrame next = mpp_frame_get_next(dec_out); + + // TODO: diaplay function called here + + mpp_frame_deinit(dec_out); + dec_out = next; + } while (dec_out); } }