apt install clang-format -y
clang-format -style=microsoft -dump-config > .clang-format
sed -i 's/AlwaysBreakTemplateDeclarations: MultiLine/AlwaysBreakTemplateDeclarations: false/g' .clang-format
# To use
find . -regex '.*\.\(c\|cc\|cpp\|cxx\|cu\|h\|hh\|hpp\|hxx\|inl\|inc\|ipp\|m\|mm\)$' -exec clang-format -style=file -i {} \;
python3 -m pip install pre-commit
pre-commit install # runs every time you commit in git
pre-commit run -a # To use
pre-commit autoupdate # To update this file
- See source code at
basic-tutorial-1.cpp
.
-
Initialize GStreamer using
gst_init()
. -
Quickly build a pipeline from a textual description using
gst_parse_launch()
. -
Create an automatic playback pipeline using
playbin
. -
Signal GStreamer to start playback using
gst_element_set_state()
. -
Sit back and relax, while GStreamer takes care of everything, using
gst_element_get_bus()
andgst_bus_timed_pop_filtered()
.
- See source code at
basic-tutorial-2.cpp
.
-
Create elements with
gst_element_factory_make()
. -
Create an empty pipeline with
gst_pipeline_new()
. -
Add elements to the pipeline with
gst_bin_add_many()
. -
Link the elements with each other with
gst_element_link()
.
- See source code at
basic-tutorial-3.cpp
.
-
Be notified of events using
GSignals
. -
Connect
GstPads
directly instead of their parent elements. -
The various states of a GStreamer element.
- See source code at
basic-tutorial-4.cpp
.
-
How to query the pipeline for information using
GstQuery
-
How to obtain common information like position and duration using
gst_element_query_position()
andgst_element_query_duration()
. -
How to seek to an arbitrary position in the stream using
gst_element_seek_simple()
. -
In which states all these operations can be performed.
- See source code at
basic-tutorial-5.cpp
.
-
How to output the video to a particular GTK Widget using the
gtksink
Element. -
How to refresh the GUI periodically by registering a timeout callback with
g_timeout_add_seconds()
. -
How to convey information to the main thread by means of application messages through the bus with
gst_element_post_message()
. -
How to be notified only of interesting messages by making the bus emit signals with
gst_bus_add_signal_watch()
and discriminating among all message types using the signal details.
- See source code at
basic-tutorial-6.cpp
.
-
What are Pad Capabilities and Pad Template Capabilities.
-
How to retrieve them with
gst_pad_get_current_caps()
orgst_pad_query_caps()
. -
That they have different meaning depending on the state of the pipeline (initially they indicate all the possible Capabilities, later they indicate the currently negotiated Caps for the Pad).
-
That Pad Caps are important to know beforehand if two elements can be linked together.
-
That Pad Caps can be found using the
gst-inspect-1.0
tool described in Basic tutorial 10: GStreamer tools.
- See source code at
basic-tutorial-6.cpp
.
-
How to make parts of a pipeline run on a different thread by using
queue
elements. -
What is a Request Pad and how to link elements with request pads, with
gst_element_request_pad_simple()
,gst_pad_link()
andgst_element_release_request_pad()
. -
How to have the same stream available in different branches by using
tee
elements.