diff options
Diffstat (limited to 'apps/recorder/pcm_record.h')
-rw-r--r-- | apps/recorder/pcm_record.h | 74 |
1 files changed, 46 insertions, 28 deletions
diff --git a/apps/recorder/pcm_record.h b/apps/recorder/pcm_record.h index bff7881605..cf7197946a 100644 --- a/apps/recorder/pcm_record.h +++ b/apps/recorder/pcm_record.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Linus Nielsen Feltzing | 10 | * Copyright (C) 2005 by Linus Nielsen Feltzing |
11 | * Copyright (C) 2006-2013 by Michael Sevakis | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or | 13 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 14 | * modify it under the terms of the GNU General Public License |
@@ -18,47 +19,64 @@ | |||
18 | * KIND, either express or implied. | 19 | * KIND, either express or implied. |
19 | * | 20 | * |
20 | ****************************************************************************/ | 21 | ****************************************************************************/ |
21 | |||
22 | #ifndef PCM_RECORD_H | 22 | #ifndef PCM_RECORD_H |
23 | #define PCM_RECORD_H | 23 | #define PCM_RECORD_H |
24 | 24 | ||
25 | #include "config.h" | 25 | /** Warnings (recording may continue with possible data loss) |
26 | ** Reset of recording clears, otherwise see notes below | ||
27 | */ | ||
26 | 28 | ||
27 | /** Warnings **/ | 29 | /* PCM buffer has overflowed; PCM samples were dropped */ |
28 | /* pcm (dma) buffer has overflowed */ | 30 | /* persists until: stop, new file, clear */ |
29 | #define PCMREC_W_PCM_BUFFER_OVF 0x00000001 | 31 | #define PCMREC_W_PCM_BUFFER_OVF 0x00000001 |
30 | /* encoder output buffer has overflowed */ | 32 | /* encoder output buffer has overflowed; encoded data was dropped */ |
33 | /* persists until: stop, new file, clear */ | ||
31 | #define PCMREC_W_ENC_BUFFER_OVF 0x00000002 | 34 | #define PCMREC_W_ENC_BUFFER_OVF 0x00000002 |
32 | /** Errors **/ | 35 | /* encoder and set/detected sample rates do not match */ |
36 | /* persists until: rates match, clear */ | ||
37 | #define PCMREC_W_SAMPR_MISMATCH 0x00000004 | ||
38 | /* PCM frame skipped because of recoverable DMA error */ | ||
39 | /* persists until: clear */ | ||
40 | #define PCMREC_W_DMA 0x00000008 | ||
41 | /* internal file size limit was reached; encoded data was dropped */ | ||
42 | /* persists until: stop, new file, clear */ | ||
43 | #define PCMREC_W_FILE_SIZE 0x00000010 | ||
44 | |||
45 | /* all warning flags */ | ||
46 | #define PCMREC_W_ALL 0x0000001f | ||
47 | |||
48 | /** Errors (recording should be reset) | ||
49 | ** | ||
50 | ** Stopping recording if recording clears internally and externally visible | ||
51 | ** status must be cleared with audio_error_clear() | ||
52 | ** reset of recording clears | ||
53 | */ | ||
54 | |||
55 | /* DMA callback has reported an error */ | ||
56 | #define PCMREC_E_DMA 0x80010000 | ||
33 | /* failed to load encoder */ | 57 | /* failed to load encoder */ |
34 | #define PCMREC_E_LOAD_ENCODER 0x80001000 | 58 | #define PCMREC_E_LOAD_ENCODER 0x80020000 |
35 | /* error originating in encoder */ | 59 | /* error originating in encoder */ |
36 | #define PCMREC_E_ENCODER 0x80002000 | 60 | #define PCMREC_E_ENCODER 0x80040000 |
37 | /* filename queue has desynced from stream markers */ | 61 | /* error from encoder setup of stream parameters */ |
38 | #define PCMREC_E_FNQ_DESYNC 0x80004000 | 62 | #define PCMREC_E_ENC_SETUP 0x80080000 |
63 | /* error writing to output stream */ | ||
64 | #define PCMREC_E_ENCODER_STREAM 0x80100000 | ||
39 | /* I/O error has occurred */ | 65 | /* I/O error has occurred */ |
40 | #define PCMREC_E_IO 0x80008000 | 66 | #define PCMREC_E_IO 0x80200000 |
41 | #ifdef DEBUG | ||
42 | /* encoder has written past end of allocated space */ | ||
43 | #define PCMREC_E_CHUNK_OVF 0x80010000 | ||
44 | #endif /* DEBUG */ | ||
45 | /* DMA callback has reported an error */ | ||
46 | #define PCMREC_E_DMA 0x80020000 | ||
47 | 67 | ||
48 | /** General functions for high level codec recording **/ | 68 | /* all error flags */ |
49 | /* pcm_rec_error_clear is deprecated for general use. audio_error_clear | 69 | #define PCMREC_E_ALL 0x803f0000 |
50 | should be used */ | 70 | |
71 | /* Functions called by audio_thread.c */ | ||
51 | void pcm_rec_error_clear(void); | 72 | void pcm_rec_error_clear(void); |
52 | /* pcm_rec_status is deprecated for general use. audio_status merges the | ||
53 | results for consistency with the hardware codec version */ | ||
54 | unsigned int pcm_rec_status(void); | 73 | unsigned int pcm_rec_status(void); |
55 | unsigned long pcm_rec_get_warnings(void); | 74 | uint32_t pcm_rec_get_warnings(void); |
56 | void pcm_rec_init(void) INIT_ATTR; | 75 | #ifdef HAVE_SPDIF_IN |
57 | int pcm_rec_current_bitrate(void); | ||
58 | int pcm_rec_encoder_afmt(void); /* AFMT_* value, AFMT_UNKNOWN if none */ | ||
59 | int pcm_rec_rec_format(void); /* Format index or -1 otherwise */ | ||
60 | unsigned long pcm_rec_sample_rate(void); | 76 | unsigned long pcm_rec_sample_rate(void); |
61 | int pcm_get_num_unprocessed(void); | 77 | #endif |
78 | |||
79 | void recording_init(void); | ||
62 | 80 | ||
63 | /* audio.h contains audio_* recording functions */ | 81 | /* audio.h contains audio_* recording functions */ |
64 | 82 | ||