baseparse: Initial GAP handling should check for mandatory fields
Submitted by Edward Hervey
There is no way for subclasses to tell the parent class that it doesn't have enough information to negotiate to at least a compatible format.
- mpegaudioparse receives "audio/mpeg, mpegversion=1" (without any other fields)
- A gap event comes in
- the base class negotiates to "audio/mpeg, mpegversion=1, layer=1, mpegaudioversion=1, rate=8000, channels=1, parsed=true"
- the caps event get pushed downstream and a decoder gets selected for MP1 (say avdec_mp1float)
- eventually data comes into mpegaudioparse and it negotiates to the actual format (mpegaudioversion=3, i.e. mp3)
- the decoder fails to negotiate
While we do want to not delay gap events in parsers, we should only allow this to happen if we do have enough information from upstream caps to negotiate to something which will later be compatible with the actual data stream.
In this case, mpegaudioparse should not push caps event if it hasn't at least got a clue as to which mpegaudioversion the stream corresponds to.