Commit graph

1278 commits

Author SHA1 Message Date
Wim Taymans
1e98580204 pulsesink: clear ringbuffer when asked to
Since we map the ringbuffer to the pulseaudio internal ringbuffer, flush the
pulseaudio buffer when we are asked to clear the ringbuffer.
This avoids some leftover audio after a seek.
2009-06-29 15:21:37 +02:00
Stefan Kost
d260a92dce souphttpsrc: free memory in finalize
finalize is called only once. no need to clear pointers there. dispose is for
unreffing.
2009-06-24 17:45:42 +03:00
Edward Hervey
ef02d1da1d raw1394: sprinkle branch likeliness macros accross the code. 2009-06-24 12:37:38 +02:00
Tim-Philipp Müller
d0056049d3 dvdemux: post container-format tag
Also merge the two almost identical _add_*_pad() functions into one.
2009-06-22 10:49:02 +01:00
Tim-Philipp Müller
42936a73e6 dvdemux: don't screw up first audio buffer
Query the audio format, esp. dvdemux->num_channels, before we use that
variable to allocate the initial buffer. That way we don't accidentally
push a zero-sized buffer as first audio buffer.
2009-06-22 10:49:02 +01:00
Wim Taymans
b8e88710e1 pulseink: don't leak device_description
don't leak the device_description.
some cleanups.
2009-06-19 16:00:51 +02:00
Tim-Philipp Müller
e2ac5edc4b souphttpsrc: reset session state when stopping
Increases the chances that the element is actually reusable.
2009-06-16 08:58:31 +01:00
Tim-Philipp Müller
185957c98b souphttpsrc: log response and request headers and fix some broken indenting 2009-06-16 08:58:31 +01:00
Tim-Philipp Müller
dea67f3d96 pulsesink: ref custom ring buffer class and type in class_init
Hack around thread-safety issues in GObject and our racy _get_type()
functions (we could easily fix the _get_type() functions, but we still
need to hack around the GObject class races until we require a newer
GLib version, I think).
2009-06-15 15:51:32 +01:00
Tim-Philipp Müller
7ade32216f Remove a few old example apps from the 0.8 days
Some have been replaced by newer ones, others are demoing elements that
don't exist any longer (not in -good anyway), and others have not been
touched in many years and it seem pointless to keep them around.

