linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Support of /dev/video read with USB camera devices
@ 2019-03-04 12:35 Hugues Fruchet
  2019-03-04 12:35 ` [PATCH] media: uvcvideo: Read support Hugues Fruchet
  0 siblings, 1 reply; 8+ messages in thread
From: Hugues Fruchet @ 2019-03-04 12:35 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Hugues Fruchet

Currently, read() call from /dev/video entry of an USB camera is
returning invalid argument error.
This is quite common for userspace application to read compressed data such as
JPEG from /dev/video then redirect those data to a multimedia player or any
other compressed format consumer, see [1].

There was a tentative of implementation in the past [2] but it was prior to
switch on vb2 helpers usage inside uvc.
Now that vb2 is in place, we can implement read support using vb2_read()
helper.

Tested with Logitech HD Webcam C525 using v4l2-ctl to configure camera
then GStreamer player to play stream:
$> v4l2-ctl -d /dev/video0 --set-fmt-video=width=640,height=480,pixelformat=MJPG
$> gst-play-1.0 /dev/video0

[1]
  http://credentiality2.blogspot.com/2010/04/v4l2-example.html?_sm_au_=ikcQHNZZFn2Rqft5
  https://stackoverrun.com/fr/q/4215615
  https://stackoverflow.com/questions/36297390/read-function-for-webcam-device-in-v4l2-fails-with-invalid-argument
  https://stackoverflow.com/questions/31058571/reading-camera-input-from-dev-video0-in-python-or-c

[2] https://www.mail-archive.com/linux-uvc-devel@lists.berlios.de/msg01258.html

Hugues Fruchet (1):
  media: uvcvideo: Read support

 drivers/media/usb/uvc/uvc_queue.c | 15 ++++++++++++++-
 drivers/media/usb/uvc/uvc_v4l2.c  | 11 ++++++++---
 drivers/media/usb/uvc/uvcvideo.h  |  2 ++
 3 files changed, 24 insertions(+), 4 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-05 12:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 12:35 [PATCH] Support of /dev/video read with USB camera devices Hugues Fruchet
2019-03-04 12:35 ` [PATCH] media: uvcvideo: Read support Hugues Fruchet
2019-03-04 12:54   ` Hans Verkuil
2019-03-04 13:06   ` Hans Verkuil
2019-03-04 15:36   ` Kieran Bingham
2019-03-04 15:44     ` Laurent Pinchart
2019-03-05 10:24       ` Hugues FRUCHET
2019-03-05 12:41         ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).