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 660255 - [theoraenc] Fix handling of GstForceKeyUnit events
[theoraenc] Fix handling of GstForceKeyUnit events
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-27 16:11 UTC by Andoni Morales
Modified: 2012-12-13 19:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix handling of GstForceKeyUnitEvents (4.18 KB, patch)
2011-09-27 16:11 UTC, Andoni Morales
rejected Details | Review

Description Andoni Morales 2011-09-27 16:11:27 UTC
Created attachment 197582 [details] [review]
Fix handling of GstForceKeyUnitEvents

This fixes how GstForceKeyUnit events are handled:

  * Reuse the upstream event instead of creating a new one, keeping all the fields from the original event

  * Don't call theora_enc_force_keyframe() from the sink_event function. It calls theora_enc_reset() which can also be called from a different thread in the setcaps function generating a segfault:
   GST_EVENT gstpad.c:5097:gst_pad_send_event:<encoder:sink> have event type custom-downstream
   ** ERROR:gsttheoraenc.c:478:theora_enc_reset: assertion failed: (enc->encoder != NULL)
Comment 1 David Schleef 2011-12-09 02:03:41 UTC
Review of attachment 197582 [details] [review]:

Looks good.
Comment 2 Sebastian Dröge (slomo) 2011-12-09 09:30:23 UTC
While we're at it this could also be changed to the new force-keyunit API in base
Comment 3 Andoni Morales 2011-12-13 12:17:00 UTC
I don't think the new API could be used anywhere since events are reused.
The only place where it could be used is in theora_enc_chain, but here we are reusing the upstream event, chanding its direction and replacing the timestamp values of the event's structure. Either we create a new downstream event with the upstream info or we add a new method to modify the timestamp fields in the existing event.
Comment 4 Sebastian Dröge (slomo) 2011-12-13 12:34:18 UTC
Either we shouldn't reuse events (how is the event direction reversed? Changing the event type requires that the event is writable and requires internal knowledge about the event) or we should have API to make this possible (e.g. functions to change the event and return a new one if it's not writable or functions to create a downstream event from an upstream event or ...).
Comment 5 Andoni Morales 2011-12-13 12:43:07 UTC
The event is copied internally, so we have the unique ref on it and it's therefore writeable. The direction is changed and the structure's fields are changed too.
But it's probably better have some API to create a downstream force-keyunit event from and upstream event, with the possibility to update the timestamps fields  which is a common use case.
Comment 6 Sebastian Dröge (slomo) 2012-12-13 19:12:26 UTC
This is obsolete now, the theora encoder uses the video base classes now.