class video_thread

video_thread is (maybe virtual) base class that hide actual implementation of video input

Inheritance:


Public Methods

video_thread( int argc, char **argv )
static video_thread* create_instance( int argc, char **argv )
select proper derived class based on argv parameters
static void video_thread_entry_func( void *_instance )
this is thread start function - single (of course) for all derived classes
virtual ~video_thread()
clean-up; actually do nothing - child class must perform actual work
virtual void shutdown()
virtual bool is_shutdown_performed()
the video hardware is sensetive to proper clean-up
void reschedule_broadcast_target( broadcast_target *target )
remove this target from the active queue and put it back into the queue
virtual void shutdown_requested()
call from outside: all that calls must be sinchronized with mutexes
virtual void start_capture()
start
virtual void stop_capture()
stop
void add_broadcast_target( int pushserv_id, const Sockaddr &control_addr, const Sockaddr &data_addr )
get a broadcast target from outside thread and place into queue
void new_text_data( text_data *data )
pass new text data to video thread

Protected Fields

bool shutdown_now
set this flag from other threads to stop the job
bool shutdown_performed
to never shutdown twice
mutex shutdown_mutex
mutex to lock shutdown procedure
typedef std::list < broadcast_target * > broadcast_targetsT
broadcast_targetsT broadcast_targets
list of all targets for broadcasting
typedef std::queue < broadcast_target * > add_target_queueT
add_target_queueT add_target_q
put in queue all hosts to set-up broadcasting
Timeval target_reconnect_time
when to reconnect if failed
typedef std::queue < Sockaddr > target_queueT
target_queueT drop_target_q
put in queue all hosts to drop broadcasting
mutex add_drop_target_mutex
lock the add/drop target operation
std::queue < text_data * > new_text
queue of text data to be sent with video packets
mutex lock_new_text
access to the queue is shared

Protected Methods

virtual void init()
raise exception if something wrong
virtual void loop()
this call loops forever until some exception, which must indicate what to do next
virtual void check_for_new_data()
load data from video card and dump it to all broadcast targets
void check_for_add_drop_targets()
check for adding/dropping targets

Documentation

video_thread is (maybe virtual) base class that hide actual implementation of video input. The first implementation will be Mpegator board under NT OS. Hope to see the support for real OS's...
bool shutdown_now
set this flag from other threads to stop the job

bool shutdown_performed
to never shutdown twice

mutex shutdown_mutex
mutex to lock shutdown procedure

typedef std::list < broadcast_target * > broadcast_targetsT

broadcast_targetsT broadcast_targets
list of all targets for broadcasting

typedef std::queue < broadcast_target * > add_target_queueT

add_target_queueT add_target_q
put in queue all hosts to set-up broadcasting

Timeval target_reconnect_time
when to reconnect if failed

typedef std::queue < Sockaddr > target_queueT

target_queueT drop_target_q
put in queue all hosts to drop broadcasting

mutex add_drop_target_mutex
lock the add/drop target operation

std::queue < text_data * > new_text
queue of text data to be sent with video packets

mutex lock_new_text
access to the queue is shared

video_thread( int argc, char **argv )

static video_thread* create_instance( int argc, char **argv )
select proper derived class based on argv parameters. By default - mpegator board

static void video_thread_entry_func( void *_instance )
this is thread start function - single (of course) for all derived classes

virtual ~video_thread()
clean-up; actually do nothing - child class must perform actual work

virtual void shutdown()

virtual bool is_shutdown_performed()
the video hardware is sensetive to proper clean-up. In particular, Mpegator driver may ( and usually do ) crash NT when it is initialised after improper shutdown. The problem is that 3-rd party drivers are allowed to execute in core of Windows NT kernel

virtual void init()
raise exception if something wrong

virtual void loop()
this call loops forever until some exception, which must indicate what to do next

virtual void check_for_new_data()
load data from video card and dump it to all broadcast targets

void check_for_add_drop_targets()
check for adding/dropping targets

void reschedule_broadcast_target( broadcast_target *target )
remove this target from the active queue and put it back into the queue

virtual void shutdown_requested()
call from outside: all that calls must be sinchronized with mutexes

virtual void start_capture()
start

virtual void stop_capture()
stop

void add_broadcast_target( int pushserv_id, const Sockaddr &control_addr, const Sockaddr &data_addr )
get a broadcast target from outside thread and place into queue

void new_text_data( text_data *data )
pass new text data to video thread. This call should never be blocked by any I/O - only place pointer into queue. The queue is protected by mutex and mutex should never lock the queue while any I/O on the way


Direct child classes:
mpegator

alphabetic index html hierarchy of classes or java



This page was generated with the help of DOC++.