[gst-devel] strange behaviour with xvid - what basic things are needed for a basic player ?

Alexander Bierbrauer abierbrauer at gmx.org
Sun Jan 16 15:49:21 CET 2005


Hey,

I've downloaded kiss and aldegone for having some examples for creating a 
basic player with gstreamer. I'm using QT and the xv-plugin for displaying 
the content.

My player is able to play divx, mpeg etc.... but no XVID !!??? I'm getting 
just the message "killed".. no exception, nothing .
aldegone can play XVID without any problems but I can't see a huge / 
significant difference between my code and the code from aldegone.

It would be great if anyone could give me some advices for getting this thing 
100% to work.

This is the way I'm initializing GStreamer::

void GStreamer::initialize()
{
 gst_init(NULL,NULL);
 
   /* initialize GStreamer objects */
  m_pPipeline = gst_element_factory_make ("playbin", "player");
  if (!m_pPipeline)
    return;
 
  m_pAudioSink = gst_element_factory_make ("alsasink", "audiosink"); 
  m_pVideoSink = gst_element_factory_make ("xvimagesink", "videosink");
  g_object_set (G_OBJECT (m_pPipeline),"video-sink", 
m_pVideoSink,"audio-sink", m_pAudioSink,NULL);
  
 
  gst_element_set_state (m_pPipeline, GST_STATE_READY);
 
 m_bInitialized = true;
}

the way I'm setting the output window :
void GStreamer::drawCurrentFrame(QWidget *widget)
{
 /* expose overlay */
  if (m_pVideoSink && GST_IS_X_OVERLAY (m_pVideoSink)) {
    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_pVideoSink), 
widget->winId());
    gst_x_overlay_expose (GST_X_OVERLAY (m_pVideoSink));
  }
}


// and here the code for setting the source and start playing
void GStreamer::setVideoSource(QString src)
{
 if(!src || src.length() <= 0)
  return;
 
 //g_object_set (G_OBJECT (m_pFileSrc), "location", src.ascii(), NULL);
 if (GST_STATE (m_pPipeline) > GST_STATE_READY)
    gst_element_set_state (m_pPipeline, GST_STATE_READY);

   g_object_set (m_pPipeline, "uri",QString(QString("file:///")+src).ascii(), 
NULL);
  
 printf("GStreamer url location is: %s\n",src.ascii());
}

void GStreamer::startPlaying()
{
 gst_element_set_state (GST_ELEMENT (m_pPipeline), GST_STATE_PLAYING);
}


Regards, Alexander Bierbrauer




More information about the gstreamer-devel mailing list