videobuf2-core.c: call to v4l_vb2q_enable_media_source()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shuah, Mauro,

I noticed that the function vb2_core_streamon() in videobuf2-core.c calls
v4l_vb2q_enable_media_source(q).

That function in turn assumes that q->owner is a v4l2_fh struct. But I
don't think that is true for DVB devices.

And since videobuf2-core.c is expected to be DVB/V4L independent, this seems
wrong.

It was introduced over 2 years ago in commit 77fa4e0729987:

commit 77fa4e072998705883c4dc672963b4bf7483cea9
Author: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Date:   Thu Feb 11 21:41:29 2016 -0200

    [media] media: Change v4l-core to check if source is free

    Change s_input, s_fmt, s_tuner, s_frequency, querystd, s_hw_freq_seek,
    and vb2_core_streamon interfaces that alter the tuner configuration to
    check if it is free, by calling v4l_enable_media_source().

    If source isn't free, return -EBUSY.

    v4l_disable_media_source() is called from v4l2_fh_exit() to release
    tuner (source).

    vb2_core_streamon() uses v4l_vb2q_enable_media_source().

    Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>

Note that this precedes the DVB_MMAP config option, so at the time this
likely worked fine. But I wonder why it works if that DVB_MMAP option is
set? Pure luck?

I think this call should be moved to videobuf2-v4l2.c (might require some
refactoring). It really doesn't belong in videobuf2-core.c.

Regards,

	Hans



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux