1 /* GStreamer 2 * Copyright (C) 2018 Collabora Ltd. 3 * @author George Kiagiadakis <george.kiagiadakis@collabora.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this library; if not, write to the 17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef __GST_PLANAR_AUDIO_ADAPTER_H__ 22 #define __GST_PLANAR_AUDIO_ADAPTER_H__ 23 24 #ifndef GST_USE_UNSTABLE_API 25 #warning "The Base library from gst-plugins-bad is unstable API and may change in future." 26 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning." 27 #endif 28 29 #include <gst/gst.h> 30 #include <gst/audio/audio-info.h> 31 #include <gst/audio/audio-bad-prelude.h> 32 33 G_BEGIN_DECLS 34 35 #define GST_TYPE_PLANAR_AUDIO_ADAPTER \ 36 (gst_planar_audio_adapter_get_type()) 37 #define GST_PLANAR_AUDIO_ADAPTER(obj) \ 38 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_PLANAR_AUDIO_ADAPTER, GstPlanarAudioAdapter)) 39 #define GST_PLANAR_AUDIO_ADAPTER_CLASS(klass) \ 40 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_PLANAR_AUDIO_ADAPTER, GstPlanarAudioAdapterClass)) 41 #define GST_PLANAR_AUDIO_ADAPTER_GET_CLASS(obj) \ 42 (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLANAR_AUDIO_ADAPTER, GstPlanarAudioAdapterClass)) 43 #define GST_IS_PLANAR_AUDIO_ADAPTER(obj) \ 44 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_PLANAR_AUDIO_ADAPTER)) 45 #define GST_IS_PLANAR_AUDIO_ADAPTER_CLASS(klass) \ 46 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_PLANAR_AUDIO_ADAPTER)) 47 48 /** 49 * GstPlanarAudioAdapter: 50 * 51 * The opaque #GstPlanarAudioAdapter data structure. 52 */ 53 typedef struct _GstPlanarAudioAdapter GstPlanarAudioAdapter; 54 typedef struct _GstPlanarAudioAdapterClass GstPlanarAudioAdapterClass; 55 56 GST_AUDIO_BAD_API 57 GType gst_planar_audio_adapter_get_type (void); 58 59 GST_AUDIO_BAD_API 60 GstPlanarAudioAdapter * gst_planar_audio_adapter_new (void) G_GNUC_MALLOC; 61 62 GST_AUDIO_BAD_API 63 void gst_planar_audio_adapter_configure (GstPlanarAudioAdapter * adapter, 64 const GstAudioInfo * info); 65 66 GST_AUDIO_BAD_API 67 void gst_planar_audio_adapter_clear (GstPlanarAudioAdapter * adapter); 68 69 GST_AUDIO_BAD_API 70 void gst_planar_audio_adapter_push (GstPlanarAudioAdapter * adapter, 71 GstBuffer * buf); 72 73 GST_AUDIO_BAD_API 74 void gst_planar_audio_adapter_flush (GstPlanarAudioAdapter * adapter, 75 gsize to_flush); 76 77 GST_AUDIO_BAD_API 78 GstBuffer * gst_planar_audio_adapter_get_buffer (GstPlanarAudioAdapter * adapter, 79 gsize nsamples, GstMapFlags flags); 80 81 GST_AUDIO_BAD_API 82 GstBuffer * gst_planar_audio_adapter_take_buffer (GstPlanarAudioAdapter * adapter, 83 gsize nsamples, GstMapFlags flags); 84 85 GST_AUDIO_BAD_API 86 gsize gst_planar_audio_adapter_available (GstPlanarAudioAdapter * adapter); 87 88 GST_AUDIO_BAD_API 89 guint64 gst_planar_audio_adapter_distance_from_discont (GstPlanarAudioAdapter * adapter); 90 91 GST_AUDIO_BAD_API 92 guint64 gst_planar_audio_adapter_offset_at_discont (GstPlanarAudioAdapter * adapter); 93 94 GST_AUDIO_BAD_API 95 GstClockTime gst_planar_audio_adapter_pts_at_discont (GstPlanarAudioAdapter * adapter); 96 97 GST_AUDIO_BAD_API 98 GstClockTime gst_planar_audio_adapter_dts_at_discont (GstPlanarAudioAdapter * adapter); 99 100 GST_AUDIO_BAD_API 101 guint64 gst_planar_audio_adapter_prev_offset (GstPlanarAudioAdapter * adapter, 102 guint64 * distance); 103 104 GST_AUDIO_BAD_API 105 GstClockTime gst_planar_audio_adapter_prev_pts (GstPlanarAudioAdapter * adapter, 106 guint64 * distance); 107 108 GST_AUDIO_BAD_API 109 GstClockTime gst_planar_audio_adapter_prev_dts (GstPlanarAudioAdapter * adapter, 110 guint64 * distance); 111 112 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPlanarAudioAdapter, gst_object_unref) 113 114 G_END_DECLS 115 116 #endif /* __GST_PLANAR_AUDIO_ADAPTER_H__ */ 117