mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
gst/: Add GAP-flag support.
Original commit message from CVS: * gst/audiotestsrc/gstaudiotestsrc.c: * gst/volume/gstvolume.c: * gst/volume/gstvolume.h: Add GAP-flag support.
This commit is contained in:
parent
dacc06a547
commit
1cfef609d0
4 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-11-26 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* gst/audiotestsrc/gstaudiotestsrc.c:
|
||||
* gst/volume/gstvolume.c:
|
||||
* gst/volume/gstvolume.h:
|
||||
Add GAP-flag support.
|
||||
|
||||
2007-11-24 Julien MOUTTE <julien@moutte.net>
|
||||
|
||||
* tests/examples/seek/seek.c: (main): Increase the range of the
|
||||
|
|
|
@ -870,8 +870,15 @@ gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset,
|
|||
src->running_time = next_time;
|
||||
src->n_samples = n_samples;
|
||||
|
||||
GST_LOG_OBJECT (src, "generating %u samples at ts %" GST_TIME_FORMAT,
|
||||
length, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
|
||||
|
||||
src->process (src, GST_BUFFER_DATA (buf));
|
||||
|
||||
if (src->wave == G_UNLIKELY (GST_AUDIO_TEST_SRC_WAVE_SILENCE)) {
|
||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_GAP);
|
||||
}
|
||||
|
||||
*buffer = buf;
|
||||
|
||||
return GST_FLOW_OK;
|
||||
|
|
|
@ -313,6 +313,8 @@ volume_update_real_volume (GstVolume * this)
|
|||
this->real_vol_i32 = this->volume_i32;
|
||||
passthrough = (this->volume_i16 == VOLUME_UNITY_INT16);
|
||||
}
|
||||
if (this->real_vol_f != 0.0)
|
||||
this->silent_buffer = FALSE;
|
||||
volume_choose_func (this);
|
||||
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (this), passthrough);
|
||||
}
|
||||
|
@ -747,11 +749,19 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||
gst_object_sync_values (G_OBJECT (this), timestamp);
|
||||
|
||||
/* don't process data in passthrough-mode */
|
||||
if (gst_base_transform_is_passthrough (base))
|
||||
if (gst_base_transform_is_passthrough (base) ||
|
||||
GST_BUFFER_FLAG_IS_SET (outbuf, GST_BUFFER_FLAG_GAP))
|
||||
return GST_FLOW_OK;
|
||||
|
||||
if (this->real_vol_f == 0.0)
|
||||
this->silent_buffer = TRUE;
|
||||
|
||||
this->process (this, GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
|
||||
|
||||
if (this->silent_buffer)
|
||||
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
|
||||
this->silent_buffer = FALSE;
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ struct _GstVolume {
|
|||
GList *tracklist;
|
||||
GstVolumeFormat format; /* caps variables */
|
||||
gint width;
|
||||
gboolean silent_buffer; /* flag for silent buffers */
|
||||
};
|
||||
|
||||
struct _GstVolumeClass {
|
||||
|
|
Loading…
Reference in a new issue