Commit graph

126 commits

Author SHA1 Message Date
Tim-Philipp Müller
f325935314 pulse, speexenc, rtpgsmpay: don't use g_assert() for error handling
Don't use g_assert() for error handling, even if they're highly unlikely.
Either we *know* that something can't happen, in which case we
should just not handle it, or we think something can happen, but it is
very very unlikely that it will ever happen, in which case we should
handle it like any other error instead of asserting.

g_assert() is best left for conditions we have control of, like checking
internal consistency of our code, not checking return values of external
code.

Fixes a bunch of warnings when compiling with -DG_DISABLE_ASSERT:
gstrtpgsmpay.c: In function 'gst_rtp_gsm_pay_handle_buffer':
gstrtpgsmpay.c:130:17: warning: variable 'rtpgsmpay' set but not used
gstspeexenc.c: In function 'gst_speex_enc_encode':
gstspeexenc.c:904:19: warning: variable 'written' set but not used
pulsesink.c: In function 'gst_pulsesink_change_state':
pulsesink.c:2725:9: warning: variable 'res' set but not used
pulsesrc.c: In function 'gst_pulsesrc_change_state':
pulsesrc.c:1253:7: warning: variable 'e' set but not used
2011-04-16 18:15:43 +01:00
Alexey Fisher
0016ceaa2b speexenc: Use speex intern silence detection
Speex has build in silence detection. If speex_encode_int returns 0,
than there is silence and sample do not need to be transmitted.
This work only if vbr=1 and dtx=1 optionas are enabled.
So if we get 0, we add GAP flag to the sample.
2011-04-08 13:54:49 +02:00
Sebastian Dröge
85ace6d413 speexdec: Get and use streamheader from the caps if possible
This allows playback of streams where the streamheader buffers
were dropped from the stream for some reason.
2011-03-24 09:00:32 +01:00
Vincent Penquerc'h
56edbd0fa3 speexdec: silence warning message when appropriate
If we did not know how many frames to expect, then we get an unexpected
end of stream when trying to decode more frames that are there, if there
are leftover bits to pad to the next byte
2011-03-15 19:44:03 +01:00
Sebastian Dröge
4d7b4ca2ae speexdec: Always process the number of frames per packet as specified in the header
Looking at the remaining bits in the bitstream after decoding a
single frame can't be used as loop condition. The remaining
bits might not give a complete frame and the speex decoder will
then output nothing but access uninitialized memory, which leads
to valgrind warnings.

Fixes bug #644669.
2011-03-14 19:31:33 +01:00
Stefan Kost
45f6707784 various (ext): add a missing G_PARAM_STATIC_STRINGS flags 2010-10-13 17:39:36 +03:00
David Hoyt
9f8619e5ca speex: Fix crashes with MSVC
Using the symbols for the different Speex modes results
in crashes when using MSVC. Use the library functions to
get the modes instead.

Fixes bug #630378.
2010-09-23 21:57:18 +02:00
Sebastian Dröge
dcae55852e ext: Don't use GST_DEBUG_FUNCPTR for GObject vfuncs 2010-06-06 18:00:22 +02:00
Tristan Matthews
6628d20eac speex: fix latency query
Speex should report 30 ms latency for narrowband mode, 34 otherwise.
  Fixes #619018
