After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739011 - [PLUGIN MOVE] Move GstVideoAggregator to gst-plugins-base
[PLUGIN MOVE] Move GstVideoAggregator to gst-plugins-base
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 739010 740768
Blocks: 739012
 
 
Reported: 2014-10-22 14:59 UTC by Thibault Saunier
Modified: 2018-11-03 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thibault Saunier 2014-10-22 14:59:28 UTC
The GstVideoAggregator should be moved to gst-plugins-base and compositor should replace the old videomixer.
Comment 1 Sebastian Dröge (slomo) 2014-11-26 15:57:10 UTC
As discussed on IRC, the current API with the GstVideoConverter is a bit magic and ugly :)

Instead of having a boolean flag in the class for that, there should be vfuncs for setting up converters and preparing frames. This would also be beneficial for compositors as it might want to do more than the automatic conversion (e.g. rescaling), and also for glvideomixer which currently has its own "prepare frames" thing inside the aggregated vfunc.
Comment 2 Sebastian Dröge (slomo) 2014-12-04 17:09:44 UTC
That part is fixed now ↑
Comment 3 Jian Li 2015-04-29 02:14:58 UTC
Is there a plan for this moving? Which version will have GstVideoAggregator in gst-plugins-base? I think this can simplify the developing of a new hardware based video compositor plugin.
Comment 4 Thibault Saunier 2015-04-29 07:20:39 UTC
(In reply to Jian Li from comment #3)
> Is there a plan for this moving? Which version will have GstVideoAggregator
> in gst-plugins-base? I think this can simplify the developing of a new
> hardware based video compositor plugin.

It is too late for it to be included in 1.6, we will try to get it in for 1.8.

Any help is welcome :)
Comment 5 Jian Li 2015-05-04 07:51:07 UTC
Thanks for you information!
Comment 6 Jan Schmidt 2015-05-09 13:00:08 UTC
Just a note - the interaction glmixer/glvideomixer has with gstvideoaggregator is awkward at the moment. They end up setting several of the vfuncs to NULL - I guess to avoid the default logic around converters, scaling and alpha.

It seems like there might be scope for moving some of that functionality down the stack, or making the default implementations more generic, with specialisations for software aggregators that need explicit converters in the sink pad path.

