mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
audiosink: Add support for DSD data
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>: https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
This commit is contained in:
parent
7e7bf907d7
commit
8febc4102a
1 changed files with 13 additions and 6 deletions
|
@ -55,6 +55,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include <gst/audio/audio.h>
|
||||
#include <gst/audio/gstdsd.h>
|
||||
#include "gstaudiosink.h"
|
||||
#include "gstaudioutilsprivate.h"
|
||||
|
||||
|
@ -416,12 +417,18 @@ gst_audio_sink_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
|||
|
||||
buf->memory = g_malloc (buf->size);
|
||||
|
||||
if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
|
||||
gst_audio_format_info_fill_silence (buf->spec.info.finfo, buf->memory,
|
||||
buf->size);
|
||||
} else {
|
||||
/* FIXME, non-raw formats get 0 as the empty sample */
|
||||
memset (buf->memory, 0, buf->size);
|
||||
switch (buf->spec.type) {
|
||||
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW:
|
||||
gst_audio_format_info_fill_silence (buf->spec.info.finfo, buf->memory,
|
||||
buf->size);
|
||||
break;
|
||||
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DSD:
|
||||
memset (buf->memory, GST_DSD_SILENCE_PATTERN_BYTE, buf->size);
|
||||
break;
|
||||
default:
|
||||
/* FIXME, non-raw formats get 0 as the empty sample */
|
||||
memset (buf->memory, 0, buf->size);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue