GNOME Bugzilla – Bug 114208
filesink now ignores NEW_MEDIA
Last modified: 2004-12-22 21:47:04 UTC
Today, Ronald B. committed a patch to remove the NEW_MEDIA support from filesink. No problem, except that there isn't any alternative yet. For example, i have a pipeline to extract frames from a film using pngenc. pngenc generates NEW_MEDIA events between each buffer because each png should be in a separate file. So what is the solution?
OK, general idea: NEW_MEDIA was a bad idea. EOS should be enough. So, when going to PLAYING, filesink openes a file. On EOS, it closes it. What should be done is that the application listens to EOS, then sets a new (next) filename to filesink and sets the pipeline back to PLAYING. This is basically what NEW_MEDIA was intended to do, except that the code was horribly wrong, had memleaks all over the place and was badly limited. This proposal works much better. What's needed is simply that the client app listens to EOS and sets a new location and resets the pipeline to PLAYING on EOS (and other elements need to use EOS instead of NEW_MEDIA). In PAUSED when a new filename is set, filesink must then immediately open it. See attached patch.
Created attachment 17045 [details] [review] this one
And change pngenc to emit EOS instead of NEW_MEDIA?
Yes. I've got two patches (for core and plugins) coming up to remove the NEW_MEDIA event alltogether.
Created attachment 17048 [details] [review] core patch to remove new_media
Created attachment 17049 [details] [review] plugins patch to remove new_media
applied to CVS.