I have completely redone this, and added extra testing to `test_media_session_Start()` which revealed some issues. But tests are failing after rebase, so it needs more work.
I am looking at the possibility of removing the transform sample request count, since it's caused a lot of trouble, and maybe the sink request count too. I think all requests from the sink should propagate all the way to the source, so we can rely on the source's internal request count only. Samples sent from the source will propagate down to the sink, and we need only ensure they are always delivered. Currently, if the source's internal request count is less than the count kept by the transform, sample delivery gets stuck.