Removing these files makes sure we don't have any code in our repository
that uses Gtk+ symbols which are to be removed for GNOME3, and as such
will make some script that greps for this kind of stuff give us a clean
bill of code health. Fixes #585757.
2009-06-14 19:19:19 +01:00
Wim Taymans
0bd984c52f pulsesink: handle border cases in resampler 2009-06-11 19:18:52 +02:00
Stefan Kost
85ba1b3e6a pulsesink: only notify if all checks passed
Replace goto done: with return, as those are checks when we don't want to flag a
pending notify.
2009-06-04 17:43:15 +03:00
Stefan Kost
44956f98d7 pulsesink: check pointer before accessing
Move existing check a few lines up, so that we check before accessing fields.
2009-06-03 18:23:53 +03:00
Stefan Kost
f77650c024 pulsesink: rename gst_pulse_sink_get_time to gst_pulsesink_get_time
Rename internal method for consistency.
2009-06-03 18:21:12 +03:00
Stefan Kost
2af7977e1d pulsesink: use values from pa_stream_get_buffer_attr()
We were putting the requested values back into ringbuffer spec, instead of
using the queried values.
2009-06-03 18:19:22 +03:00
Jan Schmidt
d9544bcc44 pngdec: Avoid possible overflow in calculations
A malformed (or simply huge) PNG file can lead to integer overflow in
calculating the size of the output buffer, leading to crashes or buffer
overflows later. Fixes SA35205 security advisory.
2009-06-02 13:44:39 +01:00
Tim-Philipp Müller
552793473f flacenc: some more logging - dump header packets
Also, the final fixing up of the headers is expected and not something
we should warn about.
2009-06-02 00:48:00 +01:00
Tim-Philipp Müller
53be1d33ca flacenc: never ever pass values >36bits to _set_total_samples_estimate()
Let's be paranoid and make sure we never pass a number that takes up
more than 36 bits to _set_total_samples_estimate(), since libFLAC
expects all the other bits to be zero, and if this is not the case
neighbouring fields in the global stream info header may get messed
up inadvertently, so that flac -d refuses to decode the stream.
See #584455.
2009-06-02 00:46:42 +01:00
Thomas Vander Stichele
0de1f5357d Address bad FLAC sample length encoding of #5844455
Commit df707c6664
introduced an obvious bug in the sample length calculation,
using the wrong macro for conversion.
2009-06-01 22:33:02 +02:00
John Keeping
32491d5a51 pngdec: match g_malloc() with g_free()
Matching g_malloc() with a g_free() is important when a custom allocator is
installed.
Fixes #583803
2009-05-25 16:33:35 +02:00
Zeeshan Ali (Khattak)
1d6fd4b6dd souphttpsrc: Set caps for audio/L16 content-type
When "Content-Type" header is "audio/L16", we need to set the caps on the
outgoing buffers so that downstream elements can have means to detect the
stream type and handle it appropriately. Tested with HTTP stream provided
by pulse-audio's http module (git master).
2009-05-22 00:55:08 +03:00
Zeeshan Ali (Khattak)
cd0e75ac1a souphttpsrc: Rename icy_caps to src_caps 2009-05-22 00:55:08 +03:00
Philippe Normand
a0de8567ca jpegdec: bump max size to 65535x65535
Remove artificial jpeg image limits.
Fixes #583048.
2009-05-21 23:39:13 +02:00
Jan Schmidt
cf584105c6 pulsesink: Convert an erroneous assertion
Occasionally, we get a change callback for an old stream, triggering
the assertion unnecessarily. Just ignore such callbacks.
2009-05-21 21:16:14 +01:00
Olivier Crête
ca25de8f77 pulse: Print a warning on under/overflows 2009-05-21 22:05:11 +02:00
Tim-Philipp Müller
8accf2704b flacdec: fix buffer leak
gst_buffer_replace() will take its own ref, so we still have
to unref the buffer if we don't need it any longer.
2009-05-13 09:18:07 +01:00
Tim-Philipp Müller
2e67ccde81 raw1394: include stdlib.h for strtol()
Fixes compiler warning when compiling with xml stuff in core disabled.
2009-05-08 19:42:10 +01:00
Edward Hervey
e8cbbd22f8 flacdec: Actually output the pending buffer.. and not a blank one.
It was previously sending the bogus buffer which was returned from
the bufferalloc (required for reverse negotiation apparently) instead
of the pending buffer.
2009-05-08 16:40:57 +02:00
Sebastian Dröge
9bf294c310 souphttpsrc: Allow non-string fields in the extra-headers property 2009-05-08 12:02:36 +02:00
Sebastian Dröge
1e34187973 souphttpsrc: Add support for extra-headers appended to the HTTP request
This allows to set the Referer header among other things by
adding a "extra-headers" property that takes a GstStructure
with field=string pairs.

