Debian Codegraph @

components/encoder/coreaudioconnect/connector/communication.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2019 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #ifndef H_COREAUDIOCOMMUNICATION
14 #define H_COREAUDIOCOMMUNICATION
15
16 #include <stdint.h>
17
18 /* Status codes.
19 */
20 const int32_t CommStatusIssued = 0; // Command has been issued by the host process.
21 const int32_t CommStatusProcessing = 1; // Connector process is processing a command.
22 const int32_t CommStatusReady = 2; // Connector process finished processing a command.
23 const int32_t CommStatusError = 3; // Error while processing a command.
24
25 /* Adapter commands.
26 */
27 const int32_t CommCommandHello = 'HELO'; // Hello -> Say hello.
28 const int32_t CommCommandCodecs = 'CDCS'; // Codecs <- Get available codecs.
29 const int32_t CommCommandSetup = 'STUP'; // Setup -> Setup encoder.
30 const int32_t CommCommandEncode = 'ENCD'; // Raw -> Encode audio samples.
31 const int32_t CommCommandFinish = 'FNSH'; // Finish encoding.
32 const int32_t CommCommandDuration = 'DURA'; // Int64 <- Get total duration in samples.
33 const int32_t CommCommandQuit = 'QUIT'; // Quit adapter process.
34
35 /* General command data structure.
36 */
37 struct CoreAudioCommBuffer
38 {
39 int32_t status;
40 int32_t command;
41
42 int32_t length;
43 int32_t data[65536];
44 };
45
46 /* Data structure for Hello command.
47 */
48 struct CoreAudioCommHello
49 {
50 int32_t version;
51 };
52
53 /* Data structure for Codecs command.
54 */
55 struct CoreAudioCommCodecs
56 {
57 uint32_t codecs[32];
58 int32_t bitrates[32][128];
59 };
60
61 /* Data structure for Setup command.
62 */
63 struct CoreAudioCommSetup
64 {
65 uint32_t codec;
66 int32_t bitrate;
67 int32_t format;
68
69 int32_t channels;
70 int32_t rate;
71 int32_t bits;
72
73 int8_t fp;
74 int8_t sign;
75
76 char file[32768];
77 };
78
79 #endif