Commit graph

24 commits

Author SHA1 Message Date
Herman Chen
2b35cee0ce [mpp_log]: Add more log helper function
1. Move mpp_log.h to inc for external user.
2. Add mpp_debug.h for mpp internal logging.
3. Fix some warning.
4. Add log level setup function.
5. Check env log_level value in mpp_get_log_level call.

NOTE:
1. mpp internal module should use mpp_debug.h and mpp external user
should use mpp_log.h
2. Use mpp_get_log_level to update mpp_log_level when the env changed.

Change-Id: I90a55a02a72db177533013280dfe111ca3479229
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-05-20 11:42:10 +08:00
Herman Chen
6f288f656e [mpp_task]: Add more interface
Change-Id: Ib80597267a439d5c42a3cf9eed77614cc8cda5c5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-04-29 17:38:46 +08:00
Herman Chen
ee3b958d9c [mpp_meta]: Add metadata dump for taskqueue
Change-Id: I0c62a93c8ffd1cf9e243e18940fc2197221f99ec
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2022-01-12 15:58:56 +08:00
Herman Chen
e61bfa736f [mpp_meta]: Improve performance
Change-Id: If2177552e5b71cd8acf5bfdb3e0a2ae20af71b4d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-11-02 19:57:52 +08:00
Herman Chen
aed7c380c5 [mpp]: Fix block input error
1. put_packet support block mode now.
2. The EosTask should be insure to be block mode.
3. NOTE: When set to block mode use put_packet and get_frame in single
thread may cause deadlock for the info change or eos may be blocked and
the put_packet can not return.

Change-Id: I8cf73f833e5d29c3b330c4b56fbd6be8d7432e60
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-04-30 18:43:16 +08:00
Herman Chen
6b5ee5a122 [mpp_dec]: Implement put_packet by dequeue/enqueue
1. Use dequeue/enqueue to implement decoder put_packet interface.
2. Change task check on deinit. Only check the metadata size in task.
   If MppTask is destroyed with valid metadata just should warning.
3. Reserve one task at input queue for eos packet.

Change-Id: Ib445b148bb5a10c588104ee1fd96bad6f52f1388
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
d3ed1d9e6e [mpp_task]: Add positive return for port poll
When poll the port task and there is task for dequeue just return
positive valid task count value to caller.

Change-Id: I6c078cee69e34ba9b6cc5ffa77c704b8c59683b4
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2021-03-03 15:18:37 +08:00
Herman Chen
5b47293917 [mpp_task]: Improve mpp_task queue work flow log
Change-Id: Ifa39726f376ac0254a8a88189b1cb918fb33a2f9
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-07-29 09:22:04 +08:00
Herman Chen
b165fcd4b0 [mpp_enc]: Change encoder work thread flow
1. Add wait and status flag for encoder
2. Add notify for encoder
3. Use wait and notify for encoder task handling.

Change-Id: I6ce0f676084f7c27cc95d6abc56557bfa286ef87
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-09-03 09:08:17 +08:00
Herman Chen
ba2fab3018 [mpp_task]: Hide port and task queue from rk_mpi.h
Move MppPort and MppTaskQueue function to mpp_task_impl.h.
Add caller parameter to mpp_port_poll, mpp_port_dequeue,
mpp_port_enqueue, mpp_port_awake functions for debug purpose.

Change-Id: I39f69d934d45b65c3bc751d71ec98388c2fb9849
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:49:20 +08:00
Herman Chen
ab235fd62e [mpp_meta]: Add meta size interface
1. Add mpp_meta_size and mpp_meta_next_node function
2. Move mpp_meta_size and mpp_meta_next_node to mpp_meta_impl.h

mpp_meta_size      - Return node count in metadata.
mpp_meta_next_node - Return next MppMetaNode in metadata.

These two functions are useful in debug.

Change-Id: If0be59c4621fd8ba2e2dbe96124a653b397bac7c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2019-06-21 17:44:03 +08:00
Randy Li
3caf8d8738 [osal]: fixup for a compiler warning
Change-Id: Idd1225c5cb98e5039bf0659e1d2ecdc5c04dbd02
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-07-07 15:05:38 +08:00
Herman Chen
9c7b9efe74 [misc]: Remove source code executable attribute
Change-Id: I1bf4ec5782e30869e971e4c27ef50285d4382233
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-06-06 08:48:50 +08:00
hh
0da8d1f604 [enc]: add output port awake when encode exit.
If encode thread is blocked in mpp_port_poll(output, MPP_POLL_BLOCK) and
user's get stream thread exit, it must awake this block call before join
encode thread exit.

Change-Id: Iee52d2d45a672464b7f3485086a389041dacdeb0
Signed-off-by: hh <hh@rock-chips.com>
2017-05-04 18:03:45 +08:00
ayaka
8bde251d54 [osal]: fix the timeout function
Please notice that clock source is only confirm to work
on the currently Rockchip ARMv7/ARMv8 SoC.
You may meet problem with the other platform.

The time granularities is miliseconds level.

Change-Id: Icf56f88dd15045d7c899bdcfaf3637fab159b35a
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Reviewed-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-04-14 11:25:58 +08:00
herman.chen
d88b087526 [mpp_task]: Fix task condition release bug
Change-Id: I2d378cb7d0219823fdcc66f3ce65c22210576025
Signed-off-by: herman.chen <herman.chen@rock-chips.com>
2017-02-10 09:01:02 +08:00
Herman Chen
d8ed1f4eb1 [mpi]: Add poll interface to mpi
1. Add poll with timeout. Support three mode: block/non-block/timeout.
2. Change control MPP_SET_INPUT_BLOCK and MPP_SET_OUTPUT_BLOCK.
3. Remove msleep in most mpp interface.

Change-Id: I39d9a261b6f1da66c6cb944abd71d1e7f4928d2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-04 15:15:37 +08:00
Lin Kesheng
60373a6973 [all]: format code
use fromdos to change file type, remove ^M in code.

Change-Id: I000202dc51fcff57cc0771455baebea595115b1d
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-09-08 15:21:02 +08:00
ChenHengming
07352a511c [mpp_enc]: fix memory leak and flow error in Android recording flow
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1068 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-22 01:05:39 +00:00
ChenHengming
baf6eb9d89 [mpp_enc]: fix task leak in async encoder mode
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1065 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-21 11:20:45 +00:00
ChenHengming
c102900a6b [mpp_task]: add mpp_port_can_dequeue function for port status detection
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1062 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-21 10:03:09 +00:00
ChenHengming
ac9505c16c [mpp_task]: add advanced task flow to mpp, mpi_enc_test can work without error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1035 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-16 10:13:35 +00:00
ChenHengming
62e28b89ea [mpp_task]: update task implement and add mpi_enc_test sample code
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1032 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-15 06:33:05 +00:00
ChenHengming
ef3a1e5c03 [mpp_task]: add mpp_task.cpp and mpp_task_impl.cpp
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1029 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-15 02:57:03 +00:00