Commit Graph

121 Commits

Author SHA1 Message Date
Herman Chen
82bc016bbb [oasl]: Add debug function to mpp_mem
1. Add memory node record.
2. Add runtime log with memory count and total size.
3. Add extra room for overflow detection.
4. Add memory poison after free to detect write after free.

Change-Id: I4f0fe7295f18a746c3b4c135681127a18337585e
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-01-29 11:47:31 +08:00
Herman Chen
7d29f32280 [osal]: Add runtime allocator detection function
Due to complexity of different kernel and usespace combination
we have to detect drm and ion allocator on runtime. The HAVE_DRM
flag may not be trust at all time. So we add a simple detection
function on first run.

Change-Id: Id4f6b2278ee0fe50ffc9806fffc5b01267f723da
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-12-18 15:15:07 +08:00
Randy Li
50bdc4de6a [mpp]: turn off a lots of message
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>
2017-11-30 11:32:17 +08:00
Randy Li
6e471a0d14 [osal]: add queue data type
Only the src port supports blocking operation. Please
notice the sink port is neither block nor atomic.

Change-Id: Ib710eaca9fe1b5d5aada8e56481102589b52fc52
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-11-20 11:54:58 +08:00
Randy Li
e0a1d6579d [drm]: use mmap() in native way for GNU Linux target
The "[drm]: fix runtime error for 32bit library" is hack way,
it won't work at GNU Linux platform. Also you need to check
_FILE_OFFSET_BITS and _LARGEFILE64_SOURCE before use the
mmap64().

For the normal mmap() with glibc, we only request to
check offset is aligned with page size but not the lenght.
But that doesn't apply for the memory from the drm device,
also the android use a different rule.

I decide not to map all the buffer to cpu at beginning
since most of them won't be access by the cpu.

Change-Id: I74ac7b5b63d45029cae076985a3d0b4526c62bbc
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-10-27 10:06:20 +08:00
leo.ding
b7cbd8a9c0 [mpp_device]: add MppDevCtx for control device status
1. add Mppdevctx to store some infos in every codec.
reason:each codec has its own unique characteristics.
2. add mpp_device_control interface for get or set ctx values.
reason:it simplity interface, which flexible, easy to use and versatile.

Change-Id: I56c9332768c86f62a3ca248ad254fba9e798c577
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-06-07 15:14:30 +08:00
leo.ding
8cd076afae [mpp_platform]: rename HAVE_265E to HAVE_265ENC for buid warnnig
H265E had defined in Cmakelist.txt to choose whether build
h265 encode module, so it here is redefined.

Change-Id: I54e9704d396d0a8a0e6d0f2ae8595d033131d81b
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-05-15 17:28:16 +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
Randy Li
6e32081214 [allocator]: Fix compiler warnings
Change-Id: I52554a3ca45747c13a7821a04bb1c01e45d9d44c
Signed-off-by: Randy Li <randy.li@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-24 12:08:20 +08:00
LongChair
a3f463f9ce [mpi] : Add a block timeout control command.
When retrieving frames current API only allows to define wether
the API should block without any timeout or not block at all.
This allows to specify a block timeout via the
MPP_SET_OUTPUT_BLOCK_TIMEOUT control operation.

Change-Id: Id35ad3d48f72881184009f830c406c3a655e1a90
Signed-off-by: LongChair <LongChair@hotmail.com>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-03-24 11:43:08 +08:00
timkingh.huang
700b7fc875 [jpegd]: check thread status before mpp_port_dequeue
The thread status may be changed before mpp_port_dequeue,
so it is necessary to check it.

Change-Id: Ibe6f33cb7a5ac88bd93da3b0a15d9e0a271d825b
Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
2017-03-09 15:00:10 +08:00
Herman Chen
4b41fdd8bc [mpp_platform]: Modify chip vcodec detection
1. Add video codec information and kernel driver device detection code for all
supported chips.
2. Add video codec type and device name detection test

Change-Id: I275c0e616acd80c9a4ad2fee00588479e47a92db
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-03-03 16:12:36 +08:00
Jung Zhao
038a3bd665 [rc]: add init qp estimation
if outside doesn't set init qp value, mpp will estimate one init qp
according to resolution and bitrate.

Change-Id: If5415f6a3bfa3f2981ffd4eb044614bf9b035d2f
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-01-17 09:20:05 +08:00
Herman Chen
444e8b429f [mpp]: Fix compile warning for strict-prototypes
Change-Id: Ia430a5d157dc2d19c92a43ca15eab83f1ac540c6
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2017-01-11 10:43:27 +08:00
leo.ding
b0902117fc [osal]: Add hardware platform detection
Change-Id: I0223b79608a9ea8346dbf194805c2536a90beb3b
Signed-off-by: leo.ding <leo.ding@rock-chips.com>
2017-01-06 09:06:54 +08:00
Herman Chen
4c1ae218e6 [mpi/mpp/enc]: New encoder framework
1. Interface change:
Separate normal config into three basic config and several runtime config:
Three basic config -
a. rate control config
b. preprocess config
c. video codec protocol config
More flexible rate control interfaces are provided.
More codec configure interfaces are provided.
Change flag with bitmap is provided for further optimization.

2. Remove old codec config from controller and left rate control module only
Encoder controller only handle user rate control requirement and bit allocation.
Hal hardware encoder only handle qp calculation according given target bit.
Remove all old codec code.

3. Move codec process to hal
Different hardware will share same codec process function in common protocol
directory. And different hardware api will register to same api set. Codec
header generation is moved to separate hal directory.

4. Encoder will return length by task
Encoder will NOT get stream information feedback from controller. All
information required by encoder will be all stored in Task.

5. Add mpp_rc for rate control
Move some common rate control utils to mpp_base.

6. Update mpi_enc_test and mpi_rc_test with new interface

Change-Id: Iebb5e276a48f547167e1bed4673f21cc2f0c8ad5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2017-01-05 10:58:27 +08:00
Herman Chen
d16a83fae4 [osal]: Add return value to condition wait
Change-Id: I4955ae98a714c227da4b2aacc9da063e05a64139
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-20 15:07:33 +08:00
Herman Chen
6a4c890291 [osal]: Add more function to Condition class
Change-Id: I31c5a2645a79576b6f1fe22285a9dfcf4b001293
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-20 09:56:07 +08:00
Herman Chen
e2ba112070 [osal]: Fix compile error on windows
Change-Id: Id908c592aaee3b8f16f7529c8c3995b3f4af78f8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-16 11:22:31 +08:00
Herman Chen
249f83f35b [mpp_buffer]: Add caller to MppBuffer functions
Add caller parameter to all mpp_buffer functions.

Change-Id: Ibebd2a31b302988fe1ed480de575189ce57e41a5
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-12-15 16:56:39 +08:00
Lin Kesheng
723ffae18e [mpi_enc_test]: fix mpi_enc_test read src frame bug
1. read src frame with real width and height of picture,
   rather than virtual ones.
2. configure correct hor_stride & ver_stride for hardware
3. support yuv420/420sp for mpi_enc_test demo and video
   app, and is compatible for old interface

Change-Id: I1fc23dc2954577b28e25b80a4dcdd1536d45d622
Signed-off-by: Lin Kesheng <lks@rock-chips.com>
2016-11-24 17:52:44 +08:00
Herman Chen
2fc024529e [osal]: add environment detection function
1. add software runtime detection
2. add hardware platform detection