Either that, or the input conversions that glmixer is currently running itself on the sink pad path should be done by integrating with the gstvideoaggregator converters logic, I'm not sure.
Comment 7 Carlos Rafael Giani 2015-07-14 18:42:13 UTC
One small suggestion: Add a vfunc to aggregator that is called whenever one of the sink pads receives a CAPS event. In my custom compositor, I need to recheck the configuration if one of the input streams changes its caps. Right now, I have to use my own sink_event function for that. It would be cleaner if there were a dedicated vfunc.
Comment 8 Thibault Saunier 2015-07-14 18:47:14 UTC
(In reply to Carlos Rafael Giani from comment #7)
> One small suggestion: Add a vfunc to aggregator that is called whenever one
> of the sink pads receives a CAPS event. In my custom compositor, I need to
> recheck the configuration if one of the input streams changes its caps.
> Right now, I have to use my own sink_event function for that. It would be
> cleaner if there were a dedicated vfunc.

I am not sure we want that, we already added a vfunc in the pad class to handle events, we should not go and add vfunc for each event type.
Comment 9 Carlos Rafael Giani 2015-07-14 18:51:48 UTC
(In reply to Thibault Saunier from comment #8)
> I am not sure we want that, we already added a vfunc in the pad class to
> handle events, we should not go and add vfunc for each event type.

Fair point. But don't you mean GstAggregatorClass? I see no vfuncs in the pad class other than "flush".
Comment 10 Thibault Saunier 2015-07-14 21:51:03 UTC
(In reply to Carlos Rafael Giani from comment #9)
> (In reply to Thibault Saunier from comment #8)
> > I am not sure we want that, we already added a vfunc in the pad class to
> > handle events, we should not go and add vfunc for each event type.
> 
> Fair point. But don't you mean GstAggregatorClass? I see no vfuncs in the
> pad class other than "flush".

Indeed I meant http://phabricator.freedesktop.org/diffusion/GSTBAD/browse/master/gst-libs/gst/base/gstaggregator.h;82c0189b2842e8729e82a4e73491dffc977bc7c2$218
Comment 11 Tim-Philipp Müller 2017-12-20 19:39:55 UTC
What the current state of play here?

Any major issues that have not been mentioned yet?

Main issue I can find in the backlog is Jan's comment about the awkward interaction of the gl subclasses with the conversion stuff.
Comment 12 Nicolas Dufresne (ndufresne) 2017-12-21 17:22:14 UTC
A quick .h review let me know that it needs work.

In the Class structure:
>  /* Output caps */
>  GstVideoInfo info;

Comment is wrong, maybe call this src_info or out_info ?

>  GstCaps *          (*update_caps)               (GstVideoAggregator *  videoaggregator,

I'm not sure I understand from reading the doc. I'm sure it's useful though.


>  GstFlowReturn      (*aggregate_frames)          (GstVideoAggregator *  videoaggregator,
                                                   GstBuffer          *  outbuffer);
>  GstFlowReturn      (*get_output_buffer)         (GstVideoAggregator *  videoaggregator,
                                                   GstBuffer          ** outbuffer);

If one implements both, what does it give over implementing aggregate() ? Just asking APIs whise. Also, get_output_buffer, should it be something like allocate_output_buffer ?

>   GstCaps           *sink_non_alpha_caps;

Undocumented, I can barely guess what this is about.
Comment 13 Nicolas Dufresne (ndufresne) 2017-12-21 17:23:20 UTC
> PROP_PAD_IGNORE_EOS

Why is this video specific ?
Comment 14 Nicolas Dufresne (ndufresne) 2017-12-21 17:26:24 UTC
>gstvideoaggregator.c:1972
>  gst_buffer_pool_set_config (pool, config);

This is missing the little validation dance. We may endup with an unconfigured pool, then fail activation later (instead of falling back to generic video pool).
Comment 15 Tim-Philipp Müller 2017-12-22 10:06:48 UTC
Just so we don't forget:

<ndufresne> __tim, ok, did a quick review, next step would be to dig into the interections between glmixer/compositor and this
<ndufresne> the caps/alpha thingy seems like a miss-fit
Comment 16 Sebastian Dröge (slomo) 2018-02-05 08:02:22 UTC
Ok so to summarize: The only thing missing here for moving it in this cycle is someone untangling the conversion and alpha handling. Which might mean to move them to new vfuncs / changed vfuncs so that glmixer can skip that behaviour / implement its own behaviour in a less awkward way.

Correct?
Comment 17 Tim-Philipp Müller 2018-02-05 08:29:28 UTC
That is my understanding too, and it's not clear to me even that that is a blocker, we could just decide to leave it as-is :)
Comment 18 Sebastian Dröge (slomo) 2018-02-28 15:52:29 UTC
Ok I looked at all this again, the following needs to be done before moving IMHO. Let's target that for 1.16 :)

1) Make the API more similar with the GstAudioAggregator. vfunc names, function names, what vfuncs are there, when are they called

Go through the API one by one and match

2) Conversion should probably be done the same way as in audioaggregator: a new pad subclass that does conversion, and the current videoaggregatorpad does not do any conversion at all. This should come with vfuncs as needed so that there is no magic negotiation happening in the videoaggregator/videoaggregatorpad base classes.

This should also already solve the special alpha handling and special caps negotiation that is currently there. It would be handled in the converter pad subclass, not generically. because generically all pad caps would have to match. GL mixer could then implement its own code for this, as it makes sense.

Note that there is no conversion on the srcpad happening in videoaggregator, and it does not have to.

3) Merge the videoaggregatorpad.h into the main header. There's no need for it to be separate.

4) The pad ignore-eos property should probably be renamed. What it does is that the last frame is going to be used forever instead of stopping at timestamp+duration. It does not really ignore EOS.

See also comment 13, which was confused by that (it is raw video specific!)

5) Don't implement childproxy interface in the base class but let subclasses decide about that, just like with audioaggregator. Subclasses might not actually want this implementation but a different one.

6) Buffer pool configuration validation, see comment 14 (also API for getting the buffer pool, decide/propose_allocation, etc like in audioaggregator)


After that I'm fine with moving it. Generally looks all good to me!
Comment 19 Sebastian Dröge (slomo) 2018-05-06 14:06:43 UTC
These are now all done, from my point of view we're ready to move GstVideoAggregator, compositor and the GL mixers.
Comment 20 GStreamer system administrator 2018-11-03 11:31:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/137.