2010-05-20 14:30:26 +02:00
Stefan Kost
8695f5a8a5 speexenc: remove unused defines 2010-04-08 13:40:09 +03:00
Stefan Kost
e032fd753e speex: remove unused define 2010-04-08 13:16:53 +03:00
Tim-Philipp Müller
073201b329 build: Makefile.am cleanups
Mostly add $(GST_BASE_CFLAGS) where it was missing, but also fix up
order of flags and libs if needed (see docs/random/moving-plugins).
2010-03-18 21:34:24 +00:00
Benjamin Otte
cccfeaa59c gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-18 14:32:00 +01:00
Benjamin Otte
c76e72a7f5 Add -Wundef to configure flags
and fix the resulting warnings
2010-03-17 21:33:28 +01:00
Sebastian Dröge
fdc7b73675 speexdec: Use speex_stereo_state_init() instead of the deprecated initialization macro
Fixes bug #612777.
2010-03-15 14:16:58 +01:00
Mark Nauwelaerts
4abf31067f speexdec: adapt to new oggdemux
Remove all granulepos hacks and simply use upstream timestamps.
2010-03-10 11:48:06 +01:00
Mark Nauwelaerts
972ce3006b speexdec: refactor granulepos hacks 2010-03-10 11:48:06 +01:00
Stefan Kost
f70dbd0eb7 speex: add missing include 2010-02-12 15:35:30 +02:00
Mark Nauwelaerts
c2eedfcceb speexdec: initialize stereo decoding state 2010-02-02 16:54:09 +01:00
Mark Nauwelaerts
77509c80c9 speexdec: free some more when resetting
Fixes #608255.
2010-01-27 17:05:52 +01:00
Mark Nauwelaerts
c529145e4b speexenc: prevent invalid arithmetic if not setup yet
Fixes #608255.
2010-01-27 17:05:04 +01:00
Mark Nauwelaerts
50c41acdff speexdec: allow for unknown varying number of frames per buffer
In particular, this caters for RTP payloads with multiple frames
per packet.
2009-09-18 14:46:38 +02:00
Mark Nauwelaerts
35f9efac88 speexdec: use correct sample size in conversions 2009-09-18 14:46:38 +02:00
Mark Nauwelaerts
f4482e4ae3 speexenc: fix buffer time and duration for multiple frames per packet 2009-09-18 14:46:38 +02:00
Stefan Kost
0541c44add speexenc: small taglist handling cleanup
Don't eventualy leak the list and instead assert (like in other elements).
2009-09-03 14:48:14 +03:00
Christian Schaller
bdf1698f35 Add RANKS for various encoders and muxers 2009-05-07 18:10:08 +01:00
Alessandro Decina
434d20862b speexdec: make speex_dec_convert work with same-format values when no data has been decoded. 2009-05-04 14:24:14 +02:00
Sebastian Dröge
6e9d728249 speex: Implement preset interface 2009-05-04 12:41:56 +02:00
Edward Hervey
0cb5b42d54 Remove trivial unused variables detected by CLang static analyzer. 2009-04-18 18:51:28 +02:00
Tim-Philipp Müller
335891c757 speexenc: fix direction of latency query and other upstream queries
Don't send queries back to the element they just came from by sending
them to the peer of the wrong pad.
2009-03-20 01:06:14 +00:00
Stefan Kost
9cf73bdd8f Update and add documentation for plugins with deps (ext).
Link to properties. Correct titles for examples. Document a few trivial cases. Keep lists in section file and docs/plugins/Makefile.am alphabetically ordered. Fix warnings that gtk-doc points out.
2009-01-28 18:05:09 +02:00
Stefan Kost
084812bffd Don't install static libs for plugins. Fixes #550851 for -good.
Original commit message from CVS:
* ext/aalib/Makefile.am:
* ext/annodex/Makefile.am:
* ext/cairo/Makefile.am:
* ext/dv/Makefile.am:
* ext/esd/Makefile.am:
* ext/flac/Makefile.am:
* ext/gconf/Makefile.am:
* ext/gdk_pixbuf/Makefile.am:
* ext/hal/Makefile.am:
* ext/jpeg/Makefile.am:
* ext/ladspa/Makefile.am:
* ext/libcaca/Makefile.am:
* ext/libmng/Makefile.am:
* ext/libpng/Makefile.am:
* ext/mikmod/Makefile.am:
* ext/pulse/Makefile.am:
* ext/raw1394/Makefile.am:
* ext/shout2/Makefile.am:
* ext/soup/Makefile.am:
* ext/speex/Makefile.am:
* ext/taglib/Makefile.am:
* ext/wavpack/Makefile.am:
* gst/alpha/Makefile.am:
* gst/apetag/Makefile.am:
* gst/audiofx/Makefile.am:
* gst/auparse/Makefile.am:
* gst/autodetect/Makefile.am:
* gst/avi/Makefile.am:
* gst/cutter/Makefile.am:
* gst/debug/Makefile.am:
* gst/effectv/Makefile.am:
* gst/equalizer/Makefile.am:
* gst/flx/Makefile.am:
* gst/goom/Makefile.am:
* gst/goom2k1/Makefile.am:
* gst/icydemux/Makefile.am:
* gst/id3demux/Makefile.am:
* gst/interleave/Makefile.am:
* gst/law/Makefile.am:
* gst/level/Makefile.am:
* gst/matroska/Makefile.am:
* gst/median/Makefile.am:
* gst/monoscope/Makefile.am:
* gst/multifile/Makefile.am:
* gst/multipart/Makefile.am:
* gst/oldcore/Makefile.am:
* gst/qtdemux/Makefile.am:
* gst/replaygain/Makefile.am:
* gst/rtp/Makefile.am:
* gst/rtsp/Makefile.am:
* gst/smpte/Makefile.am:
* gst/spectrum/Makefile.am:
* gst/udp/Makefile.am:
* gst/videobox/Makefile.am:
* gst/videocrop/Makefile.am:
* gst/videofilter/Makefile.am:
* gst/videomixer/Makefile.am:
* gst/wavenc/Makefile.am:
* gst/wavparse/Makefile.am:
* sys/directdraw/Makefile.am:
* sys/directsound/Makefile.am:
* sys/oss/Makefile.am:
* sys/osxaudio/Makefile.am:
* sys/osxvideo/Makefile.am:
* sys/sunaudio/Makefile.am:
* sys/v4l2/Makefile.am:
* sys/waveform/Makefile.am:
* sys/ximage/Makefile.am:
Don't install static libs for plugins. Fixes #550851 for -good.
2008-11-04 12:28:34 +00:00
Sebastian Dröge
3fa17e67a4 ext/speex/: Use integer encoding and decoding functions instead of converting the integer input to float in the eleme...
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_data):
* ext/speex/gstspeexdec.h:
* ext/speex/gstspeexenc.c: (gst_speex_enc_encode):
* ext/speex/gstspeexenc.h:
Use integer encoding and decoding functions instead of converting
the integer input to float in the element. The libspeex integer
functions are doing this for us already or, if libspeex was compiled
in integer mode, they're doing everything using integer arithmetics.
Also saves some copying around.
2008-09-02 08:51:04 +00:00
Sebastian Dröge
a414f86f88 ext/speex/gstspeexenc.c: Correct the timestamp and granulepos calculation by one Speex frame.
Original commit message from CVS:
* ext/speex/gstspeexenc.c: (gst_speex_enc_encode):
Correct the timestamp and granulepos calculation by one Speex
frame.
2008-08-31 15:02:09 +00:00
Sebastian Dröge
25896b3a93 ext/speex/gstspeexdec.c: Correctly take the granulepos from upstream if possible and correctly handle the granulepos ...
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_data):
Correctly take the granulepos from upstream if possible and
correctly handle the granulepos in various calculations: the
granulepos is the sample number of the _last_ sample in a frame, not
the first.
* ext/speex/gstspeexenc.c: (gst_speex_enc_sinkevent),
(gst_speex_enc_encode), (gst_speex_enc_chain),
(gst_speex_enc_change_state):
* ext/speex/gstspeexenc.h:
Handle non-zero start timestamps in the encoder and detect/handle
stream discontinuities. Fixes bug #547075.
2008-08-31 14:39:57 +00:00
Sebastian Dröge
92ed8f6a74 Don't use declarations after statements and variable length arrays.
Original commit message from CVS:
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_uri_set_uri):
* ext/speex/gstspeexenc.c: (gst_speex_enc_sink_getcaps):
* ext/wavpack/gstwavpackenc.c: (gst_wavpack_enc_set_wp_config):
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_fixate):
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format):
* tests/examples/equalizer/demo.c: (message_handler):
* tests/examples/spectrum/demo-audiotest.c: (message_handler):
* tests/examples/spectrum/demo-osssrc.c: (message_handler):
Don't use declarations after statements and variable length arrays.
2008-07-08 12:51:34 +00:00
Wim Taymans
4710c0ab85 ext/speex/gstspeexenc.c: Add mode property.
Original commit message from CVS:
* ext/speex/gstspeexenc.c: (gst_speex_enc_mode_get_type),
(gst_speex_enc_class_init), (gst_speex_enc_sink_getcaps),
(gst_speex_enc_get_latency), (gst_speex_enc_get_query_types),
(gst_speex_enc_src_query), (gst_speex_enc_init),
(gst_speex_enc_setup), (gst_speex_enc_push_buffer),
(gst_speex_enc_chain), (gst_speex_enc_get_property),
(gst_speex_enc_set_property):
Add mode property.
Some cleanups, add more debug info.
Add latency query.
2008-06-16 10:09:03 +00:00
Wim Taymans
aa959152d1 ext/speex/gstspeexdec.c: Fix the calculation of the duration of the concealment packets.
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_sink_event):
Fix the calculation of the duration of the concealment packets.
2008-05-13 08:21:26 +00:00
Olivier Crete
ca2bc1840a ext/speex/gstspeexenc.c: Add negotiation for the speex channels and rate. Fixes #465146.
Original commit message from CVS:
Patch by: Olivier Crete <tester at tester dot ca>
* ext/speex/gstspeexenc.c: (gst_speex_enc_sink_getcaps),
(gst_speex_enc_init), (gst_speex_enc_chain):
Add negotiation for the speex channels and rate. Fixes #465146.
2008-05-02 12:39:03 +00:00
Wim Taymans
882a710c29 ext/speex/gstspeexdec.c: Produce concealment data when time progresses in a segment update.
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_sink_event),
(speex_dec_chain_parse_data):
Produce concealment data when time progresses in a segment update.
2008-04-30 09:48:11 +00:00
Wim Taymans
0062c4d6d0 ext/speex/gstspeexdec.c: Try to preserve input timestamps when we can.
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_data),
(speex_dec_chain):
Try to preserve input timestamps when we can.
Do beginnings of error concealment.
2008-04-29 14:11:45 +00:00
Jan Schmidt
a578ebb964 ext/speex/gstspeexdec.c: Fix bounds checking of mode in Speex header, which may produce negative numbers in speex < 1...
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_header):
Fix bounds checking of mode in Speex header, which may
produce negative numbers in speex < 1.1.12
2008-04-11 10:32:20 +00:00
Olivier Crete
7f9ddba043 ext/speex/gstspeexenc.c: Unref the buffers only once when handling not-negotiated errors.
Original commit message from CVS:
Patch by: Olivier Crete <tester at tester dot ca>
* ext/speex/gstspeexenc.c: (gst_speex_enc_chain):
Unref the buffers only once when handling not-negotiated errors.
Fixes bug #520764.
2008-03-07 12:40:18 +00:00
Wim Taymans
e81c80a481 ext/speex/gstspeexdec.c: Use different variables for nested for loops so that the outer loop functions properly and s...
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_data):
Use different variables for nested for loops so that the outer loop
functions properly and speex files with multiple frames per buffer work
properly.
Fixes #441408.
2007-05-26 15:25:18 +00:00
Loïc Minier
682312a296 Fix build with LDFLAGS='-Wl,-z,defs' (#410997)
Original commit message from CVS:
Patch by: Loïc Minier <lool+gnome at via ecp fr>
* configure.ac:
* ext/annodex/Makefile.am:
* ext/jpeg/Makefile.am:
* ext/speex/Makefile.am:
* gst/alpha/Makefile.am:
* gst/cutter/Makefile.am:
* gst/debug/Makefile.am:
* gst/effectv/Makefile.am:
* gst/goom/Makefile.am:
* gst/level/Makefile.am:
* gst/smpte/Makefile.am:
* gst/videofilter/Makefile.am:
Fix build with LDFLAGS='-Wl,-z,defs' (#410997)
2007-02-24 22:57:49 +00:00
Wim Taymans
1e68f40b74 ext/speex/gstspeexdec.c: Some small cleanups, use _scale.
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_convert),
(speex_dec_sink_event), (speex_dec_chain_parse_header):
Some small cleanups, use _scale.
2006-10-31 09:44:39 +00:00
Tim-Philipp Müller
afef1cdc2a ext/speex/: Miscellaneous clean-ups, among other things: speexenc => enc to enhance code readability; change speexenc...
Original commit message from CVS:
* ext/speex/gstspeex.c: (plugin_init):
* ext/speex/gstspeexenc.c: (gst_speex_enc_get_formats),
(gst_speex_enc_setup_interfaces), (gst_speex_enc_base_init),
(gst_speex_enc_class_init), (gst_speex_enc_finalize),
(gst_speex_enc_sink_setcaps), (gst_speex_enc_convert_src),
(gst_speex_enc_convert_sink), (gst_speex_enc_get_query_types),
(gst_speex_enc_src_query), (gst_speex_enc_sink_query),
(gst_speex_enc_init), (gst_speex_enc_create_metadata_buffer),
(gst_speex_enc_set_last_msg), (gst_speex_enc_setup),
(gst_speex_enc_buffer_from_data), (gst_speex_enc_push_buffer),
(gst_speex_enc_set_header_on_caps), (gst_speex_enc_sinkevent),
(gst_speex_enc_chain), (gst_speex_enc_get_property),
(gst_speex_enc_set_property), (gst_speex_enc_change_state):
* ext/speex/gstspeexenc.h:
Miscellaneous clean-ups, among other things: speexenc => enc to
enhance code readability; change speexenc => speex_enc; in chain
function unref input buffer in case of error; take reference in
event function; use boilerplate macro; use gst_pad_query_peer_*
convenience functions.
2006-10-12 19:02:51 +00:00
Tim-Philipp Müller
35f4d69dec ext/speex/gstspeexenc.c: Fix some mem leaks.
Original commit message from CVS:
* ext/speex/gstspeexenc.c: (gst_speexenc_finalize),
(gst_speexenc_set_last_msg), (gst_speexenc_setup),
(gst_speexenc_set_header_on_caps):
Fix some mem leaks.
2006-10-12 18:35:10 +00:00
Tim-Philipp Müller
177751c892 ext/speex/gstspeexdec.c: Make metadata extraction actually work.
Original commit message from CVS:
* ext/speex/gstspeexdec.c: (speex_dec_chain_parse_comments):
Make metadata extraction actually work.
* ext/speex/gstspeexenc.c: (gst_speexenc_base_init),
(gst_speexenc_init), (gst_speexenc_create_metadata_buffer),
(gst_speexenc_chain):
Fix metadata writing: replace old code which wrote completely
broken tags with libgsttag-based code. Plus miscellaneous
code cleanups (use static pad templates etc.) and a bunch
of leak fixes.
2006-08-22 10:32:34 +00:00
Tim-Philipp Müller
05eaedc496 Use GST_DEBUG_CATEGORY_STATIC where possible (#342503) plus two minor macro fixes.
Original commit message from CVS:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/annodex/gstcmmlparser.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/gdk_pixbuf/pixbufscale.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalphacolor.c:
* gst/cutter/gstcutter.c:
* gst/debug/gstnavigationtest.c:
* gst/icydemux/gsticydemux.c:
* gst/level/gstlevel.c:
* gst/multipart/multipart.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpilbcpay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstvideoflip.c:
Use GST_DEBUG_CATEGORY_STATIC where possible (#342503)
plus two minor macro fixes.
2006-06-22 19:31:04 +00:00