Channing dimensions of source element
Anton Pryima
zingfrid at gmail.com
Tue Aug 3 17:35:47 UTC 2021
Hello Maurice.
I suggest, that after you've done with gst_base_src_set_caps, you should
send 'reconfigure' event down the pipe to notify all downstream elements
that caps were changed.
Best regards,
Anton.
On Tue, Aug 3, 2021 at 6:19 PM Maurice Ackel via gstreamer-devel <
gstreamer-devel at lists.freedesktop.org> wrote:
> Hi there,
>
> I am currently developing a source element for gstreamer that is supposed
> to capture a specific window of the screen. I extend the GstPushSrc class.
> My testing pipeline looks like this: mycustomsrc ! autovideosink.
>
> Currently, I get the initial dimensions of the captured window in the
> „start“ virtual function and return caps in the „get_caps“ function
> according to those dimensions. From my testing, it seems as if this causes
> the autovideosink to allocate a buffer pool. I access the buffer pool using
> gst_base_src_get_buffer_pool which I use in my „create“ function to get new
> buffers and write the captured image to the associated memory.
>
> Now, if I resize the captured window, I need this buffer pool to be
> reconfigured, as otherwise the memory might be too small or the stride is
> not matching anymore, etc. However, I don’t seem to be able to figure out
> how exactly I can do this. What I am currently trying is to detect a change
> of dimension in my capture function. Then, I am calling
> “gst_base_src_set_caps“ with updated width and height. I hoped that this
> would cause the autovideosink to reconfigure the buffer so that it allows
> for frames of the new dimensions, but this does not seem to work, as the
> size of the buffer pool stays constant, even though I see in the logs that
> the caps are communicated between my source and the sink.
>
> I am fairly new to gstreamer so I am happy for any advice that pushes me
> into the right direction! I have studied a lot of other source plugins but
> so far I have not found any other plugin that seems to do exactly what I
> need.
>
> Thank you very much for your help,
> Maurice
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210803/cf6eff09/attachment.htm>
More information about the gstreamer-devel
mailing list