Commit graph

6 commits

Author SHA1 Message Date
Michael Tretter eac9f60608 uvcsink: extract common code in idle_probe
The RECONFIGURE event has to be sent in streamon and streamoff. Extract the
common code to a separate branch to make it easier to understand.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
2023-10-06 15:55:23 +00:00
Michael Tretter 69c5529011 uvcsink: return caps when reading the host configured caps
The uvcsink calculates the caps for the format that the UVC host selected. The
gst_uvc_sink_parse_cur_caps() sets these caps as cur_caps as a side effect. This
behavior is surprising as cur_caps is later updated to reflect the actually used
caps.

Just return the configured caps to avoid side effects. This makes the function
easier to understand. Update the function name to reflect the new behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
2023-10-06 15:55:23 +00:00
Michael Grzeschik 17797d1d28 uvcsink: fix event peer probe
The only job of the event peer probe is to catch the upcoming caps event
and be able to react with the sink change. All other events that are
passing the pad shall be passed and ignored.

Since the probe is a blocking probe, there is no use in returning
with GST_PAD_PROBE_OK on other events. Otherwise the event would just
be blocked.

Since we are handling the probe removal of the probe already in the
event switch, we can remove the second explicit probe removal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
2023-10-06 15:55:23 +00:00
Michael Grzeschik e3a121950b uvcsink: drop useless debug messages in peer event probe
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4994>
2023-10-06 15:55:22 +00:00
Michael Grzeschik ea2764aa69 uvcsink: add probe handling for live pipelines
Currently the uvcsink is only capable to run in an application
that is handling the state transitions of the pipeline properly
by checking on streaming event from the uvcsink.

This code is improving the element by adding an fakesink to
consume possible videostream flow in case the pipeline state
is not changing on hosts streamoff.

This is helpfull when using local gst-launch pipelines where
the streaming event is not monitored to change the pipelines
state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 5d82deb2c5 uvcsink: add new bin element around v4l2sink
This patch adds an element to stream video data to an uvc video gadget.
The element handles the uvc events STREAMON, STREAMOFF, SETUP and DATA.
to start, stop and configure the video buffer flow by the use of pad
probes. It works with linux kernels of versions higher than v6.1.

The element makes use of the v4l2sink proxy property v4l2sink::device
to locate the corresponding device to parse the configfs for additional
data.

The code in uvc.c is basically derived from /lib/uvc.c in
https://git.ideasonboard.org/uvc-gadget.git.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00