When last stream packet is send with eos flag but without valid task or
not output is set just output an empty eos frame.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I18a4ea004479820d4dcfe30aa75d935b15a188cf
MppQueue does not support concurrent access, and there
are defect in the design, which need to be improved in
the future.
Signed-off-by: Xingwen Fang <fxw@rock-chips.com>
Change-Id: I50db4bcf520bbf4115c6f40d7a759652087965ec
1. Only use notify to communicated between mpp and codec.
2. Remove mpp_enc_impl.h
Change-Id: Ia62757240efa7d245b5215ad79539fa9bbbd1550
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add MppDecImpl layer for separate encoder and decoder.
Change-Id: I02e04acddf617ae5188572af89312ab20fbf21b6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Use HalTask to communicate between hal thread and vproc thread.
Change-Id: I4e87b7ca63bdf86e46045e31296ffa69958ae719
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Move MppCtx, MppParam, MppFrame, MppPacket, MppBuffer, MppBufferGroup,
MppTask and MppMeta to rk_type.h.
Later development need to bring in cross reference between these
objects. So we choose to move these declaration together.
Change-Id: I7ea39138ca87d6ca4cb86556464a5de89d172846
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
After info_change is encountered by paser thread, HalDecTaskFlag will
have info_change flag set. Although mpp_dec_flush is called there may be
some frame still remaining in display queue and waiting to be output. So
these frames shouldn't have info_change set since their resolution and
bit depth are the same as before. What's more, the info_change flag has
nothing to do with frames need to be output.
Change-Id: Ia01d1ecca5a6deb1a5d2914c34147d5c46c21684
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
When the buffer does not match, frame group needs to modify
the buffer size before it can be used properly, so it needs
to wake up the wait.dec_buf_match condition after info changed
ready.
Change-Id: I3ef7b2bf59d7649cf0e05731a2e51f40fd082535
Signed-off-by: Rimon Xu <rimon.xu@rock-chips.com>
Eos should not go alone with info change flag.
If input stream is only 1 frame and require info change decoder will
create a info change with eos flag which will cause buf_slot dump log
like this: "can not clr queue_use on slot"
This patch clears eos flag on creating info change task to hal thread.
Change-Id: Ibbb92155ec1d7d0d406c781ebaaa81a98a2fc893
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When there is hal_task on PROC_DONE status on reset the reset process
should set these tasks to IDLE status.
Change-Id: I8a9e25fb98e597e22b9b99a6d13f84a4a0e59e3b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When decoding is not finish (eos) and user call reset the hal thread
may not clear all the reference frame used in decoder and not clear
frame in display queue. There will be memory leak on this case.
This patch fix this error when user randomly call reset funciton on
decoding by flushing decoder and clearing display queue.
Change-Id: I68a12bd8cfb94a4d56d652a11695ef69f2a78825
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tips:
a) when parse syntax error, enable parse_err;
b) when dpb ref error, enable ref_err;
c) when use disable err, only disable ref_err, parse_err cannot.
above all, using these flags, when parse error, it also can
go ahead to hal thread, and loop all.
Change-Id: I639248dbf4499a8ed473b9f44f1e1332409c5c22
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This handwriting error will cause larger memory usage when decoder is
too fast.
Change-Id: Iea93fcfd265d81c43206499a09d682da2b6231a1
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Optimize mpp_dec parser thread wait mechanism to reduce cpu overload.
1. Add mpp signal notify flag
2. Add mpp_dec wait status flag
3. Compare the notify flag with wait status flag. When there wait
condition is fulfilled then signal parser thread to process.
This will greatly reduce cpu overload by block wake up with no sense.
Change-Id: I38da718e80d0487e0300e807bc87cdb1aa070471
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
The decoder reset function would push all the reminded
buffers into output queue. It is not necessary and
useless.
A reset order means the application want to be back
to the origin. So we must remove the references
from decoder after a resettting.
Change-Id: Ic4ec5410606ffc815cd6c29e84735a3909b27f62
Signed-off-by: Randy Li <randy.li@rock-chips.com>
tips: when not fast_mode, both wait.dec_all_done and wait.prev_task
are used.
Change-Id: I7397fe1e60cca4a7518d1d4859c4dad554a7b938
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
when video quit or eos, mpp allocate a fake frame but not free.
Change-Id: I3079953ed44c578b6ec7e4fac135039eb00140ad
Signed-off-by: ywj <ywj@rock-chips.com>
tips: when counts need update, then parser thread wait for hal
thread done, and reset wait flag.
Change-Id: I852c76b672f78e37c3dfdad7761b3b23511ec5ee
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
When paser thread generate a info change task then user call reset
operation right before hal thread receive this info change task. This
task will be released and hal thread will get a invalid buf_slot.
The patch bring in the async reset / sync reset done mechanism:
User can call reset at anytime. So it is a async reset.
Then parser / hal / vproc thread need to finish all reset operation
before process next loop.
This means decoder thread need to sync at the reset done point.
It will keep reset operation save and clear.
Change-Id: Ia8482fd09d84e5fa6a096f2740ed1319d4cf79a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add extra log to mpp_dec and vpu_mem_legacy
Change-Id: I27599077093a34a70aa7c590034f100fdc32416b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
1. Unify the hal thread output process to mpp_dec_put_frame
2. Add vproc path for field source.
3. Reserve one more buffer when deinterlace is enabled.
4. Default enable for normal mpp path but disable on vpuapi path for the
reason that rk_ffplayer has done deinterlace process internally.
Change-Id: I02e7cece844fde01c2d249dafe6f7ce6a325593f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tips: when task is not valid, and width and height is wrong,
then infochange will be tripper, which is unnecessary.
Change-Id: I45c4ee75a8d1e2928995be0562f032fabe8c95cb
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Rename thread lock / signal type by its source.
Change-Id: I426cb9490dd05183badffa36f0a861c439c5f23b
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Add more function to MppBufSlot:
1. Add used / unused count for querying with corresponding log.
2. Add more queue (deinterlace / color convertion)
3. Add MppFrame generation for slot index.
4. Add post process flag for field image.
Change-Id: I2666d026fc19816d2e32547604228f2a3747211f
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
rkffplayer send MPP_DEC_SET_PRESENT_TIME_ORDER command with NULL
parameter. We need to support NULL parameter.
Change-Id: I0f75810324546bbce24e19daf5eff6e26bd164d8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tips: when input timestamp has not pts, and set pts=dts,
it should use input timestamp order for output.
Change-Id: I8b3ef9a8d150e5729a3fa94df6c1b448edb8f1fd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
When push display mpp_frame will generate a new copy. If it found a
reset flag the whole mpp_frame should be free rather than only
mpp_buffer in the mpp_frame.
Change-Id: I4b784e668167ef9be06a9dd1a02e860a7654a021
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
tips: when decode too fast then display queue is full,
that should wait until frame displayed.
Change-Id: Ic8ec18368fdb956cad92b0760a3d4637e46f55bf
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
tips:
a) when eos is empty frame, direct flush and return.
b) when last frame has eos, then decode it and flush.
c) mpp_put_frame must check frame slot whether empty.
d) when eos_frame decode error, mark error in eos_frame
Change-Id: Ia78445b2e568195f411b2f339469f4097e83b570
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
1. Disable error default is not set for normal error detection.
2. On special case like drone streaming the user prefers to ignore
all error and continue decoding. Then disable error flag will be set
to fullfill this requirement.
3. When disable error flag is set H.264/H.265 decoding will ignore
hardware error and mark all output frame as no error.
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Change-Id: I8fd619511c53ee744ae973ab3fe015565106dd37
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
I think those information are very anxious and useless
in daily usage.
Change-Id: I946418a476a332588b1d9b9722bbd5e93213e8dc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
The MppQueue offers an atomic signal mechanism on
the pending data. It could solve the the async problem
with parser thread and input data.
Change-Id: I8201640b28b1d2b4d2186e1bcfbf018bf8f97d32
Signed-off-by: Randy Li <randy.li@rock-chips.com>
When the input stream is full, it may happen:
1. Both mTheadHal(hal) and mThreadCodec(parser) is waiting
a signal;
2. The previous task is not ready in parser;
3. A task is in idle and the other is done is the tasks group.
If the parser has finished the checking on the task is done but
has not enter into wait condition state yet, then the hal thread
can't wake the parser later.
Change-Id: I3b30e40bc1de7c5ca6d401084929cfd57ca00546
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
It would be more easy to look into those code next time.
The functions in mpp_time.c have removed the internal debug
flag checking.
Change-Id: I6392190896f74e86a8407f06fa3621dd92371e56
Signed-off-by: Randy Li <randy.li@rock-chips.com>
It will cause conflicts with the gb28181 protocol
Change-Id: Ia4c24c528c88caa3e6f7c1ad20ef309607e04794
Signed-off-by: ZhouJing <tracy.zhou@rock-chips.com>