14 self.output_width = None
15 self.output_height = None
26 self.deinterlace = False
29 def get(self, with_binary):
32 # -vo x11 appears to be necessary to prevent unwanted hardware scaling
33 # -noaspect stops mplayer rescaling to the movie's specified aspect ratio
34 args = '-vo x11 -noaspect -ao pulse -noborder -noautosub -nosub -sws 10 '
35 args += '-geometry %d:%d ' % (self.position_x, self.position_y)
37 # Video filters (passed to -vf)
41 if self.crop_x is not None or self.crop_y is not None or self.crop_w is not None or self.crop_h is not None:
43 if self.crop_w is not None and self.crop_h is not None:
44 crop += '%d:%d' % (self.crop_w, self.crop_h)
45 if self.crop_x is not None and self.crop_x is not None:
46 crop += ':%d:%d' % (self.crop_x, self.crop_y)
49 if self.output_width is not None or self.output_height is not None:
50 filters.append('scale=%d:%d' % (self.output_width, self.output_height))
62 for i in range(0, len(pp)):
67 filters.append(pp_string)
71 for i in range(0, len(filters)):
73 if i < len(filters) - 1:
78 args += '-demuxer mov '
79 if self.delay is not None:
80 args += '-delay %f ' % float(args.delay)
81 if self.aid is not None:
82 args += '-aid %s ' % self.aid
87 data_specifier = 'dvd://%d -dvd-device \"%s\"' % (self.dvd_title, self.content)
89 data_specifier = '\"%s\"' % self.content
92 return 'mplayer %s %s' % (args, data_specifier)
94 return '%s %s' % (args, data_specifier)
96 def get_player(film, format):
99 cl.dvd_title = film.dvd_title
100 cl.content = film.content
101 cl.crop_w = film.width - film.left_crop - film.right_crop
102 cl.crop_h = film.height - film.top_crop - film.bottom_crop
103 cl.position_x = format.x
105 cl.position_x = format.x + config.LEFT_SCREEN_WIDTH
106 cl.position_y = format.y
107 cl.output_width = format.width
108 cl.output_height = format.height
109 cl.deinterlace = film.deinterlace
111 return mplayer.Player(cl.get(False))