project_: Save encoder advanced settings
ClosedPublic

Authored by stefanzzz on Aug 14 2017, 1:09 PM.

Details

Summary

Make sure encoder advanced settings are serialized in the .xges file,
so users don't have to enter them again everytime they open a project

Diff Detail

Repository
rPTV Pitivi
stefanzzz created this revision.Aug 14 2017, 1:09 PM

There is an issue with the On2 VP8 encoder. Calling save_preset on it will cause a segfault. This is the most interesting part of the stack trace:

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
gst_value_serialize_g_value_array (value=0x7ffea7f31e10) at gstvalue.c:1111
1111	  return _gst_value_serialize_g_value_array (value, "< ", " >");

#0  0x00007f9388e10a62 in gst_value_serialize_g_value_array (value=0x7ffea7f31e10) at gstvalue.c:1111
#1  0x00007f9388e106f1 in gst_value_serialize (value=value@entry=0x7ffea7f31e10) at gstvalue.c:6106
        i = <optimized out>
        len = <optimized out>
        s_val = 
              {g_type = 0, data = {{v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
        table = <optimized out>
        best = <optimized out>
        s = <optimized out>
        type = 19782192
        __func__ = "gst_value_serialize"
#2  0x00007f9388ddae3c in gst_preset_default_save_preset (preset=0x367f9d0, name=0x3700bd0 "encoder_settings_1502715712.12172") at gstpreset.c:867
        gvalue = 
              {g_type = 19782192, data = {{v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}, {v_int = 0, v_uint = 0, v_long = 0, v_ulong = 0, v_int64 = 0, v_uint64 = 0, v_float = 0, v_double = 0, v_pointer = 0x0}}}
        str = <optimized out>
        property = 0x372e9c0 [GParamValueArray]
        presets = 0x36b8480
        props = 0x3709350
        i = 21
        gclass = 0x372b600
        is_child_proxy = 0
        __PRETTY_FUNCTION__ = "gst_preset_default_save_preset"

This happens because this encoder passes a GValue of type GValueArray with a NULL v_pointer, which crashes the gst_value_serialize_g_value_array function. We could modify the gst_value_serialize_g_value_array to allow this, but I am not sure if this is the way to go.

stefanzzz updated this revision to Diff 6339.Aug 21 2017, 2:08 PM
stefanzzz edited the summary of this revision. (Show Details)

Changed my approach.

thiblahute requested changes to this revision.Aug 21 2017, 2:33 PM
thiblahute added inline comments.
pitivi/check.py
337 ↗(On Diff #6247)

I added today as a GIDependency actually

pitivi/project.py
734

s/encoding_profile/container_profile

1317

You should check "Encoder" and "Audio" in fact.get_klass(), Encoders are not required to be subclasses of XxxEncoder and thus it is the proper way to do it.

This revision now requires changes to proceed.Aug 21 2017, 2:33 PM
stefanzzz updated this revision to Diff 6347.Aug 22 2017, 2:20 PM
stefanzzz marked 2 inline comments as done.

Made required changes.

stefanzzz added inline comments.Aug 22 2017, 2:21 PM
pitivi/project.py
1317

I actually just need to make sure that it implements Gst.Preset here.

thiblahute accepted this revision.Aug 26 2017, 2:18 PM

Looks good!

pitivi/project.py
1317

++

This revision is now accepted and ready to land.Aug 26 2017, 2:18 PM
This revision was automatically updated to reflect the committed changes.