directsoundsrc: Fix a number of warnings/errors in directsoundsrc

* Don't use deprecated glib mutex functions
* Don't declare useless variables
* Don't link to non-existing libgstinterfaces

Fixes #686871
This commit is contained in:
Руслан Ижбулатов 2012-10-25 19:10:40 +04:00 committed by Sebastian Dröge
parent 0d1c7f6ea2
commit 0a30ecba90
3 changed files with 9 additions and 14 deletions

View file

@ -5,7 +5,7 @@ libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \
-lgstinterfaces-$(GST_API_VERSION) -ldsound
-ldsound
libgstdirectsoundsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS)
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -136,7 +136,7 @@ gst_directsound_src_finalize (GObject * object)
{
GstDirectSoundSrc *dsoundsrc = GST_DIRECTSOUND_SRC (object);
g_mutex_free (dsoundsrc->dsound_lock);
g_mutex_clear (&dsoundsrc->dsound_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@ -189,12 +189,9 @@ gst_directsound_src_class_init (GstDirectSoundSrcClass * klass)
static GstCaps *
gst_directsound_src_getcaps (GstBaseSrc * bsrc, GstCaps * filter)
{
GstDirectSoundSrc *dsoundsrc;
GstCaps *caps = NULL;
GST_DEBUG_OBJECT (bsrc, "get caps");
dsoundsrc = GST_DIRECTSOUND_SRC (bsrc);
caps = gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD
(bsrc)));
return caps;
@ -253,7 +250,7 @@ static void
gst_directsound_src_init (GstDirectSoundSrc * src)
{
GST_DEBUG_OBJECT (src, "initializing directsoundsrc");
src->dsound_lock = g_mutex_new ();
g_mutex_init (&src->dsound_lock);
}
static gboolean
@ -319,14 +316,13 @@ static gboolean
gst_directsound_src_close (GstAudioSrc * asrc)
{
GstDirectSoundSrc *dsoundsrc;
HRESULT hRes; /* Result for windows functions */
GST_DEBUG_OBJECT (asrc, "closing directsoundsrc");
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
/* Release capture handler */
hRes = IDirectSoundCapture_Release (dsoundsrc->pDSC);
IDirectSoundCapture_Release (dsoundsrc->pDSC);
/* Close library */
FreeLibrary (dsoundsrc->DSoundDLL);
@ -446,17 +442,16 @@ static gboolean
gst_directsound_src_unprepare (GstAudioSrc * asrc)
{
GstDirectSoundSrc *dsoundsrc;
HRESULT hRes;
GST_DEBUG_OBJECT (asrc, "unpreparing directsoundsrc");
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
/* Stop capturing */
hRes = IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary);
IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary);
/* Release buffer */
hRes = IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary);
IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary);
return TRUE;
}

View file

@ -68,8 +68,8 @@ G_BEGIN_DECLS
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))
#define GST_DSOUND_LOCK(obj) (g_mutex_lock (&obj->dsound_lock))
#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (&obj->dsound_lock))
struct _GstDirectSoundSrc
{
@ -96,7 +96,7 @@ struct _GstDirectSoundSrc
guint device;
#endif
GMutex *dsound_lock;
GMutex dsound_lock;
};