gmyth-stream/plugins/media/vlc.py
branchtrunk
changeset 481 6d00c497a403
parent 453 a806d8ad0ff0
     1.1 --- a/gmyth-stream/plugins/media/vlc.py	Tue Mar 27 00:13:27 2007 +0100
     1.2 +++ b/gmyth-stream/plugins/media/vlc.py	Tue Apr 03 14:56:51 2007 +0100
     1.3 @@ -1,30 +1,3 @@
     1.4 -'''
     1.5 - # GMyth-Stream
     1.6 - #
     1.7 - # @file main.py
     1.8 - #
     1.9 - # @brief <p> Plugin for GMyth-Stream
    1.10 - #
    1.11 - # Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
    1.12 - # @author Artur Duque de Souza <artur.souza@indt.org.br>
    1.13 - #
    1.14 - #
    1.15 - # This program is free software; you can redistribute it and/or modify
    1.16 - # it under the terms of the GNU Lesser General Public License as published by
    1.17 - # the Free Software Foundation; either version 2 of the License, or
    1.18 - # (at your option) any later version.
    1.19 - #
    1.20 - # This program is distributed in the hope that it will be useful,
    1.21 - # but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.22 - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.23 - # GNU General Public License for more details.
    1.24 - #
    1.25 - # You should have received a copy of the GNU Lesser General Public License
    1.26 - # along with this program; if not, write to the Free Software
    1.27 - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.28 - #
    1.29 - '''
    1.30 -
    1.31  import os
    1.32  import sys
    1.33  import time
    1.34 @@ -52,12 +25,12 @@
    1.35              self.path += " -I telnet -d 1> /dev/null 2> /dev/null &"
    1.36              os.system(self.path)
    1.37              sys.exit(0)
    1.38 -
    1.39 -        print "ESTOU EM PARENT 1"
    1.40 -        time.sleep(3)
    1.41 -        print "ESTOU EM PARENT 2"
    1.42 -        self.sock.connect( (self.host, self.port) )
    1.43 -        self.sock.send("%s\n" % self.pwd)
    1.44 +        else:
    1.45 +            print "ESTOU EM PARENT 1"
    1.46 +            time.sleep(3)
    1.47 +            print "ESTOU EM PARENT 2"
    1.48 +            self.sock.connect( (self.host, self.port) )
    1.49 +            self.sock.send("%s\n" % self.pwd)
    1.50  
    1.51  
    1.52      def insert_file(self, filename):
    1.53 @@ -65,20 +38,28 @@
    1.54          self.sock.send("setup output0 input %s\n" % filename)
    1.55  
    1.56  
    1.57 -    def setup(self, filename, codec, bitrate, width, height, port):
    1.58 +
    1.59 +    def setup(self, filename, mux, vcodec, vbitrate,\
    1.60 +              fps, acodec, abitrate, width, height, port):
    1.61  
    1.62          self.filename = filename
    1.63 -        self.codec = codec
    1.64 -        self.bitrate = int(bitrate)
    1.65 +        self.mux = mux
    1.66 +        self.vcodec = vcodec
    1.67 +        self.vbitrate = int(vbitrate)
    1.68 +        self.fps = int(fps)
    1.69 +        self.acodec = acodec
    1.70 +        self.abitrate = int(abitrate)
    1.71          self.width = int(width)
    1.72          self.height = int(height)
    1.73 +
    1.74          self.port = int(port)
    1.75  
    1.76 +
    1.77          self.pipe = "#transcode{vcodec=%s,vb=%d,"\
    1.78                      "fps=25.0,scale=1,acodec=mpga,"\
    1.79                      "ab=64,channels=1,width=%d,height=%d}"\
    1.80                      ":duplicate{dst=std{access=http,"\
    1.81 -                    "mux=mpeg1,dst=:%d}}" % (self.codec, self.bitrate,\
    1.82 +                    "mux=mpeg1,dst=:%d}}" % (self.vcodec, self.vbitrate,\
    1.83                                               self.widht, self.height,\
    1.84                                               self.port)
    1.85