This reverts commit d95ba73844.
This workaround may fail some android case, the proper solution is that
parse drop the first Non-I frame in the beginning.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Use v4l2 ctrl V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE and
V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY to instead of private ctrl id
V4L2_CID_DIS_REORDER.
The range of V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY is [0, 0]
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
v4l2 m2m will report pollerr if both queue are off or empty,
before sequence header parsed, it's likely that the capture queue is not
on, if the first buffer doesn't contain sequence header, the output
queue may be empty if the buffer is consumed before more buffers queued,
then report pollerr and exit unexpectedly.
The beffer solution is that the parser can drop the non-I frames before
the first IDR frame.
This patch is a workaround only for hantro v4l2, as the driver implement
its own poll callback. that driver only report pollerr for both queue
empty case after the initial sequence header parsed.
Tested-by: Hou Qi <qi.hou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
some ctrl is only applicable for certain format, if the format is not
supported by vpu hardware, just filter out it.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
there are some coverity issues found in hantro_v4l2, try to fix them
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Report the average QP value of current encoded frame via the control
V4L2_CID_MPEG_VIDEO_AVERAGE_QP, the value applies to the last dequeued
capture buffer.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
when reschange_notified is set, driver will prevent to stream on capture
queue, it likely make the both queue disable case in seek, can report
pollerr unexpectedly.
Tested-by: Hou Qi <qi.hou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
For v4l2 m2m device, there has to be at least one buffer queued on each
queued_list, which means either in driver already or waiting for driver
to claim it and start processing.
hantro_v4l2 is m2m device, but it don't use the v4l2 m2m framework
directly, so just keep it consistent with v4l2 m2m poll. report pollerr
if output queue is empty and capture queue is empry or off.
Tested-by: Xu Mao <mao.xu@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Few users use the fixed qp mode
open frame level rate control feature by default
default rc mode is CBR
Signed-off-by: TaoJiang <tao.jiang_2@nxp.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
For the first source change event, set last flag too, as android may
streamon capture before the first source change event. This allows users
to handle source change with consistent behavior
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
CONFIG_VIDEOBUF2_V4L2 can be built as module and CONFIG_MXC_HANTRO_V4L2
can be built-in, which is a problem, because in that case, symbols
exported by the videobuf2-v4l2.ko module will not be available to the
built-in vsiv4l2 driver.
ld.lld: error: undefined symbol: vb2_poll
>>> referenced by vsi-v4l2-enc.c:1553 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1553)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_poll) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:1554 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1554)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_poll) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:1559 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1559)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_poll) in archive vmlinux.a
>>> referenced 5 more times
ld.lld: error: undefined symbol: vb2_mmap
>>> referenced by vsi-v4l2-enc.c:0 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:0)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(v4l2_enc_mmap) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:0 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:0)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(v4l2_dec_mmap) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_dma_contig_memops
>>> referenced by vsi-v4l2-enc.c:1465 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1465)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(v4l2_enc_open) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:1465 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1465)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(v4l2_enc_open) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:1160 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:1160)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(v4l2_dec_open) in archive vmlinux.a
>>> referenced 1 more times
ld.lld: error: undefined symbol: vb2_queue_init
>>> referenced by vsi-v4l2-enc.c:1469 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1469)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(v4l2_enc_open) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:1486 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:1486)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(v4l2_enc_open) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:1164 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:1164)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(v4l2_dec_open) in archive vmlinux.a
>>> referenced 1 more times
ld.lld: error: undefined symbol: vb2_streamon
>>> referenced by vsi-v4l2-dec.c:253 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:253)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_capture_on) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:0 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:0)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_streamon) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:661 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:661)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_encoder_cmd) in archive vmlinux.a
>>> referenced 2 more times
ld.lld: error: undefined symbol: vb2_buffer_done
>>> referenced by vsi-v4l2-dec.c:267 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:267)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_capture_on) in archive vmlinux.a
>>> referenced by vsi-v4l2-priv.h:587 (../drivers/mxc/hantro_v4l2/vsi-v4l2-priv.h:587)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(return_all_buffers) in archive vmlinux.a
>>> referenced by vsi-v4l2-priv.h:587 (../drivers/mxc/hantro_v4l2/vsi-v4l2-priv.h:587)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_streamoff) in archive vmlinux.a
>>> referenced 6 more times
ld.lld: error: undefined symbol: vb2_streamoff
>>> referenced by vsi-v4l2-dec.c:295 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:295)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_capture_off) in archive vmlinux.a
>>> referenced by vsi-v4l2-enc.c:380 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:380)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_streamoff) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:455 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:455)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_streamoff) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_ops_wait_prepare
>>> referenced by vsi-v4l2-enc.c:836 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:836)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_buf_wait_prepare) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:881 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:881)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_buf_wait_prepare) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_ops_wait_finish
>>> referenced by vsi-v4l2-enc.c:831 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:831)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_buf_wait_finish) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:876 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:876)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_buf_wait_finish) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_reqbufs
>>> referenced by vsi-v4l2-enc.c:86 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:86)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_reqbufs) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:85 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:85)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_reqbufs) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_querybuf
>>> referenced by vsi-v4l2-enc.c:228 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:228)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_querybuf) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:161 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:161)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_querybuf) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_qbuf
>>> referenced by vsi-v4l2-enc.c:0 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:0)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_qbuf) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:0 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:0)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_qbuf) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_expbuf
>>> referenced by vsi-v4l2-enc.c:479 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:479)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_expbuf) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:566 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:566)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_expbuf) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_dqbuf
>>> referenced by vsi-v4l2-enc.c:410 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:410)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_dqbuf) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:483 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:483)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_dqbuf) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_create_bufs
>>> referenced by vsi-v4l2-enc.c:111 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:111)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_create_bufs) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_prepare_buf
>>> referenced by vsi-v4l2-enc.c:458 (drivers/mxc/hantro_v4l2/vsi-v4l2-enc.c:458)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-enc.o:(vsi_enc_prepare_buf) in archive vmlinux.a
>>> referenced by vsi-v4l2-dec.c:545 (drivers/mxc/hantro_v4l2/vsi-v4l2-dec.c:545)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_prepare_buf) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_plane_vaddr
>>> referenced by vsi-v4l2-priv.h:610 (../drivers/mxc/hantro_v4l2/vsi-v4l2-priv.h:610)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2-dec.o:(vsi_dec_reqbufs) in archive vmlinux.a
>>> referenced by vsi-v4l2daemon.c:308 (drivers/mxc/hantro_v4l2/vsi-v4l2daemon.c:308)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2daemon.o:(getbusaddr) in archive vmlinux.a
ld.lld: error: undefined symbol: vb2_plane_cookie
>>> referenced by vsi-v4l2daemon.c:309 (drivers/mxc/hantro_v4l2/vsi-v4l2daemon.c:309)
>>> drivers/mxc/hantro_v4l2/vsi-v4l2daemon.o:(getbusaddr) in archive vmlinux.a
To fix the build issue, force the hantro_v4l2 driver to be also built as
a module when videobuf2-v4l2 is a module
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
The last buffer from before the change must be marked with the
V4L2_BUF_FLAG_LAST flag, similarly to the Drain sequence above.
Initiate a drain of the capture queue in dynamic resolution change.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
1.convert unsigned long to u64
2.convert pointer to u64, shouldn't use these property
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
In v4l2 encoder spec, any source frames queued to the OUTPUT queue
between V4L2_ENC_CMD_STOP and VIDIOC_STREAMOFF() will be discarded.
But we shouldn't discard frames after VIDIOC_STREAMOFF().
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: Hou Qi <qi.hou@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
kernel has define 2 rv fourcc, rv30 and rv40.
but vpu only use one rv format.
so need to store the setting rv fourcc,
and report it in get_fmt().
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
driver use the format bit mask implicitly,
it use the index in array,
but there is 2 members for rv format,
then the index may led to some bug.
so specify format bit mask explicitly to avoid bug.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
The realvideo comes in 4 incompatible flavours,
RV10/RV20/RV30/RV40 also known as RealVideo 1 / G2 / 8 / 9+10.
The fourcc V4L2_PIX_FMT_RV is inappropriate.
V4L2_PIX_FMT_RV30 and V4L2_PIX_FMT_RV40 has been upstreamed,
use the specific fourcc V4L2_PIX_FMT_RV30 and V4L2_PIX_FMT_RV40
instead of the inappropriate general fourcc V4L2_PIX_FMT_RV.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
the sizeimage calculated from width * height
may be too large,
android may not meet it, then fail the decoding.
to avoid such case, let user set a reason sizeimage
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: Ming Zhou <ming.zhou@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
in the E.2.1 of Rec. ITU-T H.264 (06/2019),
0 of cloour primaries is reserved, and 2 is unspecified.
driver can map V4L2_COLORSPACE_LAST to 0,
and map V4L2_COLORSPACE_DEFAULT to 2.
v4l2_xfer_func and v4l2_ycbcr_encoding are similar case.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
The last_buffer_dequeued flag will be cleared
in vb2_streamoff() automatically,
but there are two cases that may led to this flag not cleared,
it may fail some android cts testcase
so driver clear this flag manually
when capture streamoff and streamon
Signed-off-by: Ming Qian <ming.qian@nxp.com>
disable quirk_poll_must_check_waiting_for_buffers,
this quirk check only affect capture queue,
and it's set by V4L2 for backwards compatibility reasons.
But it's not used for m2m device, the vpu decoder is
m2m device, but not implement using m2m helper function.
just keep consistent with the m2m implementation
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
the eos event is deprecated,
if the error occurs during parsing sequence header,
driver can wakeup the poll waiting,
and set last_buffer_dequeued,
then the client can get the errno "-EPIPE"
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: Xu Mao <mao.xu@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
if source change event is triggered during seek,
handle seek first,
it requires that the capture streamoff and on
for seek and source change separately
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
if source change event is not received,
driver will prevent streamon capture really,
if do seek in this case, return the queued but not actived buffer.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
In H264/H265 spec, the video_full_range_flag is not controlled
by colour_description_present_flag,
so if colour_description_present_flag is false,
the sequence header still may report the video_full_range_flag
and when the video_full_range_flag syntax element is not present,
the value of video_full_range_flag shall be inferred to be equal to 0.
so when sequence header is found, report the parsed video_full_range_flag
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Coping with upstream changes:
cd75981ec9 ("media: v4l2-ctrls: drop 'elems' argument from control type ops.")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
init function defined in v4l2_ctrl_type_ops is changed
need to initialize elements[from_idx..end_idx] instead of element[idx]
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
when daemon report source change event to driver,
driver need recalculate the sizeimage
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Tested-by: Ming Zhou <ming.zhou@nxp.com>
driver will prevert to enqueue capture buffer to daemon
if resolution change is never received,
after reset decoder, driver needs to clear the resolution change count
to prevert to enqueue capture buffer to daemon.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
Driver use the width as the default bytesperline,
no matter what pixel format is.
The it requires the user set correct bytesperline,
if not, some error occurs.
Add some protection in driver that
calculating default bytesperline according format and width
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
V4L2 has defined V4L2_XFER_FUNC_NONE for linear transfer characteristics
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
To be compatible with Android, driver need to support contiguous formats,
and the encoder can support non contiguous formats,
so support contiguous and non contiguous formats in the same time.
Support NV12 NV12M YUV420 YUV420M NV21 NV21M.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: TaoJiang <tao.jiang_2@nxp.com>
For the format that has non contiguous planes,
we should use the non contiguous format.
use V4L2_PIX_FMT_NV12M instead of V4L2_PIX_FMT_NV12
use V4L2_PIX_FMT_YUV420M instead of V4L2_PIX_FMT_YUV420
use V4L2_PIX_FMT_NV21M instead of V4L2_PIX_FMT_NV21
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
vsi_dec_capture_on will be called after source change event.
so if user poll on capture queue before it's really stream on,
the poll will wait until timeout.
call poll_wait on the first invocation
on all the potential queues of interest
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
after daemon send reschange event to driver,
it requires driver to send captureon cmd to it,
otherwise it keeps waiting.
we add this check to compatible with ffmpeg.
if the source change event is handled by capture streamon
or start cmd,
driver can always notify userspace a source change event.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Driver will report all possible format in enum_fmt
before source change event,
so client may choose the 10bit format, for example nv12_10le.
but if the stream is 8bit, when the sequence header is parsed,
only 8 bit format is supported,
so need to send source change event to client,
then client can setup capture with 8bit format.
If the source change event is missed, the result may be unexpected
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
the flag V4L2_BUF_FLAG_LAST should be set before vb2_buffer_done,
v4l2 core can set the last_buffer_dequeued to the vb2_queue,
then any attempt to dequeue more CAPTURE buffers beyond the buffer
marked with V4L2_BUF_FLAG_LAST will result in a -EPIPE error
from VIDIOC_DQBUF().
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou>
If VP9 decoding caputre format is 'RFC0', the capture buffer needs contain
luma_table and chroma_table, so correct the sizeimage of format rfc and
rcfx.
Driver can't use the sizeimage reported by daemon directly,
as daemon report the sizeimage according bit depth, not format,
so the reported sizeimage maybe inaccuracy.
Besides, driver need to notify source change event if daemon has
stream on the capture.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou>