Hi all,
    Recently,I used the adecode to try to implement an audio player with  fast 
forward/backwad fuctions, but It gave no response to my seeking action in my 
application, and the probelm maybe be caused by the event process in the decode 
element,it just forward the event to other elements in the pipe. 
 and  the related codes are as follow: 
 
static gboolean gst_adecoder_src_event(GstPad * pad, GstEvent * event)
{
    gboolean res;
    GstADecoder *adecoder;
    adecoder = GST_ADECODER(GST_PAD_PARENT(pad));
    if (adecoder->codec_handle == NULL)
    goto no_decoder;
    res = gst_pad_push_event(adecoder->sinkpad, event);
    return res;
    no_decoder:
    {
        GST_DEBUG_OBJECT(adecoder, "no decoder, cannot handle event");
        gst_event_unref(event);
        return FALSE;
    }
}
 
 
static gboolean gst_adecoder_sink_event(GstPad * pad, GstEvent * event)
{
    GstADecoder *adecoder = GST_ADECODER(GST_PAD_PARENT(pad));
    gboolean ret = TRUE;
    #ifdef DEBUG
    printf("Got %s event on sink pad\n", GST_EVENT_TYPE_NAME(event));
    #endif
    switch (GST_EVENT_TYPE(event))
    {
  case GST_EVENT_NEWSEGMENT:
  ret = gst_pad_event_default(pad, event);
  break;
     case GST_EVENT_FLUSH_START:
        ret = gst_pad_event_default(pad, event);
        break;
     case GST_EVENT_FLUSH_STOP:
        ret = gst_pad_event_default(pad, event);
        break;
     case GST_EVENT_EOS:
      gst_adecoder_decode_remaining(adecoder);
      ret = gst_pad_event_default(pad, event);
        break;
     default:
        ret = gst_pad_event_default(pad, event);
        break;
    }
    return ret;
}
 
      Is there any problem? Any suggestion? Thank you!
 
      Volter
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to