added sys/directdraw added sys/directsound added win32/vs6/gst_plugins_bad.dsw added win32/vs6/libgstdirectsound.dsp ...

Original commit message from CVS:
2006-01-05  Sebastien Moutte  <sebastien@moutte.net>
* added sys/directdraw
* added sys/directsound
* added win32/vs6/gst_plugins_bad.dsw
* added win32/vs6/libgstdirectsound.dsp
* added win32/vs6/libgstdirectdraw.dsp
* added win32/common/config.h
This commit is contained in:
Sébastien Moutte 2006-01-05 23:17:44 +00:00
parent 4e68e0f563
commit f670909edb
8 changed files with 2689 additions and 0 deletions

View file

@ -0,0 +1,42 @@
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
*
* gstdirectdrawplugin.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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstdirectdrawsink.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "directdrawsink", GST_RANK_NONE,
GST_TYPE_DIRECTDRAW_SINK))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"directdraw",
"DIRECTDRAW plugin library",
plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,132 @@
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
*
* gstdirectdrawsink.h:
*
* 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_DIRECTDRAWSINK_H__
#define __GST_DIRECTDRAWSINK_H__
#define DIRECTDRAW_VERSION 0x0700
#include <gst/gst.h>
#include <gst/video/gstvideosink.h>
#include <windows.h>
#include <ddraw.h>
G_BEGIN_DECLS
#define GST_TYPE_DIRECTDRAW_SINK (gst_directdrawsink_get_type())
#define GST_DIRECTDRAW_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECTDRAW_SINK,GstDirectDrawSink))
#define GST_DIRECTDRAW_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECTDRAW_SINK,GstDirectDrawSinkClass))
#define GST_IS_DIRECTDRAW_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECTDRAW_SINK))
#define GST_IS_DIRECTDRAW_SINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECTDRAW_SINK))
typedef struct _GstDirectDrawSink GstDirectDrawSink;
typedef struct _GstDirectDrawSinkClass GstDirectDrawSinkClass;
#define GST_TYPE_DDRAWSURFACE (gst_ddrawsurface_get_type())
#define GST_IS_DDRAWSURFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DDRAWSURFACE))
#define GST_DDRAWSURFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DDRAWSURFACE, GstDDrawSurface))
typedef struct _GstDDrawSurface GstDDrawSurface;
struct _GstDDrawSurface
{
/* Extension of GstBuffer to store directdraw surfaces */
GstBuffer buffer;
/*directdraw surface */
LPDIRECTDRAWSURFACE surface;
gint width;
gint height;
gboolean locked;
DDPIXELFORMAT dd_pixel_format;
GstDirectDrawSink *ddrawsink;
};
typedef struct _GstDDDDisplayMode GstDDDisplayMode;
struct _GstDDDDisplayMode
{
gint width;
gint height;
gint bpp;
};
struct _GstDirectDrawSink
{
GstVideoSink videosink;
/*directdraw offscreen surfaces pool */
GSList *buffer_pool;
GSList *display_modes;
//GstDDDisplayMode display_mode;
/*directdraw objects */
LPDIRECTDRAW ddraw_object;
LPDIRECTDRAWSURFACE primary_surface;
LPDIRECTDRAWSURFACE offscreen_surface;
LPDIRECTDRAWSURFACE overlays;
LPDIRECTDRAWCLIPPER clipper;
LPDIRECTDRAWSURFACE extern_surface;
/*Directdraw caps */
GstCaps *caps;
/*handle of the video window */
HWND video_window;
gboolean resize_window;
/*video properties */
gint video_width, video_height;
gint out_width, out_height;
//gdouble framerate;
gint fps_n;
gint fps_d;
/*pixel format */
DDPIXELFORMAT dd_pixel_format;
GThread *window_thread;
gboolean bUseOverlay;
gboolean bIsOverlayVisible;
gboolean bFullScreen;
gboolean setup;
GMutex *pool_lock;
guint color_key;
/*LPDIRECTDRAWSURFACE extern_surface; */
};
struct _GstDirectDrawSinkClass
{
GstVideoSinkClass parent_class;
};
GType gst_directdrawsink_get_type (void);
G_END_DECLS
#endif /* __GST_DIRECTDRAWSINK_H__ */

