when src frame is err, dst should be set errinfo also.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I5d9f090abc3a9ffea8f7e921c1b523242ab1fc69
The first jpegd vdpu2 will send codec info with normal register access
operation. But some old kernel will not support the codec info cmd 403.
Then kernel will discard the whole ioctl operation and let the first
decoding task failed.
So we separate codec info cmd from the normal register access cmd.
Change-Id: Ic364c90367a0493f132dc78e76fae3d4fd6011ca
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Fix error on encoding yuyv422 format with offset_x.
Change-Id: I3b1115e300d257cec096981d179da8111e31903d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: sayon.chen <sayon.chen@rock-chips.com>
When quant or qtable is set change rc mode to fixqp.
Change-Id: Iacb1a1596b98c481b9ee7cbe61696a9c79445188
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
optimize the size of some structures as blow:
1. H264dVideoCtx_t
2. H264dCurCtx_t
3. DXVA_Slice_H264_Long
Change-Id: If3d7ca2f8d92d2a590767a97324537700848ab90
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
NOTE: RGB format horizontal stride is byte stride. The pixel_stride in
MppFrame is the stride by pixel.
Change-Id: I09e87c5f7fb871ee2b285451ed2f0abfb1351f19
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Compatible with some jpeg images that do not start with ffd8, but messy
data.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I963e16cb499af13fe95358e60f44e91d0df17bf3
When a new sps/pps nal is detected the spspps_update flag must be set.
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ida86fae2dbe5e2db5171504859ff6fe65b2c0828
1. In mpp_buffer_ref_dec it should be locked on search group by id.
2. Remove extra hash_32 on adding new group.
3. Improve id searching on id overflow.
Change-Id: Ibef4612e48b5a4c9dd6c5eca6c85f8ccba813827
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When nal buf len is 0, nal buf shouldn't be read.
e.g. the following stream, the nalu_len will be decrese below 0,
it will crash to read nal_buf[] with invalid idx.
0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Iafa103fe4f6df7cff41ffbdf6c94b42736456bcb
The static lock maybe release before mpp_buffer_service. So we should
not used the lock on finalizing stage.
Change-Id: Ibf207e02e4fcdc2b5280ea58bd68372a7888a60a
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
When /dev/mpp_service is opened and be forked to another thread the
leaked fd will increase file refcnt in kernel.
Then the codec kernel session will be leaked on mpp_destroy.
Change-Id: I5bb682792c8e58591ec3a21af36e3f8a967f77fb
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
There is a bug when using single drm allocator device for all buffers:
Sample:
1. external fd a is import to mpp_buffer and get handle B / fd b.
2. external fd a is import to mpp_buffer again and get handle B / fd c.
NOTE: The handle is the same in mpp for drm allocator is the same
and the handle ref_count is not increased.
4. release fd b and handle B. (NOTE: The handle B is released in kernel)
5. mmap fd c by handle B. (Crash on getting handle B in kernel)
So we should reacquire handle for fd c when it need mmap or free.
Change-Id: Ide0591f97be5e00ca71f6a16e0ff676c4ed206a5
Signed-off-by: aaron.sun <aaron.sun@rockchips-com>