Originally Posted by
deepbluesky
Ωστε το gstreamer φταει.
Ωραια λοιπον και μπορεις να μου πεις σε παρακαλω με τι τροπο μπορω να ανοιξω τα jpg/jpeg μεσω του Picture Player;
Φωτογραφιες τις οποιες εχω αποθηκευμενες στο εσωτερικο HDD τις δειχνει φυσικα αλλα τις απομακρυσμενες;
Δημιουργησα δοκιμαστικα ενα Σκιάθος.url ωστε να οδηγει στο
http://www.meteovolos.gr/skiathos.jpg ομως το Picture Player ειναι τυφλο ως προς αρχεια τυπου .url.
Δεν υπάρχει κάτι έτοιμο, θα πρέπει να το φτιάξεις.
Εδώ είναι η βάση σου για τις φωτογραφίες, κατεβάζει, κάνει refresh, εμφανίζει.
Code:
import os
import requests
# Plugin definition
from Plugins.Plugin import PluginDescriptor
from enigma import ePicLoad, eTimer
from Components.AVSwitch import AVSwitch
from Components.Label import Label
from Components.Pixmap import Pixmap
from Screens.Screen import Screen
from Tools.BoundFunction import boundFunction
class PictureCamera(Screen):
skin = """<screen position="center,center" size="800,600">
<widget name="title" position="10,0" size="790,60" halign="center" font="Regular;24" />
<widget name="pic" position="10,60" size="790,530" halign="center" transparent="1" alphatest="on" />
</screen>"""
def __init__(self, session):
Screen.__init__(self, session)
self['pic'] = Pixmap()
self['title'] = Label("TEST PIC")
self.cameraTimer = eTimer()
self.cameraTimer.timeout.callback.append(self.download)
self.cameraTimer.start(1)
def download(self):
print "[Camera] download"
self.cameraTimer.stop()
r = requests.get("http://www.meteovolos.gr/skiathos.jpg")
if r.status_code == 200:
open("/tmp/camera.jpg", "wb").write(r.content)
self.downloadFinished(None)
def downloadFinished(self, result):
image = '/tmp/camera.jpg'
if os.path.exists(image):
sc = AVSwitch().getFramebufferScale()
self.picloads = ePicLoad()
self.picloads.PictureData.get().append(self.FinishDecode)
self.picloads.setPara((
self['pic'].instance.size().width(),
self['pic'].instance.size().height(),
sc[0], sc[1], False, 1, '#00000000'))
self.picloads.startDecode(image)
self.cameraTimer.start(60*1000)
def FinishDecode(self, picInfo = None):
ptr = self.picloads.getData()
if ptr:
self["pic"].instance.setPixmap(ptr.__deref__())
del self.picloads
os.remove('/tmp/camera.jpg')
def main(session, **kwargs):
session.open(PictureCamera)
def Plugins(path, **kwargs):
return [PluginDescriptor(name=_("Picture Camera"),
description=_("Picture Camera"),
icon="picam.png",
where=PluginDescriptor.WHERE_PLUGINMENU,
fnc=main)]
Καλή συνέχεια.