View file

@ -0,0 +1,43 @@
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstdirectsoundsink.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "directsoundsink", GST_RANK_NONE,
GST_TYPE_DIRECTSOUND_SINK))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"directsound",
"DIRECTSOUND plugin library",
plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN)

View file

@ -0,0 +1,421 @@
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
*
* gstdirectsoundsink.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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstdirectsoundsink.h"
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
GST_DEBUG_CATEGORY_STATIC (directsoundsink_debug);
#define GST_CAT_DEFAULT directsoundsink_debug
/* elementfactory information */
static GstElementDetails gst_directsoundsink_details =
GST_ELEMENT_DETAILS ("Audio Sink (DIRECTSOUND)",
"Sink/Audio",
"Output to a sound card via DIRECTSOUND",
"Sebastien Moutte <sebastien@moutte.net>");
static void gst_directsoundsink_base_init (gpointer g_class);
static void gst_directsoundsink_class_init (GstDirectSoundSinkClass * klass);
static void gst_directsoundsink_init (GstDirectSoundSink * alsasink);
static void gst_directsoundsink_dispose (GObject * object);
static void gst_directsoundsink_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_directsoundsink_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstCaps *gst_directsoundsink_getcaps (GstBaseSink * bsink);
static gboolean gst_directsoundsink_prepare (GstAudioSink * asink,
GstRingBufferSpec * spec);
static gboolean gst_directsoundsink_unprepare (GstAudioSink * asink);
static gboolean gst_directsoundsink_open (GstAudioSink * asink);
static gboolean gst_directsoundsink_close (GstAudioSink * asink);
static guint gst_directsoundsink_write (GstAudioSink * asink, gpointer data,
guint length);
static guint gst_directsoundsink_delay (GstAudioSink * asink);
static void gst_directsoundsink_reset (GstAudioSink * asink);
static GstStaticPadTemplate directsoundsink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]; "
"audio/x-raw-int, "
"signed = (boolean) { TRUE, FALSE }, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]"));
static void
_do_init (GType directsoundsink_type)
{
GST_DEBUG_CATEGORY_INIT (directsoundsink_debug, "directsoundsink", 0,
"DirectSound sink");
}
GST_BOILERPLATE_FULL (GstDirectSoundSink, gst_directsoundsink, GstAudioSink,
GST_TYPE_AUDIO_SINK, _do_init);
static void
gst_directsoundsink_dispose (GObject * object)
{
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gst_directsoundsink_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &gst_directsoundsink_details);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&directsoundsink_sink_factory));
}
static void
gst_directsoundsink_class_init (GstDirectSoundSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
GstBaseAudioSinkClass *gstbaseaudiosink_class;
GstAudioSinkClass *gstaudiosink_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
gstaudiosink_class = (GstAudioSinkClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_DIRECTSOUND_SINK);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_directsoundsink_dispose);
gobject_class->get_property =
GST_DEBUG_FUNCPTR (gst_directsoundsink_get_property);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_directsoundsink_set_property);
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_directsoundsink_getcaps);
gstaudiosink_class->prepare = GST_DEBUG_FUNCPTR (gst_directsoundsink_prepare);
gstaudiosink_class->unprepare =
GST_DEBUG_FUNCPTR (gst_directsoundsink_unprepare);
gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_directsoundsink_open);
gstaudiosink_class->close = GST_DEBUG_FUNCPTR (gst_directsoundsink_close);
gstaudiosink_class->write = GST_DEBUG_FUNCPTR (gst_directsoundsink_write);
gstaudiosink_class->delay = GST_DEBUG_FUNCPTR (gst_directsoundsink_delay);
gstaudiosink_class->reset = GST_DEBUG_FUNCPTR (gst_directsoundsink_reset);
}
static void
gst_directsoundsink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstDirectSoundSink *dsoundsink;
dsoundsink = GST_DIRECTSOUND_SINK (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_directsoundsink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstDirectSoundSink *dsoundsink;
dsoundsink = GST_DIRECTSOUND_SINK (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_directsoundsink_init (GstDirectSoundSink * dsoundsink,
GstDirectSoundSinkClass g_class)
{
GST_DEBUG ("initializing directsoundsink");
dsoundsink->pDS = NULL;
dsoundsink->pDSBSecondary = NULL;
dsoundsink->current_circular_offset = 0;
dsoundsink->buffer_size = DSBSIZE_MIN;
}
static GstCaps *
gst_directsoundsink_getcaps (GstBaseSink * bsink)
{
GstDirectSoundSink *dsoundsink;
dsoundsink = GST_DIRECTSOUND_SINK (bsink);
return
gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SINK_PAD
(dsoundsink)));
}
static gboolean
gst_directsoundsink_open (GstAudioSink * asink)
{
GstDirectSoundSink *dsoundsink;
HRESULT hRes;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/* create and initialize a DirecSound object */
if (FAILED (hRes = DirectSoundCreate (NULL, &dsoundsink->pDS, NULL))) {
GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
("gst_directsoundsink_open: DirectSoundCreate: %s",
DXGetErrorString9 (hRes)), (NULL));
return FALSE;
}
if (FAILED (hRes =
IDirectSound_SetCooperativeLevel (dsoundsink->pDS,
GetDesktopWindow (), DSSCL_PRIORITY))) {
GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
("gst_directsoundsink_open: IDirectSound_SetCooperativeLevel: %s",
DXGetErrorString9 (hRes)), (NULL));
return FALSE;
}
return TRUE;
}
static gboolean
gst_directsoundsink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
{
GstDirectSoundSink *dsoundsink;
HRESULT hRes;
DSBUFFERDESC descSecondary;
WAVEFORMATEX wfx;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/*save number of bytes per sample */
dsoundsink->bytes_per_sample = spec->bytes_per_sample;
/* fill the WAVEFORMATEX struture with spec params */
memset (&wfx, 0, sizeof (wfx));
wfx.cbSize = sizeof (wfx);
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nChannels = spec->channels;
wfx.nSamplesPerSec = spec->rate;
wfx.wBitsPerSample = (spec->bytes_per_sample * 8) / wfx.nChannels;
wfx.nBlockAlign = spec->bytes_per_sample;
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
GST_DEBUG
("GstRingBufferSpec->channels: %d, GstRingBufferSpec->rate: %d, GstRingBufferSpec->bytes_per_sample: %d\n"
"WAVEFORMATEX.nSamplesPerSec: %ld, WAVEFORMATEX.wBitsPerSample: %d, WAVEFORMATEX.nBlockAlign: %d, WAVEFORMATEX.nAvgBytesPerSec: %ld\n",
spec->channels, spec->rate, spec->bytes_per_sample, wfx.nSamplesPerSec,
wfx.wBitsPerSample, wfx.nBlockAlign, wfx.nAvgBytesPerSec);
/* directsound buffer size can handle 2 secs of the stream */
dsoundsink->buffer_size = wfx.nAvgBytesPerSec / 2;
/* create a secondary directsound buffer */
memset (&descSecondary, 0, sizeof (DSBUFFERDESC));
descSecondary.dwSize = sizeof (DSBUFFERDESC);
descSecondary.dwFlags = DSBCAPS_GETCURRENTPOSITION2 |
DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLVOLUME;
descSecondary.dwBufferBytes = dsoundsink->buffer_size;
descSecondary.lpwfxFormat = (WAVEFORMATEX *) & wfx;
hRes = IDirectSound_CreateSoundBuffer (dsoundsink->pDS, &descSecondary,
&dsoundsink->pDSBSecondary, NULL);
if (FAILED (hRes)) {
GST_ELEMENT_ERROR (dsoundsink, RESOURCE, OPEN_READ,
("gst_directsoundsink_prepare: IDirectSound_CreateSoundBuffer: %s",
DXGetErrorString9 (hRes)), (NULL));
return FALSE;
}
return TRUE;
}
static gboolean
gst_directsoundsink_unprepare (GstAudioSink * asink)
{
GstDirectSoundSink *dsoundsink;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/* release secondary DirectSound buffer */
if (dsoundsink->pDSBSecondary)
IDirectSoundBuffer_Release (dsoundsink->pDSBSecondary);
return TRUE;
}
static gboolean
gst_directsoundsink_close (GstAudioSink * asink)
{
GstDirectSoundSink *dsoundsink = NULL;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/* release DirectSound object */
g_return_val_if_fail (dsoundsink->pDS != NULL, FALSE);
IDirectSound_Release (dsoundsink->pDS);
return TRUE;
}
static guint
gst_directsoundsink_write (GstAudioSink * asink, gpointer data, guint length)
{
GstDirectSoundSink *dsoundsink;
DWORD dwStatus;
HRESULT hRes;
LPVOID pLockedBuffer1 = NULL, pLockedBuffer2 = NULL;
DWORD dwSizeBuffer1, dwSizeBuffer2;
DWORD dwCurrentPlayCursor;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/* get current buffer status */
hRes = IDirectSoundBuffer_GetStatus (dsoundsink->pDSBSecondary, &dwStatus);
/* get current play cursor position */
hRes = IDirectSoundBuffer_GetCurrentPosition (dsoundsink->pDSBSecondary,
&dwCurrentPlayCursor, NULL);
if (SUCCEEDED (hRes) && (dwStatus & DSBSTATUS_PLAYING)) {
DWORD dwFreeBufferSize;
calculate_freesize:
/* calculate the free size of the circular buffer */
if (dwCurrentPlayCursor < dsoundsink->current_circular_offset)
dwFreeBufferSize =
dsoundsink->buffer_size - (dsoundsink->current_circular_offset -
dwCurrentPlayCursor);
else
dwFreeBufferSize =
dwCurrentPlayCursor - dsoundsink->current_circular_offset;
if (length >= dwFreeBufferSize) {
Sleep (100);
hRes = IDirectSoundBuffer_GetCurrentPosition (dsoundsink->pDSBSecondary,
&dwCurrentPlayCursor, NULL);
goto calculate_freesize;
}
}
if (dwStatus & DSBSTATUS_BUFFERLOST) {
hRes = IDirectSoundBuffer_Restore (dsoundsink->pDSBSecondary); /*need a loop waiting the buffer is restored?? */
dsoundsink->current_circular_offset = 0;
}
hRes = IDirectSoundBuffer_Lock (dsoundsink->pDSBSecondary,
dsoundsink->current_circular_offset, length, &pLockedBuffer1,
&dwSizeBuffer1, &pLockedBuffer2, &dwSizeBuffer2, 0L);
if (SUCCEEDED (hRes)) {
// Write to pointers without reordering.
memcpy (pLockedBuffer1, data, dwSizeBuffer1);
if (pLockedBuffer2 != NULL)
memcpy (pLockedBuffer2, (LPBYTE) data + dwSizeBuffer1, dwSizeBuffer2);
// Update where the buffer will lock (for next time)
dsoundsink->current_circular_offset += dwSizeBuffer1 + dwSizeBuffer2;
dsoundsink->current_circular_offset %= dsoundsink->buffer_size; /* Circular buffer */
hRes = IDirectSoundBuffer_Unlock (dsoundsink->pDSBSecondary, pLockedBuffer1,
dwSizeBuffer1, pLockedBuffer2, dwSizeBuffer2);
}
/* if the buffer was not in playing state yet, call play on the buffer */
if (!(dwStatus & DSBSTATUS_PLAYING)) {
hRes = IDirectSoundBuffer_Play (dsoundsink->pDSBSecondary, 0, 0,
DSBPLAY_LOOPING);
}
return length;
}
static guint
gst_directsoundsink_delay (GstAudioSink * asink)
{
GstDirectSoundSink *dsoundsink;
HRESULT hRes;
DWORD dwCurrentPlayCursor;
DWORD dwBytesInQueue = 0;
gint nNbSamplesInQueue = 0;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
/*evaluate the number of samples in queue in the circular buffer */
hRes = IDirectSoundBuffer_GetCurrentPosition (dsoundsink->pDSBSecondary,
&dwCurrentPlayCursor, NULL);
if (hRes == S_OK) {
if (dwCurrentPlayCursor < dsoundsink->current_circular_offset)
dwBytesInQueue =
dsoundsink->current_circular_offset - dwCurrentPlayCursor;
else
dwBytesInQueue =
dsoundsink->current_circular_offset + (dsoundsink->buffer_size -
dwCurrentPlayCursor);
nNbSamplesInQueue = dwBytesInQueue / dsoundsink->bytes_per_sample;
}
return nNbSamplesInQueue;
}
static void
gst_directsoundsink_reset (GstAudioSink * asink)
{
/*not tested for seeking */
GstDirectSoundSink *dsoundsink;
dsoundsink = GST_DIRECTSOUND_SINK (asink);
IDirectSoundBuffer_Stop (dsoundsink->pDSBSecondary);
}

