예제 #1
0
def __test():
    """ test function """
    from raspiserver.utils import ConfigReader
    cfg_parser = ConfigReader('./config/raspicam.cfg')
    cfg = cfg_parser.parser()
    videocmd = RaspvidCmd(cfg.video)
    APPLOGGER.debug(videocmd.cmd())
예제 #2
0
def __run():
    """ test run """
    from raspiserver.utils import ConfigReader
    config_path = './config/raspicam.cfg'
    cfg_parser = ConfigReader(config_path)
    cfg = cfg_parser.parser()
    vodserve(cfg)
예제 #3
0
def __run():
    """ test run """
    from raspiserver.utils import ConfigReader
    config_path = './config/raspicam.cfg'
    cfg_parser = ConfigReader(config_path)
    cfg = cfg_parser.parser()
    vodserve(cfg)
예제 #4
0
def __test():
    """ test function """
    from raspiserver.utils import ConfigReader
    cfg_parser = ConfigReader('./config/raspicam.cfg')
    cfg = cfg_parser.parser()
    videocmd = RaspvidCmd(cfg.video)
    APPLOGGER.debug(videocmd.cmd())
예제 #5
0
 def test_post_start(self):
     """ test start command """
     resp = requests.post(self.test_url + '/start')
     self.assertEqual(resp.status_code, 200)
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     vvpmng = VideoProcessMng(cfg.video)
     self.assertEqual(resp.text, vvpmng.process_cmd.cmd())
     sleep(5)
예제 #6
0
def __run():
    """ test function """
    from raspiserver.utils import ConfigReader
    from raspiserver.recordmng import RecordMng
    from raspiserver.processmng import VideoProcessMng
    config_parser = ConfigReader('./config/raspicam.cfg')
    cfg = config_parser.parser()
    recmng = RecordMng(cfg.record)
    vvpmng = VideoProcessMng(cfg.video)
    httpserve(cfg, recmng, vvpmng)
예제 #7
0
def __run():
    """ test function """
    from raspiserver.utils import ConfigReader
    from raspiserver.recordmng import RecordMng
    from raspiserver.processmng import VideoProcessMng
    config_parser = ConfigReader('./config/raspicam.cfg')
    cfg = config_parser.parser()
    recmng = RecordMng(cfg.record)
    vvpmng = VideoProcessMng(cfg.video)
    httpserve(cfg, recmng, vvpmng)
예제 #8
0
 def setup_class(self):
     """ real setup """
     TestCase.setUp(self)
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     # test in local(Rpi)
     recmng = RecordMng(cfg.record)
     vvpmng = VideoProcessMng(cfg.video)
     self.testthr = threading.Thread(target=httpserve, \
                                     args=(cfg, recmng, vvpmng))
     self.testthr.setDaemon(True)
     self.testthr.start()
예제 #9
0
def __test():
    """ test func """
    from raspiserver.utils import ConfigReader
    cfg_parser = ConfigReader('./config/raspicam.cfg')
    cfg = cfg_parser.parser()
    recordmng = RecordMng(cfg.record)
    allfiles = recordmng.get_recordfiles()
    APPLOGGER.debug(allfiles)
    APPLOGGER.debug(len(allfiles))

    APPLOGGER.debug(recordmng.get_freespaces())
    APPLOGGER.debug(recordmng.have_space())
    recordmng.lefthrhold = 330
    recordmng.cycle = True
    APPLOGGER.debug(recordmng.have_space())
    APPLOGGER.debug(recordmng.gen_recordfname())
예제 #10
0
def __test():
    """ test func """
    from raspiserver.utils import ConfigReader

    cfg_parser = ConfigReader("./config/raspicam.cfg")
    cfg = cfg_parser.parser()
    recordmng = RecordMng(cfg.record)
    allfiles = recordmng.get_recordfiles()
    APPLOGGER.debug(allfiles)
    APPLOGGER.debug(len(allfiles))

    APPLOGGER.debug(recordmng.get_freespaces())
    APPLOGGER.debug(recordmng.have_space())
    recordmng.lefthrhold = 330
    recordmng.cycle = True
    APPLOGGER.debug(recordmng.have_space())
    APPLOGGER.debug(recordmng.gen_recordfname())
