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 796802 - Problem calling `ges_track_update_restriction_caps` after `ges_video_track_new`
Problem calling `ges_track_update_restriction_caps` after `ges_video_track_new`
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
1.12.4
Other All
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-12 17:29 UTC by David Ing
Modified: 2018-07-12 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
track: Set restriction caps when update_restriction before caps being set (1.34 KB, patch)
2018-07-12 17:55 UTC, Thibault Saunier
committed Details | Review

Description David Ing 2018-07-12 17:29:49 UTC
This is related to a prior bug (740726) which apparently never got fixed for video tracks (it was only fixed for audio tracks).

The following code will cause all kinds of errors:

    GESTrack* videoTrack = ges_video_track_new()
    GstCaps*  caps = gst_caps_new_simple("video/x-raw",
        "width", 100,
        "height", 100,
        nullptr);

    ges_track_update_restriction_caps(gesVideoTrack, caps)

The errors:

	(whatever.exe:5788): GStreamer-CRITICAL **: gst_mini_object_copy: assertion 'mini_object != NULL' failed
	(whatever.exe:5788): GStreamer-CRITICAL **: gst_caps_get_size: assertion 'GST_IS_CAPS (caps)' failed
	(whatever.exe:5788): GStreamer-CRITICAL **: gst_caps_append_structure: assertion 'GST_IS_CAPS (caps)' failed
	** (whatever.exe:5788): CRITICAL **: ges_track_set_restriction_caps: assertion 'GST_IS_CAPS (caps)' failed

To fix these errors, the method `ges_track_update_restriction_caps` should check to see whether restriction caps already exist.  If not, it should call `ges_track_set_restriction_caps`.
Comment 1 David Ing 2018-07-12 17:33:29 UTC
Sorry, I forgot G_TYPE_INT from the code snippet.  Here is the correct snippet:

    GESTrack* videoTrack = ges_video_track_new()
    GstCaps*  caps = gst_caps_new_simple("video/x-raw",
        "width", G_TYPE_INT, 100,
        "height", G_TYPE_INT, 100,
        nullptr);

    ges_track_update_restriction_caps(gesVideoTrack, caps)
Comment 2 Thibault Saunier 2018-07-12 17:55:33 UTC
Created attachment 373010 [details] [review]
track: Set restriction caps when update_restriction before caps being set

And stop leaking intermediary restriction caps.
Comment 3 Mathieu Duponchelle 2018-07-12 18:35:02 UTC
Review of attachment 373010 [details] [review]:

looks fine to me
Comment 4 David Ing 2018-07-12 19:33:09 UTC
Review of attachment 373010 [details] [review]:

Looks good
Comment 5 Thibault Saunier 2018-07-12 19:52:21 UTC
Attachment 373010 [details] pushed as ab22f33 - track: Set restriction caps when update_restriction before caps being set