Audio Class Reference

#include <audio.h>

Inherits RTP_Stream.

Inheritance diagram for Audio:

Inheritance graph
[legend]
Collaboration diagram for Audio:

Collaboration graph
[legend]

Public Member Functions

 Audio (bool enable, int sample_rate=SAMPLE_RATE, int channels=SAMPLE_CHANNELS)
virtual ~Audio (void)
long sample_rate (void)
long channels (void)
bool present (void)
void Start (string ip, long port)
void Stop (void)

Protected Member Functions

long capture (void)
long process (void)

Protected Attributes

int fd
snd_pcm_t * capture_handle
int rtc_fd
short * sbuffer
long sbuffer_len
bool _present
long _sample_rate
long _channels

Detailed Description

Definition at line 16 of file audio.h.


Constructor & Destructor Documentation

Audio::Audio ( bool  enable,
int  sample_rate = SAMPLE_RATE,
int  channels = SAMPLE_CHANNELS 
)

Definition at line 26 of file audio.cpp.

References _channels, RTP_Stream::_play, _present, RTP_Stream::_ptype, _sample_rate, capture_handle, D, RTP_Stream::init_pthread(), malloc(), rtc_fd, SAMPLE_CHANNELS, SAMPLE_RATE, sample_time, sbuffer, sbuffer_len, RTP_Stream::SSRC, RTP_Stream::stream_name, and t.

Audio::~Audio ( void   )  [virtual]

Definition at line 94 of file audio.cpp.

References _present, capture_handle, and rtc_fd.


Member Function Documentation

long Audio::sample_rate ( void   )  [inline]

Definition at line 20 of file audio.h.

References _sample_rate.

Referenced by Streamer::Main().

long Audio::channels ( void   )  [inline]

Definition at line 21 of file audio.h.

References _channels.

Referenced by Streamer::Main().

bool Audio::present ( void   )  [inline]

Definition at line 22 of file audio.h.

References _present.

Referenced by Streamer::Main().

void Audio::Start ( string  ip,
long  port 
)

Definition at line 101 of file audio.cpp.

References _present, D, RTP_Stream::f_tv, fd_stream, IOC_STREAM_GET_TIME, and RTP_Stream::Start().

Referenced by Streamer::handler(), and Streamer::Main().

void Audio::Stop ( void   )  [virtual]

Reimplemented from RTP_Stream.

Definition at line 117 of file audio.cpp.

References _present, D, RTP_Stream::f_tv, and RTP_Stream::Stop().

Referenced by Streamer::handler().

long Audio::capture ( void   )  [protected]

Definition at line 127 of file audio.cpp.

References capture_handle, RTP_Stream::f_tv, sbuffer, and sbuffer_len.

Referenced by process().

long Audio::process ( void   )  [protected, virtual]

Implements RTP_Stream.

Definition at line 173 of file audio.cpp.

References _channels, RTP_Stream::_ptype, _sample_rate, capture(), chunk, d, D, f, RTP_Stream::f_tv, LEN, memcpy(), RTP_Stream::packet_num, RTP_Stream::rtp_octets, RTP_Stream::rtp_packets, RTP_Stream::rtp_socket, sbuffer, Socket::send(), size, RTP_Stream::SSRC, time_plus(), and RTP_Stream::timestamp.


Field Documentation

int Audio::fd [protected]

Definition at line 28 of file audio.h.

snd_pcm_t* Audio::capture_handle [protected]

Definition at line 29 of file audio.h.

Referenced by Audio(), capture(), and ~Audio().

int Audio::rtc_fd [protected]

Definition at line 30 of file audio.h.

Referenced by Audio(), and ~Audio().

short* Audio::sbuffer [protected]

Definition at line 31 of file audio.h.

Referenced by Audio(), capture(), and process().

long Audio::sbuffer_len [protected]

Definition at line 32 of file audio.h.

Referenced by Audio(), and capture().

bool Audio::_present [protected]

Definition at line 33 of file audio.h.

Referenced by Audio(), present(), Start(), Stop(), and ~Audio().

long Audio::_sample_rate [protected]

Definition at line 34 of file audio.h.

Referenced by Audio(), process(), and sample_rate().

long Audio::_channels [protected]

Definition at line 35 of file audio.h.

Referenced by Audio(), channels(), and process().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 00:08:43 2008 for elphel by  doxygen 1.5.1