Not able to add sometimes pad ....

shiva.mudugal shiva.mudugal at gmail.com
Sun Feb 17 21:34:45 PST 2013


Hi,

I am trying to write a gstreamer plugin for asf demuxer. I am trying to
create a sometimes pad for audio and video. But I am getting following error
when run the pipeline 

$ gst-launch-1.0 filesrc location=temp.wmv ! decodebin  ! fakesink -v

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
caps = video/x-ms-asf
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
caps = video/x-ms-asf
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstPPAsfDemux:ppasfdemux0.GstPad:sink:
caps = video/x-ms-asf
**** activating strm : 1  : WMA Version 8 *****

(gst-launch-1.0:3319): GStreamer-CRITICAL **: gst_mini_object_ref: assertion
`mini_object != NULL' failed

(gst-launch-1.0:3319): GLib-GObject-CRITICAL **: g_value_unset: assertion
`G_IS_VALUE (value)' failed
Missing element: Windows Media Audio 8 decoder



---------------------------------------------------------------------------------------------------

"ppasfdemux" is my plugin... following is the snippet of my code adding
sometimes pad.... 


  name = g_strdup_printf ("audio_%u", 0);

  src_pad = gst_pad_new_from_static_template (&audio_src_template, name);
  g_free(name);

  codec_data = gst_buffer_new_allocate (NULL,
StreamProp.info.audio.nCodecSpecificDataSize , NULL);

  gst_buffer_map (codec_data, &map, GST_MAP_WRITE);

  memcpy(map.data, StreamProp.info.audio.pCodecSpecificData, map.size);

  cap = gst_riff_create_audio_caps (StreamProp.info.audio.nCodecID, NULL,
      (gst_riff_strf_auds *) &(StreamProp.info.audio), codec_data, NULL,
&codec_name, NULL);


  if(cap == NULL)
  {
  cap = gst_caps_new_simple ("audio/x-wma",
                   "codec_id", G_TYPE_UINT, StreamProp.info.audio.nCodecID,   
                   "channels", G_TYPE_UINT,
StreamProp.info.audio.nChannelCount, 
                   "sample rate", G_TYPE_UINT,
StreamProp.info.audio.nSamplesPerSec,  
                   "bitrate",  G_TYPE_ULONG,
(StreamProp.info.audio.nAvgNoOfBytesPerSec * 8), 
                   "Bitdepth", G_TYPE_UINT,
StreamProp.info.audio.nBitsPerSample, 
                   "block_align", G_TYPE_UINT,
StreamProp.info.audio.nBlockAlign, 
                   "Codec data", G_TYPE_STRING,
StreamProp.info.audio.pCodecSpecificData, NULL);
  }

  gst_pad_use_fixed_caps (src_pad);

  gst_pad_set_event_function(src_pad, GST_DEBUG_FUNCPTR
(gst_pp_asf_demux_handle_src_event));
  gst_pad_set_query_function(src_pad, GST_DEBUG_FUNCPTR
(gst_pp_asf_demux_handle_src_query));

  //filter->aud_src_pad = src_pad;
  gst_pad_set_active (src_pad, TRUE);

  stream_id = gst_pad_create_stream_id_printf (src_pad, GST_ELEMENT_CAST
(filter), "%u", StreamProp.nStreamNum);
  gst_pad_push_event (src_pad, gst_event_new_stream_start (stream_id));
  g_print("**** activating strm : %d  : %s *****\n", StreamProp.nStreamNum,
codec_name);
  g_free (stream_id);


  gst_pad_set_caps (src_pad, cap);
  gst_element_add_pad (GST_ELEMENT_CAST (filter), src_pad);

  gst_buffer_unmap (codec_data, &map);
  gst_caps_unref (cap); 



Can anyone please help me on this ...?








--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Not-able-to-add-sometimes-pad-tp4658580.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list