}
snd_pcm_t *
-gst_alsa_open_iec958_pcm (GstObject * obj)
+gst_alsa_open_iec958_pcm (GstObject * obj, gchar * device)
{
char *iec958_pcm_name = NULL;
snd_pcm_t *pcm = NULL;
* spdif:{AES0 0x2 AES1 0x82 AES2 0x0 AES3 0x2}
*/
sprintf (devstr,
- "iec958:{AES0 0x%02x AES1 0x%02x AES2 0x%02x AES3 0x%02x}",
+ "%s:{AES0 0x%02x AES1 0x%02x AES2 0x%02x AES3 0x%02x}",
+ device,
IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO,
IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
0, IEC958_AES3_CON_FS_48000);
*/
GstCaps *
-gst_alsa_probe_supported_formats (GstObject * obj, snd_pcm_t * handle,
- const GstCaps * template_caps)
+gst_alsa_probe_supported_formats (GstObject * obj, gchar * device,
+ snd_pcm_t * handle, const GstCaps * template_caps)
{
snd_pcm_hw_params_t *hw_params;
snd_pcm_stream_t stream_type;
/* Try opening IEC958 device to see if we can support that format (playback
* only for now but we could add SPDIF capture later) */
if (stream_type == SND_PCM_STREAM_PLAYBACK) {
- snd_pcm_t *pcm = gst_alsa_open_iec958_pcm (obj);
+ snd_pcm_t *pcm = gst_alsa_open_iec958_pcm (obj, device);
if (G_LIKELY (pcm)) {
gst_caps_append (caps, gst_caps_from_string (PASSTHROUGH_CAPS));
GST_DEBUG_CATEGORY_EXTERN (alsa_debug);
#define GST_CAT_DEFAULT alsa_debug
-snd_pcm_t * gst_alsa_open_iec958_pcm (GstObject * obj);
+snd_pcm_t * gst_alsa_open_iec958_pcm (GstObject * obj, gchar *device);
GstCaps * gst_alsa_probe_supported_formats (GstObject * obj,
+ gchar * device,
snd_pcm_t * handle,
const GstCaps * template_caps);
g_return_val_if_fail (pad_template != NULL, NULL);
templ_caps = gst_pad_template_get_caps (pad_template);
- caps = gst_alsa_probe_supported_formats (GST_OBJECT (sink), sink->handle,
- templ_caps);
+ caps = gst_alsa_probe_supported_formats (GST_OBJECT (sink), sink->device,
+ sink->handle, templ_caps);
gst_caps_unref (templ_caps);
if (caps) {
alsa = GST_ALSA_SINK (asink);
- if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IEC958) {
+ if (alsa->iec958) {
snd_pcm_close (alsa->handle);
- alsa->handle = gst_alsa_open_iec958_pcm (GST_OBJECT (alsa));
+ alsa->handle = gst_alsa_open_iec958_pcm (GST_OBJECT (alsa), alsa->device);
if (G_UNLIKELY (!alsa->handle)) {
goto no_iec958;
}
templ_caps = gst_pad_template_get_caps (pad_template);
GST_INFO_OBJECT (src, "template caps %" GST_PTR_FORMAT, templ_caps);
- caps = gst_alsa_probe_supported_formats (GST_OBJECT (src), src->handle,
- templ_caps);
+ caps = gst_alsa_probe_supported_formats (GST_OBJECT (src),
+ src->device, src->handle, templ_caps);
gst_caps_unref (templ_caps);
if (caps) {