aboutsummaryrefslogtreecommitdiff
path: root/xbmc/peripherals
AgeCommit message (Collapse)Author
2013-10-15PeripheralCecAdapter: use correct timeout checkKarlson2k
2013-10-02Allow WinEvents to observe Peripherals changesTrent Nelson
2013-10-02changed: use .empty() instead of testing for .size() > 0wsoltys
2013-09-30Merge pull request #3286 from ace20022/tokenizejmarshallnz
Move TokenizeStringUtils and replace CStdStrings by std::strings.
2013-09-30Faster substring comparisonsBen Avison
There were nearly 200 places in the code where testing for a substring was being performed using a construct of the form CStdString::Left(len).Equals("string") or the related CStdString methods Mid or Right. These are bad for performance because they involve allocating a heap block for the duration of the expression evaluation, for the purpose of holding the substring, and then freeing it again. These would need replacing anyway because CStdString is being phased out (PR #3225), and there is also the maintainability issue that developers need to keep the string lengths in step with the string literals. This latter point is also true of a number of instances in the code of std::string::compare(0, len, "string") == 0 Now that the StartsWith() and EndsWith() methods in StringUtils have been made more efficient, it is worth replacing both the above constructs with such calls. This patch does so, using the case-sensitive versions where std::string::compare was used, where the bUseCase parameter was specified true in Equals() calls, or where the string literal passed to Equals() contained no alphabetic characters. For the sake of compatibility, the remaining calls have been left using the case-insensitive versions ("NoCase" suffix to the method name), although these may be worth reviewing on a case-by-case basis. The majority of the changes here were achieved using a sophisticated search and replace, which will hopefully minimise any bugs introduced in the conversion. This patch is expected to have wide-reaching performance benefits. One benchmark (that can't pretend to exercise all ~200 improvements) is the time to open the songs library: on a Raspberry Pi, this patch improves this time by 12% (down from 13% for a previous version of this patch that also reduced the number of calls to tolower()).
2013-09-24Move Tokenize from Util to StringUtils and replace CStdString by std::string.ace20022
2013-09-12[cosmetic] rename non-member varCory Fields
2013-08-11[cosmetic] update copyright headersMartijn Kaijser
2013-08-04move IsPlaying-IsPaused-IsPlayingAudio-IsPlayingVideo to CApplicationPlayer ↵Voyager1
wrapper
2013-08-02fixed compiler warning, missing return valuedavilla
2013-07-25[cosmetics] update copyright headersM. Kaijser
2013-07-07Add new builtin, ToggleCECDevice, to control state of playing device via a ↵Javier Marcet
cec peripheral
2013-06-02changed, use TARGET_xxx, die _LINUX diedavilla
2013-06-02Merge pull request #2637 from dagwieers/rescan-intervalLars Op den Kamp
Raise USB and CEC rescan interval to 5 seconds
2013-06-01Merge pull request #2636 from dagwieers/peripheral-thread-namingjmarshallnz
Use different names for USB/CEC and Udev related threads
2013-05-15settings: move dependency logic from CGUIWindowSettingsCategory to ↵montellese
CSettingsManager
2013-05-01settings: replace CSettings and CGUISettings with new CSettingsmontellese
2013-04-20Use different names for USB/CEC and Udev related threadsDag Wieers
While debugging some rescanning issues, it helped to distinguish the different PeripheralBus threads. Since there is a limit to thread names, I had to make sure the name fitted into 15 characters. This is part of a series of PRs: #2323 and #2541 Before: ``` xbmc.bin-+-{EPGUpdater} |-{EventServer} |-2*[{PVRClient}] |-{PVRGUIInfo} |-{PVRManager} |-2*{PeripheralBus} <- |-{SoftAE} |-{TCPServer} |-5*[{XBPython}] `-8*[{xbmc.bin}] ``` After: ``` xbmc.bin-+-{EPGUpdater} |-{EventServer} |-2*[{PVRClient}] |-{PVRGUIInfo} |-{PVRManager} |-{PeripBusCEC} <- |-{PeripBusUSBUdev} <- |-{SoftAE} |-{TCPServer} |-5*[{XBPython}] `-8*[{xbmc.bin}] ```
2013-04-20Increase USB and CEC rescan interval to 5 secondsDag Wieers
In one of my investigations to see why XBMC performance is so bad (even when idle) I found one of the threads (in my case PeripheralBusCEC) scan a big sysfs tree recursively. On the 1Ghz AppleTV 1 device this would be about 2% of the CPU *every* second. For the USB thread we luckily have Udev events, but for CEC it is using sysfs polling which is quite expensive. It would be better to make use of Udev as well for CEC (where available) however 5 seconds should be fine for everyone. In my own builds I even brought it down to 30 seconds. Which means 29 seconds of reduced CPU usage. The CEC polling probably should be more restricted to specific sysfs sections, or preferably use Udev as well, when available. PS XBMC needs a special idle-state where it can turn down these expensive threads to make sure hardware can go into deeper sleep states. Especially for devices that doesn't do suspend for various reasons this is a requirement. (The ATV1 device for instance gets warm even when idle) If we can combine display-sleep with low-power states and a less expensive main-loop, that would be already quite an improvement without needing a complete refactoring of the code.
2013-04-09Merge pull request #2012 from jmarcet/masterMartijn Kaijser
Add new Built-In function to control attached CEC device
2013-04-10Add missing thread names, improve existing thread namesDag Wieers
This extends on the work of PR #2323. Since thread names are limited to 15 characters, we reduced the length of the name (removing starting C, get rid of spaces, remove trailing Thread, ...) where it made sense. ``` xbmc02:~ # pstree -p 715 xbmc.bin(715)-+-{EPGUpdater}(798) |-{EventServer}(790) |-{PeripheralBus}(778) |-{PeripheralBus}(779) |-{PVRAddon}(800) |-{PVRAddon}(932) |-{PVRGUIInfo}(933) |-{PVRManager}(799) |-{SoftAE}(777) |-{TCPServer}(791) |-{XBPython}(783) |-{XBPython}(784) |-{XBPython}(786) |-{XBPython}(787) |-{XBPython}(955) |-{XBPython}(972) `-{xbmc.bin}(792) ``` I would like to see more specific names for XBPython, PeripheralBus and PVRAddon. And also get rid of the remaining xbmc.bin thread name.
2013-04-08Add support for new libcec method, PowerOnScreensaverJavier Marcet
2013-04-08settings: move audio settings to CApplicationmontellese
2013-04-05Merge pull request #2530 from ulion/change_cfstring_to_utf8_stringMemphiz
[Fix] Change from DarwinCFStringRefToString to DarwinCFStringRefToUTF8String
2013-04-04cosmetics: cleanup unused Settings.h includesmontellese
2013-04-02[Fix] Change from DarwinCFStringRefToString to DarwinCFStringRefToUTF8String.ulion
2013-03-17fix: add missing include after reshuffle commit ↵Martijn Kaijser
16f276be317fa74efba6e5ddf16ec3f9bfba4b26
2013-03-12[cec] fixed compilation without libcec-dev on the system after ↵Lars Op den Kamp
95d87f545665674f76f691197bbad3360b807981. updated the method names of the dummy CPeripheralCecAdapter implementation so they match the ones in the real implementation
2013-03-12[cec] and let's init m_queryThread to NULL so we won't crash on exit when ↵Lars Op den Kamp
CEC has been disabled
2013-03-12[cec] extra guards around m_queryThreadLars Op den Kamp
2013-03-12[cec] cosmetics. made some methods private that don't need to be publicLars Op den Kamp
2013-03-12[cec] removed no longer used TranslateComPort()Lars Op den Kamp
2013-03-12[cec] removed dupe methods. if we really need that Sleep(), do it in ↵Lars Op den Kamp
CPeripherals instead
2013-03-10[cec] don't do another device scan when opening a connection to the adapter, ↵Lars Op den Kamp
just use the scan results that we already got. also fixes the wrong device name being opened when trying to connect to an RPi
2013-03-07[cec] prevent duplicate power on commands from being sentLars Op den Kamp
2013-03-07[cec] use client version 'current' now that libCEC 2.1.0 is being used. also ↵Lars Op den Kamp
fixes 'when the tv goes to standby' option being reset, since libCEC now checks the version correctly for that option
2013-03-05[peripherals] fixed CPeripheral::operator ==(const PeripheralScanResult& right)Lars Op den Kamp
2013-03-03settings: move GUIDialog* and GUIWindow* into their own sub-directoriesmontellese
2013-02-28[peripheral] support for multiple adapters of the same typeLars Op den Kamp
2013-02-28[cec] ensure that the updater thread has been stopped before trying to stop ↵Lars Op den Kamp
the main thread or we'll be waiting a long time to exit when the tv can't be polled
2013-02-28[peripherals] use a separate field for mapped bus types in ↵Lars Op den Kamp
PeripheralScanResult or setting won't be loaded
2013-02-28[peripherals] pass the full PeripheralScanResult to CPeripheral constructors ↵Lars Op den Kamp
(cleanup)
2013-02-28[cec] override the bus type, so users don't have to reconfigure their adaptersLars Op den Kamp
2013-02-28[peripherals] store the bus type in PeripheralScanResult so it can be overriddenLars Op den Kamp
2013-02-28[peripherals] update m_mappedType and m_strDeviceName in ↵Lars Op den Kamp
PeripheralScanResult in CPeripherals::GetMappingForDevice()
2013-02-28[peripherals] added fields m_mappedType and m_strDeviceName to ↵Lars Op den Kamp
PeripheralScanResult
2013-02-28[peripherals] pass the full scan result to CPeripherals::GetMappingForDevice()Lars Op den Kamp
2013-02-28[peripherals] removed unused constructorLars Op den Kamp
2013-02-28[peripherals] pass the full scan result to CPeripherals::CreatePeripheral()Lars Op den Kamp
2013-02-28[cec] get the CEC devices that are connected to the system from libCEC, ↵Lars Op den Kamp
rather than getting them from usb device scanning (or other methods). this way all adapters that libCEC supports are automatically supported by XBMC, without the need for specific device scanning code. bumped libCEC to 2.1.0