On Mon Mar 6 07:34:41 2023 +0000, Zebediah Figura wrote:
decodebin has a "caps" property that controls when decoding ends. What we should probably do is, on creation, grab those caps, append (or prepend?) the right caps (in this case I think video/x-wmv) to that and set it. Since this is configurable we'll want this to be an argument to wg_parser creation. I think we want to do this one set of caps at a time, as necessary. For efficiency and simplicity we still want to prefer decoding the entire pipeline. Note that one interesting aspect of this is that in wmvcore this behaviour is configurable. I don't *think* there's a way to signal decodebin to "re-decode" its streams, or at least I couldn't easily find one, so I think we'll need to drop and recreate the wg_parser when that property is changed.
I think we need to do something that is very similar to wm_reader.c: reader_SetOutputProps(). Here is what reader_SetOutputProps() do:
``` reader_SetOutputProps() { ... wg_parser_stream_enable(stream->wg_stream); ... wg_parser_stream_seek(reader->streams[0].wg_stream, 1.0, reader->start_time, 0, AM_SEEKING_AbsolutePositioning, AM_SEEKING_NoPositioning); } ``` See: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/winegstreamer/wm_read...
In wg_parser_stream_enable(), it calls gst_pad_push_event(gst_event_new_reconfigure()) to reconfigure the pipeline.
Document of gst_event_new_reconfigure():
gst_event_new_reconfigure:
Create a new reconfigure event. The purpose of the reconfigure event is to travel upstream and make elements renegotiate their caps or reconfigure their buffer pools. This is useful when changing properties on elements or changing the topology of the pipeline.
Returns: (transfer full): a new #GstEvent