Change-Id: I75736ae85130325029023d948e4d756e27953af8
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2016-11-08 18:22:29 +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
4f7f69c1ae [mpp]: fix compile error on windows
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1191 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-08-11 10:16:44 +00:00
ChenHengming
e179717e0b [mpp]: update mpp debug log
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1124 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-28 11:52:51 +00:00
ChenHengming
1a2551ec3e [mpp_enc]: fix crash in vpu_api_legacy.cpp
[mpi]: use new control macro system

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1050 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-20 07:54:31 +00:00
GaoZhili
3fafb0fe4f commit the avc encode code, now avc encode process is ok
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1048 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-20 07:22:25 +00:00
GaoZhili
3249378118 only format the unformated code to standard style
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@1020 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-07-14 09:34:04 +00:00
ChenHengming
4201f689c0 [format]: format coding style
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@907 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-13 09:47:19 +00:00
ChenHengming
c0866a76f9 [comment]: fix company name hand writing error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@906 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-13 09:42:31 +00:00
ChenHengming
053001c541 [common]: 1. add 32bit runtime function, 2. change uintXX_t to RK definition
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@905 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-12 07:11:52 +00:00
ChenHengming
74bdf736f0 [mpp_thread]: add mpp_log.h for mpp_assert in thread class
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@903 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-12 02:59:24 +00:00
ChenHengming
fa0d33ab9f [osal]: fix mpp_allocator handwriting error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@878 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-06 12:19:38 +00:00
ChenHengming
d24e6800f1 [mpp_log]: use dynamic abort to replace static compiled mpp_abort
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@864 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-06-02 10:08:19 +00:00
ChenHengming
50277780fc [mpp_thread]: fix compile error on windows and linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@774 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-19 06:35:22 +00:00
ChenHengming
7bd7a300e6 [osal]: better way to set thread name on android/linux
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@771 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-19 03:08:50 +00:00
ChenHengming
00726d2a77 [mpp_mem]: Add mpp memory snapshot function
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@717 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-05-10 11:36:29 +00:00
DingWei
1ecd3ceaf2 [h265d] add hevc-10bit-4K fast-mode errorinfo mark
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@606 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-04-16 03:17:10 +00:00
ChenHengming
8199200963 [astyle]: format coding style on linux and remove warning
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@592 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-03-18 06:15:42 +00:00
ChenSiyong
5cf3dcb2dd [mpp_dec] add que display mux for frame que fixed thread async cause push frame que error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@580 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-03-02 02:33:00 +00:00
ChenSiyong
42d89860a3 [vp9_d]fix compile error
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@564 6e48237b-75ef-9749-8fc9-41990f28c85a
2016-02-01 09:51:12 +00:00
ChenHengming
cdac24a654 [mpp_thread]: remove warning of timedwait
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@497 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-12-02 23:08:05 +00:00
ChenHengming
3f7ef46a14 [osal]: add timedwait
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@493 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-12-02 22:49:45 +00:00
ChenHengming
028ebc655c [mpp_time]: add limit mpp time diff print
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@491 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-12-02 14:44:06 +00:00
ChenHengming
1265c7f173 [osal]: add time differ function
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@486 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-11-25 15:30:58 +00:00
ChenHengming
0c69cc591f [mpp]: use __FUNCTION__ to replace __FILE__, add mpp_debug initial and move mpp_debug to osal
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@485 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-11-25 14:53:47 +00:00
ChenHengming
85b3592ba8 [hal]: add hal timing function
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@483 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-11-25 02:33:06 +00:00
DingWei
d57009240d [h264d] update module, which change the dxva interface the same as mircosoft
[hal_h264d]  add on2 hard module, which all intra stream && AVC && seek are OK
[h264d_test] update the demo can be run and ouput raw yuv, which is right 
[vpu_api]    add AVC interface
[mpp_buf_slot] add a return variable value
[mpp_log]    delete some marco define and put these to h264d_log.h

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@448 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-11-04 14:29:38 +00:00
ChenHengming
107e40bf82 [astyle]: coding style formating
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@438 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-11-01 20:10:35 +00:00
ChenHengming
23652564dc [mpp_thread]: improve reset lock/condition implement
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@428 6e48237b-75ef-9749-8fc9-41990f28c85a
2015-10-25 16:50:57 +00:00