Fixes bug #581806.
2009-05-08 11:30:44 +02:00
Christian Schaller
bdf1698f35 Add RANKS for various encoders and muxers 2009-05-07 18:10:08 +01:00
Jan Schmidt
c41d3d87fa flac: Make buffers created during seek act like normal buffers.
Store the offset and caps when allocating a buffer during seeking, and then
allocate a new buffer with buffer_alloc before we push it out. This ensures
that in all respects the first buffer decoded during seeking behaves like
all other buffers, including allowing downstream re-negotiation.
2009-05-06 14:24:20 +01:00
Thomas Vander Stichele
71acf2e900 flacdec: don't use pad_alloc when decoding while seeking. Fixes #579422 2009-05-06 15:28:46 +02:00
Arnout Vandecappelle
99efbfcf4d jpegdec: refactored gst_jpeg_dec_parse_image_data
Fixes #579808
2009-05-06 13:22:51 +02:00
Arnout Vandecappelle
788986e269 jpegdec: support additional 0xff before end marker.
JPEG markers may be preceded by additional 0xff.  jpegdec should
skip over these, even before the end marker.
See #579808
2009-05-06 13:11:53 +02:00
Wim Taymans
4606188039 jpegenc: set colorspace before _set_defaults()
The libjpeg api says that we need to set the colorspace before we call
_set_defaults(). Indeed, if we don't do that we end up with some very freaky
non-standard quant table and huffman table indexes.
2009-05-05 16:24:16 +02:00
Tim-Philipp Müller
3d9f6d9615 configure: make gdk-pixbuf plugin depend only on gdk-pixbuf, not gtk+ 2009-05-05 13:20:47 +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
9da04cd6af flac: Implement preset interface 2009-05-04 12:43:42 +02:00
Sebastian Dröge
6e9d728249 speex: Implement preset interface 2009-05-04 12:41:56 +02:00
Sebastian Dröge
9bb965430f wavpack: Implement preset interface 2009-05-04 12:40:36 +02:00
Wim Taymans
28afc6e591 pulsesink: make sure we always signal waiters
Always signal the waiters in the async callbacks. Especially for the volume
callbacks since this might cause deadlocks.
2009-04-30 10:32:39 +02:00
Sebastian Dröge
5a7edcbd81 flacenc: Use the tag merge mode that was set on the interface for merging tag events 2009-04-29 11:13:11 +02:00
Tim-Philipp Müller
8d8e9af0a8 jpegdec: fix warning for still images by not trying to divide by 0
Don't pass a 0 divisor to gst_util_uint64_scale(), or it will complain
in the single image case where fps=0/1 (are we supposed to differentiate
between no fps=still image and fps=0/1=variable rate here btw?)
2009-04-20 19:42:13 +01:00
Andy Wingo
034a4a771e fix format string in pngdec
* ext/libpng/gstpngdec.c: Fix size_t vs unsigned int format in error message.
2009-04-20 15:54:31 +02:00
Edward Hervey
0cb5b42d54 Remove trivial unused variables detected by CLang static analyzer. 2009-04-18 18:51:28 +02:00
Edward Hervey
cdb03bdc2b Remove blank {set|get}_property/change_state/finalize methods. 2009-04-18 18:51:27 +02:00
Edward Hervey
4a9e80720a Remove unused variables in _class_init
Detected by LLVM's CLang static analyzer
2009-04-18 18:51:27 +02:00
Wim Taymans
c052906590 pulsesink: fix sample offset calculation again 2009-04-16 22:51:54 +02:00
Wim Taymans
776b0ae8cb pulsesink: handle NULL timing info
Don't crash when the timing info is not yet available.
2009-04-10 21:32:54 +02:00
Stefan Kost
b3d66d5e8d pulse: make it work on 0.9.12
First we ignore request to fill the ringbuffer which are less then a segment.
The small request where causing stutter.
Then we disable flushing the stream when running against pa 0.9.12 as this
triggers an assertiong in the sound server and terminates it. It does not happen
with 0.9.10 and 0.9.14.
2009-04-10 21:42:13 +03:00
Wim Taymans
963b343548 pulsesink: handle server disconnect in get_time
When the server is disconnected or when we are shut down, make our clock return
an invalid time instead of erroring out.
2009-04-10 14:18:48 +02:00
Wim Taymans
20a6908dfd pulsesink: bps is signed int to avoid overflow
Keep bps as gint instead of guint because we will be doing signed math with it
later on and we don't want weird results.
2009-04-10 12:01:27 +02:00
Wim Taymans
7d438518fb pulsesink: check for a stream
Don't try to change the stream volume (and other things) when we don't have a
stream yet. Just store the values for later.
2009-04-09 23:43:58 +02:00
Wim Taymans
ae83945349 pulsesink: fix compilation for newer pulseaudio 2009-04-09 18:07:38 +02:00
Wim Taymans
8d58de128d pulsesink: uncork fixes and use prebuf = 0
We can use prebuf = 0 to instruct pulse to not pause the stream on underflows.
This way we can remove the underflow callback. We however have to manually
uncork the stream now when we have no available space in the buffer or when we
are writing too far away from the current read_index.
2009-04-09 17:26:21 +02:00
Wim Taymans
d849340e64 pulsesink: handle write errors 2009-04-09 17:26:20 +02:00
Wim Taymans
81c5fb9e48 pulsesink: write silence on underflow
Start filling up the buffer with empty samples when an underflow happens. We
need to do this to keep pulseaudio reporting the right time for us.
2009-04-09 17:26:20 +02:00
Wim Taymans
2e2f1d73ca pulsesink: handle pull-based scheduling
Use the default basesink methods for implementing pull based scheduling, it
works fine for us.
2009-04-09 17:26:20 +02:00
Wim Taymans
8855ed90c0 pulsesink: add beginnings of pull-based scheduling 2009-04-09 17:26:20 +02:00
Wim Taymans
236baa5a13 pulsesink: keep track of clock reset
when we switch streams, the clock will reset to 0. Make sure that the provided
clock doesn't get stuck when this happens by keeping an initial offset. We also
need to make sure that we subtract this offset in samples when writing to the
ringbuffer.
2009-04-09 17:26:20 +02:00
Wim Taymans
6bc6cafcc6 pulsesink: rewrite pulsesink
Derive from BaseAudioSink and implement our custom ringbuffer that maps to the
internal pulseaudio ringbuffer.
2009-04-09 17:26:20 +02:00
Wim Taymans
28d733d53b pulse: remove some stray debug lines 2009-04-09 17:26:20 +02:00
Tim-Philipp Müller
e14bae6637 jpegdec: use slightly more adaptive formula for QoS
Should work at least a tad better if the decoder can't keep up, and
should also spread dropped frames a bit more evenly over time.
2009-04-09 11:34:19 +01:00
Thomas Vander Stichele
8009fcf547 add pending_samples so that we only update segment's last stop after really sending the samples 2009-04-04 15:14:32 +02:00
Thomas Vander Stichele
fb4953a68d add debugging 2009-04-04 15:14:31 +02:00
Thomas Vander Stichele
5e19fc1058 clipping should also work if it's done on the first buffer starting at 0 2009-04-04 15:14:31 +02:00
Jonathan Matthew
9b7c9208c3 id3v2mux: write RVA2 frames containing peak/gain volume data 2009-04-02 00:20:02 +01:00
Tim-Philipp Müller
f1fb1f80fa jpegdec: demote some log message from DEBUG to LOG
And log decoder object.
2009-04-02 00:05:14 +01:00
Tim-Philipp Müller
00c4b0b17a jpegdec: implement basic QoS
Don't decode frames that are going to be too late anyway.
2009-04-01 21:15:02 +01:00
Tim-Philipp Müller
11a8aa91b8 flac: require a 'newer' flac and remove support for the legacy flac API 2009-03-27 21:27:30 +00:00
Tim-Philipp Müller
ab1bbcd58d jpegdec: put GstSegment inside the element struct instead of allocating it separately 2009-03-25 10:36:49 +00:00
Wim Taymans
39f59ea456 pulsesink: clean up the state change function
Make the state change function a bit more readable and only pause after the
parent had a change to pause first.
2009-03-23 11:22:08 +01:00
Jan Schmidt
b39d090a49 pulsesink: Track the corked/uncorked state ourselves
Use an instance variable to track whether the stream is corked or not,
instead of using PA API that was only introduced in 0.9.11
2009-03-20 13:27:59 +00:00
Jan Schmidt
120e6bfc5c pulse: Make sure the stream is uncorked in the write function
If the caps changes, the sink is reset without transitioning through
a PAUSED->PLAYING state change, resulting in a corked stream. This avoids
the problem by checking that the stream is uncorked when writing samples
to it.
2009-03-20 12:11:06 +00: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
Jan Schmidt
608d13d462 pulsesink: Wait until there is enough room to write an entire segment
When trying to write out a segment, wait until there is enough free space
for the entire segment. This helps to reduce ripple in the clock reporting,
where the app might query the playback position while only half a segment
has been written (and is therefore reported by _delay(), even though
the ring buffer has not yet been advanced)
2009-03-13 15:40:50 +00:00
Laszlo Pandy
73fac6e4ea Don't call FLAC__ methods before it's initialized. Fixes #516031
In the event handler, gst_flac_dec_sink_event(), two functions are called on
the FLAC stream without checking if it has been initialized:
FLAC__stream_decoder_flush()
FLAC__stream_decoder_process_until_end_of_stream()

