Digital Signal Processing Reference
In-Depth Information
3
Software Implementation
This solution mainly consists of three parts: audio module, video module and network
transmission module. As demonstrated in Fig. 4, the real-time monitoring software
application is implemented by creating three threads: AudioDaemon, VideoDaemon
and RtmpDaemon on the basis of Linux open source library.
Fig. 4. Software Overview
Thread AudioDaemon and VideoDaemon capture and encode audio and video data
respectively (video data encoded by DSP hardware), add timestamps to the encoded
audio and video encoded frames and submit them to Thread RtmpDaemon.
RtmpDaemon circularly packs data into RTMP packets and delivers them to RTMP
server. Data exchange between threads is implemented by reading and writing Buffer
queue AudioBuffer and VideoBuffer. With this asynchronous data exchanging me-
chanism, the influence of sending RTMP packets on AudioDaemon and VideoDae-
mon can be avoided.
3.1
Implementation of Audio Encoding
3.1.1 Audio Data Capturing
ALSA (Advanced Linux Sound Architecture) [8] used for audio capture, as shown in
Fig. 5, consists of a series of kernel drivers, API (application Program Interface) and
utilities for Linux audio. ALSA provides an API library called libasound to simplify
audio programming.
A typical audio capturing program [9] [10] implemented by calling API functions
in libasound is regularly as follows:
Search WWH ::




Custom Search