title: WebRTC playing webcam with Qt
body: <p>I use WebRTC for webcam playing (it's for testing webcam at my application before video calling). I do these next some WebRTC function:</p>
  
  <pre><code>////////////////////////
  
  //initialization
  {
  webrtc::VoiceEngine* voe = VoiceEngine::Create();
  webrtc::VoEBase* voeBase = VoEBase::GetInterface( voe );
  voeBase-&gt;Init();
  webrtc::VideoEngine* vie = VideoEngine::Create();
  webrtc::ViEBase* vieBase = ViEBase::GetInterface( vie );
  vieBase-&gt;Init();
  webrtc::ViECapture* vieCapture = ViECapture::GetInterface( vie );
  }
  
  ////////////////////////
  
  // start webcam playing
  void MainWindow::StartWebcamTest()
  {
           // creating window for playing webcam video
      videoWidget = new Phonon::VideoWidget();
      videoWidget-&gt;setFixedSize( 640, 480 );
      videoWidget-&gt;setWindowTitle( "Test Webcam" );
  
      char captDevName[1024], captGuidName[1024];
      VoEEngineSingleton::Instance()-&gt;GetViECapture()-&gt;GetCaptureDevice( 0, captDevName, 1024, captGuidName, 1024 );
      VoEEngineSingleton::Instance()-&gt;GetViECapture()-&gt;AllocateCaptureDevice( captGuidName, 1024, captureID );
  
      testVideoChannel = VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;CreateChannel( testVideoChannel );
      if( testVideoChannel == -1 )
          LOGERR &lt;&lt; "Creating video channel error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;LastError() &lt;&lt; endl; 
      else LOGDEBUG &lt;&lt; "Video channel created, ID = " &lt;&lt; testVideoChannel &lt;&lt; endl;
  
      testAudioChannel = VoEEngineSingleton::Instance()-&gt;GetVoEBase()-&gt;CreateChannel();
      if( testAudioChannel == -1 )
          LOGERR &lt;&lt; "Creating audio channel error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetVoEBase()-&gt;LastError() &lt;&lt; endl;
      else LOGDEBUG &lt;&lt; "Audio channel created, ID = " &lt;&lt; testAudioChannel &lt;&lt; endl;
  
      if( VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;ConnectAudioChannel( testVideoChannel, testAudioChannel ) != 0 )
          LOGERR &lt;&lt; "ConnectAudioChannel() error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;LastError() &lt;&lt; endl;
      else LOGINFO &lt;&lt; "Audio channel connected successful " &lt;&lt; endl;
  
      if( VoEEngineSingleton::Instance()-&gt;GetViECapture()-&gt;ConnectCaptureDevice( captureID, testVideoChannel ) != 0 )
          LOGERR &lt;&lt; "ConnectCaptureDevice() error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;LastError() &lt;&lt; endl;
      else LOGINFO &lt;&lt; "Capture device connected successful " &lt;&lt; endl;
  
      if( VoEEngineSingleton::Instance()-&gt;GetViERender()-&gt;StartRender( testVideoChannel ) != 0 )
          LOGERR &lt;&lt; "StartRender() error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;LastError() &lt;&lt; endl;
      else LOGINFO "StartRender() successed " &lt;&lt; endl;
  
      if( VoEEngineSingleton::Instance()-&gt;GetViECapture()-&gt;StartCapture( captureID ) != 0 )
          LOGERR &lt;&lt; "StartCapture() error: " &lt;&lt; VoEEngineSingleton::Instance()-&gt;GetViEBase()-&gt;LastError() &lt;&lt; endl;
      else LOGINFO &lt;&lt; "StartCapture() successed " &lt;&lt; endl;
  
      videoWidget-&gt;show();
  }
  </code></pre>
  
  <p>When I click button for playing video - webcam starts playing but <code>videoWidget</code> window is black empty.</p>
  
  <p>What am I doing not true? And maybe I must use other Qt widget for it?</p>