mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 05:35:39 +00:00
audio: move capture API to own header
For modularity/clarity reasons, move the capture API in a specific header. The current audio/ header license is MIT. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
@@ -2977,7 +2977,7 @@ X: audio/paaudio.c
|
||||
X: audio/sdlaudio.c
|
||||
X: audio/sndioaudio.c
|
||||
X: audio/spiceaudio.c
|
||||
F: include/qemu/audio.h
|
||||
F: include/qemu/audio*.h
|
||||
F: qapi/audio.json
|
||||
|
||||
ALSA Audio backend
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
/* #define RECIPROCAL */
|
||||
#endif
|
||||
#include "qemu/audio.h"
|
||||
#include "qemu/audio-capture.h"
|
||||
#include "mixeng.h"
|
||||
|
||||
#ifdef CONFIG_GIO
|
||||
|
||||
43
include/qemu/audio-capture.h
Normal file
43
include/qemu/audio-capture.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* QEMU Audio subsystem
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#ifndef QEMU_AUDIO_CAPTURE_H
|
||||
#define QEMU_AUDIO_CAPTURE_H
|
||||
|
||||
#include "audio.h"
|
||||
|
||||
typedef struct CaptureVoiceOut CaptureVoiceOut;
|
||||
|
||||
typedef enum {
|
||||
AUD_CNOTIFY_ENABLE,
|
||||
AUD_CNOTIFY_DISABLE
|
||||
} audcnotification_e;
|
||||
|
||||
struct audio_capture_ops {
|
||||
void (*notify) (void *opaque, audcnotification_e cmd);
|
||||
void (*capture) (void *opaque, const void *buf, int size);
|
||||
void (*destroy) (void *opaque);
|
||||
};
|
||||
|
||||
struct capture_ops {
|
||||
void (*info) (void *opaque);
|
||||
void (*destroy) (void *opaque);
|
||||
};
|
||||
|
||||
typedef struct CaptureState {
|
||||
void *opaque;
|
||||
struct capture_ops ops;
|
||||
QLIST_ENTRY(CaptureState) entries;
|
||||
} CaptureState;
|
||||
|
||||
CaptureVoiceOut *AUD_add_capture(
|
||||
AudioBackend *be,
|
||||
struct audsettings *as,
|
||||
struct audio_capture_ops *ops,
|
||||
void *opaque
|
||||
);
|
||||
void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque);
|
||||
|
||||
#endif /* QEMU_AUDIO_CAPTURE_H */
|
||||
@@ -41,30 +41,7 @@ typedef struct audsettings {
|
||||
int endianness;
|
||||
} audsettings;
|
||||
|
||||
typedef enum {
|
||||
AUD_CNOTIFY_ENABLE,
|
||||
AUD_CNOTIFY_DISABLE
|
||||
} audcnotification_e;
|
||||
|
||||
struct audio_capture_ops {
|
||||
void (*notify) (void *opaque, audcnotification_e cmd);
|
||||
void (*capture) (void *opaque, const void *buf, int size);
|
||||
void (*destroy) (void *opaque);
|
||||
};
|
||||
|
||||
struct capture_ops {
|
||||
void (*info) (void *opaque);
|
||||
void (*destroy) (void *opaque);
|
||||
};
|
||||
|
||||
typedef struct CaptureState {
|
||||
void *opaque;
|
||||
struct capture_ops ops;
|
||||
QLIST_ENTRY (CaptureState) entries;
|
||||
} CaptureState;
|
||||
|
||||
typedef struct SWVoiceOut SWVoiceOut;
|
||||
typedef struct CaptureVoiceOut CaptureVoiceOut;
|
||||
typedef struct SWVoiceIn SWVoiceIn;
|
||||
|
||||
struct AudioBackendClass {
|
||||
@@ -79,14 +56,6 @@ typedef struct QEMUAudioTimeStamp {
|
||||
|
||||
bool AUD_backend_check(AudioBackend **be, Error **errp);
|
||||
|
||||
CaptureVoiceOut *AUD_add_capture(
|
||||
AudioBackend *s,
|
||||
struct audsettings *as,
|
||||
struct audio_capture_ops *ops,
|
||||
void *opaque
|
||||
);
|
||||
void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque);
|
||||
|
||||
SWVoiceOut *AUD_open_out (
|
||||
AudioBackend *be,
|
||||
SWVoiceOut *sw,
|
||||
|
||||
Reference in New Issue
Block a user