GNOME Bugzilla – Bug 674865
directsoundsink: add support for ac3 over spdif
Last modified: 2012-05-09 07:49:09 UTC
Created attachment 212868 [details] [review] add support for ac3 over spdif Initial patch to add support for ac3 over spdif. Untested since I don't have the proper hardware to test it.
Review of attachment 212868 [details] [review]: Looks good in general :) Does directsound also support DTS/DCA or MP3 or something else? Can be added the same way with the payloaders in the audio library ::: sys/directsound/gstdirectsoundsink.c @@ +453,3 @@ + gst_structure_get_boolean (st, "parsed", &parsed); + if ((!framed && !parsed) || gst_audio_iec61937_frame_size (&spec) <= 0) + goto done; Might be good to actually check if the device supports AC3 too here @@ +496,3 @@ + + type = GST_BASE_AUDIO_SINK (dsoundsink)->ringbuffer->spec.type; + return (type == GST_BUFTYPE_IEC958 || type == GST_BUFTYPE_AC3); No IEC958 anymore @@ +835,3 @@ DXGetErrorString9 (hRes)); caps = gst_caps_subtract (caps, gst_caps_new_simple ("audio/x-iec958", NULL)); No IEC958 anymore @@ +847,3 @@ } #else caps = gst_caps_subtract (caps, gst_caps_new_simple ("audio/x-iec958", NULL)); No IEC958 anymore
Couldn't we leave support for audio/x-iec958 in the input caps for backward compatibility? From what I have read here (http://msdn.microsoft.com/en-us/library/windows/hardware/ff538534(v=vs.85).aspx), the supported formats are ac3 and wma-prom, but there is not GstBufferFormatType for it. Regarding the check, it's already done ::prepare
Review of attachment 212868 [details] [review]: ::: sys/directsound/gstdirectsoundsink.c @@ +429,3 @@ + GstRingBufferSpec spec = { 0 }; + + pad_caps = gst_pad_get_caps_reffed (pad); Does the getcaps function on the sinkpad only return what the device supports if called in states >= READY? @@ +432,3 @@ + if (pad_caps) { + ret = gst_caps_can_intersect (pad_caps, caps); + gst_caps_unref (pad_caps); If can_intersect() returns FALSE you should return that immediately without doing the checks below.
Created attachment 213671 [details] [review] add support for ac3 over spdif Update previous patch with the required changes
Created attachment 213672 [details] [review] force 48kHz for AC-3 over spdif AC-3 over spdif requires to be treated as 2-channels, 16-bits, 48 kHz.
commit bdaec498cb0203ca801b2f9b8fc2ee3f5ea6ff19 Author: Andoni Morales Alastruey <ylatuya@gmail.com> Date: Tue May 8 16:23:42 2012 +0200 directsoundsink: force 48000 kHz force AC-3 over spdif AC-3 over spdif must be treated as 2-channel, 16-bit, 48kHz commit 78ac4dd4e96c8e23aed52176b08f0a91ee8c4778 Author: Andoni Morales Alastruey <ylatuya@gmail.com> Date: Thu Apr 26 12:50:09 2012 +0200 directsoundsink: add support for ac-3 over spdif
Created attachment 213691 [details] [review] fix assertion Fix assertion introduced by previous patch(from gst-plugins-base:3e750315e4)
Comment on attachment 213691 [details] [review] fix assertion Thanks, now it would be great if you could also port these changes to 0.11 :) If you need help with that, look at the alsasink part or ask me