add freeBSD vlc support

This commit is contained in:
rimach 2011-12-08 21:51:44 +01:00
commit 1cffe2bffa
4 changed files with 16 additions and 8 deletions

View File

@ -720,8 +720,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
args = []
for a in self.arguments:
args.extend([a])
self.serviceManagerContents.loadFile(unicode(args[0],
sys.getfilesystemencoding()))
filename = args[0]
if not isinstance(filename, unicode):
filename = unicode(filename, sys.getfilesystemencoding())
self.serviceManagerContents.loadFile(filename)
elif QtCore.QSettings().value(
self.generalSettingsSection + u'/auto open',
QtCore.QVariant(False)).toBool():

View File

@ -311,8 +311,13 @@ class MediaController(object):
isValid = self.check_file_type(controller, display)
display.override[u'theme'] = u''
display.override[u'video'] = True
controller.media_info.start_time = display.serviceItem.start_time
controller.media_info.end_time = display.serviceItem.end_time
if controller.media_info.is_background:
# ignore start/end time
controller.media_info.start_time = 0
controller.media_info.end_time = 0
else:
controller.media_info.start_time = display.serviceItem.start_time
controller.media_info.end_time = display.serviceItem.end_time
elif controller.previewDisplay:
display = controller.previewDisplay
isValid = self.check_file_type(controller, display)

View File

@ -56,7 +56,7 @@ _internal_guard = object()
def find_lib():
dll = None
plugin_path = None
if sys.platform.startswith('linux'):
if sys.platform.startswith('linux') or sys.platform.startswith('freeBSD'):
p = find_library('vlc')
try:
dll = ctypes.CDLL(p)

View File

@ -116,12 +116,13 @@ class VlcPlayer(MediaPlayer):
# this is platform specific!
# you have to give the id of the QFrame (or similar object) to
# vlc, different platforms have different functions for this
if sys.platform == "linux2": # for Linux using the X Server
display.vlcMediaPlayer.set_xwindow(int(display.vlcWidget.winId()))
elif sys.platform == "win32": # for Windows
if sys.platform == "win32": # for Windows
display.vlcMediaPlayer.set_hwnd(int(display.vlcWidget.winId()))
elif sys.platform == "darwin": # for MacOS
display.vlcMediaPlayer.set_agl(int(display.vlcWidget.winId()))
else:
# for Linux using the X Server
display.vlcMediaPlayer.set_xwindow(int(display.vlcWidget.winId()))
self.hasOwnWidget = True
def check_available(self):