Re: AppSink consumes lot's of memory. How to control memory consumption?
Антон Шаров
sharov_am at mail.ru
Mon Sep 18 17:16:27 UTC 2023
Hi, Nicolas! Thank you for reply!
Shame on me, but I’m not aware of this functionality. Can you provide more info about this feature?
Thanks in advance.
>
>I believe recent C# GC allow you to do explicit unref (nullifying the object) to workaround the issue. The GC have no idea about the size of the object/buffer, so it does not prioritize it.
>
>>>>
>>>> Any ideas how to achieve that?
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>> Appsink code:
>>>>
>>>> var appSink = new AppSink("appsink_{CaptureConfig.CameraId}");
>>>> appSink.NewSample += AppSinkNewSample;
>>>> appSink.EmitSignals = true;
>>>>
>>>> private void AppSinkNewSample(object o, NewSampleArgs args)
>>>> {
>>>> if (o is AppSink aps)
>>>> {
>>>> using (var sample = aps.PullSample())
>>>> {
>>>> using (var buf = sample.Buffer)
>>>> {
>>>> SomeStuff(buf);
>>>> }
>>>> }
>>>> }
>>>> }
>>>>
>>>>
>>>>
>>
>>
>>--
>>С Уважением,
>>Шаров Антон
>>
>
>
--
С Уважением,
Шаров Антон
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230918/4fda53e4/attachment.htm>
More information about the gstreamer-devel
mailing list