After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648312 - [v4l2sink] Unconditionally accepts video/mpegts
[v4l2sink] Unconditionally accepts video/mpegts
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-20 15:04 UTC by Edward Hervey
Modified: 2011-06-15 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2objects: Only allow mpeg-ts on source objects (1008 bytes, patch)
2011-04-28 13:57 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2011-04-20 15:04:46 UTC
When v4l2sink is raised to a non-null rank (because system has a v4l2 output device) and when playbin2 plays back a mpeg-ts file, it ends up auto-plugging the mpeg-ts stream directly to v4l2sink.

This is because v4l2sink unconditionally accepts video/mpegts and doesn't check whether the hardware can actually support it.

The culprit seems to be in gstv4l2object:
@@ -1842,6 +1863,9 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, guint32 pixelformat,
   memset (&format, 0x00, sizeof (struct v4l2_format));
   format.type = v4l2object->type;
 
+  if (pixelformat == GST_MAKE_FOURCC ('M', 'P', 'E', 'G'))
+    return TRUE;
+
   if (v4l2_ioctl (fd, VIDIOC_G_FMT, &format) < 0)
     goto get_fmt_failed;
Comment 1 Sebastian Dröge (slomo) 2011-04-21 15:38:28 UTC
What should be set for mpegts in width/height/field? Did you check if it works if you just put 0 in there, that return TRUE there is definitely wrong.
Comment 2 Edward Hervey 2011-04-28 13:57:42 UTC
Created attachment 186818 [details] [review]
v4l2objects: Only allow mpeg-ts on source objects

Ugly fix for #648312
Comment 3 Tim-Philipp Müller 2011-04-28 14:05:18 UTC
Comment on attachment 186818 [details] [review]
v4l2objects: Only allow mpeg-ts on source objects

(((Works)&&(for)&&(me))&&(thanks)
Comment 4 Sebastian Dröge (slomo) 2011-05-17 07:25:50 UTC
commit 1a310d558c6c123f73593009200589f252d2d949
Author: Edward Hervey <edward.hervey@collabora.co.uk>
Date:   Thu Apr 28 15:57:04 2011 +0200

    v4l2objects: Only allow mpeg-ts on source objects
    
    Ugly fix for #648312