Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alicia Boya García
gst-plugins-good
Commits
3d6955d6
Commit
3d6955d6
authored
Jun 15, 2011
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove esound/esdsink plugin
parent
72873243
Changes
57
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
217 additions
and
1915 deletions
+217
-1915
REQUIREMENTS
REQUIREMENTS
+0
-5
configure.ac
configure.ac
+0
-13
docs/plugins/Makefile.am
docs/plugins/Makefile.am
+0
-1
docs/plugins/gst-plugins-good-plugins-docs.sgml
docs/plugins/gst-plugins-good-plugins-docs.sgml
+0
-2
docs/plugins/gst-plugins-good-plugins-sections.txt
docs/plugins/gst-plugins-good-plugins-sections.txt
+0
-14
docs/plugins/inspect/plugin-esdsink.xml
docs/plugins/inspect/plugin-esdsink.xml
+0
-28
ext/Makefile.am
ext/Makefile.am
+0
-8
ext/esd/Makefile.am
ext/esd/Makefile.am
+0
-14
ext/esd/esdmon.c
ext/esd/esdmon.c
+0
-466
ext/esd/esdmon.h
ext/esd/esdmon.h
+0
-77
ext/esd/esdsink.c
ext/esd/esdsink.c
+0
-469
ext/esd/esdsink.h
ext/esd/esdsink.h
+0
-64
ext/esd/gstesd.c
ext/esd/gstesd.c
+0
-60
gst-plugins-good.spec.in
gst-plugins-good.spec.in
+0
-6
m4/Makefile.am
m4/Makefile.am
+0
-2
m4/as-arts.m4
m4/as-arts.m4
+0
-209
m4/esd.m4
m4/esd.m4
+0
-202
po/POTFILES.in
po/POTFILES.in
+0
-1
po/af.po
po/af.po
+1
-7
po/az.po
po/az.po
+1
-7
po/bg.po
po/bg.po
+7
-7
po/ca.po
po/ca.po
+1
-7
po/cs.po
po/cs.po
+7
-7
po/da.po
po/da.po
+7
-7
po/de.po
po/de.po
+7
-7
po/el.po
po/el.po
+7
-7
po/en_GB.po
po/en_GB.po
+1
-7
po/es.po
po/es.po
+7
-7
po/eu.po
po/eu.po
+7
-7
po/fi.po
po/fi.po
+7
-7
po/fr.po
po/fr.po
+8
-8
po/gl.po
po/gl.po
+7
-7
po/hu.po
po/hu.po
+7
-7
po/id.po
po/id.po
+7
-7
po/it.po
po/it.po
+7
-7
po/ja.po
po/ja.po
+7
-7
po/lt.po
po/lt.po
+7
-7
po/lv.po
po/lv.po
+7
-7
po/mt.po
po/mt.po
+7
-7
po/nb.po
po/nb.po
+4
-7
po/nl.po
po/nl.po
+7
-7
po/or.po
po/or.po
+1
-7
po/pl.po
po/pl.po
+7
-7
po/pt_BR.po
po/pt_BR.po
+7
-7
po/ro.po
po/ro.po
+7
-7
po/ru.po
po/ru.po
+7
-7
po/sk.po
po/sk.po
+7
-7
po/sl.po
po/sl.po
+7
-7
po/sq.po
po/sq.po
+1
-7
po/sr.po
po/sr.po
+1
-7
po/sv.po
po/sv.po
+7
-7
po/tr.po
po/tr.po
+7
-7
po/uk.po
po/uk.po
+7
-7
po/vi.po
po/vi.po
+7
-7
po/zh_CN.po
po/zh_CN.po
+7
-7
po/zh_HK.po
po/zh_HK.po
+1
-7
po/zh_TW.po
po/zh_TW.po
+1
-7
No files found.
REQUIREMENTS
View file @
3d6955d6
...
...
@@ -89,11 +89,6 @@ Version: >= 0.71
Plugins: cdio (cdiocddasrc)
URL: http://www.gnu.org/software/libcdio/
Package: ESound
Version: >= 0.2.12
Plugins: esdsink
URL: http://www.gnome.org/
Package: FLAC
Version: == 1.1.2
Plugins: flac (flacenc, flacdec)
...
...
configure.ac
View file @
3d6955d6
...
...
@@ -719,17 +719,6 @@ AG_GST_CHECK_FEATURE(CAIRO_GOBJECT,
AG_GST_PKG_CHECK_MODULES(CAIRO_GOBJECT, cairo-gobject >= 1.10.0)
])
dnl **** ESound ****
translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
AG_GST_CHECK_FEATURE(ESD, [ESounD sound daemon], esdsink, [
AG_GST_PKG_CHECK_MODULES(ESD, esound >= 0.2.12)
if test $HAVE_ESD = no
then
AM_PATH_ESD(0.2.12, HAVE_ESD="yes")
AS_SCRUB_INCLUDE(ESD_CFLAGS)
fi
])
dnl *** FLAC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
AG_GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flac, [
...
...
@@ -1021,7 +1010,6 @@ AM_CONDITIONAL(USE_CAIRO, false)
AM_CONDITIONAL(USE_CAIRO_GOBJECT, false)
AM_CONDITIONAL(USE_DIRECTSOUND, false)
AM_CONDITIONAL(USE_DV1394, false)
AM_CONDITIONAL(USE_ESD, false)
AM_CONDITIONAL(USE_FLAC, false)
AM_CONDITIONAL(USE_GDK_PIXBUF, false)
AM_CONDITIONAL(USE_GST_V4L2, false)
...
...
@@ -1157,7 +1145,6 @@ ext/aalib/Makefile
ext/annodex/Makefile
ext/cairo/Makefile
ext/dv/Makefile
ext/esd/Makefile
ext/flac/Makefile
ext/gdk_pixbuf/Makefile
ext/hal/Makefile
...
...
docs/plugins/Makefile.am
View file @
3d6955d6
...
...
@@ -84,7 +84,6 @@ EXTRA_HFILES = \
$(top_srcdir)
/ext/cairo/gstcairooverlay.h
\
$(top_srcdir)
/ext/dv/gstdvdec.h
\
$(top_srcdir)
/ext/dv/gstdvdemux.h
\
$(top_srcdir)
/ext/esd/esdsink.h
\
$(top_srcdir)
/ext/flac/gstflacdec.h
\
$(top_srcdir)
/ext/flac/gstflacenc.h
\
$(top_srcdir)
/ext/flac/gstflactag.h
\
...
...
docs/plugins/gst-plugins-good-plugins-docs.sgml
View file @
3d6955d6
...
...
@@ -72,7 +72,6 @@
<xi:include
href=
"xml/element-equalizer-10bands.xml"
/>
<xi:include
href=
"xml/element-equalizer-3bands.xml"
/>
<xi:include
href=
"xml/element-equalizer-nbands.xml"
/>
<xi:include
href=
"xml/element-esdsink.xml"
/>
<xi:include
href=
"xml/element-flacdec.xml"
/>
<xi:include
href=
"xml/element-flacenc.xml"
/>
<xi:include
href=
"xml/element-flacparse.xml"
/>
...
...
@@ -205,7 +204,6 @@
<xi:include
href=
"xml/plugin-efence.xml"
/>
<xi:include
href=
"xml/plugin-equalizer.xml"
/>
<xi:include
href=
"xml/plugin-effectv.xml"
/>
<xi:include
href=
"xml/plugin-esdsink.xml"
/>
<xi:include
href=
"xml/plugin-flac.xml"
/>
<xi:include
href=
"xml/plugin-flv.xml"
/>
<xi:include
href=
"xml/plugin-flxdec.xml"
/>
...
...
docs/plugins/gst-plugins-good-plugins-sections.txt
View file @
3d6955d6
...
...
@@ -797,20 +797,6 @@ LOWEST_FREQ
ProcessFunc
</SECTION>
<SECTION>
<FILE>element-esdsink</FILE>
<TITLE>esdsink</TITLE>
GstEsdSink
<SUBSECTION Standard>
GstEsdSinkClass
GST_TYPE_ESDSINK
GST_ESDSINK
GST_ESDSINK_CLASS
GST_IS_ESDSINK
GST_IS_ESDSINK_CLASS
gst_esdsink_get_type
</SECTION>
<SECTION>
<FILE>element-flacdec</FILE>
<TITLE>flacdec</TITLE>
...
...
docs/plugins/inspect/plugin-esdsink.xml
deleted
100644 → 0
View file @
72873243
<plugin>
<name>
esdsink
</name>
<description>
ESD Element Plugins
</description>
<filename>
../../ext/esd/.libs/libgstesd.so
</filename>
<basename>
libgstesd.so
</basename>
<version>
0.10.29.1
</version>
<license>
LGPL
</license>
<source>
gst-plugins-good
</source>
<package>
GStreamer Good Plug-ins git
</package>
<origin>
Unknown package origin
</origin>
<elements>
<element>
<name>
esdsink
</name>
<longname>
Esound audio sink
</longname>
<class>
Sink/Audio
</class>
<description>
Plays audio to an esound server
</description>
<author>
Arwed von Merkatz
<
v.merkatz@gmx.net
>
</author>
<pads>
<caps>
<name>
sink
</name>
<direction>
sink
</direction>
<presence>
always
</presence>
<details>
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ]; audio/x-raw-int, signed=(boolean){ true, false }, width=(int)8, depth=(int)8, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ]
</details>
</caps>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
ext/Makefile.am
View file @
3d6955d6
...
...
@@ -16,12 +16,6 @@ else
CAIRO_DIR
=
endif
if
USE_ESD
ESD_DIR
=
esd
else
ESD_DIR
=
endif
if
USE_FLAC
FLAC_DIR
=
flac
else
...
...
@@ -130,7 +124,6 @@ SUBDIRS = \
$(ANNODEX_DIR)
\
$(CAIRO_DIR)
\
$(DV1394_DIR)
\
$(ESD_DIR)
\
$(FLAC_DIR)
\
$(GDK_PIXBUF_DIR)
\
$(HAL_DIR)
\
...
...
@@ -153,7 +146,6 @@ DIST_SUBDIRS = \
annodex
\
cairo
\
dv
\
esd
\
flac
\
gdk_pixbuf
\
hal
\
...
...
ext/esd/Makefile.am
deleted
100644 → 0
View file @
72873243
plugin_LTLIBRARIES
=
libgstesd.la
libgstesd_la_SOURCES
=
esdsink.c gstesd.c
libgstesd_la_CFLAGS
=
$(GST_PLUGINS_BASE_CFLAGS)
$(GST_BASE_CFLAGS)
$(GST_CFLAGS)
$(ESD_CFLAGS)
libgstesd_la_LIBADD
=
\
$(GST_PLUGINS_BASE_LIBS)
-lgstaudio-
$(GST_MAJORMINOR)
\
$(GST_BASE_LIBS)
\
$(GST_LIBS)
\
$(ESD_LIBS)
libgstesd_la_LDFLAGS
=
$(GST_PLUGIN_LDFLAGS)
libgstesd_la_LIBTOOLFLAGS
=
--tag
=
disable-static
noinst_HEADERS
=
esdsink.h esdmon.h
EXTRA_DIST
=
ext/esd/esdmon.c
deleted
100644 → 0
View file @
72873243
/* GStreamer
* Copyright (C) <2001,2002> Richard Boulton <richard-gst@tartarus.org>
*
* Based on example.c:
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* 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.
*/
/**
* SECTION:element-esdmon
* @see_also: #GstAlsaSrc, #GstAutoAudioSrc
*
* This element records sound from an already-running Enlightened Sound Daemon
* (ESound Daemon, esd). Note that a sound daemon will never be auto-spawned
* through this element (regardless of the system configuration), since this
* is actively prevented by the element. If you must use esd, you need to
* make sure it is started automatically with your session or otherwise.
*
* TODO: insert some comments about how sucky esd is and that all the cool
* kids use pulseaudio or whatever these days.
*
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch esdmon ! audioconvert ! waveenc ! filesink location=record.wav
* ]| Record from audioinput
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "esdmon.h"
#include <esd.h>
#include <unistd.h>
/* Signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0
,
ARG_DEPTH
,
ARG_BYTESPERREAD
,
ARG_CUROFFSET
,
ARG_CHANNELS
,
ARG_RATE
,
ARG_HOST
};
static
GstStaticPadTemplate
src_factory
=
GST_STATIC_PAD_TEMPLATE
(
"src"
,
GST_PAD_SRC
,
GST_PAD_ALWAYS
,
GST_STATIC_CAPS
(
"audio/x-raw-int, "
"endianness = (int) "
G_STRINGIFY
(
G_BYTE_ORDER
)
", "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = [ 8000, 96000 ], "
"channels = [ 1, 2 ]; "
"audio/x-raw-int, "
"signed = (boolean) FALSE, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = [ 8000, 96000 ], "
"channels = [ 1, 2 ]"
)
);
static
void
gst_esdmon_base_init
(
gpointer
g_class
);
static
void
gst_esdmon_class_init
(
gpointer
g_class
,
gpointer
class_data
);
static
void
gst_esdmon_init
(
GTypeInstance
*
instance
,
gpointer
g_class
);
static
gboolean
gst_esdmon_open_audio
(
GstEsdmon
*
src
);
static
void
gst_esdmon_close_audio
(
GstEsdmon
*
src
);
static
GstStateChangeReturn
gst_esdmon_change_state
(
GstElement
*
element
,
GstStateChange
transition
);
static
gboolean
gst_esdmon_sync_parms
(
GstEsdmon
*
esdmon
);
static
GstData
*
gst_esdmon_get
(
GstPad
*
pad
);
static
void
gst_esdmon_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
);
static
void
gst_esdmon_get_property
(
GObject
*
object
,
guint
prop_id
,
GValue
*
value
,
GParamSpec
*
pspec
);
#define GST_TYPE_ESDMON_DEPTHS (gst_esdmon_depths_get_type())
static
GType
gst_esdmon_depths_get_type
(
void
)
{
static
GType
esdmon_depths_type
=
0
;
static
const
GEnumValue
esdmon_depths
[]
=
{
{
8
,
"8 Bits"
,
"8"
},
{
16
,
"16 Bits"
,
"16"
},
{
0
,
NULL
,
NULL
},
};
if
(
!
esdmon_depths_type
)
{
esdmon_depths_type
=
g_enum_register_static
(
"GstEsdmonDepths"
,
esdmon_depths
);
}
return
esdmon_depths_type
;
}
#define GST_TYPE_ESDMON_CHANNELS (gst_esdmon_channels_get_type())
static
GType
gst_esdmon_channels_get_type
(
void
)
{
static
GType
esdmon_channels_type
=
0
;
static
const
GEnumValue
esdmon_channels
[]
=
{
{
1
,
"Mono"
,
"mono"
},
{
2
,
"Stereo"
,
"stereo"
},
{
0
,
NULL
,
NULL
},
};
if
(
!
esdmon_channels_type
)
{
esdmon_channels_type
=
g_enum_register_static
(
"GstEsdmonChannels"
,
esdmon_channels
);
}
return
esdmon_channels_type
;
}
static
GstElementClass
*
parent_class
=
NULL
;
/*static guint gst_esdmon_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_esdmon_get_type
(
void
)
{
static
GType
esdmon_type
=
0
;
if
(
!
esdmon_type
)
{
static
const
GTypeInfo
esdmon_info
=
{
sizeof
(
GstEsdmonClass
),
gst_esdmon_base_init
,
NULL
,
gst_esdmon_class_init
,
NULL
,
NULL
,
sizeof
(
GstEsdmon
),
0
,
gst_esdmon_init
,
};
esdmon_type
=
g_type_register_static
(
GST_TYPE_ELEMENT
,
"GstEsdmon"
,
&
esdmon_info
,
0
);
}
return
esdmon_type
;
}
static
void
gst_esdmon_base_init
(
gpointer
g_class
)
{
GstElementClass
*
element_class
=
GST_ELEMENT_CLASS
(
g_class
);
gst_element_class_add_pad_template
(
element_class
,
gst_static_pad_template_get
(
&
src_factory
));
gst_element_class_set_details_simple
(
element_class
,
"Esound audio monitor"
,
"Source/Audio"
,
"Monitors audio from an esound server"
,
"Richard Boulton <richard-gst@tartarus.org>"
);
}
static
void
gst_esdmon_class_init
(
gpointer
g_class
,
gpointer
class_data
)
{
GObjectClass
*
gobject_class
=
G_OBJECT_CLASS
(
g_class
);
GstElementClass
*
gstelement_class
=
GST_ELEMENT_CLASS
(
g_class
);
parent_class
=
g_type_class_peek_parent
(
g_class
);
/* FIXME: add long property descriptions */
g_object_class_install_property
(
gobject_class
,
ARG_BYTESPERREAD
,
g_param_spec_ulong
(
"bytes-per-read"
,
"bytes per read"
,
"bytes per read"
,
0
,
G_MAXULONG
,
0
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
ARG_CUROFFSET
,
g_param_spec_ulong
(
"curoffset"
,
"curoffset"
,
"curoffset"
,
0
,
G_MAXULONG
,
0
,
G_PARAM_READABLE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
ARG_DEPTH
,
g_param_spec_enum
(
"depth"
,
"depth"
,
"depth"
,
GST_TYPE_ESDMON_DEPTHS
,
16
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
ARG_CHANNELS
,
g_param_spec_enum
(
"channels"
,
"channels"
,
"channels"
,
GST_TYPE_ESDMON_CHANNELS
,
2
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
ARG_RATE
,
g_param_spec_int
(
"frequency"
,
"frequency"
,
"frequency"
,
G_MININT
,
G_MAXINT
,
0
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
ARG_HOST
,
g_param_spec_string
(
"host"
,
"host"
,
"host"
,
NULL
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
gobject_class
->
set_property
=
gst_esdmon_set_property
;
gobject_class
->
get_property
=
gst_esdmon_get_property
;
gstelement_class
->
change_state
=
gst_esdmon_change_state
;
}
static
void
gst_esdmon_init
(
GTypeInstance
*
instance
,
gpointer
g_class
)
{
GstEsdmon
*
esdmon
=
GST_ESDMON
(
instance
);
esdmon
->
srcpad
=
gst_pad_new_from_template
(
gst_element_class_get_pad_template
(
GST_ELEMENT_GET_CLASS
(
esdmon
),
"src"
),
"src"
);
gst_pad_set_get_function
(
esdmon
->
srcpad
,
gst_esdmon_get
);
gst_pad_use_explicit_caps
(
esdmon
->
srcpad
);
gst_element_add_pad
(
GST_ELEMENT
(
esdmon
),
esdmon
->
srcpad
);
esdmon
->
fd
=
-
1
;
/* FIXME: get default from somewhere better than just putting them inline. */
esdmon
->
depth
=
16
;
esdmon
->
channels
=
2
;
esdmon
->
frequency
=
44100
;
esdmon
->
host
=
NULL
;
esdmon
->
bytes_per_read
=
4096
;
esdmon
->
curoffset
=
0
;
esdmon
->
basetime
=
0
;
esdmon
->
samples_since_basetime
=
0
;
}
static
gboolean
gst_esdmon_sync_parms
(
GstEsdmon
*
esdmon
)
{
g_return_val_if_fail
(
esdmon
!=
NULL
,
FALSE
);
g_return_val_if_fail
(
GST_IS_ESDMON
(
esdmon
),
FALSE
);
if
(
esdmon
->
fd
==
-
1
)
return
TRUE
;
/* Need to set fd to use new parameters: only way to do this is to reopen. */
gst_esdmon_close_audio
(
esdmon
);
return
gst_esdmon_open_audio
(
esdmon
);
}
static
GstData
*
gst_esdmon_get
(
GstPad
*
pad
)
{
GstEsdmon
*
esdmon
;
GstBuffer
*
buf
;
glong
readbytes
;
glong
readsamples
;
g_return_val_if_fail
(
pad
!=
NULL
,
NULL
);
esdmon
=
GST_ESDMON
(
gst_pad_get_parent
(
pad
));
GST_DEBUG
(
"attempting to read something from esdmon"
);
buf
=
gst_buffer_new
();
g_return_val_if_fail
(
buf
,
NULL
);
GST_BUFFER_DATA
(
buf
)
=
(
gpointer
)
g_malloc
(
esdmon
->
bytes_per_read
);
readbytes
=
read
(
esdmon
->
fd
,
GST_BUFFER_DATA
(
buf
),
esdmon
->
bytes_per_read
);
if
(
readbytes
==
0
)
{
gst_element_set_eos
(
GST_ELEMENT
(
esdmon
));
return
NULL
;
}
if
(
!
GST_PAD_CAPS
(
pad
))
{
GstCaps
*
caps
=
gst_caps_new_simple
(
"audio/x-raw-int"
,
"endianness"
,
G_TYPE_INT
,
G_BYTE_ORDER
,
"signed"
,
G_TYPE_BOOLEAN
,
esdmon
->
depth
==
8
?
FALSE
:
TRUE
,
"width"
,
G_TYPE_INT
,
esdmon
->
depth
,
"depth"
,
G_TYPE_INT
,
esdmon
->
depth
,
"rate"
,
G_TYPE_INT
,
esdmon
->
frequency
,
"channels"
,
G_TYPE_INT
,
esdmon
->
channels
,
NULL
);
/* set caps on src pad */
if
(
gst_pad_set_explicit_caps
(
esdmon
->
srcpad
,
caps
)
<=
0
)
{
GST_ELEMENT_ERROR
(
esdmon
,
CORE
,
NEGOTIATION
,
(
NULL
),
(
NULL
));
gst_caps_free
(
caps
);
return
NULL
;
}
gst_caps_free
(
caps
);
}
GST_BUFFER_SIZE
(
buf
)
=
readbytes
;
GST_BUFFER_OFFSET
(
buf
)
=
esdmon
->
curoffset
;
GST_BUFFER_TIMESTAMP
(
buf
)
=
esdmon
->
basetime
+
esdmon
->
samples_since_basetime
*
GST_SECOND
/
esdmon
->
frequency
;
esdmon
->
curoffset
+=
readbytes
;
readsamples
=
readbytes
/
esdmon
->
channels
;
if
(
esdmon
->
depth
==
16
)
readsamples
/=
2
;
esdmon
->
samples_since_basetime
+=
readsamples
;
GST_DEBUG
(
"pushed buffer from esdmon of %ld bytes, timestamp %"
G_GINT64_FORMAT
,
readbytes
,
GST_BUFFER_TIMESTAMP
(
buf
));
gst_object_unref
(
esdmon
);
return
GST_DATA
(
buf
);
}
static
void
gst_esdmon_set_property
(
GObject
*
object
,
guint
prop_id
,
const
GValue
*
value
,
GParamSpec
*
pspec
)
{
GstEsdmon
*
esdmon
;
g_return_if_fail
(
GST_IS_ESDMON
(
object
));
esdmon
=
GST_ESDMON
(
object
);
switch
(
prop_id
)
{
case
ARG_BYTESPERREAD
:
esdmon
->
bytes_per_read
=
g_value_get_ulong
(
value
);
/* No need to sync params - will just happen on next read. */
break
;
case
ARG_DEPTH
:
esdmon
->
depth
=
g_value_get_enum
(
value
);
gst_esdmon_sync_parms
(
esdmon
);
break
;
case
ARG_CHANNELS
:
esdmon
->
channels
=
g_value_get_enum
(
value
);
gst_esdmon_sync_parms
(
esdmon
);
break
;
case
ARG_RATE
:
/* Preserve the timestamps */
esdmon
->
basetime
=
esdmon
->
samples_since_basetime
*
GST_SECOND
/
esdmon
->
frequency
;
esdmon
->
samples_since_basetime
=
0
;
/* Set the new frequency */
esdmon
->
frequency
=
g_value_get_int
(
value
);
gst_esdmon_sync_parms
(
esdmon
);
break
;
case
ARG_HOST
:
if
(
esdmon
->
host
!=
NULL
)
g_free
(
esdmon
->
host
);
if
(
g_value_get_string
(
value
)
==
NULL
)
esdmon
->
host
=
NULL
;
else
esdmon
->
host
=
g_strdup
(
g_value_get_string
(
value
));
break
;
default:
break
;
}
}
static
void
gst_esdmon_get_property
(
GObject
*
object
,
guint
prop_id
,
GValue
*
value
,
GParamSpec
*
pspec
)
{
GstEsdmon
*
esdmon
;
g_return_if_fail
(
GST_IS_ESDMON
(
object
));
esdmon
=
GST_ESDMON
(
object
);
switch
(
prop_id
)
{
case
ARG_BYTESPERREAD
:
g_value_set_ulong
(
value
,
esdmon
->
bytes_per_read
);
break
;
case
ARG_CUROFFSET
:
g_value_set_ulong
(
value
,
esdmon
->
curoffset
);
break
;
case
ARG_DEPTH
:
g_value_set_enum
(
value
,
esdmon
->
depth
);
break
;
case
ARG_CHANNELS
:
g_value_set_enum
(
value
,
esdmon
->
channels
);
break
;
case
ARG_RATE
:
g_value_set_int
(
value
,
esdmon
->
frequency
);
break
;
case
ARG_HOST
:
g_value_set_string
(
value
,
esdmon
->
host
);
break
;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
prop_id
,
pspec
);
break
;
}
}
static
gboolean
gst_esdmon_open_audio
(
GstEsdmon
*
src
)
{
/* Name used by esound for this connection. */
const
char
connname
[]
=
"GStreamer"
;
/* Bitmap describing audio format. */
esd_format_t
esdformat
=
ESD_STREAM
|
ESD_PLAY
;
g_return_val_if_fail
(
src
->
fd
==
-
1
,
FALSE
);
if
(
src
->
depth
==
16
)
esdformat
|=
ESD_BITS16
;
else
if
(
src
->
depth
==
8
)
esdformat
|=
ESD_BITS8
;
else
{
GST_DEBUG
(
"esdmon: invalid bit depth (%d)"
,
src
->
depth
);
return
FALSE
;
}
if
(
src
->
channels
==
2
)
esdformat
|=
ESD_STEREO
;
else
if
(
src
->
channels
==
1
)
esdformat
|=
ESD_MONO
;
else
{
GST_DEBUG
(
"esdmon: invalid number of channels (%d)"
,
src
->
channels
);
return
FALSE
;
}
GST_DEBUG
(
"esdmon: attempting to open connection to esound server"
);
src
->
fd
=
esd_monitor_stream
(
esdformat
,
src
->
frequency
,
src
->
host
,
connname
);
if
(
src
->
fd
<
0
)
{
GST_DEBUG
(
"esdmon: can't open connection to esound server"
);
return
FALSE
;
}
GST_OBJECT_FLAG_SET
(
src
,
GST_ESDMON_OPEN
);
return
TRUE
;
}
static
void
gst_esdmon_close_audio
(
GstEsdmon
*
src
)
{
if
(
src
->
fd
<
0
)
return
;
close
(
src
->
fd
);
src
->
fd
=
-
1
;
GST_OBJECT_FLAG_UNSET
(
src
,
GST_ESDMON_OPEN
);
GST_DEBUG
(
"esdmon: closed sound device"
);
}
static
GstStateChangeReturn
gst_esdmon_change_state
(
GstElement
*
element
,
GstStateChange
transition
)
{
g_return_val_if_fail
(
GST_IS_ESDMON
(
element
),
FALSE
);
/* if going down into NULL state, close the fd if it's open */
if
(
GST_STATE_PENDING
(
element
)
==
GST_STATE_NULL
)
{
if
(
GST_OBJECT_FLAG_IS_SET
(
element
,
GST_ESDMON_OPEN
))
gst_esdmon_close_audio
(
GST_ESDMON
(
element
));
/* otherwise (READY or higher) we need to open the fd */
}
else
{
if
(
!
GST_OBJECT_FLAG_IS_SET
(
element
,
GST_ESDMON_OPEN
))
{
if
(
!
gst_esdmon_open_audio
(
GST_ESDMON
(
element
)))
return
GST_STATE_CHANGE_FAILURE
;
}
}
if
(
GST_ELEMENT_CLASS
(
parent_class
)
->
change_state
)
return
GST_ELEMENT_CLASS
(
parent_class
)
->
change_state
(
element
,
transition
);
return
GST_STATE_CHANGE_SUCCESS
;
}
ext/esd/esdmon.h
deleted
100644 → 0
View file @
72873243
/* GStreamer
* Copyright (C) <2001,2002> Richard Boulton <richard-gst@tartarus.org>
*