[pitivi: 3/4] Use match_stream_groups in SourceFactory.makeBin.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi: 3/4] Use match_stream_groups in SourceFactory.makeBin.
- Date: Tue, 2 Jun 2009 04:33:51 -0400 (EDT)
commit 0b3a7905d97528b4555e1fce76699dc9f4af8f0a
Author: Alessandro Decina <alessandro d gmail com>
Date: Mon Jun 1 13:30:03 2009 +0200
Use match_stream_groups in SourceFactory.makeBin.
---
pitivi/factories/base.py | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/pitivi/factories/base.py b/pitivi/factories/base.py
index 0f116c0..2da0d1f 100644
--- a/pitivi/factories/base.py
+++ b/pitivi/factories/base.py
@@ -28,6 +28,7 @@ import gst
from pitivi.log.loggable import Loggable
from pitivi.elements.singledecodebin import SingleDecodeBin
from pitivi.signalinterface import Signallable
+from pitivi.stream import match_stream_groups_map
# FIXME: define a proper hierarchy
class ObjectFactoryError(Exception):
@@ -228,15 +229,13 @@ class SourceFactory(ObjectFactory):
compatible_stream = None
self.debug("stream %r", output_stream)
+
if output_stream is not None:
- self.debug("streams %r", self.output_streams)
- for stream in self.output_streams:
- if output_stream.isCompatible(stream):
- compatible_stream = stream
- break
+ stream_map = match_stream_groups_map([output_stream], self.output_streams)
+ if output_stream not in stream_map:
+ raise ObjectFactoryError("can not create stream")
- if compatible_stream is None:
- raise ObjectFactoryError('can not create stream')
+ compatible_stream = stream_map[output_stream]
if self.max_bins != -1 and self.current_bins == self.max_bins:
raise ObjectFactoryError('no bins available')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]