]> git.alsa-project.org Git - tinycompress.git/commitdiff
crecord: Move wave data structures to their own header
authorDaniel Baluta <daniel.baluta@nxp.com>
Thu, 7 Jan 2021 18:17:58 +0000 (20:17 +0200)
committerDaniel Baluta <daniel.baluta@nxp.com>
Thu, 7 Jan 2021 21:10:15 +0000 (23:10 +0200)
This is in preparation for adding wave parsing routines
to be used by tinycompress utilities.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
include/tinycompress/tinywave.h [new file with mode: 0644]
src/utils/crecord.c

diff --git a/include/tinycompress/tinywave.h b/include/tinycompress/tinywave.h
new file mode 100644 (file)
index 0000000..c7e98aa
--- /dev/null
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: (LGPL-2.1-only OR BSD-3-Clause) */
+/*
+ * wave header and parsing
+ *
+ * Copyright 2020 NXP
+ */
+
+#ifndef __TINYWAVE_H
+#define __TINYWAVE_H
+
+struct riff_chunk {
+       char desc[4];
+       uint32_t size;
+} __attribute__((__packed__));
+
+struct wave_header {
+       struct {
+               struct riff_chunk chunk;
+               char format[4];
+       } __attribute__((__packed__)) riff;
+
+       struct {
+               struct riff_chunk chunk;
+               uint16_t type;
+               uint16_t channels;
+               uint32_t rate;
+               uint32_t byterate;
+               uint16_t blockalign;
+               uint16_t samplebits;
+       } __attribute__((__packed__)) fmt;
+
+       struct {
+               struct riff_chunk chunk;
+       } __attribute__((__packed__)) data;
+} __attribute__((__packed__));
+
+#endif
index 12ad9615a5801798aff84ef59a0ada4bb8399ebb..41a90e08832d0ed9a73bdb12f7361a4a7372bd9a 100644 (file)
@@ -77,6 +77,7 @@
 #include "sound/compress_params.h"
 #include "sound/compress_offload.h"
 #include "tinycompress/tinycompress.h"
+#include "tinycompress/tinywave.h"
 
 static int verbose;
 static int file;
@@ -112,32 +113,6 @@ static const struct {
 };
 #define CREC_NUM_CODEC_IDS (sizeof(codec_ids) / sizeof(codec_ids[0]))
 
-struct riff_chunk {
-       char desc[4];
-       uint32_t size;
-} __attribute__((__packed__));
-
-struct wave_header {
-       struct {
-               struct riff_chunk chunk;
-               char format[4];
-       } __attribute__((__packed__)) riff;
-
-       struct {
-               struct riff_chunk chunk;
-               uint16_t type;
-               uint16_t channels;
-               uint32_t rate;
-               uint32_t byterate;
-               uint16_t blockalign;
-               uint16_t samplebits;
-       } __attribute__((__packed__)) fmt;
-
-       struct {
-               struct riff_chunk chunk;
-       } __attribute__((__packed__)) data;
-} __attribute__((__packed__));
-
 static const struct wave_header blank_wave_header = {
        .riff = {
                .chunk = {