Commit graph

56 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
f338621446 sys: Convert source files to UTF-8
Otherwise we have problems with the new gtk-doc
ported to python. But it's a good thing to do
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=786364
2017-08-16 13:05:05 +01:00
Philippe Renon
db36718ee4 directsoundsrc: Properly pass pLockedBuffer by reference when calling IDirectSoundCaptureBuffer_Lock
https://bugzilla.gnome.org/show_bug.cgi?id=784755
2017-07-11 09:12:48 +03:00
Nicolas Dufresne
4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Nirbheek Chauhan
8494f1e709 directsoundsrc: Use a GstClockID to wait instead of Sleep()
The main advantage is that our sleeps can be interrupted in case of
an src_reset(). Earlier, we would need to wait for a read to complete
before we could do a reset, which could take a long time.

https://bugzilla.gnome.org/show_bug.cgi?id=781249
2017-05-12 14:51:10 +05:30
Nirbheek Chauhan
1a8610f8f8 directsoundsrc: Use latency-time and buffer-time settings
Earlier, the plugin was ignoring those settings and blindly setting
buffer-time to 2 seconds and latency-time to 200ms, which forced all
pipelines to have a minimum latency of 200ms + sink latency.

The values of segsize and segtotal were also not derived correctly.
Now we obey these values, and you can get close to the previous
behaviour by setting buffer-time and latency-time manually. Note that
they are set in microseconds.

As a consequence, when we haven't received enough data from the
device, we now sleep for a time proportional to the data remaining.
However, Directsound is a deprecated API so it maintains its own
software ringbuffer which updates at arbitrary intervals. Hence we
might have to wait a full segsize to get the last 10% of data. To
avoid tight loops, we clamp our sleep floor at 10ms.

In my testing, this keeps the wakeups not-too-high (proportional to
the latency-time set on the source). Further improvements should be
made by fixing the WASAPI audio source plugin instead of this.
Directsound is deprecated and as the comments explain, it is
impossible to get low latency, decent quality, or good performance
from it.

Based on a patch by Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781249
2017-05-08 16:13:20 +02:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Sebastian Dröge
244a80787d Revert "directsoundsrc: Correctly calculate segsize and segtotal"
This reverts commit 6d256d9908.

It was configuring the period/buffer size in a way that often causes
drop-outs or complete underruns. Needs further investigation.
2017-04-12 13:18:18 +03:00
Sebastian Dröge
6d256d9908 directsoundsrc: Correctly calculate segsize and segtotal
segsize should be based on latency-time, and must be a multiple of the
frame size. segtotal should be based on buffer-time and segsize.

This prevents errors caused by outputting buffers that are not a
multiple of the frame size, and actually makes the buffer-time and
latency-time properties do what they're supposed to do.
2017-04-06 16:15:28 +03:00
Artem Martynovich
bd2fcc9571 directsoundsrc: Correctly cast mixer to uintptr
https://bugzilla.gnome.org/show_bug.cgi?id=773720
2016-10-31 16:06:49 +02:00
Scott D Phillips
2ea67f0da2 meson: directsound: Add ole32 library dependency
https://bugzilla.gnome.org/show_bug.cgi?id=773114
2016-10-21 06:05:27 -03:00
Nirbheek Chauhan
42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:35:54 +01:00
Sebastian Dröge
65398a1596 directsoundsrc: Convert Windows strings to UTF8 before comparing against UTF8 strings
The device name and descriptions returned are in the locale encoding, not
UTF8. Our device name property is in UTF8 though, so we need to convert.

https://bugzilla.gnome.org/show_bug.cgi?id=756948
2016-05-03 16:59:33 +03:00
Kouhei Sutou
d27662fdcd directsoundsrc: add missing -lole32
CLSIDFromString() requires ole32.dll.
See https://msdn.microsoft.com/en-us/library/windows/desktop/ms680589%28v=vs.85%29.aspx

CLSIDFromString() is introduced at
f9464ce354 .

https://bugzilla.gnome.org/show_bug.cgi?id=764523
2016-04-03 13:37:16 +03:00
Vineeth TM
8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Thomas Roos
f9464ce354 directsoundsrc: add device property as it is done in directsoundsink
This allows selection of the device by GUID instead of the name. The name is
user-given and multiple devices can have the same name.

https://bugzilla.gnome.org/show_bug.cgi?id=759484
2015-12-18 12:39:03 +01:00
Sebastian Dröge
d4920948aa directsoundsrc: Convert header from (some) DOS line endings to UNIX
A mix between different line endings in the same file is not a good idea,
and the .c files are both with UNIX line endings so let's use that.
2015-12-18 12:39:03 +01:00
Vineeth TM
7c42ba97d7 plugins-bad: Fix example pipelines
rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

