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 630808 - valve: move to core
valve: move to core
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-28 10:54 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2010-12-31 02:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
less reffing and locking (1.57 KB, patch)
2010-09-28 10:54 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-28 10:54:49 UTC
Created attachment 171253 [details] [review]
less reffing and locking

The valve element is reffing locking too much. I am attaching a patch. If especially the locks where taken on purpose if would be nice to add a comment.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-28 10:55:43 UTC
I wonder also if we could use atomic ops to read/write 'drop' as those are cheaper than locks.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-28 11:00:15 UTC
Imho the _(set|get)_property methods look fishy. Is it really okay to have the default: case first. I would move it down in any case to be more like elsewhere.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-28 11:27:28 UTC
just changed the order in the switch statements (comment #3) and committed.
Comment 4 Olivier Crête 2010-09-28 15:45:54 UTC
I don't see why you propose removing the check for the drop after returning from pad_push/pad_alloc? It is for the case where you do a pad block after the valve, set drop=TRUE, remove some elements which could cause an error and then return, we want to suppress that error entirely.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-28 16:04:35 UTC
That's why I asked for feedback and think there should be a comment to explain that you explicitly want to re-read the property value after the pad_push.

I can make the _ref change and a separate patch that just uses atomic ops instead of the logging.
Comment 6 Olivier Crête 2010-09-30 21:49:35 UTC
I made it use an atomic, I fixed the doc, I re-implemented discont support (which was broken years ago, so I guess its not critical, but it's still nice to set the marker bit on RTP). I also committed a simple unit test for valve which should cover most cases (since a pretty simple element).

If you guys like it, please merge it. I guess the whole thing could also be merged into identity if we think its a better idea.
Comment 7 Olivier Crête 2010-09-30 21:50:14 UTC
merge-> move to good/base
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-04 08:22:22 UTC
Thanks for the update. This looks good now. I would consider moving it to core actually. It is media-agnostic.

Anyway +1 for moving from my side. Oliver, please bug another core-dev to get 2nd approval and opinion on where it should go. Then we can mark it as release blocker for the respective module.
Comment 9 Olivier Crête 2010-12-26 18:41:42 UTC
I think that in 0.11, the functionality should be part of GstPad. Especially if we can get rid of the nasty new-segment event. It would make it easier to dynamically modify pipelines.
Comment 10 Tim-Philipp Müller 2010-12-31 02:01:45 UTC
Moved to core, removed from -bad.