View file

@ -0,0 +1,68 @@
/* GStreamer
* Copyright (C) 2005 Sebastien Moutte <sebastien@moutte.net>
*
* gstdirectsoundsink.h:
*
* 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_DIRECTSOUNDSINK_H__
#define __GST_DIRECTSOUNDSINK_H__
#include <gst/gst.h>
#include <gst/audio/gstaudiosink.h>
#include <windows.h>
#include <dxerr9.h>
#include <dsound.h>
G_BEGIN_DECLS
#define GST_TYPE_DIRECTSOUND_SINK (gst_directsoundsink_get_type())
#define GST_DIRECTSOUND_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECTSOUND_SINK,GstDirectSoundSink))
#define GST_DIRECTSOUND_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECTSOUND_SINK,GstDirectSoundSinkClass))
#define GST_IS_DIRECTSOUND_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECTSOUND_SINK))
#define GST_IS_DIRECTSOUND_SINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECTSOUND_SINK))
typedef struct _GstDirectSoundSink GstDirectSoundSink;
typedef struct _GstDirectSoundSinkClass GstDirectSoundSinkClass;
struct _GstDirectSoundSink
{
GstAudioSink sink;
LPDIRECTSOUND pDS;
LPDIRECTSOUNDBUFFER pDSBSecondary;
/*DirectSound buffer size */
guint buffer_size;
/*Offset of the circular buffer where we must write next */
guint current_circular_offset;
guint bytes_per_sample;
};
struct _GstDirectSoundSinkClass
{
GstAudioSinkClass parent_class;
};
GType gst_directsoundsink_get_type (void);
G_END_DECLS
#endif /* __GST_DIRECTSOUNDSINK_H__ */

