On Thu Apr 6 08:45:42 2023 +0000, Ziqing Hui wrote:
Here's the result of `gst-inspect-1.0 avdec_wmav1`:
... Pad Templates: SINK template: 'sink' Availability: Always Capabilities: audio/x-wma wmaversion: 1 block_align: [ 0, 2147483647 ] bitrate: [ 0, 2147483647 ] SRC template: 'src' Availability: Always Capabilities: audio/x-raw format: F32LE layout: non-interleaved ...
The src pad template here is identical to what we see in autoplug_continue_cb(). Also, see: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/g... From the decodebin source, we can see that the caps argument passed to autoplug_continue comes from the plugin pad template. And avdec_wmav1 plugin src pad template doesn't have rate, which leads to the missing rate in autoplug_continue.
If I run wmvcore test with this patch: [test.patch](/uploads/c6da0600f0e5ce11a9e4a29f831e0bcb/test.patch)
The result will be:
``` autoplug_continue_cb: video/x-ms-asf Using "ASF Demuxer". autoplug_continue_cb: video/x-wmv autoplug_continue_cb: wmvversion: 1 autoplug_continue_cb: width: 64 autoplug_continue_cb: height: 48 autoplug_continue_cb: pixel-aspect-ratio: 1/1 autoplug_continue_cb: format: WMV1 Using "libav Windows Media Video 7 decoder". autoplug_continue_cb: audio/x-wma autoplug_continue_cb: wmaversion: 1 autoplug_continue_cb: bitrate: 128000 autoplug_continue_cb: depth: 16 autoplug_continue_cb: rate: 44100 autoplug_continue_cb: channels: 1 autoplug_continue_cb: block_align: 743 autoplug_continue_cb: codec_data: 00000100 Using "libav Windows Media Audio 1 decoder". autoplug_continue_cb: audio/x-raw autoplug_continue_cb: format: F32LE autoplug_continue_cb: layout: non-interleaved sink_event_cb: GST_EVENT_CAPS: audio/x-raw sink_event_cb: GST_EVENT_CAPS: format: F32LE sink_event_cb: GST_EVENT_CAPS: layout: non-interleaved sink_event_cb: GST_EVENT_CAPS: rate: 44100 sink_event_cb: GST_EVENT_CAPS: channels: 1 sink_event_cb: GST_EVENT_CAPS: video/x-raw sink_event_cb: GST_EVENT_CAPS: format: I420 sink_event_cb: GST_EVENT_CAPS: width: 64 sink_event_cb: GST_EVENT_CAPS: height: 48 sink_event_cb: GST_EVENT_CAPS: interlace-mode: progressive sink_event_cb: GST_EVENT_CAPS: pixel-aspect-ratio: 1/1 sink_event_cb: GST_EVENT_CAPS: framerate: 25/1 sink_event_cb: GST_EVENT_CAPS: audio/x-raw sink_event_cb: GST_EVENT_CAPS: format: S16LE sink_event_cb: GST_EVENT_CAPS: layout: interleaved sink_event_cb: GST_EVENT_CAPS: rate: 44100 sink_event_cb: GST_EVENT_CAPS: channels: 1 sink_event_cb: GST_EVENT_CAPS: channel-mask: 0x0000000000000004 sink_event_cb: GST_EVENT_CAPS: video/x-raw sink_event_cb: GST_EVENT_CAPS: format: BGR sink_event_cb: GST_EVENT_CAPS: width: 64 sink_event_cb: GST_EVENT_CAPS: height: 48 sink_event_cb: GST_EVENT_CAPS: interlace-mode: progressive sink_event_cb: GST_EVENT_CAPS: pixel-aspect-ratio: 1/1 sink_event_cb: GST_EVENT_CAPS: framerate: 25/1 ```
I don't think that solves the problem. If we're missing the sample rate, that's kind of a serious problem; we kind of need the sample rate in order to report it downstream. Does the stream ever give more specific caps?
We can see that althought rate is missing in autoplug_continue, it is given in GST_EVENT_CAPS. So I think it's OK to use an our own version of wg_format_from_caps_audio().