Commit f41100e8 authored by Joni Valtanen's avatar Joni Valtanen Committed by Sebastian Dröge

directsoundsrc: Add DirectSound source plugin

Fixes bug #344129.
parent 7fa5cba6
......@@ -354,6 +354,20 @@ fi
dnl *** sys plug-ins ***
dnl DirectSound
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTSOUND, true)
GST_CHECK_FEATURE(DIRECTSOUND, [DirectSound], [directsound], [
AC_CHECK_HEADER(dsound.h, HAVE_DIRECTSOUND="yes", HAVE_DIRECTSOUND="no")
])
AC_CHECK_LIB( dsound, DXGetErrorString9, [
echo "Errorstrings in DirectSoundSink - enabled"
AM_CONDITIONAL( DSOUND9, true )
], [
echo "Errorstrings in DirectSoundSink - disabled"
AM_CONDITIONAL( DSOUND9, false )
] )
dnl DirectDraw
translit(dnm, m, l) AM_CONDITIONAL(USE_DIRECTDRAW, true)
AG_GST_CHECK_FEATURE(DIRECTDRAW, [DirectDraw plug-in], directdrawsink, [
......@@ -1516,6 +1530,7 @@ AM_CONDITIONAL(USE_CELT, false)
AM_CONDITIONAL(USE_DC1394, false)
AM_CONDITIONAL(USE_DIRECTFB, false)
AM_CONDITIONAL(USE_DIRECTDRAW, false)
AM_CONDITIONAL(USE_DIRECTSOUND, false)
AM_CONDITIONAL(USE_DTS, false)
AM_CONDITIONAL(USE_DIRAC, false)
AM_CONDITIONAL(USE_DIVX, false)
......@@ -1683,6 +1698,7 @@ sys/dshowdecwrapper/Makefile
sys/acmenc/Makefile
sys/acmmp3dec/Makefile
sys/directdraw/Makefile
sys/directsound/Makefile
sys/dshowsrcwrapper/Makefile
sys/dshowvideosink/Makefile
sys/dvb/Makefile
......
......@@ -28,6 +28,12 @@ else
DIRECTDRAW_DIR=
endif
if USE_DIRECTSOUND
DIRECTSOUND_DIR=directsound
else
DIRECTSOUND_DIR=
endif
if USE_FBDEV
FBDEV_DIR=fbdev
else
......@@ -76,8 +82,8 @@ else
VDPAU_DIR=
endif
SUBDIRS = $(ACM_DIR) $(DIRECTDRAW_DIR) $(DVB_DIR) $(FBDEV_DIR) $(OSS4_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR)
SUBDIRS = $(ACM_DIR) $(DIRECTDRAW_DIR) $(DIRECTSOUND_DIR) $(DVB_DIR) $(FBDEV_DIR) $(OSS4_DIR) $(OSX_VIDEO_DIR) $(QT_DIR) $(VCD_DIR) $(VDPAU_DIR) $(WININET_DIR)
DIST_SUBDIRS = acmenc acmmp3dec directdraw dvb fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
DIST_SUBDIRS = acmenc acmmp3dec directdraw directsound dvb fbdev dshowdecwrapper dshowsrcwrapper dshowvideosink \
oss4 osxvideo qtwrapper vcd vdpau wasapi wininet winks winscreencap
plugin_LTLIBRARIES = libgstdirectsoundsrc.la
libgstdirectsoundsrc_la_SOURCES = gstdirectsoundsrc.c gstdirectsoundplugin.c
libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS)
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) \
-lgstinterfaces-$(GST_MAJORMINOR) -ldsound
libgstdirectsoundsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTDRAW_LDFLAGS)
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS= gstdirectsoundsrc.h
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
* Copyright (C) 2007 Pioneers of the Inevitable <songbird@songbirdnest.com>
*
* gstdirectsoundplugin.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*
* The development of this code was made possible due to the involvement
* of Pioneers of the Inevitable, the creators of the Songbird Music player
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstdirectsoundsrc.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "directsoundsrc", GST_RANK_PRIMARY,
GST_TYPE_DIRECTSOUND_SRC))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"directsoundsrc",
"Direct Sound Source plugin library",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
This diff is collapsed.
/*
* GStreamer
* Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright 2005 Sbastien Moutte <sebastien@moutte.net>
* Copyright 2006 Joni Valtanen <joni.valtanen@movial.fi>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_DIRECTSOUNDSRC_H__
#define __GST_DIRECTSOUNDSRC_H__
#include <gst/gst.h>
#include <gst/audio/gstaudiosrc.h>
#include <windows.h>
#include <dsound.h>
/* add here some headers if needed */
G_BEGIN_DECLS
/* #defines don't like whitespacey bits */
#define GST_TYPE_DIRECTSOUND_SRC (gst_directsound_src_get_type())
#define GST_DIRECTSOUND_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECTSOUND_SRC,GstDirectSoundSrc))
#define GST_DIRECTSOUND_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECTSOUND_SRC,GstDirectSoundSrcClass))
#define GST_IS_DIRECTSOUND_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECTSOUND_SRC))
#define GST_IS_DIRECTSOUND_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECTSOUND_SRC))
typedef struct _GstDirectSoundSrc GstDirectSoundSrc;
typedef struct _GstDirectSoundSrcClass GstDirectSoundSrcClass;
#define GST_DSOUND_LOCK(obj) (g_mutex_lock (obj->dsound_lock))
#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (obj->dsound_lock))
struct _GstDirectSoundSrc
{
GstAudioSrc src;
HINSTANCE DSoundDLL; /* DLL instance */
LPDIRECTSOUNDCAPTURE pDSC; /* DirectSoundCapture*/
LPDIRECTSOUNDCAPTUREBUFFER pDSBSecondary; /*Secondaty capturebuffer*/
DWORD current_circular_offset;
HANDLE rghEvent;
DWORD notifysize;
guint buffer_size;
guint latency_size;
guint bytes_per_sample;
guint buffer_time;
guint latency_time;
#if 0
guint device;
#endif
GMutex *dsound_lock;
};
struct _GstDirectSoundSrcClass
{
GstAudioSrcClass parent_class;
};
GType gst_directsound_src_get_type (void);
G_END_DECLS
#endif /* __GST_DIRECTSOUNDSRC_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment