Blame ext/alsa/gstalsasrc.h

Packit 971217
/* GStreamer
Packit 971217
 * Copyright (C)  2005 Wim Taymans <wim@fluendo.com>
Packit 971217
 *
Packit 971217
 * gstalsasrc.h: 
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
Packit 971217
#ifndef __GST_ALSASRC_H__
Packit 971217
#define __GST_ALSASRC_H__
Packit 971217
Packit 971217
#include <gst/audio/audio.h>
Packit 971217
#include "gstalsa.h"
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
#define GST_TYPE_ALSA_SRC            (gst_alsasrc_get_type())
Packit 971217
#define GST_ALSA_SRC(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_SRC,GstAlsaSrc))
Packit 971217
#define GST_ALSA_SRC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_SRC,GstAlsaSrcClass))
Packit 971217
#define GST_IS_ALSA_SRC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_SRC))
Packit 971217
#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
Packit 971217
#define GST_ALSA_SRC_CAST(obj)       ((GstAlsaSrc *)(obj))
Packit 971217
Packit 971217
#define GST_ALSA_SRC_GET_LOCK(obj)  (&GST_ALSA_SRC_CAST (obj)->alsa_lock)
Packit 971217
#define GST_ALSA_SRC_LOCK(obj)      (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
Packit 971217
#define GST_ALSA_SRC_UNLOCK(obj)    (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
Packit 971217
Packit 971217
typedef struct _GstAlsaSrc GstAlsaSrc;
Packit 971217
typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstAlsaSrc:
Packit 971217
 *
Packit 971217
 * Opaque data structure
Packit 971217
 */
Packit 971217
struct _GstAlsaSrc {
Packit 971217
  GstAudioSrc           src;
Packit 971217
Packit 971217
  gchar                 *device;
Packit 971217
Packit 971217
  snd_pcm_t             *handle;
Packit 971217
  snd_pcm_hw_params_t   *hwparams;
Packit 971217
  snd_pcm_sw_params_t   *swparams;
Packit 971217
Packit 971217
  GstCaps               *cached_caps;
Packit 971217
Packit 971217
  snd_pcm_access_t      access;
Packit 971217
  snd_pcm_format_t      format;
Packit 971217
  guint                 rate;
Packit 971217
  guint                 channels;
Packit 971217
  gint                  bpf;
Packit 971217
  gboolean              driver_timestamps;
Packit 971217
Packit 971217
  guint                 buffer_time;
Packit 971217
  guint                 period_time;
Packit 971217
  snd_pcm_uframes_t     buffer_size;
Packit 971217
  snd_pcm_uframes_t     period_size;
Packit 971217
Packit 971217
  GMutex                alsa_lock;
Packit 971217
};
Packit 971217
Packit 971217
struct _GstAlsaSrcClass {
Packit 971217
  GstAudioSrcClass parent_class;
Packit 971217
};
Packit 971217
Packit 971217
GType gst_alsasrc_get_type(void);
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __GST_ALSASRC_H__ */