ccrtp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] starting threads from main.cpp


From: j.s.bach
Subject: [Ccrtp-devel] starting threads from main.cpp
Date: Fri, 11 Apr 2008 14:22:16 +0200 (CEST)

Hei All,

i have a problem related to "starting receiver/transmitter threads". I can't 
start a recorder thread(receiver), from my main procedure which lies in an 
other file(main class).

from main.cpp:

int main(int argc, char** argv){
//...

InetHostAddress* iha = filter_input(argv[2]);
AudioRecorder ar("/tmp/output",iha);

//....

// ar.start()    doesn't work have to call 'run'
ar.run();
}

For my test purposes, i set every kind of member in AudioRecorder class to 
publc, but i still 
can't call the AudioRecorder as thread.. Strange.  

Here is the declaration of Audiorecorder (AudioRecorder.h)

#ifndef _AUDIORECORDER_H_
#define _AUDIORECORDER_H_
    
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <ccrtp/rtp.h>
using namespace ost;
using namespace std;
   
#include "globals.h"
    
    
class AudioRecorder: public Thread, public TimerPort
{   
    
    public:
        char* client ;
        int rec_port ;
        InetHostAddress* local_ip ;
        RTPSession* rtp_socket ;
        ofstream* dump_file ;
                
    public:
        AudioRecorder(const char* filename, InetHostAddress* iha) ;
        virtual ~AudioRecorder() ;
        void run() ;
};              
                
                
#endif // _AUDIORECORDER_H_

To me from a point of oop, i create a recorder class which is an extension of 
Thread and start
it.  And that should work. I'd appriciate any hints.

Thanx in advance.

Cheers,











reply via email to

[Prev in Thread] Current Thread [Next in Thread]