apps/camogm2/camogm_wav.c File Reference

#include <endian.h>
#include <byteswap.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "camogm_wav.h"
#include "camogm.h"
#include <alsa/asoundlib.h>

Include dependency graph for camogm_wav.c:

Go to the source code of this file.

Data Structures

struct  WaveHeader
struct  WaveFmtBody
struct  WaveChunkHeader

Defines

#define COMPOSE_ID(a, b, c, d)   ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))
#define LE_SHORT(v)   (v)
#define LE_INT(v)   (v)
#define BE_SHORT(v)   bswap_16(v)
#define BE_INT(v)   bswap_32(v)
#define WAV_RIFF   COMPOSE_ID('R','I','F','F')
#define WAV_WAVE   COMPOSE_ID('W','A','V','E')
#define WAV_FMT   COMPOSE_ID('f','m','t',' ')
#define WAV_DATA   COMPOSE_ID('d','a','t','a')
#define WAV_PCM_CODE   1

Functions

static int begin_wave (int fd, size_t cnt)
static void end_wave (int fd)
void wave_begin (const char *fname)
void wave_push (void *buf, int len)
void wave_end ()

Variables

long long fdcount = 0
int wave_fd


Define Documentation

#define BE_INT (  )     bswap_32(v)

Definition at line 20 of file camogm_wav.c.

#define BE_SHORT (  )     bswap_16(v)

Definition at line 19 of file camogm_wav.c.

#define COMPOSE_ID ( a,
b,
c,
d   )     ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24))

Definition at line 16 of file camogm_wav.c.

#define LE_INT (  )     (v)

Definition at line 18 of file camogm_wav.c.

Referenced by begin_wave(), and end_wave().

#define LE_SHORT (  )     (v)

Definition at line 17 of file camogm_wav.c.

Referenced by begin_wave().

#define WAV_DATA   COMPOSE_ID('d','a','t','a')

Definition at line 34 of file camogm_wav.c.

Referenced by begin_wave(), and end_wave().

#define WAV_FMT   COMPOSE_ID('f','m','t',' ')

Definition at line 33 of file camogm_wav.c.

Referenced by begin_wave().

#define WAV_PCM_CODE   1

Definition at line 35 of file camogm_wav.c.

Referenced by begin_wave().

#define WAV_RIFF   COMPOSE_ID('R','I','F','F')

Definition at line 31 of file camogm_wav.c.

Referenced by begin_wave().

#define WAV_WAVE   COMPOSE_ID('W','A','V','E')

Definition at line 32 of file camogm_wav.c.

Referenced by begin_wave().


Function Documentation

static int begin_wave ( int  fd,
size_t  cnt 
) [static]

Definition at line 64 of file camogm_wav.c.

References camogm_state::audio_channels, camogm_state::audio_format, camogm_state::audio_rate, f, LE_INT, LE_SHORT, WaveChunkHeader::length, WaveHeader::length, WaveHeader::magic, state, WaveChunkHeader::type, WaveHeader::type, WAV_DATA, WAV_FMT, WAV_PCM_CODE, WAV_RIFF, WAV_WAVE, and write.

Referenced by wave_begin().

static void end_wave ( int  fd  )  [static]

Definition at line 135 of file camogm_wav.c.

References fdcount, LE_INT, WaveChunkHeader::length, SEEK_SET, WaveChunkHeader::type, WAV_DATA, and write.

Referenced by wave_end().

void wave_begin ( const char *  fname  ) 

Definition at line 157 of file camogm_wav.c.

References begin_wave(), stderr, and wave_fd.

Referenced by audio_start().

void wave_end (  ) 

Definition at line 167 of file camogm_wav.c.

References end_wave(), and wave_fd.

Referenced by audio_end().

void wave_push ( void *  buf,
int  len 
)

Definition at line 163 of file camogm_wav.c.

References fdcount, wave_fd, and write.

Referenced by audio_process().


Variable Documentation

long long fdcount = 0

Definition at line 61 of file camogm_wav.c.

Referenced by end_wave(), and wave_push().

int wave_fd

Definition at line 155 of file camogm_wav.c.

Referenced by wave_begin(), wave_end(), and wave_push().


Generated on Fri Nov 28 00:07:00 2008 for elphel by  doxygen 1.5.1