How to retrieve last-sample from d3d11videosink

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to retrieve last-sample from d3d11videosink

jean-philippe
I need to store a snapshot from my live display. I'm using the D3D11 elements
on Windows 10 with GStreamer 1.18.3.

The relevant section of the pipeline: "d3d11h264dec ! d3d11convert !
d3d11videosink".

Variable 'sample' is null after the call in the following code:

GstSample* sample = nullptr;

g_object_get(videosink, "last-sample", &sample, NULL);
if (!sample)
   THROW("Failed getting sample");

If the last-sample option does not work, what alternative do I have to take
a snapshot?

Thanks




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to retrieve last-sample from d3d11videosink

Nicolas Dufresne-5
Le mardi 02 mars 2021 à 10:51 -0600, jean-philippe a écrit :

> I need to store a snapshot from my live display. I'm using the D3D11 elements
> on Windows 10 with GStreamer 1.18.3.
>
> The relevant section of the pipeline: "d3d11h264dec ! d3d11convert !
> d3d11videosink".
>
> Variable 'sample' is null after the call in the following code:
>
> GstSample* sample = nullptr;
>
> g_object_get(videosink, "last-sample", &sample, NULL);
> if (!sample)
>    THROW("Failed getting sample");
>
> If the last-sample option does not work, what alternative do I have to take
> a snapshot?

Can you check is enable-last-sample property is set ?

>
> Thanks
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to retrieve last-sample from d3d11videosink

Seungha Yang
In reply to this post by jean-philippe
Hi,

g_object_get(videosink, "last-sample", &sample, NULL) could return null
sample
if it's called before the videosink is receiving any buffer from upstream

Regards,
Seungha



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to retrieve last-sample from d3d11videosink

jean-philippe
In reply to this post by Nicolas Dufresne-5
enable-last-sample is set to TRUE by default, but setting it anyway to TRUE
make the last-sample signal work.

   videosink = gst_element_factory_make("d3d11videosink", "");
   int x = -1;
   g_object_get(videosink, "enable-last-sample", &x, NULL);  -- > x == TRUE,
but last-sample returns nullptr
   g_object_set(videosink, "enable-last-sample", TRUE, NULL);
   g_object_get(videosink, "enable-last-sample", &x, NULL);  -- > x == TRUE,
last-sample returns valid GstSample *

Many thanks for the help!

Do you need me to file a bug report? If so, can you let me know where
please?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel