title: Qt Camera on Raspberry Pi 2: Internal data flow error
body: <h2>QML Camera</h2>
  
  <p>Trying to run Qt 5.5 <code>declarative-camera</code> example on the Raspberry Pi 2 with the 'Raspberry Pi Camera' and getting an error after some delay:</p>
  
  <pre><code>CameraBin error: "Internal data flow error."
  </code></pre>
  
  <p>GUI runs but the viewfinder is black.</p>
  
  <p>Video recording works fine with GStreamer:</p>
  
  <pre><code>gst-launch-1.0 v4l2src ! video/x-h264 ! avimux ! filesink location=1.mp4
  </code></pre>
  
  <p>GStreamer packages installed from the Debian jessie:</p>
  
  <pre><code>gstreamer1.0-plugins-bad
  gstreamer1.0-plugins-base
  gstreamer1.0-plugins-good
  gstreamer1.0-plugins-ugly
  gstreamer1.0-tools
  libgstreamer-plugins-bad1.0-0
  libgstreamer-plugins-base1.0-0
  libgstreamer1.0-0
  </code></pre>
  
  <p>Qt is built from source. GStreamer Qt plugin is enabled (it even swears with GStreamer asserts when no <code>gstreamer1.0-plugins-bad</code> or <code>gstreamer1.0-plugins-ugly</code> installed).</p>
  
  <p>What's missing?</p>
  
  <h2>Qt Widgets Camera</h2>
  
  <p>The <code>qt5/qtmultimedia/examples/multimediawidgets/camera</code> application is really acting a little like the one from the <a href="https://stackoverflow.com/questions/17650710/recording-video-from-usb-cam-with-qt5">Recording Video from USB Cam with Qt5</a>:</p>
  
  <p>The viewfinder shows just one frame. When I press 'Capture Photo', it gives:</p>
  
  <pre><code>CameraBin error: "Failed to allocate required memory."
  CameraBin error: "Internal data flow error."
  </code></pre>
  
  <p>When switching to the 'Video' tab:</p>
  
  <pre><code>CameraBin error: "Internal data flow error."
  CameraBin error: "Failed to allocate required memory."
  CameraBin error: "Internal data flow error."
  </code></pre>
  
  <p>Setting different resolutions (or not setting at all) doesn't help.</p>
  
  <h2>GStreamer error output</h2>
  
  <p>On launch:</p>
  
  <pre><code>0:00:01.898512576  1923  0x17bbb50 WARN                    v4l2 gstv4l2bufferpool.c:658:gst_v4l2_buffer_pool_start:&lt;camera_source:pool:src&gt; using 3 buffers instead of 2
  </code></pre>
  
  <p>When clicking on 'Video' or 'Capture Photo':</p>
  
  <pre><code>0:00:32.243379958  1923  0x17bbb50 WARN           v4l2allocator gstv4l2allocator.c:651:gst_v4l2_allocator_new:&lt;camera_source:pool:src:allocator&gt; Could not probe supported memory type, assuming MMAP is supported, this is expected for older drivers not  yet ported to videobuf2 framework
  0:00:33.208261007  1923  0x17bbb50 ERROR          v4l2allocator gstv4l2allocator.c:727:gst_v4l2_allocator_start:&lt;camera_source:pool:src:allocator&gt; error requesting 2 buffers: Device or resource busy
  0:00:33.209047925  1923  0x17bbb50 ERROR                   v4l2 gstv4l2bufferpool.c:768:gst_v4l2_buffer_pool_start:&lt;camera_source:pool:src&gt; we received 0 buffer from device '/dev/video0', we want at least 2
  0:00:33.209696460  1923  0x17bbb50 ERROR             bufferpool gstbufferpool.c:533:gst_buffer_pool_set_active:&lt;camera_source:pool:src&gt; start failed
  0:00:33.210209266  1923  0x17bbb50 WARN                 v4l2src gstv4l2src.c:478:gst_v4l2src_decide_allocation:&lt;camera_source&gt; error: Failed to allocate required memory.
  0:00:33.210667803  1923  0x17bbb50 WARN                 v4l2src gstv4l2src.c:478:gst_v4l2src_decide_allocation:&lt;camera_source&gt; error: Buffer pool activation failed
  0:00:33.211621438  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:3161:gst_base_src_prepare_allocation:&lt;camera_source&gt; Subclass failed to decide allocation
  CameraBin error: "Failed to allocate required memory."
  0:00:33.212857100  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:&lt;camera_source&gt; error: Internal data flow error.
  0:00:33.213240169  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:&lt;camera_source&gt; error: streaming task paused, reason not-negotiated (-4)
  CameraBin error: "Internal data flow error."
  </code></pre>