예제 #11
0
def main():
    """ serve for all """
    config_path = '/home/pi/server/config/raspicam.cfg'
    cfg_parser = ConfigReader(config_path)
    cfg = cfg_parser.parser()
    recmng = RecordMng(cfg.record)
    vvpmng = VideoProcessMng(cfg.video)
    global PROCESSMNG
    PROCESSMNG = vvpmng
    hyserve = HybirdServer()
    # you can start tcp server or http server
    try:
        hyserve.setservices('httpserver', httpserve, (cfg, recmng, vvpmng))
        hyserve.setservices('tcpserver', tcpserve, (cfg, recmng, vvpmng))
        hyserve.setservices('vodserver', vodserve, (cfg, ))
        hyserve.serve()
    except AppException as ex:
        APPLOGGER.error(ex)
예제 #12
0
def main():
    """ serve for all """
    config_path = '/home/pi/server/config/raspicam.cfg'
    cfg_parser = ConfigReader(config_path)
    cfg = cfg_parser.parser()
    recmng = RecordMng(cfg.record)
    vvpmng = VideoProcessMng(cfg.video)
    global PROCESSMNG
    PROCESSMNG = vvpmng
    hyserve = HybirdServer()
    # you can start tcp server or http server
    try:
        hyserve.setservices('httpserver', httpserve, (cfg, recmng, vvpmng))
        hyserve.setservices('tcpserver', tcpserve, (cfg, recmng, vvpmng))
        hyserve.setservices('vodserver', vodserve, (cfg,))
        hyserve.serve()
    except AppException as ex:
        APPLOGGER.error(ex)
예제 #13
0
    def test_config_reader(self):
        """ test get config """
        config = './config/raspicam.cfg'
        parser = ConfigReader(config)
        cfg = parser.parser()

        self.assertEqual(cfg.comm_port.tcp_port, 9999)
        self.assertEqual(cfg.comm_port.http_port, 8080)
        self.assertEqual(cfg.comm_port.vod_port, 9001)

        self.assertEqual(cfg.video.width, 1280)
        self.assertEqual(cfg.video.height, 800)
        self.assertEqual(cfg.video.bitrate, 4500000)
        self.assertEqual(cfg.video.brightness, 50)
        self.assertEqual(cfg.video.fps, 30)
        self.assertEqual(cfg.video.rtsp_port, 9000)

        self.assertEqual(cfg.record.base, "'/home/pi/records'")
        self.assertEqual(cfg.record.cycle, True)
        self.assertEqual(cfg.record.fsp_limit, 3700)
예제 #14
0
    def test_config_reader(self):
        """ test get config """
        config = './config/raspicam.cfg'
        parser = ConfigReader(config)
        cfg = parser.parser()

        self.assertEqual(cfg.comm_port.tcp_port, 9999)
        self.assertEqual(cfg.comm_port.http_port, 8080)
        self.assertEqual(cfg.comm_port.vod_port, 9001)

        self.assertEqual(cfg.video.width, 1280)
        self.assertEqual(cfg.video.height, 800)
        self.assertEqual(cfg.video.bitrate, 4500000)
        self.assertEqual(cfg.video.brightness, 50)
        self.assertEqual(cfg.video.fps, 30)
        self.assertEqual(cfg.video.rtsp_port, 9000)

        self.assertEqual(cfg.record.base, "'/home/pi/records'")
        self.assertEqual(cfg.record.cycle, True)
        self.assertEqual(cfg.record.fsp_limit, 3700)
예제 #15
0
 def setUp(self):
     cfg_parser = ConfigReader('./config/raspicam.cfg')
     cfg = cfg_parser.parser()
     self.recordmng = RecordMng(cfg.record)
예제 #16
0
 def __get_process_cmd(cls):
     """ get process_cmd """
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     vvpmng = VideoProcessMng(cfg.video)
     return vvpmng.process_cmd.cmd()
예제 #17
0
 def setUp(self):
     """ setup """
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     cmd = RaspvidCmd(cfg.video)
     self.cmd = cmd
예제 #18
0
 def setUp(self):
     """ setup """
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     self.procssmng = VideoProcessMng(cfg.video)
 def setUp(self):
     """ setup """
     config_parser = ConfigReader('/home/pi/server/config/raspicam.cfg')
     cfg = config_parser.parser()
     self.procssmng = VideoProcessMng(cfg.video)