Skip to content

Commit 6808a4f

Browse files
committed
Added some constants in state.py to configure capture size and FPS.
1 parent 79cc128 commit 6808a4f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

resources/lib/state.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
from hyperion.Hyperion import Hyperion
2828
from misc import log
2929
from misc import notify
30+
X_SIZE = 300
31+
Y_SIZE = 300
32+
SLEEP_PER_FRAME = 30
3033

3134
class DisconnectedState:
3235
'''
@@ -85,7 +88,7 @@ def __init__(self, settings):
8588

8689
# create the capture object
8790
self.__capture = xbmc.RenderCapture()
88-
self.__capture.capture(64, 64)
91+
self.__capture.capture(X_SIZE, Y_SIZE)
8992

9093
def __del__(self):
9194
'''Destructor
@@ -145,10 +148,10 @@ def execute(self):
145148
if self.__useLegacyApi:
146149
if self.__captureState != xbmc.CAPTURE_STATE_WORKING:
147150
#the current capture is processed or it has failed, we request a new one
148-
self.__capture.capture(64, 64)
151+
self.__capture.capture(X_SIZE, Y_SIZE)
149152

150153
#limit the maximum number of frames sent to hyperion
151-
xbmc.sleep(100)
154+
xbmc.sleep(SLEEP_PER_FRAME)
152155

153156
return self
154157

0 commit comments

Comments
 (0)