title: Gstreamer Pause/Resume pipeline issue
body: <p>I am using qt-gstreamer 1.2 with gstreamer 1.2.4 on nVidia TX1 running Ubuntu 14.04.</p>
  
  <p>I am having a pipeline with camera preview + recording + Ethernet Streaming + Wifi Streaming and i want to make pipeline dynamic. ex i can add/remove recording/Streaming on running pipeline.</p>
  
  <p>I pause pipeline to add/remove elements and then resume without using pads and its blocking capabilities. This works fine. But pipeline hangs after several add/remove of elements. and it hangs when i paused the pipeline.</p>
  
  <p>I found that its Pause/Resume which hangs pipeline not Linking/Unlinking elements on pause.
  If i add less elements in pipeline like only adding elements required for preview and recording then pipeline hangs after long time then with all elements.</p>
  
  <p>All sink element sync and async are false. </p>
  
  <pre><code>m_pipeline  =   QGst::Pipeline::create();
  m_source    =   QGst::ElementFactory::make("v4l2src", "v4l2src");
  m_filter1   =   QGst::ElementFactory::make("capsfilter", "capsfilter");
  m_convert   =   QGst::ElementFactory::make("nvvidconv", "videoconvert");
  m_filter2   =   QGst::ElementFactory::make("capsfilter", "capsfilter1");
  m_filter3   =   QGst::ElementFactory::make("capsfilter", "capsfilter2");
  m_tee       =   QGst::ElementFactory::make("tee", "tee");
  m_tee1      =   QGst::ElementFactory::make("tee", "tee1");
  m_enc       =   QGst::ElementFactory::make("omxh264enc", "omxh264enc");
  m_enc1      =   QGst::ElementFactory::make("omxh264enc", "omxh264enc1");
  m_parse     =   QGst::ElementFactory::make("h264parse", "h264parse");
  m_parse1    =   QGst::ElementFactory::make("h264parse", "h264parse1");
  m_parse2    =   QGst::ElementFactory::make("h264parse", "h264parse2");
  m_mux       =   QGst::ElementFactory::make("qtmux", "qtmux");
  m_filesink  =   QGst::ElementFactory::make("filesink", "filesink");
  m_queue1    =   QGst::ElementFactory::make("queue", "queue1");
  m_queue2    =   QGst::ElementFactory::make("queue", "queue2");
  m_queue3    =   QGst::ElementFactory::make("queue", "queue3");
  m_queue4    =   QGst::ElementFactory::make("queue", "queue4");
  m_queue5    =   QGst::ElementFactory::make("queue", "queue5");
  m_queue6    =   QGst::ElementFactory::make("queue", "queue6");
  m_queue7    =   QGst::ElementFactory::make("queue", "queue7");
  m_queue8    =   QGst::ElementFactory::make("queue", "queue8");
  m_fakesink  =   QGst::ElementFactory::make("fakesink", "fakesink");
  m_rtppay1   =   QGst::ElementFactory::make("rtph264pay", "rtph264pay");
  m_rtppay2   =   QGst::ElementFactory::make("rtph264pay", "rtph264pay1");
  m_udpsink   =   QGst::ElementFactory::make("udpsink", "udpsink");
  m_udpsink1  =   QGst::ElementFactory::make("udpsink", "udpsink1");
  m_videoSink =   QGst::ElementFactory::make("nvoverlaysink", "sink");
  m_tee2      =   QGst::ElementFactory::make("tee", "tee3");
  m_fakesink1 =   QGst::ElementFactory::make("fakesink", "fakesink1");
  m_mux1       =   QGst::ElementFactory::make("qtmux", "qtmux1");
  m_filesink1 =   QGst::ElementFactory::make("filesink", "filesink1");
  
  m_filter1-&gt;setProperty("caps", QGst::Caps::fromString("video/x-raw, width=1920, height=1080, format=UYVY, framerate=60/1"));
  m_filter2-&gt;setProperty("caps", QGst::Caps::fromString("video/x-raw(memory:NVMM), width=1920, height=1080, format=I420, framerate=60/1"));
  m_filter3-&gt;setProperty("caps", QGst::Caps::fromString("video/x-h264, stream-format=(string)byte-stream"));
  
  m_videoSink-&gt;setProperty("sync", false);
  m_videoSink-&gt;setProperty("async", false);
  
  m_pipeline-&gt;setProperty("video-sink", m_videoSink);
  
  m_filesink-&gt;setProperty("sync", false);
  m_filesink-&gt;setProperty("async", false);
  m_enc-&gt;setProperty("bitrate", 19000000);
  m_enc-&gt;setProperty("low-latency", 1);
  m_enc-&gt;setProperty("control-rate", 2);
  m_filesink-&gt;setProperty("location", "/home/ubuntu/video.mp4");
  m_rtppay1-&gt;setProperty("mtu", 1400);
  m_rtppay2-&gt;setProperty("mtu", 1400);
  
  m_filesink1-&gt;setProperty("sync", false);
  m_filesink1-&gt;setProperty("async", false);
  m_filesink1-&gt;setProperty("location", "/home/ubuntu/video1.mp4");
  
  m_udpsink-&gt;setProperty("port", 5000);
  m_udpsink-&gt;setProperty("sync", false);
  m_udpsink-&gt;setProperty("async", false);
  m_udpsink-&gt;setProperty("host", "127.0.0.1");
  
  m_udpsink1-&gt;setProperty("port", 8554);
  m_udpsink1-&gt;setProperty("sync", false);
  m_udpsink1-&gt;setProperty("async", false);
  m_udpsink1-&gt;setProperty("host", "172.10.10.135");
  
  m_pipeline-&gt;add(m_source, m_filter1, m_tee2, m_queue6, m_fakesink1);
  m_pipeline-&gt;add(m_queue7, m_convert, m_filter2, m_tee, m_queue1, m_videoSink);
  m_pipeline-&gt;add(m_queue2, m_enc, m_filter3, m_tee1, m_queue8, m_fakesink);
  m_pipeline-&gt;add(m_queue3, m_parse, m_mux, m_filesink);
  m_pipeline-&gt;add(m_queue4, m_parse1, m_rtppay1, m_udpsink);
  m_pipeline-&gt;add(m_queue5, m_parse2, m_rtppay2, m_udpsink1);
  
  m_pipeline-&gt;linkMany(m_source, m_filter1, m_tee2, m_queue6, m_fakesink1);
  m_pipeline-&gt;linkMany(m_tee2, m_queue7, m_convert, m_filter2, m_tee, m_queue1, m_videoSink);
  m_pipeline-&gt;linkMany(m_tee, m_queue2, m_enc, m_filter3, m_tee1, m_queue8, m_fakesink);
  m_pipeline-&gt;linkMany(m_tee1, m_queue3, m_parse, m_mux, m_filesink);
  m_pipeline-&gt;linkMany(m_tee1, m_queue4, m_parse1, m_rtppay1, m_udpsink);
  m_pipeline-&gt;linkMany(m_tee1, m_queue5, m_parse2, m_rtppay2, m_udpsink1);
  </code></pre>
  
  <p>for testing i am pause and play pipeline every 1 sec.</p>
  
  <pre><code>m_pipeline-&gt;setState(QGst::StatePaused);
  QThread::msleep(10);
  m_pipeline-&gt;setState(QGst::StatePlaying);
  </code></pre>
  
  <p>The pipeline hangs after several Pause/Resume.
  If i remove last 2 lines of linkmany and add the i can pause/resume more times than with all elements added.</p>
  
  <p>So whats the problem here?
  How can i pause / play pipeline efficiently? </p>