summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp
Commit message (Collapse)AuthorAgeFilesLines
* GStreamer: add QT_GSTREAMER_PLAYBIN_AUDIOSINK env variablev5.9.0-beta2Yoann Lopes2017-04-071-1/+2
| | | | | | | | Allows to set a custom audio sink to be used by the media player, instead of the default 'autoaudiosink'. Change-Id: I13ea93a787ba6412a42bf48ecf7d3a822060cbe4 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-101-5/+5
|\ | | | | | | | | | | | | Conflicts: src/plugins/gstreamer/camerabin/camerabincontainer.h Change-Id: I4942d41d69112335fe0c994002f1b32ef3aad051
| * Use QT_CONFIG macro to check for featuresLars Knoll2017-02-271-5/+5
| | | | | | | | | | | | | | And remove many custom defines. Change-Id: I658cc8430d1d99ed3c0aafe03a77adce76621a29 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| * GStreamer: Only register one typefind functionChristian Strømme2016-12-141-10/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each time a GStreamer session was created it would register the same callback function, but each time with a new user data, which in our case was a pointer to the session. The pointer would then be used without verification of its validity. The problem with this is that the typefind function is static and used for all sessions, making multiple sessions impossible. The documentation for gst_type_find_register() also clearly specifies that the supplied user data needs to valid as long as the plugin is loaded, which of course was not the case. With this change only one callback function will be registered, and each session will register itself with a typefind delegate, that will keep track of sessions that are still alive. Note: This only makes sure that the typefind function is called on a valid session, it does not make sure that the type actually belong to the session, which is a separate issue. Task-number: QTBUG-50460 Change-Id: I20eeabfe4e85839e8845003298d6f64705c2e15e Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| * GStreamer: fix a memory leak in the media player sessionYoann Lopes2016-12-121-4/+6
| | | | | | | | | | | | | | A gchar* was never freed. Change-Id: Ib28fee3d13839bf15a9216bdcd5da68b6d1f904c Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | GStreamer: Remove typefind functionChristian Strømme2016-12-121-65/+12
|/ | | | | | | | | | The typefind function was not well suited for our use-case, as it can't be configured to work with multiple sessions. The detection of playlist resources has also been moved into the abstraction layer; making this implementation redundant. Change-Id: Ife04ffe91707665a36706330f89401b49248bf91 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Cleanup all maemo/meego specific codeLars Knoll2016-11-141-5/+0
| | | | | Change-Id: I6c6f28084c6b030928eebc53c5d0009b168ede6a Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-5/+14
|\ | | | | | | Change-Id: I2e4e9cca01d63ed0d1e7f71c7a58322390696036
| * GStreamer: fix GstAppSrc usage.Yoann Lopes2016-01-191-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow our GstAppSrc wrapper to be reconfigured with a new GstAppSrc object. This is necessary because that object changes every time playback is restarted, even for the same source. The consequence of not allowing the reconfigure was that playback for a given qrc media would only work the first time; any subsequent calls to play() would not work since our wrapper wouldn't know about the new GstAppSrc object and therefore wouldn't be able to produce any data. Also improved management of the wrapper lifecycle. Task-number: QTBUG-49531 Change-Id: I905afb6848cc7e9a563b4edc2c5875cdd7e53d21 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-191-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I324f65c61171f36641472964d095d72e452afb3a Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Gstreamer plugin: replace foreach with range-based forAnton Kudryavtsev2016-01-151-1/+2
|/ | | | | Change-Id: Ic6d0f9d6b45eae1cdadc46783cb6f5bb7c64ac8c Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* GStreamer: fix compilation with version < 0.10.31.Yoann Lopes2015-10-201-4/+4
| | | | | | | | | | Qt 5.4 and earlier required GStreamer 0.10.24 as minimum version. Qt 5.5 added code that requires 0.10.31, this code is now ifdef'd and we now support again 0.10.24. Task-number: QTBUG-48353 Change-Id: Ie708a33c0515874b003ce26a3400475075d316ca Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Update copyright headersAntti Kokko2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Fix initialization orderLaszlo Agocs2015-01-191-1/+1
| | | | | | | | | | | | | | | | | | | Avoid the following warning: In file included from qgstreamerplayersession.cpp:34:0: qgstreamerplayersession.h: In constructor ‘QGstreamerPlayerSession::QGstreamerPlayerSession(QObject*)’: qgstreamerplayersession.h:203:10: warning: ‘QGstreamerPlayerSession::m_usingColorspaceElement’ will be initialized after [-Wreorder] bool m_usingColorspaceElement; ^ qgstreamerplayersession.h:197:17: warning: ‘GstElement* QGstreamerPlayerSession::m_videoSink’ [-Wreorder] GstElement* m_videoSink; ^ qgstreamerplayersession.cpp:107:1: warning: when initialized here [-Wreorder] QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent) ^ Change-Id: Ic4dfe6ead19db8d581cc7de622f478e63524715b Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* GStreamer: port to 1.0.Yoann Lopes2014-11-271-114/+124
| | | | | | | | | | | | | | | 0.10 is still used by default. To enable GStreamer 1.0, pass GST_VERSION=1.0 to qmake for qtmultimedia.pro. Contributions from: Andrew den Exter <andrew.den.exter@qinetic.com.au> Ilya Smelykh <ilya@videoexpertsgroup.com> Jim Hodapp <jim.hodapp@canonical.com> Sergio Schvezov <sergio.schvezov@canonical.com> Change-Id: I72a46d1170a8794a149bdb5e20767afcc5b7587c Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Update license headers and add new license filesAntti Kokko2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Ied06887225df341064c12bcc14c259ae74116f2e Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix stuttering with RTSP streams.Andrew den Exter2014-06-261-0/+1
| | | | | | | | | Set the rtspsrc buffer-mode to 'slave' which is the default in gstreamer 1.0 and doesn't cause the stuttering apparent with the default buffer mode. Change-Id: I4241fbe638c176ad93f441a3f76a1041ef1cb6bb Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* GStreamer: disable clock syncing in video sink for live sources.Yoann Lopes2014-05-091-0/+1
| | | | | | Task-number: QTBUG-38465 Change-Id: Icdf2df36b9b3c09dd047e60ac24e221a3d233c6f Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* GStreamer: correctly get metadata from live sources.Yoann Lopes2014-04-091-10/+5
| | | | | | | | | | For some unknown reason, "iradio-mode" was set to false on the source element, which was preventing new metadata to be received when playing live streams. Task-number: QTBUG-37640 Change-Id: Ib90297e81e26a99c3dfc753bdcd5cbd1ee2f6764 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* GStreamer: each QMediaPlayer now has its own volume by default.Yoann Lopes2014-04-031-13/+48
| | | | | | | | | | | | | | | | | | | | | | | | We were using the volume property of GStreamer's playbin element to set the volume. This could behave differently depending on the system configuration; it could affect the system volume or the media player own audio stream. We now use a 'volume' element to do software attenuation on the audio data sent to the audio sink, it allows each QMediaPlayer to always have its own volume. To preserve the previous behavior, developers can set the QT_GSTREAMER_USE_PLAYBIN_VOLUME environment variable to true. [ChangeLog][QtMultimedia][GStreamer] QMediaPlayer::setVolume() doesn't change the system volume anymore (it could be the case before depending on the system configuration). Set the QT_GSTREAMER_USE_PLAYBIN_VOLUME environment variable to true to restore that behavior. Task-number: QTBUG-30317 Task-number: QTBUG-36511 Change-Id: Ia0249962a74ac21fb110fcb634c08706f8d5767a Reviewed-by: Wouter Huysentruit <wouter_huysentruit@hotmail.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* GStreamer: fix memory leaks.Yoann Lopes2014-03-211-5/+11
| | | | | | | Many GStreamer objects were not properly managed or never released. Change-Id: I38b3854e8b9e2264b5b647f331d3bb16b886e2d6 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* GStreamer: don't try to seek when it's not supported.Yoann Lopes2014-03-211-2/+2
| | | | | | | This eliminates warnings on the console. Change-Id: I6a0509dba4a0f7ec6fad33f8803be746f425a616 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* whitespace fixesOswald Buddenhagen2014-01-301-2/+2
| | | | | | | | remove trailing spaces & expand tabs. Change-Id: I05ef110abed90f13b47752760ffb4567a11a6a5e Reviewed-by: Yoann Lopes <yoann.lopes@digia.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
* Fix playback with exotic gstreamer pipelines.Andrew den Exter2014-01-131-1/+7
| | | | | | | | | | Extend the list of raw video formats, and allow the playbin flags to be overridden by an environment variable when the default isn't suitable for whatever reason. Change-Id: I4c7d821b0ce29f5ad2dc0341e378ffd17c489e98 Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Decouple qmediametadata.h from qmultimedia.hSze Howe Koh2013-05-141-0/+1
| | | | | | | | qmultimedia.h is included in more places, but qmediametadata.h is larger. This patch should reduce unnecessary #include-ing. Change-Id: I4a3d174bafc555d794bb75087c1f6b79745ae903 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: Ia8c1c38aba1544603fada8c414cc856f365fd15b Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix QGstreamerPlayerSession::availablePlaybackRanges()Andras Becsi2012-11-281-18/+15
| | | | | | | | | | | | | | | Since buffering information through buffering queries is only valid if progressive download buffering (on-disk caching) is enabled or local media is played and we explicitly disable on-disk buffering because of cleanup issues with gstreamer availablePlaybackRanges() always returns an empty range for online media. Seeking is also possible using http range requests therefore if valid playback ranges could not be determined we should return the [0..duration] range unless the source is a live stream or the duration is unknown. Change-Id: Idbebc0fdde5053c6f9c0b3794c6d122492c6239c Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Remove nonfunctional mediaDownloadEnabled propertyAndras Becsi2012-11-201-10/+3
| | | | | | | | | | | | | | I suppose this was introduced after an API freeze to try to support on-disk buffering but since the code does not set the GST_PLAY_FLAG_DOWNLOAD flag on the player element the feature is not only undocumented but also nonfunctional. If on-disk buffering is needed we should add proper API to enable/disable it for all backends which might be possible with Qt 5.1 the earliest. Change-Id: I6b42a06166509db0023a3e0263ecc3a36f0d2bdb Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Clean up QGstreamerPlayerSessionAndras Becsi2012-11-201-13/+3
| | | | | | | | Remove dead code and fix compiler warnings about unused and uninitialized variables. Change-Id: I809d905e13234db1dbc1b9c2a0ac887c5c712fc7 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Media is always set to be seekable with the gstreamer backendAndras Becsi2012-11-201-16/+9
| | | | | | | | | | | | | | Since the used mechanism for querying whether the media is seekable was unreliable the code has been commented out and the media always set to be seekable. Query for seeking capabilities after the duration is known in updateDuration() which retries to determine the duration multiple times if unsuccessful and use gst_query_parse_seeking to check if the media is seekable or not. Change-Id: I141dfb1616dc59f8c92a698ddb2867f63a2656b9 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Rename namespace QtMultimedia::MetaData -> QMediaMetaDataSze Howe Koh2012-11-061-1/+1
| | | | | | | | | | | | | | | | | | Main code, examples, tests and docs updated. Method: 1. Remove unused forward-declarations, "class QMediaMetaData" 2. Mass find+replace "QtMultimedia::MetaData" -> "QMediaMetaData" 3. Un-nest from the QtMultimedia namespace in qtmedianamespace.h For consistency (with minimal disruption), namespaces with a "Qt" prefix will be renamed. Also, Qt guidelines don't include nested namespaces (http://lists.qt-project.org/pipermail/development/2012-October/006756.html) Part of the Header Consistency Project (http://lists.qt-project.org/pipermail/development/2012-October/007570.html) Change-Id: I40e59c1cf58c1792725e735e9285c51bc5f226b1 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make QGstreamerPlayerSession 'VAAPI-aware'.Yoann Lopes2012-10-171-0/+79
| | | | | | | | | | | | | | | | At the moment the GStreamer player pipeline is not setup properly when the VAAPI plugin is available, resulting in no video being shown. Added 'video/x-surface' as one of the default raw formats for the decodebin. Don't use vaapidecode when the video sink is not compatible. This is a preliminary patch to support VAAPI. In the current state vaapidecode will never be used as none of our video sinks support the video/x-surface format. Change-Id: I39f339b483d4052dd1e29c2b0ef06343d5670224 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Id77334cfb15de096941c88e32d04ca07b4eb4709 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* GStreamer player session: remove code for old playbin.Lev Zelenskiy2012-05-141-147/+50
| | | | | | | We only support 'playbin2'. Change-Id: Ibe35f71377862cb83742c2f9b606c5e2fdd5199d Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* Update duration information after switching to PLAYING state.Lev Zelenskiy2012-05-111-1/+9
| | | | | | | | For rtsp streams duration information might not be available until playback starts. Change-Id: Id8829408a4bd2c0fc6a89f2d059d23a5a95d940e Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* QGStreamerPlayerSession: unref pads after using them.Lev Zelenskiy2012-05-111-4/+12
| | | | | Change-Id: I3eec73eca5c2da3c449f362da8639a6dfb52a9e9 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* Gst played: removed GST_SEEK_FLAG_ACCURATE flagDmytro Poplavskiy2012-05-101-2/+2
| | | | | | | | | | Forcing accurate seeking may be very slow for some files, it's not intended to be used with media players. Change-Id: I9fe759f6effa447a800aeea321cc46617c64866f Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com> Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com> Reviewed-by: Ling Hu <ling.hu@nokia.com>
* Split gstreamer plugin into smaller plugins providing fewer servicesJonas Rabbe2012-04-271-4/+4
| | | | | | | | | | | | | | The gstreamer blob has been split into four plugins: audiodecoder, camerabin, mediacapture, and mediaplayer. Note: camerabin is still disabled because it is untested camerabin2 implementation. A new qmake configuration use_gstreamer_camera has been introduced and is needed for the mediacapture plugin to expose the camera service. This configuration has been disabled by default. Shared functionality has been moved to the internal gsttools library. Change-Id: Ifb2604f440cfa97513d39f5d7978766c88eaec45 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* Make sure the audio/video availability information changes atomically.Michael Goddard2012-04-271-4/+8
| | | | | | | So there's a consistent picture of the stream availability. Change-Id: Id7ea166353c0151fcc11105a1e233e9fe8df9cc6 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* GStreamer backend: set initial volume and mute values.Lev Zelenskiy2012-04-051-9/+8
| | | | | | | | For each stream set initial volume to 100 and mute state to FALSE. Change-Id: I529a82c12f0fd65277f97193b3feed7f9782e4c0 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* Reset playbin state to NULL on end of stream signal.Lev Zelenskiy2012-04-051-0/+20
| | | | | | | | | | | | | According to GStreamer documentation "playbin should be set back to READY or NULL state, then the "uri" property should be set to the new location and then playbin be set to PLAYING state again." We reset playbin to NULL state and then call setMedia() again in case playback is restarted. Change-Id: If7efbf8d88e0aad461c3d1d8b802c6621af221f7 Reviewed-by: Mithra Pattison <mithra.pattison@nokia.com> Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* Fixed major mem leak of unfreed GstTagList when playing ogg files.bigbearzhu2012-04-041-0/+2
| | | | | | | | Could cause serious leak if ogg files contain coverart image. Should use gst_tag_list_fee to free the used taglist. Change-Id: I8f7b799729b84ad9a2ca45bc3e31f37a987a5885 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* Fixed: Streams information is not updated properly for RTSP streams.Lev Zelenskiy2012-03-281-1/+19
| | | | | | | | | | | Changes to QGstreamerPlayerSession: Handle video-changed, audio-changed, and text-changed signals. Call getStreamsInfo() to update streams information. Change-Id: I8bfead3268771245635424b5f1debff624bbe038 Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com> Reviewed-by: Ling Hu <ling.hu@nokia.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* QMediaPlayer: GStreamer backend changes for playlist support.Lev Zelenskiy2012-03-211-14/+65
| | | | | | | | Register type find function to check if unrecognized media is a playlist. Emit MediaIsPlaylist error and let frontend handle playlists. Change-Id: Ib17da1c46014ac3c0f2f48b75ea9de2f0428b573 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* Handle more errors from GStreamer.Michael Goddard2012-03-161-6/+7
| | | | | | | | | Corrupted etc files can throw GST_STREAM_ERROR_DECODE and those should generally stop playback. So now any error is fatal, not just the recognised ones. Change-Id: I7b6dd2a460d94f70c459a313a9d4dc84028f8002 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* GStreamer backend changes for media probing API.Lev Zelenskiy2012-02-161-3/+176
| | | | | | | | QGstreamerPlayerSession: Using GStreamer buffer probes to access media data. Change-Id: Ibc056283fdedaebba90456cc4e86ab63eae5f5f7 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I20e5215108c6ebd5f8474fed5c3665118e4791e6 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix some static analysis defects.Michael Goddard2012-01-251-6/+8
| | | | | | | | | A few silly errors, a few unlikely errors, a few changes that should not have resulted in a problem but makes the code clearer. Change-Id: Id2c82e9317d53822e4da13c94dec9595ea33b07a Reviewed-by: Ling Hu <ling.hu@nokia.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Ie8cd560b6d9a2c6e552b6be1ad8bc96c80a6535c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed metadata keys type from enum to QString.Dmytro Poplavskiy2012-01-201-4/+4
| | | | | | | | This allows to combine metaData and extendedMetaData and simplify metadata handling on both backend and application sides. Change-Id: I136eedc86c215be3485db101c43069ca7c82101b Reviewed-by: Michael Goddard <michael.goddard@nokia.com>