Skip to content

Commit 09c6670

Browse files
committed
Switch to using ffmpeg in place of PIL for all devices
1 parent 86d2a77 commit 09c6670

5 files changed

Lines changed: 34 additions & 5 deletions

File tree

main-ui/devices/muos/muos_anbernic_rgxx.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from devices.muos.muos_device import MuosDevice
99
from devices.utils.process_runner import ProcessRunner
1010
from utils import throttle
11+
from utils.ffmpeg_image_utils import FfmpegImageUtils
1112
from utils.logger import PyUiLogger
12-
from utils.pil_image_utils import PilImageUtils
1313
from utils.py_ui_config import PyUiConfig
1414

1515
class MuosAnbernicRGXX(MuosDevice):
@@ -130,8 +130,7 @@ def clear_framebuffer(self):
130130
ProcessRunner.run(["dd", "if=/dev/zero", "of=/dev/fb0", "bs=4096"])
131131

132132
def get_image_utils(self):
133-
#TODO see if ffmpeg is available
134-
return PilImageUtils()
133+
return FfmpegImageUtils()
135134

136135
def get_device_name(self):
137136
return self.device_name

main-ui/devices/muos/muos_device.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,21 @@ def take_snapshot(self, path):
344344
def get_save_state_image(self, rom_info: RomInfo):
345345
#TODO, where does it store this?
346346
return None
347+
348+
def get_wpa_supplicant_conf_path(self):
349+
return None
350+
351+
def supports_brightness_calibration(self):
352+
return False
353+
354+
def supports_contrast_calibration(self):
355+
return False
356+
357+
def supports_saturation_calibration(self):
358+
return False
359+
360+
def supports_hue_calibration(self):
361+
return False
362+
363+
def supports_qoi(self):
364+
return False

main-ui/menus/games/utils/daijisho_theme_index.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,20 @@ def _convert_if_needed(self, filename):
119119
Device.get_image_utils().convert_from_jpg_to_qoi(jpg_path, qoi_path)
120120
except Exception as e:
121121
PyUiLogger.get_logger().warning(
122-
f"Failed to convert {jpg_path} to PNG: {e}"
122+
f"Failed to convert {jpg_path} to qoi: {e}"
123123
)
124+
125+
try:
126+
png_filename = os.path.splitext(filename)[0] + ".png"
127+
png_path = os.path.join(self.foldername, png_filename)
128+
if not os.path.exists(qoi_path):
129+
Device.get_image_utils().convert_from_jpg_to_qoi(jpg_path, png_path)
130+
return png_path
131+
except Exception as pngE:
132+
PyUiLogger.get_logger().warning(
133+
f"Failed to convert {jpg_path} to PNG: {pngE}"
134+
)
135+
124136
return jpg_path # fallback: return original JPG
125137

126138
return qoi_path # Return full path to PNG

muOS/source/PyUI/setup/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ python3 pip_offline/pip-25.2-py3-none-any.whl/pip install --no-index --find-link
1616
python3 -m pip install --no-index --find-links=pip_offline pip setuptools wheel
1717

1818
# Step 2: Use pip via python to install your project dependencies
19-
python3 -m pip install --no-index --find-links=offline_packages psutil pyserial pillow pysdl2
19+
python3 -m pip install --no-index --find-links=offline_packages psutil pyserial pysdl2
2020

2121
echo "Offline installation completed successfully!"
2222

0 commit comments

Comments
 (0)