Both these FLAC__*() functions modify the internal state of the FLAC stream.
Later, when the buffers start flowing, gst_flac_dec_chain() tries to initialize
the stream. the FLAC__stream_decoder_init_stream() call will fail because the
previous calls to FLAC__*() changed the stream state so it is no longer in the
initialized state.
2009-03-12 16:10:25 +01:00
Wim Taymans
18571b9e4f pngdec: various cleanups.
Make some code more readable.
Fix a leak when pull range returns a shot buffer.
Push EOS after posting the error.
2009-03-10 11:03:14 +01:00
Wim Taymans
8f8e035cd5 flacdec: don't lose the first buffer after a seek
The flacdec API calls the write callback when performing a seek. We cannot yet
push out a buffer at that time so we must keep it and push it out later.
Flush out the upstream part of the pipeline when doing a seek.
Fixes #574275.
2009-03-09 17:14:12 +01:00
Edward Hervey
1523ef681b souphttpsrc: Expose the SoupSession 'timeout' property. 2009-03-03 12:20:27 +01:00
Thomas Vander Stichele
9f25f96155 Merge branch 'master' of ssh://thomasvs@git.freedesktop.org/git/gstreamer/gst-plugins-good 2009-03-02 09:43:30 +01:00
Thomas Vander Stichele
13221762d0 Add/clarify/fix some logging. 2009-03-02 08:41:15 +01:00
David Schleef
9f3ad53ca8 Fix the field dominance
PAL is TFF, NTSC is BFF.  Some day I will learn to keep this
straight.
2009-02-27 23:26:40 -08:00
David Schleef
b264c99074 dvdec: Add interlacing info to caps and buffers 2009-02-25 20:01:36 -08:00
Tim-Philipp Müller
1a2bd6c617 jpegenc: error out instead of crashing if no caps have been set
Don't crash if we receive a buffer without caps. Fixes #572413.
2009-02-25 12:50:37 +00:00
Sebastian Dröge
5da35b1ee2 gconf: Rename gconf.[ch] to gstgconf.[ch] to prevent name conflicts 2009-02-24 14:56:14 +01:00
Wim Taymans
7e64f1d106 Some cleanups
Remove some unused variables.
Avoid a useless _resync call.
Correctly use a gboolean.
2009-02-23 15:48:41 +01:00
Sjoerd Simons
ef33cf891f gconfvideo(src|sink): Disconnect GConf notifications
Fixes bug #571321.
2009-02-22 19:30:32 +01:00
Sebastian Dröge
dfa627da30 pulsemixer: Don't use g_atomic_int_(get|set) for accessing the mixer track flags
g_atomic_int_(get|set) only work on ints and the flags are
an enum (which on most architectures is stored as an int).

