sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
csink = GST_AUDIO_SINK_GET_CLASS (sink);
- if (csink->clear_all) {
+ if (csink->extension->clear_all) {
GST_DEBUG_OBJECT (sink, "clear all");
- csink->clear_all (sink);
+ csink->extension->clear_all (sink);
}
/* chain up to the parent implementation */
};
#define _do_init \
- GST_DEBUG_CATEGORY_INIT (gst_audio_sink_debug, "audiosink", 0, "audiosink element");
+ GST_DEBUG_CATEGORY_INIT (gst_audio_sink_debug, "audiosink", 0, "audiosink element"); \
+ g_type_add_class_private (g_define_type_id, \
+ sizeof (GstAudioSinkClassExtension));
#define gst_audio_sink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstAudioSink, gst_audio_sink,
GST_TYPE_AUDIO_BASE_SINK, _do_init);
GST_DEBUG_FUNCPTR (gst_audio_sink_create_ringbuffer);
g_type_class_ref (GST_TYPE_AUDIO_SINK_RING_BUFFER);
+
+ klass->extension = G_TYPE_CLASS_GET_PRIVATE (klass,
+ GST_TYPE_AUDIO_SINK, GstAudioSinkClassExtension);
}
static void
typedef struct _GstAudioSink GstAudioSink;
typedef struct _GstAudioSinkClass GstAudioSinkClass;
+typedef struct _GstAudioSinkClassExtension GstAudioSinkClassExtension;
/**
* GstAudioSink:
* This vmethod is deprecated. Please provide pause and stop instead.
* @pause: Pause the device and unblock write as fast as possible.
* For retro compatibility, the audio sink will fallback
- * to calling reset if this vmethod is not provided.
- * @resume: Resume the device.
+ * to calling reset if this vmethod is not provided. Since: 1.18
+ * @resume: Resume the device. Since: 1.18
* @stop: Stop the device and unblock write as fast as possible.
* Pending samples are flushed from the device.
* For retro compatibility, the audio sink will fallback
- * to calling reset if this vmethod is not provided.
- * @clear-all: Clear the device.
+ * to calling reset if this vmethod is not provided. Since: 1.18
+ * @extension: class extension structure. Since: 1.18
*/
struct _GstAudioSinkClass {
GstAudioBaseSinkClass parent_class;
void (*resume) (GstAudioSink *sink);
/* stop the audio device, unblock from a write */
void (*stop) (GstAudioSink *sink);
+
+ GstAudioSinkClassExtension *extension;
+};
+
+/**
+ * GstAudioSinkClassExtension:
+ * @clear-all: Clear the device. Since: 1.18
+ */
+struct _GstAudioSinkClassExtension
+{
/* clear the audio device */
void (*clear_all) (GstAudioSink *sink);
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING - 4];
+ /* no padding needed */
};
GST_AUDIO_API