From: Andy W. <wi...@po...> - 2002-09-09 18:30:09
|
On Mon, 09 Sep 2002, Thomas Vander Stichele wrote: > Hi, > > I've been asked to explain my commits to adder, so here's the simple > explanation. Thanks, and sorry for the monday morning crabbiness ;) -- It's just that I have thought a lot about adder, and worked on it quite a bit in the past, although I know you originally wrote it. It is a crucial part of audio mixing, so anything that affects it needs a little discussing, that's all. > I think that adder should always send data, regardless of the fact if it > has any input to it. If it doesn't, it should send out zeroes, of course. > In my head, gst-launch adder ! osssrc should work, useless though it is in osssink, of course (typo) > practical life. Also, the same should work in gst-editor. Right, these should work. I thought I had adder ! osssink working, but if not that needed to be fixed, somehow... > The reason I think this should work is that there are apps that will use > adder, and connect and disconnect inputs to it as necessary. Adder > shouldn't stop working when all inputs are gone, and shouldn't wait to > start working when none of it's inputs are connected. > A prerequisite for that launch line to work is a way to set audio format > properties on the cmd line - I guess this is what Andy objects to, though > I'm not sure. Well, let's see. The real requirement is that adder ! osssink work. If that can be done without having properties, that would be nice (ie, adder defaults to S16/native endian stereo 44.1 kHz or something). However, consider the case that you want to determine the exact format that adder will be outputting: do you add a float/int property? width, depth, rate? channels? Well, that's quite a bit, and one might imagine a case in which you would want to set properties for every potential src-sink connection. There is a defined method to set specific media properties on a connection, gst_{pad,element}_connect_filtered (). This will provide for the specific determining of media properties on a connection. There's no need to be able to set the rate on the adder itself, imho -- that is far more flexibly done with the _filtered connection routines. Now, wrt adder ! osssink. Just put in a default setup, and have adder do a set_caps on the src pad in READY->PAUSED if no sink pad is connected. Much easier than mucking about trying to sync properties with caps, which is a tricky piece of code. Also, there's a minimal chance of breaking the adder with this simple approach. Thoughts? wingo. |