mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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:
parent
0d1c7f6ea2
commit
0a30ecba90
3 changed files with 9 additions and 14 deletions
|
@ -5,7 +5,7 @@ libgstdirectsoundsrc_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
|
$(GST_PLUGINS_BASE_CFLAGS) $(DIRECTX_CFLAGS)
|
||||||
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
|
libgstdirectsoundsrc_la_LIBADD = $(DIRECTDRAW_LIBS) \
|
||||||
$(GST_BASE_LIBS) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \
|
$(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_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(DIRECTX_LDFLAGS)
|
||||||
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static
|
libgstdirectsoundsrc_la_LIBTOOLFLAGS = --tag=disable-static
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ gst_directsound_src_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
GstDirectSoundSrc *dsoundsrc = GST_DIRECTSOUND_SRC (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);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
@ -189,12 +189,9 @@ gst_directsound_src_class_init (GstDirectSoundSrcClass * klass)
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_directsound_src_getcaps (GstBaseSrc * bsrc, GstCaps * filter)
|
gst_directsound_src_getcaps (GstBaseSrc * bsrc, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstDirectSoundSrc *dsoundsrc;
|
|
||||||
GstCaps *caps = NULL;
|
GstCaps *caps = NULL;
|
||||||
GST_DEBUG_OBJECT (bsrc, "get caps");
|
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
|
caps = gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD
|
||||||
(bsrc)));
|
(bsrc)));
|
||||||
return caps;
|
return caps;
|
||||||
|
@ -253,7 +250,7 @@ static void
|
||||||
gst_directsound_src_init (GstDirectSoundSrc * src)
|
gst_directsound_src_init (GstDirectSoundSrc * src)
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (src, "initializing directsoundsrc");
|
GST_DEBUG_OBJECT (src, "initializing directsoundsrc");
|
||||||
src->dsound_lock = g_mutex_new ();
|
g_mutex_init (&src->dsound_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -319,14 +316,13 @@ static gboolean
|
||||||
gst_directsound_src_close (GstAudioSrc * asrc)
|
gst_directsound_src_close (GstAudioSrc * asrc)
|
||||||
{
|
{
|
||||||
GstDirectSoundSrc *dsoundsrc;
|
GstDirectSoundSrc *dsoundsrc;
|
||||||
HRESULT hRes; /* Result for windows functions */
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (asrc, "closing directsoundsrc");
|
GST_DEBUG_OBJECT (asrc, "closing directsoundsrc");
|
||||||
|
|
||||||
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
|
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
|
||||||
|
|
||||||
/* Release capture handler */
|
/* Release capture handler */
|
||||||
hRes = IDirectSoundCapture_Release (dsoundsrc->pDSC);
|
IDirectSoundCapture_Release (dsoundsrc->pDSC);
|
||||||
|
|
||||||
/* Close library */
|
/* Close library */
|
||||||
FreeLibrary (dsoundsrc->DSoundDLL);
|
FreeLibrary (dsoundsrc->DSoundDLL);
|
||||||
|
@ -446,17 +442,16 @@ static gboolean
|
||||||
gst_directsound_src_unprepare (GstAudioSrc * asrc)
|
gst_directsound_src_unprepare (GstAudioSrc * asrc)
|
||||||
{
|
{
|
||||||
GstDirectSoundSrc *dsoundsrc;
|
GstDirectSoundSrc *dsoundsrc;
|
||||||
HRESULT hRes;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (asrc, "unpreparing directsoundsrc");
|
GST_DEBUG_OBJECT (asrc, "unpreparing directsoundsrc");
|
||||||
|
|
||||||
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
|
dsoundsrc = GST_DIRECTSOUND_SRC (asrc);
|
||||||
|
|
||||||
/* Stop capturing */
|
/* Stop capturing */
|
||||||
hRes = IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary);
|
IDirectSoundCaptureBuffer_Stop (dsoundsrc->pDSBSecondary);
|
||||||
|
|
||||||
/* Release buffer */
|
/* Release buffer */
|
||||||
hRes = IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary);
|
IDirectSoundCaptureBuffer_Release (dsoundsrc->pDSBSecondary);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,8 @@ G_BEGIN_DECLS
|
||||||
typedef struct _GstDirectSoundSrc GstDirectSoundSrc;
|
typedef struct _GstDirectSoundSrc GstDirectSoundSrc;
|
||||||
typedef struct _GstDirectSoundSrcClass GstDirectSoundSrcClass;
|
typedef struct _GstDirectSoundSrcClass GstDirectSoundSrcClass;
|
||||||
|
|
||||||
#define GST_DSOUND_LOCK(obj) (g_mutex_lock (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))
|
#define GST_DSOUND_UNLOCK(obj) (g_mutex_unlock (&obj->dsound_lock))
|
||||||
|
|
||||||
struct _GstDirectSoundSrc
|
struct _GstDirectSoundSrc
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ struct _GstDirectSoundSrc
|
||||||
guint device;
|
guint device;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GMutex *dsound_lock;
|
GMutex dsound_lock;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue