"presence": "always"
},
"src": {
- "caps": "audio/x-raw:\n format: S8\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\naudio/x-raw:\n format: S16LE\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\naudio/x-raw:\n format: S32LE\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\n",
+ "caps": "audio/x-raw:\n format: S8\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\naudio/x-raw:\n format: S16LE\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\naudio/x-raw:\n format: S32LE\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\naudio/x-raw:\n format: F32LE\n layout: interleaved\n channels: [ 1, 8 ]\n rate: [ 6000, 192000 ]\n",
"direction": "src",
"presence": "always"
}
"audio/x-raw, "
"format = (string) " GST_AUDIO_NE (S32) ", "
"layout = (string) interleaved, "
+ "channels = (int) [ 1, 8 ], " "rate = (int) [ 6000, 192000 ]; "
+ "audio/x-raw, "
+ "format = (string) " GST_AUDIO_NE (F32) ", "
+ "layout = (string) interleaved, "
"channels = (int) [ 1, 8 ], " "rate = (int) [ 6000, 192000 ]")
);
dec->channel_mask = 0;
dec->sample_rate = 0;
dec->depth = 0;
+ dec->mode_float = FALSE;
}
static void
break;
case 24:
case 32:
- fmt = _GST_AUDIO_FORMAT_NE (S32);
+ fmt =
+ dec->mode_float ? _GST_AUDIO_FORMAT_NE (F32) :
+ _GST_AUDIO_FORMAT_NE (S32);
dec->width = 32;
break;
default:
WavpackHeader wph;
int32_t decoded, unpacked_size;
gboolean format_changed;
- gint width, depth, i, j, max;
+ gint width, depth, i, j, max, wavpack_mode;
+ gboolean mode_float;
gint32 *dec_data = NULL;
guint8 *out_data;
GstMapInfo map, omap;
g_assert (dec->context != NULL);
+ wavpack_mode = WavpackGetMode (dec->context);
+ mode_float = (wavpack_mode & MODE_FLOAT) == MODE_FLOAT;
+
format_changed =
(dec->sample_rate != WavpackGetSampleRate (dec->context)) ||
(dec->channels != WavpackGetNumChannels (dec->context)) ||
(dec->depth != WavpackGetBytesPerSample (dec->context) * 8) ||
+ (dec->mode_float != mode_float) ||
(dec->channel_mask != WavpackGetChannelMask (dec->context));
if (!gst_pad_has_current_caps (GST_AUDIO_DECODER_SRC_PAD (dec)) ||
dec->sample_rate = WavpackGetSampleRate (dec->context);
dec->channels = WavpackGetNumChannels (dec->context);
dec->depth = WavpackGetBytesPerSample (dec->context) * 8;
+ dec->mode_float = mode_float;
channel_mask = WavpackGetChannelMask (dec->context);
if (channel_mask == 0)