Also the way the flags were accessed atomically would still
leave a possible race condition and we don't do it in any
other mixer track implementation, let alone at any other
place where an integer could be changed from different
threads. Removing the g_atomic_int_(get|set) will only
introduce a new race condition on architectures where
integers could be half-written while reading them
which shouldn't be the case for any modern architecture
and if we really care about this we need to use
g_atomic_int_(get|set) at many other places too.

Apart from that g_atomic_int_(set|get) will result in
aliasing warnings if their argument is explicitely
casted to an int *. Fixes bug #571153.
2009-02-22 18:08:59 +01:00
Sebastian Dröge
b6e745d2d3 hdv1394src: Don't use void * pointer arithmetic 2009-02-22 12:41:53 +01:00
Thomas Vander Stichele
a7902054bd respect DEFAULT segment by clipping the last buffer to be sent 2009-02-21 12:47:00 +01:00
Mark Nauwelaerts
5cfc906d1b pulsemixer: Fix compiler warnings.
Cast (enum *) to (int *), not necessarily technically right,
but plugs #571153.
2009-02-13 18:50:52 +01:00
Mark Nauwelaerts
7756d37531 pulsesink: Issue property change notification in streaming thread,
rather than PA thread.

pa_threaded_mainloop_lock() (a.o.) and by extension get_property should
not be done from a PA thread, but the latter may occur as a result of a
property change notification.  Fixes #571204 (though current situation
not ideal, e.g. post message rather than signal).
2009-02-13 18:04:41 +01:00
Michael Smith
db0b8755e0 flacdec: if we aborted reading, don't do into an infinite loop.
If our read callback ran out of data, so had to abort reading, we return
GST_FLOW_ERROR instead of going into an infinite loop.
2009-02-05 15:53:04 -08:00
Thomas Vander Stichele
b312bc6931 debug on the object 2009-02-05 20:02:01 +01:00
Jonathan Matthew
9218eae98b Use correct flag for the GNOME proxy configuration
Fixes bug #552140.
2009-02-02 18:38:40 +01:00
Stefan Kost
eb89143219 Add examples for the jpeg elements. 2009-01-29 10:12:43 +02:00
Jan Schmidt
9795e95f39 Fix compile error in the last commit 2009-01-28 21:40:11 +00:00
Jan Schmidt
0037635bf2 Rewrite the pulse plugin, conditionally enabling new behaviour with
newer pulseaudio.

Fixes: #567794

* Hook pulsesink's volume property up with the stream volume -- not the
  sink volume in PA.

* Read the device description directly from the sink instead of going
  via the mixer.

* Properly implement _reset() methods for both sink and source to avoid
  deadlocks when shutting down a pipeline.

* Replace all simple pa_threaded_mainloop_wait() by proper loops to
  guarantee that we wait for the right event in case multiple events are
  fired.  While this is not strictly necessary in many cases it
  certainly is more correct and makes me sleep better at night.

* Replace CHECK_DEAD_GOTO macros with proper functions

* Extend the number of supported channels to 32 since that is the actual
  limit in PA.

* Get rid of _dispose() methods since we don't need them.

* Increase the volume property upper limit of the sink to 1000.

* Reset function pointers after we disconnect a stream/context. Better
  fix for bug 556986.

* Reset the state of the element properly if open/prepare fails

* Cork the PA stream when the pipeline is paused. This allows the PA
* daemon to
  close audio device on pause and thus save a bit of power.

* Set PA stream properties based on GST tags such as GST_TAG_TITLE,
  GST_TAG_ARTIST, and so on.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
2009-01-28 20:34:40 +00:00