summaryrefslogtreecommitdiff
path: root/src/camera.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera.cc')
-rw-r--r--src/camera.cc55
1 files changed, 9 insertions, 46 deletions
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<Frame>(); // infinite size
player_queue = new Queue<Frame>(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;
}