View file

@ -0,0 +1,125 @@
# Microsoft Developer Studio Project File - Name="libgstdirectdraw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=libgstdirectdraw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libgstdirectdraw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libgstdirectdraw.mak" CFG="libgstdirectdraw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libgstdirectdraw - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libgstdirectdraw - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "libgstdirectdraw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTDRAW_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../gst-libs" /I "../../../gstreamer" /I "../common" /I "../../../gstreamer/libs" /I "../../../gst-plugins-base/gst-libs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTDRAW_EXPORTS" /D "HAVE_CONFIG_H" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG"
# ADD RSC /l 0x40c /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstvideo-0.10.lib glib-2.0.lib gobject-2.0.lib user32.lib gdi32.lib ddraw.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" /libpath:"./release"
# Begin Special Build Tool
TargetPath=.\Release\libgstdirectdraw.dll
SOURCE="$(InputPath)"
PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\lib\gstreamer-0.10
# End Special Build Tool
!ELSEIF "$(CFG)" == "libgstdirectdraw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTDRAW_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../gst-libs" /I "../../../gstreamer" /I "../common" /I "../../../gstreamer/libs" /I "../../../gst-plugins-base/gst-libs" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTDRAW_EXPORTS" /D "HAVE_CONFIG_H" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstvideo-0.10.lib glib-2.0D.lib gobject-2.0D.lib ddraw.lib user32.lib gdi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../../gstreamer/win32/vs6/debug" /libpath:"../../../gst-plugins-base/win32/vs6/debug" /libpath:"./debug"
# Begin Special Build Tool
TargetPath=.\Debug\libgstdirectdraw.dll
SOURCE="$(InputPath)"
PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\debug\lib\gstreamer-0.10
# End Special Build Tool
!ENDIF
# Begin Target
# Name "libgstdirectdraw - Win32 Release"
# Name "libgstdirectdraw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\sys\directdraw\gstdirectdrawplugin.c
# End Source File
# Begin Source File
SOURCE=..\..\sys\directdraw\gstdirectdrawsink.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\sys\directdraw\gstdirectdrawsink.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View file

