Commit graph

9558 commits

Author SHA1 Message Date
Mark Nauwelaerts
d41ed9693d aacparse: separate plugin registration and rename plugin 2011-04-08 18:07:01 +01:00
Mark Nauwelaerts
7cd3f0a2db aacparse: ensure sufficient data available before accessing 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
f3d2429f92 aacparse: use (default) time handling of baseparser class 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
4ed9e61615 aacparse: fixup comments to C-style 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
4a2a3a60f4 baseparse: reset passthrough mode to default (disabled) on activation 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
4d637e7549 baseparse: ensure buffer metadata is writable 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
3b88bb6cd6 baseparse: fix/enhance DISCONT marking
In particular, consider DISCONT == !sync, and allow subclass to query
sync state, as it may want to perform additional checks depending
on whether sync was achieved earlier on.
Also arrange for subclass to query whether leftover data is being drained.
2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
b766e405b3 baseparse: add timestamp handling, and default conversion
In particular, (optionally) provide baseparse with a notion of frames per second
(and therefore also frame duration) and have it track frame and byte counts.
This way, subclass can provide baseparse with fps and have it provide default
buffer time metadata and conversions, though subclass can still install
callbacks to handle such itself.
2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
cc203d7219 baseparse: documentation fixes 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
4f2790c9a1 baseparse: use_fixed_caps for src pad
After all, stream is as-is, and there is little molding to downstream's
taste that can be done.  If subclass can and wants to do so, it can
still override as such.
2011-04-08 18:06:59 +01:00
Julien Moutte
bd45e64d31 aacparse: Fix compilation warnings 2011-04-08 18:06:59 +01:00
Josep Torra
906c4faa24 aacparse: fix warnings in macosx snow leopard 2011-04-08 18:06:59 +01:00
Mark Nauwelaerts
fb84ca3d93 aacparse: forego (bogus) parsing of already parsed (raw) input 2011-04-08 18:06:58 +01:00
Mark Nauwelaerts
19c47f9673 baseparse: prevent infinite loop when draining 2011-04-08 18:06:58 +01:00
Mark Nauwelaerts
d610cfbbc0 baseparse: fix minor memory leak 2011-04-08 18:06:58 +01:00
Sebastian Dröge
bfe54aff4b aacparse: Add function for the baseparse subclass to push buffers downstream
Also handle the case gracefully where the subclass decides to drop
the first buffers and has no caps set yet. It's still required to
have valid caps set when the first buffer should be passed downstream.
2011-04-08 18:06:58 +01:00
Sebastian Dröge
c83364ee81 baseparse: Fix seek event leaking 2011-04-08 18:06:58 +01:00
Mark Nauwelaerts
442ab41a05 aacparse: ADIF: do not send bogus timestamps, leave to downstream (decoder) 2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
92c80bc879 aacparse: fix sample rate extraction from codec data
In one case we extracted the sample rate index from the codec data
and saved it as sample rate rather than getting the real sample
rate from the table. Fix that, and also make sure we don't access
non-existant table entries by adding a small helper function that
guards against out-of-bounds access in case of invalid input data.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
c252137b82 aacparse, amrparse: remove bogus gst_pad_fixate_caps() calls 2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
e74776b3cb baseparse: propagate return value of GstBaseParse::set_sink_caps()
gst_base_parse_sink_setcaps() presumably should fail if the subclass
returns FALSE from its ::set_sink_caps() function.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
c59ee281ba baseparse: don't try to GST_LOG an already-freed caps string
The proper way to log caps is via GST_PTR_FORMAT anyway.
2011-04-08 18:06:58 +01:00
Tim-Philipp Müller
fc09fe78af aacparse: set channels and rate on output caps, and keep codec_data
Create output caps from input caps, so we maintain any fields we
might get on the input caps, such as codec_data or rate and channels.
Set channels and rate on the output caps if we don't have input caps
or they don't contain such fields. We do this partly because we can,
but also because some muxers need this information. Tagreadbin will
also be happy about this.
2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
debb9362ef baseparse: fix debug category 2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
f5379229a0 baseparse: fix (regression in) newsegment handling
(aacparse, amrparse, flacparse).  Fixes #580133.
2011-04-08 18:06:57 +01:00
René Stadler
4b80afc22c baseparse: Fix slightly broken buffer-in-segment check (aacparse, amrparse, flacparse) 2011-04-08 18:06:57 +01:00
René Stadler
471bc5730a baseparse: Fix push mode seeking (aacparse, amrparse)
Sending the flush-start event forward before taking the stream lock actually
works, in contrast to deadlocking in downstream preroll_wait (hunk 1).

After that we get the chain function being stuck in a busy loop. This is fixed
by updating the minimum frame size inside the synchronization loop because the
subclass asks for more data in this way (hunk 2).

