Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Move TokenizeStringUtils and replace CStdStrings by std::strings.
|
|
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()).
|
|
|
|
|
|
|
|
wrapper
|
|
|
|
|
|
cec peripheral
|
|
|
|
Raise USB and CEC rescan interval to 5 seconds
|
|
Use different names for USB/CEC and Udev related threads
|
|
CSettingsManager
|
|
|
|
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}]
```
|
|
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.
|
|
Add new Built-In function to control attached CEC device
|
|
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.
|
|
|
|
|
|
[Fix] Change from DarwinCFStringRefToString to DarwinCFStringRefToUTF8String
|
|
|
|
|
|
16f276be317fa74efba6e5ddf16ec3f9bfba4b26
|
|
95d87f545665674f76f691197bbad3360b807981.
updated the method names of the dummy CPeripheralCecAdapter implementation so they match the ones in the real implementation
|
|
CEC has been disabled
|
|
|
|
|
|
|
|
CPeripherals instead
|
|
just use the scan results that we already got. also fixes the wrong device name being opened when trying to connect to an RPi
|
|
|
|
fixes 'when the tv goes to standby' option being reset, since libCEC now checks the version correctly for that option
|
|
|
|
|
|
|
|
the main thread or we'll be waiting a long time to exit when the tv can't be polled
|
|
PeripheralScanResult or setting won't be loaded
|
|
(cleanup)
|
|
|
|
|
|
PeripheralScanResult in CPeripherals::GetMappingForDevice()
|
|
PeripheralScanResult
|
|
|
|
|
|
|
|
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
|