[pitivi] SingleDecodeBin: Cache globally the list of usable gst.ElementFactory
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] SingleDecodeBin: Cache globally the list of usable gst.ElementFactory
- Date: Sat, 5 Sep 2009 15:20:12 +0000 (UTC)
commit a166633f81052b2a003fcfb40375e92ff736c456
Author: Edward Hervey <bilboed bilboed com>
Date: Fri Sep 4 15:59:58 2009 +0200
SingleDecodeBin: Cache globally the list of usable gst.ElementFactory
Otherwise this list gets recomputed/stored for every single instance of
singledecodebin used in the pitivi.
This is a speed and memory optimization.
pitivi/elements/singledecodebin.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/elements/singledecodebin.py b/pitivi/elements/singledecodebin.py
index 5399bca..b0eec7d 100644
--- a/pitivi/elements/singledecodebin.py
+++ b/pitivi/elements/singledecodebin.py
@@ -56,6 +56,9 @@ class SingleDecodeBin(gst.Bin):
gst.PAD_SOMETIMES,
gst.caps_new_any())
)
+
+ _factories = []
+
def __init__(self, caps=None, uri=None, stream=None, *args, **kwargs):
gst.Bin.__init__(self, *args, **kwargs)
if not caps:
@@ -88,7 +91,8 @@ class SingleDecodeBin(gst.Bin):
self._validelements = [] #added elements
- self._factories = self._getSortedFactoryList()
+ if self._factories == []:
+ self._factories = self._getSortedFactoryList()
self.debug("stream:%r" % self.stream)
@@ -108,6 +112,7 @@ class SingleDecodeBin(gst.Bin):
Returns the list of demuxers, decoders and parsers available, sorted
by rank
"""
+ self.debug("getting factory list")
def _myfilter(fact):
if fact.get_rank() < 64 :
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]