On 12/2/20 2:49 PM, Derek Lesho wrote:
On 12/2/20 3:39 PM, Zebediah Figura (she/her) wrote:
"rate" and "channels" are already set by gst_audio_info_to_caps().
Yeah, the reason I have them here is that future patches I have convert from compressed audio types, which I don't think can use gst_audio_info_to_caps, so I reset it after the subtype specific section of the function. Should I remove this until those patches?
Those statements shouldn't be present in this patch, no.
- if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_AUDIO_CHANNEL_MASK, &channel_mask))) - { + if (channel_mask != -1) gst_caps_set_simple(output, "channel-mask", GST_TYPE_BITMASK, (guint64) channel_mask, NULL); - }
- if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_AVG_BITRATE, &bitrate))) - { + if (bitrate != -1) gst_caps_set_simple(output, "bitrate", G_TYPE_INT, bitrate, NULL); - } return output; }
I only just now notice this, but MF_MT_AVG_BITRATE is a video type attribute, not an audio type attribute; I suspect it should be removed from this function...
Good catch, if you think I should keep rate and channels manually set, I guess I would just use MF_MT_AUDIO_AVG_BYTES_PER_SECOND instead. If not, I'll just remove this one too.
I don't think there's any point; I haven't seen any plugins that care about a "bitrate" member for PCM audio.