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
28G_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 */
39typedef struct _GstAudioStreamAlign GstAudioStreamAlign;
40
41GST_AUDIO_API
42GType gst_audio_stream_align_get_type (void);
43
44GST_AUDIO_API
45GstAudioStreamAlign * gst_audio_stream_align_new (gint rate,
46 GstClockTime alignment_threshold,
47 GstClockTime discont_wait);
48GST_AUDIO_API
49GstAudioStreamAlign * gst_audio_stream_align_copy (const GstAudioStreamAlign * align);
50GST_AUDIO_API
51void gst_audio_stream_align_free (GstAudioStreamAlign * align);
52
53GST_AUDIO_API
54void gst_audio_stream_align_set_rate (GstAudioStreamAlign * align,
55 gint rate);
56GST_AUDIO_API
57gint gst_audio_stream_align_get_rate (const GstAudioStreamAlign * align);
58
59GST_AUDIO_API
60void gst_audio_stream_align_set_alignment_threshold (GstAudioStreamAlign * align,
61 GstClockTime alignment_threshold);
62GST_AUDIO_API
63GstClockTime gst_audio_stream_align_get_alignment_threshold (const GstAudioStreamAlign * align);
64
65GST_AUDIO_API
66void gst_audio_stream_align_set_discont_wait (GstAudioStreamAlign * align,
67 GstClockTime discont_wait);
68GST_AUDIO_API
69GstClockTime gst_audio_stream_align_get_discont_wait (const GstAudioStreamAlign * align);
70
71
72GST_AUDIO_API
73void gst_audio_stream_align_mark_discont (GstAudioStreamAlign * align);
74
75GST_AUDIO_API
76GstClockTime gst_audio_stream_align_get_timestamp_at_discont (const GstAudioStreamAlign * align);
77
78GST_AUDIO_API
79guint64 gst_audio_stream_align_get_samples_since_discont (const GstAudioStreamAlign * align);
80
81GST_AUDIO_API
82gboolean 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
90G_END_DECLS
91
92#endif /* __GST_AUDIO_STREAM_ALIGN_H__ */
93

source code of include/gstreamer-1.0/gst/audio/gstaudiostreamalign.h