On Mon Oct 17 03:20:51 2022 +0000, Zebediah Figura wrote:
This doesn't really simplify the interface, though. It simplifies the wmvcore glue at the expense of making the wg_parser interface more complicated, but it's not clear to me that's a worthwhile trade. I think that given the wmvcore interface, it should be possible to implement zero-copy while still dealing with the alternation logic in the wmvcore frontend. In particular we'd end up caching the whole sample on the PE side. That said, it's possible this is less pretty than caching on the Unix side; I haven't tried the whole way through...
There could perhaps be alternative ways of doing this, but I don't see any reason for this specific change to be unnacceptable. It simplifies the interface, as there'll be less calls to be done for the same thing.
The wg_parser_stream_get_buffer function will need to be changed anyway, in order for sample allocation requests to be eventually returned in addition to buffer output requests. This can hardly be done differently as the allocation needs be be done from a specific stream thread and may also be blocking.
The whole series is at https://gitlab.winehq.org/rbernon/wine/-/commits/wip/zerocopy/v2 if you want to have a look.