22 Sep, 2016

1 commit

  • As warned by linuxdoc[1] tool, using:

    $ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

    include/media/v4l2-dev.h:118 :WARN: function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs: if_vid_dec_index if_vid_dec_pad_index
    include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs: if_aud_dec_index if_aud_dec_pad_index
    include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs: v4l2_m2m_num_src_bufs_ready v4l2_m2m_num_dst_bufs_ready
    drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs: cintlog2 intlog2
    include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs: s_radio v4l2_subdev_tuner_ops
    include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs: v4l2_set_subdevdata v4l2_set_subdev_hostdata
    include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs: v4l2_get_subdevdata v4l2_get_subdev_hostdata
    drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs: dvb_ringbuffer_writeuser dvb_ringbuffer_write_user
    include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs: vb2_ops vb2_buf_ops
    include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
    include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs: media_entity_enum_test media_entity_enum_test_and_set
    include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_pad
    include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_link
    include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_intf
    include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs: gobj_to_entity intf_to_devnode
    include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs: rc_open rc_close
    include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
    include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

    [1] https://return42.github.io/linuxdoc/linux.html

    The above are real issues at the documentation. On several cases,
    caused by cut-and-paste.

    Fix them.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

23 Jul, 2016

1 commit


22 Aug, 2015

1 commit


24 May, 2014

1 commit

  • This event indicates that the video device has encountered
    a source parameter change during runtime. This can typically be a
    resolution change detected by a video decoder OR a format change
    detected by an input connector.

    This needs to be nofified to the userspace and the application may
    be expected to reallocate buffers before proceeding. The application
    can subscribe to events on a specific pad or input port which
    it is interested in.

    Signed-off-by: Arun Kumar K
    Acked-by: Sylwester Nawrocki
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Arun Kumar K
     

06 Feb, 2013

1 commit


21 Nov, 2012

1 commit


26 Sep, 2012

1 commit


15 May, 2012

1 commit

  • If the V4L2_EVENT_SUB_FL_SEND_INITIAL was set, then the application expects
    to receive an initial event of the initial value of the control.

    However, commit c53c2549333b340e2662dc64ec81323476b69a97 that added the new
    v4l2_subscribed_event_ops introduced a regression: while the code still queued
    that initial event the __v4l2_event_queue_fh() function was modified to ignore
    such requests if sev->elems was 0 (meaning that the event subscription wasn't
    finished yet).

    And sev->elems was only set to a non-zero value after the add operation
    returned.

    This patch fixes this by passing the elems value to the add function. Then the
    add function can set it before queuing the initial event.

    Signed-off-by: Hans Verkuil
    Acked-by: Hans de Goede
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

08 May, 2012

1 commit

  • Just like with ctrl events, drivers may want to get called back on
    listener add / remove for other event types too. Rather then special
    casing all of this in subscribe / unsubscribe event it is better to
    use ops for this.

    Signed-off-by: Hans de Goede
    Acked-by: Hans Verkuil
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans de Goede
     

28 Jul, 2011

7 commits

  • It's getting confusing who is linking to what, so add an overview at
    the start of the header.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Thanks to Laurent Pinchart .

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • When the event queue for a subscribed event is full, then the oldest
    event is dropped. It would be nice if the contents of that oldest
    event could be merged with the next-oldest. That way no information is
    lost, only intermediate steps are lost.

    This patch adds optional replace() (called when only one kevent was allocated)
    and merge() (called when more than one kevent was allocated) callbacks that
    will be called to do this job.

    These two callbacks are implemented for the V4L2_EVENT_CTRL event.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The driver had to decide how many events to allocate when the v4l2_fh struct
    was created. It was possible to add more events afterwards, but there was no
    way to ensure that you wouldn't miss important events if the event queue
    would fill up for that filehandle.

    In addition, once there were no more free events, any new events were simply
    dropped on the floor.

    For the control event in particular this made life very difficult since
    control status/value changes could just be missed if the number of allocated
    events and the speed at which the application read events was too low to keep
    up with the number of generated events. The application would have no idea
    what the latest state was for a control since it could have missed the latest
    control change.

    So this patch makes some major changes in how events are allocated. Instead
    of allocating events per-filehandle they are now allocated when subscribing an
    event. So for that particular event type N events (determined by the driver)
    are allocated. Those events are reserved for that particular event type.
    This ensures that you will not miss events for a particular type altogether.

    In addition, if there are N events in use and a new event is raised, then
    the oldest event is dropped and the new one is added. So the latest event
    is always available.

    This can be further improved by adding the ability to merge the state of
    two events together, ensuring that no data is lost at all. This will be
    added in the next patch.

    This also makes it possible to allow the user to determine the number of
    events that will be allocated. This is not implemented at the moment, but
    would be trivial.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control
    would know which filehandles subscribed to it. However, it is much easier
    to use struct v4l2_subscribed_event directly for that and get rid of that
    intermediate struct.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Drivers that supported events used to be rare, but now that controls can also
    raise events this will become much more common since almost all drivers have
    controls.

    This means that keeping struct v4l2_events as a separate struct make no more
    sense. Merging it into struct v4l2_fh simplifies things substantially as it
    is now an integral part of the filehandle struct.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Whenever a control changes value or state an event is sent to anyone
    that subscribed to it.

    This functionality is useful for control panels but also for applications
    that need to wait for (usually status) controls to change value.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

19 May, 2010

1 commit

  • Add event handling backend to V4L2. The backend handles event subscription
    and delivery to file handles. Event subscriptions are based on file handle.
    Events may be delivered to all subscribed file handles on a device
    independent of where they originate from.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus