gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.h
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    18  * License along with this library; if not, write to the
    18  * License along with this library; if not, write to the
    19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    20  * Boston, MA 02111-1307, USA.
    20  * Boston, MA 02111-1307, USA.
    21  */
    21  */
    22 
    22 
       
    23 /* a base class for simple audio srcs.
       
    24  *
       
    25  * This base class only requires subclasses to implement a set
       
    26  * of simple functions.
       
    27  *
       
    28  * - open: open the device with the specified caps
       
    29  * - read: read samples to the audio device
       
    30  * - close: close the device
       
    31  * - delay: the number of samples queued in the device
       
    32  * - reset: unblock a read to the device and reset.
       
    33  *
       
    34  * All scheduling of samples and timestamps is done in this
       
    35  * base class.
       
    36  */
       
    37 
    23 #ifndef __GST_AUDIO_SRC_H__
    38 #ifndef __GST_AUDIO_SRC_H__
    24 #define __GST_AUDIO_SRC_H__
    39 #define __GST_AUDIO_SRC_H__
    25 
    40 
    26 #include <gst/gst.h>
    41 #include <gst/gst.h>
    27 #include <gst/audio/gstbaseaudiosrc.h>
    42 #include <gst/audio/gstbaseaudiosrc.h>
    36 #define GST_IS_AUDIO_SRC_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC))
    51 #define GST_IS_AUDIO_SRC_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_SRC))
    37 
    52 
    38 typedef struct _GstAudioSrc GstAudioSrc;
    53 typedef struct _GstAudioSrc GstAudioSrc;
    39 typedef struct _GstAudioSrcClass GstAudioSrcClass;
    54 typedef struct _GstAudioSrcClass GstAudioSrcClass;
    40 
    55 
    41 /**
       
    42  * GstAudioSrc:
       
    43  * @element: parent class
       
    44  *
       
    45  * Base class for simple audio sources.
       
    46  */
       
    47 struct _GstAudioSrc {
    56 struct _GstAudioSrc {
    48   GstBaseAudioSrc        element;
    57   GstBaseAudioSrc        element;
    49 
    58 
    50   /*< private >*/ /* with LOCK */
    59   /*< private >*/ /* with LOCK */
    51   GThread   *thread;
    60   GThread   *thread;
    52 
    61 
    53   /*< private >*/
    62   /*< private >*/
    54   gpointer _gst_reserved[GST_PADDING];
    63   gpointer _gst_reserved[GST_PADDING];
    55 };
    64 };
    56 
    65 
    57 /**
       
    58  * GstAudioSrcClass:
       
    59  * @parent_class: the parent class.
       
    60  * @open: open the device with the specified caps
       
    61  * @prepare: configure device with format
       
    62  * @unprepare: undo the configuration
       
    63  * @close: close the device
       
    64  * @read: read samples to the audio device
       
    65  * @delay: the number of samples queued in the device
       
    66  * @reset: unblock a read to the device and reset.
       
    67  *
       
    68  * #GstAudioSrc class. Override the vmethod to implement
       
    69  * functionality.
       
    70  */
       
    71 struct _GstAudioSrcClass {
    66 struct _GstAudioSrcClass {
    72   GstBaseAudioSrcClass parent_class;
    67   GstBaseAudioSrcClass parent_class;
    73 
    68 
    74   /* vtable */
    69   /* vtable */
    75 
    70