diff options
author | Max Kellermann <max@duempel.org> | 2012-03-01 00:25:08 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-03-01 01:15:22 +0100 |
commit | 25164969932590894671895944f30743d344e541 (patch) | |
tree | 80cdce06ec46865c7de0d228441fba4c8178f4f7 /src/audio_format.h | |
parent | 3b565b5f972ad65ab3e498c29eaf4f825eacece4 (diff) | |
download | mpd-25164969932590894671895944f30743d344e541.tar.gz mpd-25164969932590894671895944f30743d344e541.tar.xz mpd-25164969932590894671895944f30743d344e541.zip |
audio_format: add DSD sample format
Basic support for Direct Stream Digital. No conversion yet, and no
decoder/output plugin support.
Diffstat (limited to 'src/audio_format.h')
-rw-r--r-- | src/audio_format.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/audio_format.h b/src/audio_format.h index 4f7dbfb1a..2c86b70b9 100644 --- a/src/audio_format.h +++ b/src/audio_format.h @@ -49,6 +49,18 @@ enum sample_format { * range is -1.0f to +1.0f. */ SAMPLE_FORMAT_FLOAT, + + /** + * Direct Stream Digital. 1-bit samples; each frame has one + * byte (8 samples) per channel. + */ + SAMPLE_FORMAT_DSD, + + /** + * Same as #SAMPLE_FORMAT_DSD, but the least significant bit + * comes first. + */ + SAMPLE_FORMAT_DSD_LSBFIRST, }; static const unsigned MAX_CHANNELS = 8; @@ -175,6 +187,8 @@ audio_valid_sample_format(enum sample_format format) case SAMPLE_FORMAT_S24_P32: case SAMPLE_FORMAT_S32: case SAMPLE_FORMAT_FLOAT: + case SAMPLE_FORMAT_DSD: + case SAMPLE_FORMAT_DSD_LSBFIRST: return true; case SAMPLE_FORMAT_UNDEFINED: @@ -251,6 +265,11 @@ sample_format_size(enum sample_format format) case SAMPLE_FORMAT_FLOAT: return 4; + case SAMPLE_FORMAT_DSD: + case SAMPLE_FORMAT_DSD_LSBFIRST: + /* each frame has 8 samples per channel */ + return 1; + case SAMPLE_FORMAT_UNDEFINED: return 0; } |