STEP 2 : Create the Gstreamer element on template

STEP 2.1 : Build the Gstreamer template and testing

This process will build gstreamer template plugin for create your gstreamer template for get data from gstreaamer on step 3

  1. Build gstreamer on devcontainer

$ meson build

2. Linking library from build file

$ ninja -C build

3. Set environment to built gstreamer template

$ export GST_PLUGIN_PATH=/workspaces/gst-template/build/gst-plugin

4. Check gst-plugin gst-inspect-1.0 is a tool that prints out information on availabl GStreamer plugins, information about a particular plugin, or information about a particular element.

$ gst-inspect-1.0 /workspaces/gst-template/build/gst-plugin/libgstplugin.so

From the inspection, we found version of gst-plugin from we build is version 1.19.0.1 and it’s gstreamer element, The name of element is plugin_template

5. Test run gst-template working

$ gst-launch-1.0 videotestsrc ! plugin_template ! fakesink

STEP 2.2 : Create the gstreamer template

In this state, we will create our gstreamer template for get data from mockup data and application gstreamer code for get more data.

1. First we will create the gstreamer element

$ cd gst-plugin/src
$ ../tools/make_element videodatagst 
# video_data_gst just a name of your element, Don't worry to create your element name like lnwza007.

2. Go to line 247 : gst videodatagst_chain. This function using for adjust working process inside the element. What is gst elemnet please folow this link

  • The Gstreamer element is black box of video process, it’s can recive input process from sink and put throughtput to src

From the function, we saw the parameter is

  • pad are the element's interface to the outside world. Data streams from one element's source pad to another element's sink pad.

  • parent are the element’s relation on sink or src pad between element for reference data with the group of parent element.

  • buf are the basic unit of data transfer in GStreamer. They contain the timing and offset along with other arbitrary metadata that is associated with the GstMemory blocks that the buffer contains.

So from this function is chain. it’s mean working process on element pad, we can debug code or define element process on this fucntion.

Last updated

Assoc. Prof. Wiroon Sriborrirux, Founder of Advance Innovation Center (AIC) and Bangsaen Design House (BDH), Electrical Engineering Department, Faculty of Engineering, Burapha University