#include <audio.h>
Inherits RTP_Stream.
Inheritance diagram for Audio:
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 |
Definition at line 16 of file audio.h.
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] |
long Audio::sample_rate | ( | void | ) | [inline] |
long Audio::channels | ( | void | ) | [inline] |
bool Audio::present | ( | void | ) | [inline] |
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.
snd_pcm_t* Audio::capture_handle [protected] |
int Audio::rtc_fd [protected] |
short* Audio::sbuffer [protected] |
long Audio::sbuffer_len [protected] |
bool Audio::_present [protected] |
long Audio::_sample_rate [protected] |
long Audio::_channels [protected] |