summaryrefslogtreecommitdiffstats
path: root/src/plugins/resourcepolicy
Commit message (Collapse)AuthorAgeFilesLines
* Update license headers and add new license filesAntti Kokko2014-08-246-114/+66
| | | | | | | | | - 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>
* Implement more full resource policy features.Robin Burchell2014-08-043-18/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle released by manager properly. Signal resourcesReleasedByManager is different from signal handleResourcesLost and needs to be handled separately. Signal handleResourcesLost means some other client has acquired the resources, thus the resources are lost from us, but if the other client frees the resources, we will automatically get the resources back. With resourcesReleasedByManager we lose the resources, and resource manager releases them as well (same as if client would call release()), so only way to re-acquire resources in latter case is calling acquire() again. This distinction is useful for example in cases where user is listening to music with headphones connected and removes the headphones, then the music player shouldn't continue playback until user requests so. But if user is listening to music when phone call is received, it is convenient to resume the playback automatically after the call. * Implement availability changed. Availability changed is information whether resources the client is interested in are available (no higher priority resource classes have acquired the resources). * Implement missing resources released. Emit resourcesReleased signal when receiving corresponding signal from libresource-qt. * Add mechanism to change used resource class. Check for environment for special variable, and if the variable has proper data, use that as the resource class. Can be set with for example qputenv("NEMO_RESOURCE_CLASS_OVERRIDE", "game"); Change-Id: I8e92f40cc5c01b6b94f54c3fa0f7a07775e87df0 Done-with: Juho Hämäläinen <juho.hamalainen@tieto.com> Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Handle resource requests through singleton.Robin Burchell2014-06-045-79/+440
| | | | | | | | | | | | | | | | | | | | | Many applications have multiple objects dealing with audio, and each needs to request audio resources from resource policy manager. Resource policy manager handles audio resources per-manager. Each ResourceSet instance creates new manager, which causes applications having multiple audio objects to fight for the audio resources internally, even though the streams are played from the same process id. To overcome this in QtMultimedia applications, handle all ResourceSet operations through singleton. This way one client has only one manager id registered, and resource acquiring and releasing can be limited to only when no resources are acquired or all resources are freed. To reduce unnecessary noise from resource policy plugin to the clients, keep track of client states and only notify clients which themselves request for resources etc. Change-Id: Ifa4488a9f6298a3f601399e9d339f7bd819be757 Done-with: Juho Hämäläinen <juho.hamalainen@tieto.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Normalize signal & slot signatures in connectionThiago Macieira2014-02-031-1/+1
| | | | | | | Profiling shows Qt Creator spends 2% of its load time normalizing Change-Id: I1a4bef16be79ced35c47da865153ebe1bee22f9c Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Only acquire resources as required in gstreamer backend.Andrew den Exter2014-01-131-1/+2
| | | | | | | | | | | Make resources required for capture optional and disable just the capture features if they are not available, so the camera viewfinder can be displayed and images captured without blocking the music playback and the other way around. Change-Id: Ic9692195156d994ccd4a911ae41d2242a00d575b Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Implement resource policy plugin using libresourceqt.Robin Burchell2013-08-056-0/+371
This contains a new resource policy plugin, replacing the built-in code that was deleted when the plugin interface was removed in 138242fb2dc19438a0ead34b36af848800e27190 (which unfortunately did not provide a plugin). Change-Id: Iae7ed6edc330c69ca0c72d50bde6c7e12b8cca4e Reviewed-by: Andy Nichols <andy.nichols@digia.com>