Unable to use numpy arrays for certain element properties with recent pygobject

Nicolas Dufresne nicolas at ndufresne.ca
Wed Apr 5 22:50:09 UTC 2023


Le mer. 5 avr. 2023, 17 h 32, Chad Hanna <crh184 at psu.edu> a écrit :

> Thanks, Nicolas.
>
> Fwiw, it was first reported in gstreamer and suggested to report to
> pygobject, see here
>
> https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/50
>

We have a monorepo now, so this is likely lost.


>
> Your example is helpful but I am not sure that it actually addresses all
> of the cases that previously worked, unfortunately.  Our workaround is much
> more extensive at this point than just adding a .to list() for every case
> with array like properties and it used to be much easier.  I will follow up
> when I can, but it sounds like there is no intention to restore the
> previous behavior?  That is useful for our planning.
>

Then play the card of API break with pygobject folks, we made no recent
changes on our side in this regard. I noticed that ValueArray constructor
in glib now ignore the args, if it didn't do that before, it's an API
break. ValueArray is such a mess, but we are stuck with it in some part of
GStreamer.

An alternative is to add overrides to explicitly support the numpy arrays
in gst-python, patches welcome (against GStreamer/ repo these days).

Nicolas


> Best,
>
> Chad
>
>
>
> On Wed, Apr 5, 2023, 2:51 PM Nicolas Dufresne <nicolas at ndufresne.ca>
> wrote:
>
>> Le lundi 03 avril 2023 à 22:03 -0400, Chad Hanna via gstreamer-devel a
>> écrit :
>> > Hi all
>> >
>> > Has anyone else run into this problem and do you have any advice?
>> >
>> > https://gitlab.gnome.org/GNOME/pygobject/-/issues/488
>>
>> Replied on the issue, please come here first next time, this is a support
>> request, not a bug report. Here's what you are looking for:
>>
>>   elem.props.kernel = numpy.array([1.3, 2.6, 3.9]).tolist()
>>
>> Nicolas
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230405/1dac4eec/attachment.htm>


More information about the gstreamer-devel mailing list