@ -0,0 +1,125 @@
# Microsoft Developer Studio Project File - Name="libgstdirectsound" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=libgstdirectsound - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libgstdirectsound.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libgstdirectsound.mak" CFG="libgstdirectsound - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libgstdirectsound - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libgstdirectsound - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "libgstdirectsound - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTSOUND_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /O2 /I "../.." /I "../../gst-libs" /I "../../../gstreamer" /I "../common" /I "../../../gstreamer/libs" /I "../../../gst-plugins-base/gst-libs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTSOUND_EXPORTS" /D "HAVE_CONFIG_H" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG"
# ADD RSC /l 0x40c /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstaudio-0.10.lib glib-2.0.lib gobject-2.0.lib dsound.lib dxerr9.lib user32.lib /nologo /dll /machine:I386 /libpath:"../../../gstreamer/win32/vs6/release" /libpath:"../../../gst-plugins-base/win32/vs6/release" /libpath:"./release"
# Begin Special Build Tool
TargetPath=.\Release\libgstdirectsound.dll
SOURCE="$(InputPath)"
PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\lib\gstreamer-0.10
# End Special Build Tool
!ELSEIF "$(CFG)" == "libgstdirectsound - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTSOUND_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "../../gst-libs" /I "../../../gstreamer" /I "../common" /I "../../../gstreamer/libs" /I "../../../gst-plugins-base/gst-libs" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBGSTDIRECTSOUND_EXPORTS" /D "HAVE_CONFIG_H" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 libgstreamer-0.10.lib libgstbase-0.10.lib libgstaudio-0.10.lib glib-2.0D.lib gobject-2.0D.lib dsound.lib dxerr9.lib user32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../../gstreamer/win32/vs6/debug" /libpath:"../../../gst-plugins-base/win32/vs6/debug" /libpath:"./debug"
# Begin Special Build Tool
TargetPath=.\Debug\libgstdirectsound.dll
SOURCE="$(InputPath)"
PostBuild_Cmds=copy /Y $(TargetPath) c:\gstreamer\debug\lib\gstreamer-0.10
# End Special Build Tool
!ENDIF
# Begin Target
# Name "libgstdirectsound - Win32 Release"
# Name "libgstdirectsound - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\sys\directsound\gstdirectsoundplugin.c
# End Source File
# Begin Source File
SOURCE=..\..\sys\directsound\gstdirectsoundsink.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\sys\directsound\gstdirectsoundsink.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project