| 1 | /* GStreamer |
| 2 | * Copyright (C) 2017 Sebastian Dröge <sebastian@centricular.com> |
| 3 | * |
| 4 | * gstaudiostreamalign.h: |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; if not, write to the |
| 18 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef __GST_AUDIO_STREAM_ALIGN_H__ |
| 23 | #define __GST_AUDIO_STREAM_ALIGN_H__ |
| 24 | |
| 25 | #include <gst/gst.h> |
| 26 | #include <gst/audio/audio-prelude.h> |
| 27 | |
| 28 | G_BEGIN_DECLS |
| 29 | |
| 30 | #define GST_TYPE_AUDIO_INFO_STREAM_ALIGN (gst_audio_stream_align_get_type ()) |
| 31 | |
| 32 | /** |
| 33 | * GstAudioStreamAlign: |
| 34 | * |
| 35 | * The opaque #GstAudioStreamAlign data structure. |
| 36 | * |
| 37 | * Since: 1.14 |
| 38 | */ |
| 39 | typedef struct _GstAudioStreamAlign GstAudioStreamAlign; |
| 40 | |
| 41 | GST_AUDIO_API |
| 42 | GType gst_audio_stream_align_get_type (void); |
| 43 | |
| 44 | GST_AUDIO_API |
| 45 | GstAudioStreamAlign * gst_audio_stream_align_new (gint rate, |
| 46 | GstClockTime alignment_threshold, |
| 47 | GstClockTime discont_wait); |
| 48 | GST_AUDIO_API |
| 49 | GstAudioStreamAlign * gst_audio_stream_align_copy (const GstAudioStreamAlign * align); |
| 50 | GST_AUDIO_API |
| 51 | void gst_audio_stream_align_free (GstAudioStreamAlign * align); |
| 52 | |
| 53 | GST_AUDIO_API |
| 54 | void gst_audio_stream_align_set_rate (GstAudioStreamAlign * align, |
| 55 | gint rate); |
| 56 | GST_AUDIO_API |
| 57 | gint gst_audio_stream_align_get_rate (const GstAudioStreamAlign * align); |
| 58 | |
| 59 | GST_AUDIO_API |
| 60 | void gst_audio_stream_align_set_alignment_threshold (GstAudioStreamAlign * align, |
| 61 | GstClockTime alignment_threshold); |
| 62 | GST_AUDIO_API |
| 63 | GstClockTime gst_audio_stream_align_get_alignment_threshold (const GstAudioStreamAlign * align); |
| 64 | |
| 65 | GST_AUDIO_API |
| 66 | void gst_audio_stream_align_set_discont_wait (GstAudioStreamAlign * align, |
| 67 | GstClockTime discont_wait); |
| 68 | GST_AUDIO_API |
| 69 | GstClockTime gst_audio_stream_align_get_discont_wait (const GstAudioStreamAlign * align); |
| 70 | |
| 71 | |
| 72 | GST_AUDIO_API |
| 73 | void gst_audio_stream_align_mark_discont (GstAudioStreamAlign * align); |
| 74 | |
| 75 | GST_AUDIO_API |
| 76 | GstClockTime gst_audio_stream_align_get_timestamp_at_discont (const GstAudioStreamAlign * align); |
| 77 | |
| 78 | GST_AUDIO_API |
| 79 | guint64 gst_audio_stream_align_get_samples_since_discont (const GstAudioStreamAlign * align); |
| 80 | |
| 81 | GST_AUDIO_API |
| 82 | gboolean gst_audio_stream_align_process (GstAudioStreamAlign * align, |
| 83 | gboolean discont, |
| 84 | GstClockTime timestamp, |
| 85 | guint n_samples, |
| 86 | GstClockTime *out_timestamp, |
| 87 | GstClockTime *out_duration, |
| 88 | guint64 *out_sample_position); |
| 89 | |
| 90 | G_END_DECLS |
| 91 | |
| 92 | #endif /* __GST_AUDIO_STREAM_ALIGN_H__ */ |
| 93 | |