#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) |
bool | 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.
Definition at line 18 of file audio.cpp.
References _channels, RTP_Stream::_play, _present, RTP_Stream::_ptype, _sample_rate, capture_handle, DEV_HIST_NAME, RTP_Stream::init_pthread(), malloc(), rtc_fd, SAMPLE_CHANNELS, SAMPLE_RATE, sbuffer, sbuffer_len, RTP_Stream::SSRC, and RTP_Stream::stream_name.
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 95 of file audio.cpp.
References _present, 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 111 of file audio.cpp.
References _present, RTP_Stream::f_tv, and RTP_Stream::Stop().
Referenced by Streamer::handler().
long Audio::capture | ( | void | ) | [protected] |
Definition at line 121 of file audio.cpp.
References capture_handle, RTP_Stream::f_tv, sbuffer, and sbuffer_len.
Referenced by process().
bool Audio::process | ( | void | ) | [protected, virtual] |
Implements RTP_Stream.
Definition at line 166 of file audio.cpp.
References _channels, RTP_Stream::_ptype, _sample_rate, capture(), 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(), 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] |