diff -r 2b1824e138b1 -r 36720270b368 gmyth-stream/server/lib/transcoder.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gmyth-stream/server/lib/transcoder.py Thu Aug 30 12:51:31 2007 +0100 @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__author__ = "Gustavo Sverzut Barbieri / Artur Duque de Souza" +__author_email__ = "barbieri@gmail.com / artur.souza@indt.org.br" +__license__ = "GPL" +__version__ = "0.4" + +__all__ = ("Transcoder") + +class Transcoder(object): + """Transcoder's Class: parent class to implement + a plugin for transcoding data.""" + priority = 0 # negative values have higher priorities + name = None # to be used in requests + status = None + log = None + tid = -1 + + def __init__(self, params): + self.params = params + # __init__() + + def params_first(self, key, default=None): + if default is None: + return self.params[key][0] + else: + try: + return self.params[key][0] + except: + return default + # params_first() + + def get_mimetype(self): + return "application/octet-stream" + # get_mimetype() + + def start(self, outfile): + pass + # start() + + def stop(self): + pass + # stop() + + def get_legth (self): + pass + # get_leght () + + def get_progress (self): + pass + # get_progress () + + def __str__(self): + return '%s: %s( params=%s ) - Status: %s%%' % \ + (self.__class__.__name__, self.tid, + self.params, self.status) + # __str__() +# Transcoder