~timo-jyrinki/ubuntu/trusty/pitivi/backport_utopic_fixes

« back to all changes in this revision

Viewing changes to pitivi/factories/test.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-05-26 15:29:58 UTC
  • mfrom: (3.1.20 experimental)
  • Revision ID: james.westby@ubuntu.com-20110526152958-90je1myzzjly26vw
Tags: 0.13.9.90-1ubuntu1
* Resynchronize on Debian
* debian/control:
  - Depend on python-launchpad-integration
  - Drop hal from Recommends to Suggests. This version has the patch applied
    to not crash without hal.
* debian/patches/01_lpi.patch:
  - launchpad integration  
* debian/rules:
  - Use gnome.mk so a translation template is built

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
import gst
25
25
from pitivi.factories.base import SourceFactory
 
26
from pitivi.factories.operation import EffectFactory
26
27
from pitivi.stream import VideoStream, AudioStream
27
28
 
28
29
class VideoTestSourceFactory(SourceFactory):
40
41
        bin = gst.Bin()
41
42
        videotestsrc = gst.element_factory_make('videotestsrc')
42
43
        videotestsrc.props.pattern = self.pattern
43
 
        capsfilter = gst.element_factory_make('capsfilter')
 
44
        capsfilter = gst.element_factory_make('capsfilter',
 
45
                "videotestsrc-capsfilter")
44
46
        capsfilter.props.caps = output_stream.caps.copy()
45
47
 
46
48
        bin.add(videotestsrc)
47
49
        bin.add(capsfilter)
48
 
        videotestsrc.link(capsfilter)
49
 
 
50
 
        target = capsfilter.get_pad('src')
 
50
        videotestsrc.link_pads_full("src", capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
 
51
 
 
52
        return bin
 
53
 
 
54
    def _makeStreamBin(self, output_stream):
 
55
        video_bin = SourceFactory._makeStreamBin(self, output_stream)
 
56
        capsfilter = video_bin.get_by_name("videotestsrc-capsfilter")
 
57
        queue = video_bin.get_by_name("internal-queue")
 
58
        capsfilter.link_pads_full("src", queue, "sink", gst.PAD_LINK_CHECK_NOTHING)
 
59
 
 
60
        capsfilter = video_bin.get_by_name("capsfilter-proj-settings")
 
61
        target = capsfilter.get_pad("src")
51
62
        ghost = gst.GhostPad('src', target)
52
 
        bin.add_pad(ghost)
53
 
 
54
 
        return bin
 
63
        video_bin.add_pad(ghost)
 
64
 
 
65
        return video_bin
 
66
 
 
67
    def _makeDefaultBin(self):
 
68
        return self._makeStreamBin(self.output_streams[0])
55
69
 
56
70
    def _releaseBin(self, bin):
57
71
        pass
77
91
        capsfilter.props.caps = output_stream.caps.copy()
78
92
 
79
93
        bin.add(audiotestsrc, ares, aconv, capsfilter)
80
 
        gst.element_link_many(audiotestsrc, aconv, ares, capsfilter)
 
94
        audiotestsrc.link_pads_full("src", aconv, "sink", gst.PAD_LINK_CHECK_NOTHING)
 
95
        aconv.link_pads_full("src", ares, "sink", gst.PAD_LINK_CHECK_NOTHING)
 
96
        ares.link_pads_full("src", capsfilter, "sink", gst.PAD_LINK_CHECK_NOTHING)
81
97
 
82
98
        target = capsfilter.get_pad('src')
83
99
        ghost = gst.GhostPad('src', target)
93
109
        props.update({"volume": None})
94
110
        return props
95
111
 
 
112
 
 
113
class TestEffectFactory(EffectFactory):
 
114
    def __init__(self, stream):
 
115
        EffectFactory.__init__(self, "identity", "identity")
 
116
 
 
117
        caps = gst.Caps('video/x-raw-rgb')
 
118
        self.addOutputStream(stream)
 
119
        self.addInputStream(stream)