title: Retrieving video size using QtGStreamer returns ZERO
body: <p>I'm playing with <strong><a href="http://gstreamer.freedesktop.org/modules/qt-gstreamer.html" rel="nofollow">QtGStreamer</a> 0.10.0</strong> and I'm trying to retrieve the video size but it's returning <strong>ZERO</strong> for <strong>height</strong> and <strong>width</strong> values.</p>
  
  <p>However, <strong>I am able to play the video</strong> with no problems on a <em>QImage</em>.</p>
  
  <pre><code>QGst::init();        
  
  pipeline = QGst::Pipeline::create();
  filesrc = QGst::ElementFactory::make("filesrc");
  filesrc-&gt;setProperty("location", "sample.avi");
  pipeline-&gt;add(filesrc);
  
  decodebin = QGst::ElementFactory::make("decodebin2").dynamicCast&lt;QGst::Bin&gt;();
  pipeline-&gt;add(decodebin);
  QGlib::connect(decodebin, "pad-added", this, &amp;MyMultimedia::onNewDecodedPad);
  QGlib::connect(decodebin, "pad-removed", this, &amp;MyMultimedia::onRemoveDecodedPad);
  filesrc-&gt;link(decodebin);
  
  // more code ...
  </code></pre>
  
  <p>The code above shows the begining of the pipeline setup. By connecting my method <code>MyMultimedia::onNewDecodedPad</code> on the signal <code>"pad-added"</code> I have access to the data of the video. At least that's what I think.</p>
  
  <pre><code>void MyMultimedia::onNewDecodedPad(QGst::PadPtr pad)
  {  
      QGst::CapsPtr caps = pad-&gt;caps();
      QGst::StructurePtr structure = caps-&gt;internalStructure(0);
      if (structure-&gt;name().contains("video/x-raw"))
      {
          // Trying to print width and height using a couple of different ways,
          // but all of them returns 0 for width/height.
  
          qDebug() &lt;&lt; "#1 Size: " &lt;&lt; structure-&gt;value("width").get&lt;int&gt;() &lt;&lt; "x" &lt;&lt; structure-&gt;value("height").get&lt;int&gt;();
  
          qDebug() &lt;&lt; "#2 Size: " &lt;&lt; structure-&gt;value("width").toInt() &lt;&lt; "x" &lt;&lt; structure-&gt;value("height").toInt();
  
          qDebug() &lt;&lt; "#3 Size: " &lt;&lt; structure.data()-&gt;value("width").get&lt;int&gt;() &lt;&lt; "x" &lt;&lt; structure.data()-&gt;value("height").get&lt;int&gt;();
  
          // numberOfFields also returns 0, which is very wierd.
          qDebug() &lt;&lt; "numberOfFields:" &lt;&lt; structure-&gt;numberOfFields(); 
  
      }
  
      // some other code
  }
  </code></pre>
  
  <p>I wonder what I might be doing wrong. Any tips? I was unable to find a relevant example on the web using this API.</p>