AW: Help with setting Caps in src code - not using gst-parse-launch

Thornton, Keith keith.thornton at zeiss.com
Fri Mar 19 05:02:14 UTC 2021


Hi,
I haven't tried this myself but you might find something useful in the re-negotiation part of
https://gstreamer.freedesktop.org/documentation/plugin-development/advanced/negotiation.html?gi-language=c
Grüße

Von: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> Im Auftrag von JimmyHan
Gesendet: Freitag, 19. März 2021 02:35
An: gstreamer-devel at lists.freedesktop.org
Betreff: Help with setting Caps in src code - not using gst-parse-launch

Hello Beginner here,

Started learning and understanding more n more with practice.
I have been searching up n down for examples on adding caps in code but after a few days I still don't have a clue.

E.g setting width and height, or denoise, detail, brightness, hue, frc-algorithm and the list goes on.
My boss has built a UI in html, php; where he has been able to add to inser text or choose from a drop down list options for the pipeline.

Looks like this screenshot of my setup:
[http://gstreamer-devel.966125.n4.nabble.com/file/t379895/rsz_screenshot_from_2021-03-18_17-24-45.png]

My task was to add and integrate those options shown in the image. After choosing those options I then create a xml file, then read that xml file options into variables using an xmlreader.

For e.g I know a video source capabilities would include width and height.
I know how to add those caps using gst-launch-1.0 or gst-parse-launch


what I really wanna know is how do I get that done in code.
I don't even have any idea which element has capabilities such as the others shown in the image but for now I'd just like to how to add them in code.

I have seen e.g. such as:

GstElements *capsfilter;
GstCaps * caps;

capsfilter = gst_element_factory_make ("capsfilter", "capsfilter");
caps = gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, 1920, "height", G_TYPE_INT, 1080, "framerate", G_TYPE_INT, 60, NULL);
g_object_set (capsfilter, "caps", caps, NULL);
gst_caps_unref (caps);

I'd also appreciate any idea or guide on adjusting these in code:
denoise, detail, brightness, hue, frc-algorithm, etc
________________________________
Sent from the GStreamer-devel mailing list archive<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgstreamer-devel.966125.n4.nabble.com%2F&data=04%7C01%7C%7C4ec28fd90c424277540c08d8ea810e9d%7C28042244bb514cd680347776fa3703e8%7C1%7C1%7C637517187306190690%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=aWUz23YXz9TItRImkreoEdWZ38UmVS6IrE%2BnVaJCzFo%3D&reserved=0> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210319/a599ce62/attachment.htm>


More information about the gstreamer-devel mailing list