From 442c6ec72cbafacbfb6044e1a80c6eaadf8f070e Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 25 Jul 2005 12:42:13 +0000 Subject: *** empty log message *** --- src/camera.cc | 55 +++++++++---------------------------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) (limited to 'src/camera.cc') diff --git a/src/camera.cc b/src/camera.cc index a9a0982..833b048 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.19 2005/07/25 12:42:13 deva + * *** empty log message *** + * * Revision 1.18 2005/06/16 21:28:57 deva * Rewrote thread object * Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to @@ -81,19 +84,14 @@ Camera::Camera(Info *ginfo) info = ginfo; } -void Camera::connect(const char *ip, const int port) +void Camera::connect(const char *ip, const int port, int width, int height) { initialized = false; pthread_mutex_init (&mutex, NULL); //mutex = PTHREAD_MUTEX_INITIALIZER; - /* - AVFormatContext *ifmtctx; - AVFormatContext *ofmtctx; - */ - running = 1; - // av_register_all(); + running = 1; encode_queue = new Queue(); // infinite size player_queue = new Queue(1); // fixed size of 1 @@ -108,60 +106,25 @@ void Camera::connect(const char *ip, const int port) player_queue, &mutex, &running); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (decoder)."); - return; - } - */ + encoder = new Encoder(info, ip, port, &encode_sem, encode_queue, &mutex, &running); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (encoder)."); - return; - } - */ + player = new Player(info, + width, height, &running, &player_sem, player_queue, &mutex); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (player)."); - return; - } - */ - // pthread_create (&decodetid, NULL, thread_run, decoder); decoder->run(); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (decoder thread)."); - return; - } - */ - // pthread_create (&encodetid, NULL, thread_run, encoder); encoder->run(); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (encoder thread)."); - return; - } - */ - // pthread_create (&playertid, NULL, thread_run, player); player->run(); - /* - if(errorstatus->hasError()) { - errorstatus->pushError("Camera initialization failed (player thread)."); - return; - } - */ + initialized = true; } -- cgit v1.2.3