Trees | Indices | Help |
---|
|
1 # -*- Mode: Python -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 import gst 19 20 from flumotion.common import errors, messages 21 from flumotion.common.i18n import N_, gettexter 22 from flumotion.component import feedcomponent 23 from flumotion.component.effects.videoscale import videoscale 24 from flumotion.component.effects.deinterlace import deinterlace 25 26 __all__ = ['Converter'] 27 __version__ = "$Rev$" 28 T_ = gettexter() 29 3032 logCategory = 'videoconvert' 337535 props = self.config['properties'] 36 deintMode = props.get('deinterlace-mode', 'auto') 37 deintMethod = props.get('deinterlace-method', 'ffmpeg') 38 39 if deintMode not in deinterlace.DEINTERLACE_MODE: 40 msg = "'%s' is not a valid deinterlace mode." % deintMode 41 raise errors.ConfigError(msg) 42 if deintMethod not in deinterlace.DEINTERLACE_METHOD: 43 msg = "'%s' is not a valid deinterlace method." % deintMethod 44 raise errors.ConfigError(msg)45 4850 self.deintMode = properties.get('deinterlace-mode', "auto") 51 self.deintMethod = properties.get('deinterlace-method', "ffmpeg") 52 self.width = properties.get('width', None) 53 self.height = properties.get('height', None) 54 self.widthCorrection = properties.get('width-correction', 8) 55 self.heightCorrection = properties.get('height-correction', 0) 56 self.is_square = properties.get('is-square', False) 57 58 identity = pipeline.get_by_name("identity") 59 # FIXME: The deinterlace effect uses a videorate which we don't want in 60 # the middle of a flow. 61 # Add deinterlace effect. Deinterlacing must always be done 62 # before scaling. 63 #deinterlacer = deinterlace.Deinterlace('deinterlace', 64 # identity.get_pad("src"), 65 # pipeline, self.deintMode, self.deintMethod) 66 #self.addEffect(deinterlacer) 67 #deinterlacer.plug() 68 # Add videoscale effect 69 videoscaler = videoscale.Videoscale('videoscale', self, 70 identity.get_pad("src"), pipeline, 71 self.width, self.height, self.is_square, False, 72 self.widthCorrection, self.heightCorrection) 73 self.addEffect(videoscaler) 74 videoscaler.plug()
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:14 2013 | http://epydoc.sourceforge.net |