本文整理匯總了Python中pitivi.timeline.timeline.Timeline.updateVideoCaps方法的典型用法代碼示例。如果您正苦於以下問題:Python Timeline.updateVideoCaps方法的具體用法?Python Timeline.updateVideoCaps怎麽用?Python Timeline.updateVideoCaps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pitivi.timeline.timeline.Timeline
的用法示例。
在下文中一共展示了Timeline.updateVideoCaps方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Project
# 需要導入模塊: from pitivi.timeline.timeline import Timeline [as 別名]
# 或者: from pitivi.timeline.timeline.Timeline import updateVideoCaps [as 別名]
#.........這裏部分代碼省略.........
@type factory: L{TimelineSourceFactory}
@ivar format: The format under which the project is currently stored.
@type format: L{FormatterClass}
@ivar loaded: Whether the project is fully loaded or not.
@type loaded: C{bool}
Signals:
- C{loaded} : The project is now fully loaded.
"""
__signals__ = {
"settings-changed" : ['old', 'new'],
"project-changed" : [],
}
def __init__(self, name="", uri=None, **kwargs):
"""
@param name: the name of the project
@param uri: the uri of the project
"""
Loggable.__init__(self)
self.log("name:%s, uri:%s", name, uri)
self.name = name
self.settings = None
self.description = ""
self.uri = uri
self.urichanged = False
self.format = None
self.sources = SourceList()
self.sources.connect("source-added", self._sourceAddedCb)
self.sources.connect("source-removed", self._sourceRemovedCb)
self._dirty = False
self.timeline = Timeline()
self.factory = TimelineSourceFactory(self.timeline)
self.pipeline = Pipeline()
self.view_action = ViewAction()
self.view_action.addProducers(self.factory)
self.seeker = Seeker(80)
self.settings = ExportSettings()
self._videocaps = self.settings.getVideoCaps()
def release(self):
self.pipeline.release()
self.pipeline = None
#{ Settings methods
def getSettings(self):
"""
return the currently configured settings.
"""
self.debug("self.settings %s", self.settings)
return self.settings
def setSettings(self, settings):
"""
Sets the given settings as the project's settings.
@param settings: The new settings for the project.
@type settings: ExportSettings
"""
assert settings
self.log("Setting %s as the project's settings", settings)
oldsettings = self.settings
self.settings = settings
self._projectSettingsChanged()
self.emit('settings-changed', oldsettings, settings)
#}
#{ Save and Load features
def setModificationState(self, state):
self._dirty = state
if state:
self.emit('project-changed')
def hasUnsavedModifications(self):
return self._dirty
def _projectSettingsChanged(self):
settings = self.getSettings()
self._videocaps = settings.getVideoCaps()
if self.timeline:
self.timeline.updateVideoCaps(self._videocaps)
for fact in self.sources.getSources():
fact.setFilterCaps(self._videocaps)
if self.pipeline.getState() != gst.STATE_NULL:
self.pipeline.stop()
self.pipeline.pause()
def _sourceAddedCb(self, sourcelist, factory):
factory.setFilterCaps(self._videocaps)
def _sourceRemovedCb(self, sourclist, uri, factory):
self.timeline.removeFactory(factory)