Commit Graph

187 Commits

Author SHA1 Message Date
Jim Broadus 2804a4d89f gstengine: Make output format configurable
Add an output format option in playback settings. The options are
Detect, S16LE, and F32LE. Selecting Detect will use the existing
behavior and detect the native format when the pipeline starts. The
other options will set the format when the pipeline is built.
2021-04-03 13:56:22 +01:00
Jim Broadus 2339404852 player: Send request when reporting playback status
Modify the signals emitted by the engine when a url is determined to be
valid or invalid to send the entire request. This will allow additional
metadata to be added to the request, providing a mechanism to better
identify the request source.
2021-03-12 15:20:42 +00:00
Jim Broadus cf842a8c5a gstengine: Use existing stream id to track background streams
New ids were being created for background stream mapping, but streams already
have unique IDs that can be used for this.
2021-01-14 11:29:43 +00:00
Jim Broadus 409c6b89d1 gstengine: Add a gstreamer debug console page
New page initially provides a button that triggers a dump of a graph of the main
pipeline.
2021-01-01 16:26:29 +00:00
Jim Broadus c353deba0c gstengine: Add a DumpGraph method to GstEnginePipeline
This will write a .dot graph and can be integrated with the debug console.
2021-01-01 16:26:29 +00:00
Jim Broadus a012e7e273 gstengine: Fix InitFromString return value
GstEnginePipeline::InitFromString was attempting to link the decoder and audio
bins twice and returning the result of the failed second attempt as it's own
status. The return value was also being ignored by the caller.
2020-12-27 21:50:06 +00:00
Jim Broadus 616ccc6fde gstengine: Remove extra unref on element creation failure
GstEngine::CreateElement unrefs the supplied bin if an error
occurs. In all current cases, that bin is referenced by a
pipeline.
2020-12-26 22:14:23 +00:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus 7378e5b141 gstengine: Clean up buffer references in error cases 2020-05-23 11:07:34 +01:00
Jim Broadus 94eb2dcfc1 Preserve auth headers when redirecting.
When redirecting, copy the original request, which may include extra headers.
2020-03-13 10:38:47 +00:00
Jim Broadus 9ed5503ee3 Add MediaPlaybackRequest class.
Add a class to wrap the URL in the playback engines. In the future, this will
contain authentication information for the specified URL. It can also include
the start and end time as well as other data that is currently specified along
with the URL.
2020-03-11 10:57:21 +00:00
Jim Broadus 2c1ae986c5 Create a GstEngine::IsCurrentPipeline helper function for callbacks. 2020-03-09 10:21:07 +00:00
Jim Broadus d3d6c1ff3c Fix UNC paths.
The fix-up for URLs for files that that begin with // no longer works since the
QUrl class determines that these modifications are invalid, resulting in an
empty string when converted. Instead of attempting to modify the QUrl, add a
utility function that makes the correction on the encoded byte array at time of
usage.
2020-01-29 00:38:43 -08:00
Jonas Kvinge a5e8eba91c Merge remote-tracking branch 'upstream/master' into qt5-update 2018-06-29 02:38:19 +02:00
Jonas Kvinge 5dbdcca54f Set empty string for sinks with default devices and auto sink 2018-06-14 21:39:16 +01:00
Jonas Kvinge f3aab34d3a Add ALSA Device Finder (#6079) 2018-06-13 09:56:42 +01:00
Jonas Kvinge 925e74f909 Fix crash when uridecodebin fails. (#6077)
Let's the user see the error message what failed instead of Clementine crashing.

Also don't do gst_object_unref unless bin is set.
This fixes GStreamer-CRITICAL gst_object_unref: assertion 'object != NULL' failed
2018-06-06 23:53:25 +01:00
Chocobozzz 70f68b1926
Merge remote-tracking branch 'upstream/master' into qt5 2018-02-01 09:50:42 +01:00
benpicco 27bef68cf6 Attempt to reload stream on "Server does not support seeking." error (#5923)
When the network connection changes while playing an HTTP stream, I always get the "Server does not support seeking." error from GStreamer.
It seems like GStreamer tries to seek on reconnect, which fails, an propagates the error to Clementine which in turn ceases playback with
the error message handed through from GStreamer, even though there is now a perfectly fine network connection again.

As a workaround, try to reload the stream when this error occurs.

fixes #5116
2017-12-11 00:13:30 +00:00
Florian Bigard 69b2a832db Merge branch 'master' into qt5 2017-01-18 15:57:07 +01:00
Santiago Gil d3898d2f47 Add dialog to display streams' audio details (#5547)
* Add Stream Details window

* Fix capitalization in StreamDiscoverer::Discover()

* StreamDiscoverer::Discover(): get URL by const reference

* Refactor StreamDiscoverer::Discover

* Rename StreamDiscoverer callbacks

* StreamDiscoverer::OnDiscovered: fix nullptr comparison

* StreamDiscoverer: rename DiscoverFinished signal

* StreamDiscoverer::DataReady: receive const reference

* StreamDiscoverer: Remove unsigned types

* StreamDetailsDialog: rename Close slot

* StreamDetailsDialog: rename ui pointer to ui_

* MainWindow::ShowStreamDetails: receive a const reference

* StreamDetailsDialog: use unique_ptr, remove unsigned types
2016-12-21 16:57:04 +00:00
Chocobozzz ff7026c9fe Merge remote-tracking branch 'upstream/master' into qt5 2015-12-13 20:05:12 +01:00
John Maguire 2d61fe6c87 Changed my mind about automatically passing QFutures. 2015-11-27 12:04:14 +00:00
Arnaud Bienner ec98a68c3d Update SLOT signatures.
There weren't update as part of commit 33494dcddcb64f9fccae215f1100cfa885c72039: this prevented the slider to be updated, among other things.
2015-11-27 11:44:59 +01:00
John Maguire 33494dcddc Remove BoundFutureWatcher 2015-11-26 18:53:42 +00:00
Chocobozzz 631a6cdabd Merge branch 'master' into qt5 2015-09-16 17:40:54 +02:00
Mark Furneaux e9494af3f7 Add sample rate selection
This change provides the ability to set a fixed pipeline sample rate as an alternate to automatically negotiating it.
This can be useful on systems with sound cards that work at a fixed rate, as well as it can triage issues (on Windows)
where changing tracks hangs due to a problem with gstreamer's caps negotiation.
2015-07-09 22:19:31 -04:00
Eduardo Sánchez Muñoz 4af4e185da Fix song continuously rewinding when seeking using keyboard arrow keys. 2015-07-01 20:24:17 +02:00
Mark Furneaux f4b7c22bc2 Revert "Revert "Add track intro mode""
This reverts commit ece262f7f4.
2015-06-15 16:27:40 -04:00
John Maguire ece262f7f4 Revert "Add track intro mode" 2015-06-15 15:49:08 -04:00
Mark Furneaux b57cebbf2d Add track intro mode
This repeat mode plays the beginning of each track, good for quickly getting a feel for a new album for example.
2015-06-14 13:32:58 -04:00
Chocobozzz 5aec1c0e24 Merge remote-tracking branch 'upstream/master' into qt5
Update qt version to 5.4.2
2015-06-03 22:57:58 +02:00
John Maguire 8d2e3373a8 Use a GTlsDatabase for gstreamer SSL on mac. 2015-04-27 11:21:22 +01:00
Chocobozzz e986ab5a4b Merge master branch and adapt it to qt5 2015-04-16 17:16:34 +02:00
Chocobozzz 8b226c2171 Update non optionnals sources to qt5 2015-04-11 23:24:07 +02:00
Andreas ec35688c86 Fix crash when stopping a track while a fadeout to pause is occuring. Fixes #4800. 2015-04-11 11:30:28 +02:00
Arnaud Bienner f3426c05c7 Don't call gst_deinit when exiting Clementine.
It sometimes cause a deadlock since we migrated to GStreamer 1.0.
And it seems we shouldn't need to call it as we are "a normal application":
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-Gst.html#gst-deinit
2015-03-25 22:23:13 +01:00
Mark Furneaux 3be48f8f44 unref buffers going to analyser at the right time
This unrefs the buffer after the last chunk is pulled from it.
2014-10-04 10:39:33 -04:00
Mark Furneaux e8c2b4b267 Fix missing buffers sent to analyzer
This is a regression in the upgrade to gstreamer1.0.
The gst_buffer_unref() is incorrect as it removes the buffer when it is still needed by the chunker.
Forcing the pointer to be null prevents it from segfaulting but causes it to skip all chunks in the buffer, dropping the framerate and causing a worse case of #4321.
Removing these 2 lines restores original functionality.
2014-10-03 20:53:07 -04:00
David Sansome 6b32ecec27 Various bits for gstreamer-1.0 compatability 2014-09-21 19:38:13 +10:00
David Sansome 50551d987a Rewrite moodbar stuff for gstreamer-1.0:
- Rewrite gstspectrum (1.0) to use FFTW (2x faster) and emit raw magnitude
  values (not log scaled).
- Rewrite the moodbar generation code to be somewhat understandable, and
  do it in Clementine instead of gstreamer.
2014-09-21 19:38:13 +10:00
David Sansome 6bb81328e8 Merge branch 'master' into gstreamer-1.2
Conflicts:
	ext/clementine-spotifyblob/mediapipeline.cpp
	gst/moodbar/gstfftwspectrum.c
	src/core/songloader.cpp
	src/core/songloader.h
	src/engines/gstengine.cpp
	src/engines/gstenginepipeline.cpp
	src/moodbar/moodbarpipeline.cpp
	src/musicbrainz/chromaprinter.cpp
	src/transcoder/transcoder.cpp
	src/ui/mainwindow.cpp
	src/visualisations/projectmvisualisation.cpp
2014-06-09 16:20:24 +10:00
David Sansome 1e3cfb0a2c Don't try to update the scope if there's no buffer yet. Fixes #4388 2014-06-02 12:46:45 +10:00
David Sansome 162b2efbb0 If we don't know the length of a song from the metadata, get it from the pipeline which has the real length. Fixes #2818 when the length isn't in the podcast metadata. 2014-05-29 21:33:53 +10:00
Mark Furneaux 84434fd84e Fix dbz possibility with small buffers at end of track
There was a possibility of a dbz when a buffer sent to the
analyzer was shorter than 1ms long, such as what may happen at the end
of a track when stopping. This patch guards against this.
2014-05-17 14:38:46 -04:00
Mark Furneaux 8f9229d7c9 Apparently I'm blind. (Refactoring) 2014-05-03 09:28:07 -04:00
Mark Furneaux 00a1fe1e32 Refactoring 2014-05-03 09:14:15 -04:00
Mark Furneaux 6c653e5ba2 Synchronize buffer chunks with audio stream
The chunks are now determined by the density of data in the buffer
to the length of audio in the buffer. The chunk length can change
size so that the audio that is analysed is exactly what is being played
at the instant the frame is requested.
2014-04-30 14:18:39 -04:00
Mark Furneaux ee7fed36bc Fix pointer arithmetic when seeking buffers
It's possible the sample type will change, so best to not use
a fixed value.
2014-04-30 10:00:58 -04:00
Mark Furneaux 53f21584e4 Fix inconsistent buffer sizes sent to analyzer
The analyzers are sent new buffers of audio data to process each time
they pass through the gst pipeline. Different file formats and bit depths/
sample rates can change the size of these buffers, in some cases making them
large and therefore infrequent. This causes choppiness in the analyzer
as it is not getting new data with every frame. This patch chunks the buffers
coming off the pipeline to correspond with the framerate of the analyzer.
2014-04-29 21:38:21 -04:00