Finally, this leads to a very probable crash because the subclass can find a
valid frame with a size greater than the currently available data in the
adapter. This makes the subsequent gst_adapter_take_buffer call return NULL,
which is not expected (hunk 3).
2011-04-08 18:06:57 +01:00
Mark Nauwelaerts
4deaa95eda baseparse: Delay newsegment as long as possible.
If newsegment is sent (too) early, caps may not yet be fixed/set,
and downstream may not have been linked.
2011-04-08 18:06:57 +01:00
René Stadler
179632dc02 aacparse: Fix busyloop when seeking. Fixes #575388
The problem is that after a discont, set_min_frame_size(1024) is called when
detect_stream returns FALSE. However, detect_stream calls check_adts_frame
which sets the frame size on its own to something larger than 1024. This is the
same situation as in the beginning, so the base class ends up calling
check_valid_frame in an endless loop.
2011-04-08 18:06:57 +01:00
René Stadler
2856da8601 aacparse: Refactor check_valid_frame to expose broken code
Just moving code around and removing an unhelpful/misleading comment.
2011-04-08 18:06:57 +01:00
Stefan Kost
4ffb2499d3 baseparse: revert last change and properly fix
Baseparse internaly breaks the semantics of a _chain function by calling it with
buffer==NULL. The reson I belived it was okay to remove it was that there is
also an unchecked access to buffer later in _chain. Actually that code is wrong,
as it most probably wants to set discont on the outgoing buffer.
2011-04-08 18:06:57 +01:00
Stefan Kost
675dc650ca baseparse: remove checks for buffer==NULL
Accordifn to docs for GstPadChainFunction buffer cannot be NULL. If we would
leave the check, we would also need more such check below.
2011-04-08 18:06:57 +01:00
René Stadler
2bfa7bc456 aacparse: Fix license specified in plugin details. 2011-04-08 18:06:56 +01:00
Jan Schmidt
06f4cbd7f3 Fix the return value of the default parse_frame function.
Fix the return value of the default parse_frame function in both
copies of GstBaseParse
2011-04-08 18:06:56 +01:00
Stefan Kost
8b20a1d46f Log aac details found in codec_data. 2011-04-08 18:06:56 +01:00
Wim Taymans
76d9b6deaa gst/aacparse/gstaacparse.c: Don't autoplug aacparse until it works.
Original commit message from CVS:
* gst/aacparse/gstaacparse.c: (plugin_init):
Don't autoplug aacparse until it works.
2011-04-08 18:06:56 +01:00
Stefan Kost
c3faaa2daa tests/check/: Add unit tests for new parsers.
Original commit message from CVS:
* tests/check/Makefile.am:
* tests/check/elements/aacparse.c:
* tests/check/elements/amrparse.c:
Add unit tests for new parsers.
2011-04-08 18:06:56 +01:00
Stefan Kost
16e3a36dc6 gst/: Fix baseparse type name.
Original commit message from CVS:
* gst/aacparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.c:
Fix baseparse type name.
2011-04-08 18:06:56 +01:00
Stefan Kost
fe9e6d3469 Add two new baseparse based parsers (aac and amr) from Bug #518857.
Original commit message from CVS:
* configure.ac:
* gst/aacparse/Makefile.am:
* gst/aacparse/gstaacparse.c:
* gst/aacparse/gstaacparse.h:
* gst/aacparse/gstbaseparse.c:
* gst/aacparse/gstbaseparse.h:
* gst/amrparse/Makefile.am:
* gst/amrparse/gstamrparse.c:
* gst/amrparse/gstamrparse.h:
* gst/amrparse/gstbaseparse.c:
* gst/amrparse/gstbaseparse.h:
Add two new baseparse based parsers (aac and amr) from Bug #518857.
2011-04-08 18:06:56 +01:00
Havard Graff
e71a908d96 jitterbuffer: Make src_query MT-safe
It is possible that the element might be going down while the event arrives
2011-04-08 15:23:05 +02:00
Sebastian Dröge
b784173e4a jpegdec: Unref event if the parent element disappeared 2011-04-08 15:22:47 +02:00
Sebastian Dröge
4c36ca30b2 jitterbuffer: Unref event if the parent element disappeared 2011-04-08 15:22:19 +02:00
Havard Graff
9386448649 jpegdec: Make upstream events MT-safe 2011-04-08 15:21:52 +02:00
Havard Graff
342686bb02 jitterbuffer: Make upstream events MT-safe 2011-04-08 15:21:46 +02:00
Sebastian Dröge
31af4fe33e rtp: Unref events if the parent element disappeared 2011-04-08 15:20:51 +02:00
Ole André Vadla Ravnås
046f170d6a rtpmanager: fix pad callbacks so they handle when parent goes away
1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
2011-04-08 15:16:56 +02:00
Havard Graff
f8370bb2a8 rtpsession: make iterate_internal_links MT-safe 2011-04-08 14:41:34 +02:00
Sebastian Dröge
11bcac7c90 Revert "Pulsesink: Allow chunks up to bufsize instead of segsize"
This reverts commit 1e2c1467ae.

The commit causes pulsesink to ignore the latency-time baseaudiosink property.
2011-04-08 14:35:04 +02:00
Alexey Fisher
9b15f9c6a1 rtpspeexpay: Do not transmitt samples with GAP flag
If we get GAP samples, there is no need to transmitt it.
In some situations, microphone is muted, we can drop net traffick
usage to ~1 kbit/s. Without patch it will stay ~20 kbit/s
2011-04-08 13:56:13 +02: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