示例#1
0
static gboolean
audioresample_event (GstBaseTransform * base, GstEvent * event)
{
  GstAudioresample *audioresample;

  audioresample = GST_AUDIORESAMPLE (base);

  switch (GST_EVENT_TYPE (event)) {
    case GST_EVENT_FLUSH_START:
      break;
    case GST_EVENT_FLUSH_STOP:
      resample_input_flush (audioresample->resample);
      audioresample->ts_offset = -1;
      audioresample->next_ts = -1;
      audioresample->offset = -1;
      break;
    case GST_EVENT_NEWSEGMENT:
      resample_input_pushthrough (audioresample->resample);
      audioresample_pushthrough (audioresample);
      audioresample->ts_offset = -1;
      audioresample->next_ts = -1;
      audioresample->offset = -1;
      break;
    case GST_EVENT_EOS:
      resample_input_eos (audioresample->resample);
      audioresample_pushthrough (audioresample);
      break;
    default:
      break;
  }
  parent_class->event (base, event);

  return TRUE;
}
示例#2
0
static gboolean
legacyresample_event (GstBaseTransform * base, GstEvent * event)
{
  GstLegacyresample *legacyresample;

  legacyresample = GST_LEGACYRESAMPLE (base);

  switch (GST_EVENT_TYPE (event)) {
    case GST_EVENT_FLUSH_START:
      break;
    case GST_EVENT_FLUSH_STOP:
      if (legacyresample->resample)
        resample_input_flush (legacyresample->resample);
      legacyresample->ts_offset = -1;
      legacyresample->next_ts = -1;
      legacyresample->offset = -1;
      break;
    case GST_EVENT_NEWSEGMENT:
      resample_input_pushthrough (legacyresample->resample);
      legacyresample_pushthrough (legacyresample);
      legacyresample->ts_offset = -1;
      legacyresample->next_ts = -1;
      legacyresample->offset = -1;
      break;
    case GST_EVENT_EOS:
      resample_input_eos (legacyresample->resample);
      legacyresample_pushthrough (legacyresample);
      break;
    default:
      break;
  }
  return parent_class->event (base, event);
}