|
Packit |
0652a1 |
/* GStreamer
|
|
Packit |
0652a1 |
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
Packit |
0652a1 |
* 2005 Wim Taymans <wim@fluendo.com>
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* gstaudiosink.h:
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
0652a1 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
0652a1 |
* License as published by the Free Software Foundation; either
|
|
Packit |
0652a1 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
0652a1 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
0652a1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
0652a1 |
* Library General Public License for more details.
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
0652a1 |
* License along with this library; if not, write to the
|
|
Packit |
0652a1 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
0652a1 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
0652a1 |
*/
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#ifndef __GST_AUDIO_AUDIO_H__
|
|
Packit |
0652a1 |
#include <gst/audio/audio.h>
|
|
Packit |
0652a1 |
#endif
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#ifndef __GST_AUDIO_SINK_H__
|
|
Packit |
0652a1 |
#define __GST_AUDIO_SINK_H__
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#include <gst/gst.h>
|
|
Packit |
0652a1 |
#include <gst/audio/gstaudiobasesink.h>
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
G_BEGIN_DECLS
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#define GST_TYPE_AUDIO_SINK (gst_audio_sink_get_type())
|
|
Packit |
0652a1 |
#define GST_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_SINK,GstAudioSink))
|
|
Packit |
0652a1 |
#define GST_AUDIO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_SINK,GstAudioSinkClass))
|
|
Packit |
0652a1 |
#define GST_AUDIO_SINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_AUDIO_SINK,GstAudioSinkClass))
|
|
Packit |
0652a1 |
#define GST_IS_AUDIO_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_SINK))
|
|
Packit |
0652a1 |
#define GST_IS_AUDIO_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SINK))
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
typedef struct _GstAudioSink GstAudioSink;
|
|
Packit |
0652a1 |
typedef struct _GstAudioSinkClass GstAudioSinkClass;
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/**
|
|
Packit |
0652a1 |
* GstAudioSink:
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* Opaque #GstAudioSink.
|
|
Packit |
0652a1 |
*/
|
|
Packit |
0652a1 |
struct _GstAudioSink {
|
|
Packit |
0652a1 |
GstAudioBaseSink element;
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/*< private >*/ /* with LOCK */
|
|
Packit |
0652a1 |
GThread *thread;
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/*< private >*/
|
|
Packit |
0652a1 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
0652a1 |
};
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/**
|
|
Packit |
0652a1 |
* GstAudioSinkClass:
|
|
Packit |
0652a1 |
* @parent_class: the parent class structure.
|
|
Packit |
0652a1 |
* @open: Open the device. No configuration needs to be done at this point.
|
|
Packit |
0652a1 |
* This function is also used to check if the device is available.
|
|
Packit |
0652a1 |
* @prepare: Prepare the device to operate with the specified parameters.
|
|
Packit |
0652a1 |
* @unprepare: Undo operations done in prepare.
|
|
Packit |
0652a1 |
* @close: Close the device.
|
|
Packit |
0652a1 |
* @write: Write data to the device.
|
|
Packit |
0652a1 |
* @delay: Return how many frames are still in the device. This is used to
|
|
Packit |
0652a1 |
* drive the synchronisation.
|
|
Packit |
0652a1 |
* @reset: Returns as quickly as possible from a write and flush any pending
|
|
Packit |
0652a1 |
* samples from the device.
|
|
Packit |
0652a1 |
*
|
|
Packit |
0652a1 |
* #GstAudioSink class. Override the vmethods to implement functionality.
|
|
Packit |
0652a1 |
*/
|
|
Packit |
0652a1 |
struct _GstAudioSinkClass {
|
|
Packit |
0652a1 |
GstAudioBaseSinkClass parent_class;
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/* vtable */
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/* open the device with given specs */
|
|
Packit |
0652a1 |
gboolean (*open) (GstAudioSink *sink);
|
|
Packit |
0652a1 |
/* prepare resources and state to operate with the given specs */
|
|
Packit |
0652a1 |
gboolean (*prepare) (GstAudioSink *sink, GstAudioRingBufferSpec *spec);
|
|
Packit |
0652a1 |
/* undo anything that was done in prepare() */
|
|
Packit |
0652a1 |
gboolean (*unprepare) (GstAudioSink *sink);
|
|
Packit |
0652a1 |
/* close the device */
|
|
Packit |
0652a1 |
gboolean (*close) (GstAudioSink *sink);
|
|
Packit |
0652a1 |
/* write samples to the device */
|
|
Packit |
0652a1 |
gint (*write) (GstAudioSink *sink, gpointer data, guint length);
|
|
Packit |
0652a1 |
/* get number of frames queued in the device */
|
|
Packit |
0652a1 |
guint (*delay) (GstAudioSink *sink);
|
|
Packit |
0652a1 |
/* reset the audio device, unblock from a write */
|
|
Packit |
0652a1 |
void (*reset) (GstAudioSink *sink);
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
/*< private >*/
|
|
Packit |
0652a1 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
0652a1 |
};
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
GST_AUDIO_API
|
|
Packit |
0652a1 |
GType gst_audio_sink_get_type(void);
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
Packit |
0652a1 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioSink, gst_object_unref)
|
|
Packit |
0652a1 |
#endif
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
G_END_DECLS
|
|
Packit |
0652a1 |
|
|
Packit |
0652a1 |
#endif /* __GST_AUDIO_SINK_H__ */
|