title: Change input resolution for QCamera
body: <p>I have implemented a camera capture using QCamera with QAbstractVideoSurface.
  I extended the QAbstractVideoSurface to a derived class to marshal the captures into a buffer for future processing. Everything works fine but I am having an issue changing the capture resolution of the input capture.</p>
  
  <p>using setNativeResolution() does not seem to work.</p>
  
  <p>Below is a brief of the code.</p>
  
  <pre><code>#ifndef _CAPTURE_BUFFER_H_
  #define _CAPTURE_BUFFER_H_
  
  #include &lt;QMutex&gt;
  #include &lt;QWidget&gt;
  #include &lt;QImage&gt;
  #include &lt;QVideoFrame&gt;
  #include &lt;QAbstractVideoSurface&gt;
  #include &lt;QVideoSurfaceFormat&gt;
  #include &lt;control/qcircularbuffer.h&gt;
  
  class CaptureBuffer: public QAbstractVideoSurface
  {
      Q_OBJECT
  
  public:
      CaptureBuffer(int size = 30);
      QList&lt;QVideoFrame::PixelFormat&gt; supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const;
      bool start(const QVideoSurfaceFormat&amp; format);
      void stop();
      bool present(const QVideoFrame&amp; frame);
      bool isEmpty() const;
      void pushBack(const QVideoFrame&amp; new_frame);    
      void popFront();
      bool top(QVideoFrame&amp; frame);
      bool back(QVideoFrame&amp; frame);
  
      const QImage::Format&amp; image_format() const {return m_image_format;}
      const QSize&amp; image_size() const {return m_image_size;}
  
  protected:
      void setNativeResolution(const QSize &amp; resolution);
  
  private:
      QSize                        m_image_size;
      QImage::Format               m_image_format;
      QCircularBuffer&lt;QVideoFrame&gt; m_buffer;
      QMutex                       m_buffer_mutex;
  };
  
  #endif
  
  
  
     CaptureBuffer::CaptureBuffer(int size) :
      m_buffer(QCircularBuffer&lt;QVideoFrame&gt;(size))
  {
  }
  
  QList&lt;QVideoFrame::PixelFormat&gt; CaptureBuffer::supportedPixelFormats(
          QAbstractVideoBuffer::HandleType handleType) const
  {
      if (handleType == QAbstractVideoBuffer::NoHandle) {
          return QList&lt;QVideoFrame::PixelFormat&gt;()
                  &lt;&lt; QVideoFrame::Format_RGB24
                  &lt;&lt; QVideoFrame::Format_RGB32
                  &lt;&lt; QVideoFrame::Format_ARGB32
                  &lt;&lt; QVideoFrame::Format_ARGB32_Premultiplied
                  &lt;&lt; QVideoFrame::Format_RGB565
                  &lt;&lt; QVideoFrame::Format_RGB555;
      } else {
          return QList&lt;QVideoFrame::PixelFormat&gt;();
      }
  }
  
  bool CaptureBuffer::start(const QVideoSurfaceFormat&amp; format)
  {
      const QImage::Format image_format = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
      const QSize size = format.frameSize();
  
      if (image_format != QImage::Format_Invalid &amp;&amp; !size.isEmpty()) {
          m_image_format = image_format;
          m_image_size = size;
  
          QAbstractVideoSurface::start(format);
  
          return true;
      } else {
          return false;
      }
  }
  
  void CaptureBuffer::stop()
  {
      QAbstractVideoSurface::stop();
  }
  
  bool CaptureBuffer::present(const QVideoFrame&amp; frame)
  {   
      pushBack(frame);
      return true;
  }
  
  bool CaptureBuffer::isEmpty() const
  {
      return m_buffer.empty();
  }
  
  void CaptureBuffer::pushBack(const QVideoFrame&amp; frame)
  {
      m_buffer_mutex.lock();
      m_buffer.push_back(frame);
      m_buffer_mutex.unlock();
  }
  
  void CaptureBuffer::popFront()
  {
      m_buffer_mutex.lock();
      m_buffer.pop_front();
      m_buffer_mutex.unlock();
  }
  
  bool CaptureBuffer::top(QVideoFrame&amp; frame)
  {
      if(m_buffer.empty()) 
          return false;
  
      m_buffer_mutex.lock();
      frame = m_buffer.front();
      m_buffer_mutex.unlock();
      return true;
  }
  
  bool CaptureBuffer::back(QVideoFrame&amp; frame)
  {
      if(m_buffer.empty())
          return false;
  
      m_buffer_mutex.lock();
      frame = m_buffer.back();
      m_buffer_mutex.unlock();
      return true;
  }
  
  void CaptureBuffer::setNativeResolution( const QSize &amp; resolution )
  {
      QAbstractVideoSurface::setNativeResolution(resolution);
  }
  </code></pre>
  
  <p>Here is how the QCamera is used and attached to the capture buffer:</p>
  
  <pre><code>m_camera = camera;
  m_camera-&gt;setCaptureMode(QCamera::CaptureVideo);
  m_camera-&gt;setViewfinder(m_capture_buffer);
  m_camera-&gt;start(); 
  </code></pre>
  
  <p>How do I adjust the input capture resolution to say from 640 x 480 to 1280 x 720 etc given the fact that the web camera supports this resolution.</p>