https://bugzilla.gnome.org/show_bug.cgi?id=759432
2015-12-15 10:30:49 +00:00
Thomas Roos
d794908dfd directsoundsrc: Check return values of DirectSound functions in read loop
Otherwise we might end up in an infinite loop because of errors.

Also take the element's mutex in unprepare().

https://bugzilla.gnome.org/show_bug.cgi?id=738292
2015-12-11 12:46:41 +02:00
Kouhei Sutou
21bfa428d1 directsoundsrc: fix build error for 64bit Windows build by MinGW
Casting to UINT from HMIXER generates the following warning with
64bit Windows target MinGW:

    gstdirectsoundsrc.c: In function 'gst_directsound_src_mixer_find':
    gstdirectsoundsrc.c:733:30: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         mmres = mixerGetDevCaps ((UINT) dsoundsrc->mixer,
                                  ^
    cc1: all warnings being treated as errors

We can use portable GPOINTER_TO_UINT() macro for this propose.

https://bugzilla.gnome.org/show_bug.cgi?id=754756
2015-09-09 16:57:08 +03:00
Victor Toso
1b564bfb8b directsoundsrc: Implement volume and mute
Using the MixerAPI as IDirectSoundCaptureBuffer doesn't implement volume
control.

https://bugzilla.gnome.org/show_bug.cgi?id=744383
2015-03-31 10:53:55 +01:00
Sebastian Rasmussen
6d151843ef directsoundsrc: Avoid leaking copy of caps object
gst_pad_get_pad_template_caps() returns a reference which is unreferenced,
so creating a copy using gst_caps_copy() results in a reference leak.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734536
2014-08-10 12:16:08 +01:00
Xavi Artigas
e12646f30a directsoundsrc: Fix critical due to missing debug category initialization
https://bugzilla.gnome.org/show_bug.cgi?id=727812
2014-04-08 13:39:22 +02:00
Sebastian Dröge
6f4f84fea0 directsoundsrc: Remove unused variable 2013-08-22 17:32:17 +02:00
Kishore Arepalli
9df9ee426e directsoundsrc: Add 'device-name' property for selecting a audio device
https://bugzilla.gnome.org/show_bug.cgi?id=706574
2013-08-22 15:10:20 +02:00
Sebastian Dröge
e51cd4fe2f gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
Руслан Ижбулатов
1b11496194 directsound: fix compilation errors caused by circular includes
https://bugzilla.gnome.org/show_bug.cgi?id=690128
2012-12-12 22:45:53 +00:00
Sebastian Dröge
97a365c439 windows: Put the DirectX LDFLAGS in the correct place and reorder libraries 2012-11-21 10:23:45 +01:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Руслан Ижбулатов
0a30ecba90 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
2012-10-26 10:01:03 +02:00
Raimo Järvi
01853745a3 directsoundsrc: Fix compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=673414
2012-10-17 21:01:39 +01:00
Raimo Järvi
a7258842ab directsoundsrc: port to 1.0
https://bugzilla.gnome.org/show_bug.cgi?id=673414
2012-10-17 13:25:25 +01:00
Mark Nauwelaerts
578861abea replace gst_element_class_set_details_simple with gst_element_class_set_metadata 2012-09-14 17:27:49 +02:00
Sebastian Dröge
a26e5bbf9b directsoundsrc: Chain up to the parent class' finalize implementation 2012-07-03 12:58:53 +02:00
Sebastian Dröge
cda192b3b7 gst: Update for GST_PLUGIN_DEFINE() API changes 2012-04-05 18:02:56 +02:00
Sebastian Dröge
1318a97e0a gst: Update versioning 2012-04-04 14:44:34 +02:00
Руслан Ижбулатов
baffaea6e8 Fix warnings in directdrawsink and directsoundsrc
Fixes #617331
2010-05-01 00:04:55 +02:00
Benjamin Otte
775c7584fd gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-18 22:46:41 +01:00
Michael Smith
7ca8034c51 Remove executable bits from non-executable files. 2009-10-27 11:51:05 -07:00
Руслан Ижбулатов
936d87f64b directdraw, directsound: unify CFLAGS and fix configure checks for DirectX-based plugins
One set of CFLAGS for all DirectX-based plugins. Correct header/library
checks for DirectX-based-plugins. Remove unused variable and label in
directsoundsrc.

Fixes #593068.
2009-08-26 01:18:00 +01:00
Julien Isorce
94ece2054c directsoundsrc: LF and indent 2009-08-10 11:36:41 +02:00
Joni Valtanen
f41100e832 directsoundsrc: Add DirectSound source plugin
Fixes bug #344129.
2009-07-29 15:37:08 +02:00
Jan Schmidt
dbf7acdf1d Remove DirectDraw & DirectSound plugins, as they've moved to Good
Original commit message from CVS:
* configure.ac:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-bad-plugins-docs.sgml:
* docs/plugins/gst-plugins-bad-plugins-sections.txt:
* docs/plugins/gst-plugins-bad-plugins.args:
* docs/plugins/inspect/plugin-directdraw.xml:
* docs/plugins/inspect/plugin-directsound.xml:
* sys/Makefile.am:
* sys/directdraw/Makefile.am:
* sys/directdraw/gstdirectdrawplugin.c:
* sys/directdraw/gstdirectdrawsink.c:
* sys/directdraw/gstdirectdrawsink.h:
* sys/directsound/Makefile.am:
* sys/directsound/gstdirectsoundplugin.c:
* sys/directsound/gstdirectsoundsink.c:
* sys/directsound/gstdirectsoundsink.h:
* win32/MANIFEST:
* win32/gst.sln:
* win32/vs6/libgstdirectdraw.dsp:
* win32/vs6/libgstdirectsound.dsp:
* win32/vs7/libgstdirectdraw.vcproj:
* win32/vs7/libgstdirectsound.vcproj:
* win32/vs8/libgstdirectdraw.vcproj:
* win32/vs8/libgstdirectsound.vcproj:
Remove DirectDraw & DirectSound plugins, as they've moved to Good
2007-06-08 17:36:46 +00:00
Sébastien Moutte
0a0c13670a docs/plugins/gst-plugins-bad-plugins.args: Remove directsoundsink property doc as this sink use the mixer interface now.
Original commit message from CVS:
* docs/plugins/gst-plugins-bad-plugins.args:
Remove directsoundsink property doc as this sink use the mixer
interface now.
* docs/plugins/gst-plugins-bad-plugins.interfaces:
Add interfaces implemented by Windows sinks.
* sys/directsound/gstdirectsoundsink.c:
* sys/directsound/gstdirectsoundsink.h:
Remove directsoundsink property  and implement the mixer interface.
* win32/vs6/gst_plugins_bad.dsw:
* win32/vs6/libgstdirectsound.dsp:
Update project files.
* gst-libs/gst/dshow/gstdshow.cpp:
* gst-libs/gst/dshow/gstdshow.h:
* gst-libs/gst/dshow/gstdshowfakesink.cpp:
* gst-libs/gst/dshow/gstdshowfakesink.h:
* gst-libs/gst/dshow/gstdshowfakesrc.cpp:
* gst-libs/gst/dshow/gstdshowfakesrc.h:
* gst-libs/gst/dshow/gstdshowinterface.cpp:
* gst-libs/gst/dshow/gstdshowinterface.h:
* win32/common/libgstdshow.def:
* win32/vs6/libgstdshow.dsp:
Add a new gst library which allow to create internal Direct Show
graph (pipelines) to wrap Windows sources, decoders or encoders.
It includes a DirectShow fake source and sink and utility functions.
* sys/dshowsrcwrapper/gstdshowaudiosrc.c:
* sys/dshowsrcwrapper/gstdshowaudiosrc.h:
* sys/dshowsrcwrapper/gstdshowsrcwrapper.c:
* sys/dshowsrcwrapper/gstdshowsrcwrapper.h:
* sys/dshowsrcwrapper/gstdshowvideosrc.c:
* sys/dshowsrcwrapper/gstdshowvideosrc.h:
* win32/vs6/libdshowsrcwrapper.dsp:
Add a new plugin to wrap DirectShow sources on Windows.
It gets data from any webcam, dv cam, micro. We could add
tv tunner card later.
2007-05-23 22:44:12 +00:00
Tim-Philipp Müller
b979d59b3d Add DIRECTDRAW_CFLAGS and DIRECTSOUND_CFLAGS to Makefile.am; save and restore the various flags in the directdraw/dir...
Original commit message from CVS:
* configure.ac:
* sys/directdraw/Makefile.am:
* sys/directsound/Makefile.am:
Add DIRECTDRAW_CFLAGS and DIRECTSOUND_CFLAGS to Makefile.am; save
and restore the various flags in the directdraw/directsound
detection section. Apparently improves cross-compiling for win32
with mingw32 under some circumstances (#437539).
2007-05-15 17:22:58 +00:00
Christian Schaller
e3ede85ab5 update copyright statements
Original commit message from CVS:
update copyright statements
2007-02-27 12:02:03 +00:00
Sébastien Moutte
da5144bc04 sys/directsound/gstdirectsoundsink.*: Remove include of unused headers.
Original commit message from CVS:
* sys/directsound/gstdirectsoundsink.c:
* sys/directsound/gstdirectsoundsink.h:
Remove include of unused headers.
* sys/waveform/gstwaveformplugin.c:
* sys/waveform/gstwaveformsink.c:
* sys/waveform/gstwaveformsink.h:
* win32/vs6/libgstwaveform.dsp:
Add a new waveform plugin which includes an audio sink
element using the WaveForm win32 API.
* win32/MANIFEST:
Add the new project file form waveform plugin.
2007-02-20 21:34:00 +00:00
Sébastien Moutte
f0ea2ecc06 sys/directdraw/: Prepare the plugin to move to good:
Original commit message from CVS:
* sys/directdraw/gstdirectdrawplugin.c:
* sys/directdraw/gstdirectdrawsink.c:
* sys/directdraw/gstdirectdrawsink.h:
Prepare the plugin to move to good:
Remove unused/untested code (rendering to an extern surface,
yuv format rendering).Use GST_(DEBUG/*)_OBJECT macros
Rename all functions from gst_directdrawsink to gst_directdraw_sink.
Add gtk doc section
Fix a bug in gst_directdraw_sink_show_frame, memcpy line by line
respecting destination surface stride.
* sys/directsound/gstdirectsoundplugin.c:
* sys/directsound/gstdirectsoundsink.c:
* sys/directsound/gstdirectsoundsink.h:
Prepare the plugin to move to good:
Rename all functions from gst_directsoundsink to gst_directsound_sink.
Add gtk doc section
* win32/common/config.h.in:
* win32/MANIFEST:
Add config.h.in
2007-02-18 18:00:51 +00:00
Vincent Torri
e2117c6c67 Add directsoundsink to build and dist it, so it gets built when compiling with MingW on win32 and the required header...
Original commit message from CVS:
Patch by: Vincent Torri  <vtorri at univ-evry fr>
* configure.ac:
* sys/Makefile.am:
* sys/directsound/Makefile.am:
* sys/directsound/gstdirectsoundsink.c:
(gst_directsoundsink_reset):
Add directsoundsink to build and dist it, so it gets built when
compiling with MingW on win32 and the required headers and libraries
are available (fixes: #392638). Also simplify DirectDraw check a bit.
* tests/check/elements/.cvsignore:
Fix CVS ignore for neonhttpsrc test binary.
2007-01-04 09:44:57 +00:00
Sergey Scobich
017a8c8527 sys/: Wait until the window is created before using it; guard unistd.h includes with HAVE_UNISTD_H. (#366523)
Original commit message from CVS:
Patch by: Sergey Scobich  <sergey dot scobich at gmail com>
* sys/directdraw/gstdirectdrawsink.c:
(gst_directdrawsink_window_thread),
(gst_directdrawsink_create_default_window):
* sys/directdraw/gstdirectdrawsink.h:
* sys/directsound/gstdirectsoundsink.c:
Wait until the window is created before using it; guard unistd.h
includes with HAVE_UNISTD_H. (#366523)
* win32/vs8/libgstdirectdraw.vcproj:
* win32/vs8/libgstdirectsound.vcproj:
Update project files.
2006-11-01 10:19:18 +00:00
Sébastien Moutte
454c252335 sys/directsound/gstdirectsoundsink.*: Add an attenuation property that will directly attenuate the directsound buffer.
Original commit message from CVS:
* sys/directsound/gstdirectsoundsink.h:
* sys/directsound/gstdirectsoundsink.c:
Add an attenuation property that will directly attenuate the
directsound buffer.
Change the size of the directsound secondary buffer to a half second.
Add more debug logs.
Add a lock to protect dsound buffer write access.
Fix a bad implementation of reset.
* sys/directsound/gstdirectdrawsink.c:
* sys/directsound/gstdirectdrawsink.h:
Add a keep_aspect_ratio property.
Do not use overlay if not supported.
Add more debug logs.
Remove overwrite of WM_ERASEBKGND message handling. It was not
redrawing border when keep_aspect_ratio was enabled.
* win32/common/config.h:
update version waiting an auto-generated config.h
2006-07-24 21:43:06 +00:00