Add gpodder-mplayer wrapper script for Maemo
This allows full-screen cropped playback for YouTube 3gp videos on Maemo by cropping the video to fit the screen.
This commit is contained in:
parent
d94251bc42
commit
b78a753567
3 changed files with 21 additions and 2 deletions
9
data/maemo/gpodder-mplayer
Executable file
9
data/maemo/gpodder-mplayer
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
# Small wrapper to crop widescreen Youtube 3gp videos (and others)
|
||||
# Used by gPodder if available and player is set to "mplayer"
|
||||
# Thomas Perl <thpinfo.com> 2009-09-09
|
||||
|
||||
CROP_PARAM=`mplayer -ss 5 -frames 5 -vo null -ao null -vf cropdetect "$1" 2>/dev/null | grep -o -- '-vf crop=[^)]*' | tail -n1`
|
||||
|
||||
mplayer $CROP_PARAM "$1"
|
||||
|
6
setup.py
6
setup.py
|
@ -94,6 +94,7 @@ if target == DEFAULT:
|
|||
packages += [
|
||||
'gpodder.gtkui.desktop',
|
||||
]
|
||||
additional_scripts = []
|
||||
elif target == MAEMO:
|
||||
data_files += [
|
||||
('share/gpodder/ui/maemo', inst_share_ui_maemo),
|
||||
|
@ -105,6 +106,9 @@ elif target == MAEMO:
|
|||
packages += [
|
||||
'gpodder.gtkui.maemo',
|
||||
]
|
||||
additional_scripts = [
|
||||
'data/maemo/gpodder-mplayer',
|
||||
]
|
||||
|
||||
author, email = re.match(r'^(.*) <(.*)>$', gpodder.__author__).groups()
|
||||
|
||||
|
@ -117,7 +121,7 @@ setup(
|
|||
author = author,
|
||||
author_email = email,
|
||||
url = gpodder.__url__,
|
||||
scripts = glob.glob('bin/*'),
|
||||
scripts = glob.glob('bin/*') + additional_scripts,
|
||||
data_files = data_files + translation_files
|
||||
)
|
||||
|
||||
|
|
|
@ -1331,7 +1331,8 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
shutil.rmtree(ddir, ignore_errors=True)
|
||||
|
||||
def streaming_possible(self):
|
||||
return self.config.player and self.config.player != 'default'
|
||||
return self.config.player and self.config.player != 'default' and \
|
||||
gpodder.interface != gpodder.MAEMO
|
||||
|
||||
def playback_episodes_for_real(self, episodes):
|
||||
groups = collections.defaultdict(list)
|
||||
|
@ -1343,6 +1344,11 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
if file_type == 'video' and self.config.videoplayer and \
|
||||
self.config.videoplayer != 'default':
|
||||
player = self.config.videoplayer
|
||||
if gpodder.interface == gpodder.MAEMO:
|
||||
# Use the wrapper script if it's installed to crop 3GP YouTube
|
||||
# videos to fit the screen (looks much nicer than w/ black border)
|
||||
if player == 'mplayer' and util.find_command('gpodder-mplayer'):
|
||||
player = 'gpodder-mplayer'
|
||||
elif file_type == 'audio' and self.config.player and \
|
||||
self.config.player != 'default':
|
||||
player = self.config.player
|
||||
|
|
Loading…
Reference in a new issue