Plugin Search Path
When the GStreamer program runs, search for the plug-in in the following order:
- PATH
- gst_plugin_path_1_0 or gst_plugin_path
- gst_plugin_system_path_1_0 or gst_plugin_system_path
Each environment variable contains a list of paths. If the gst_plugin_path_1_0 environment variable is set, the Gst_plugin_path is automatically invalidated. This facilitates the simultaneous installation of GStreamer-0.10 and GStreamer-1.0 in the system. Similarly, if gst_plugin_system_path_1_0 is set, it will replace Gst_plugin_system_path.
So since Gst_plugin_path and Gst_plugin_system_path both refer to the path of the plugin, why set two similar environment variables?
The answer is that GStreamer does not reload the search plugin, so we search for a plugin in Gst_plugin_path , and another version of the plugin is gst_plugin_system_ The PATH is searched, and the latter version is ignored. This allows us to overwrite the version of the system installation with our own version.
In this case, we should use Gst_plugin_system_path to refer to the GStreamer plugin path installed on the system and use the Gst_plugin_path Refers to our own development of plug-ins. However, in practice, it is not necessary to strictly define the nature of the plug-in path that these variables point to. I often add the system plug-in path to the path system variable. GStreamer can also find the system plugin.
It is also necessary to note that
-
When both gst_plugin_system_path_1_0 and Gst_plugin_system_path are not defined, GStreamer automatically adds the following path to the Gst_plugin_system_path:
-
User Directory GStreamer plug-in path, typically $xdg_data_home/gstreamer-1.0/plugins, $xdg_data_home The default path is $ Home/.local/share
-
System plug-in directory, $prefix/libs/gstreamer-1.0
-
If you need to avoid GStreamer automatic search for the above path, you can set Gst_plugin_system_path to empty!
Debug output
Set the gst_debug variable to control the output of the GStreamer runtime. Gst_debug can be set to the following format:
"Module Name 1: Level , module Name 2: Level , ..."
A wildcard "*" can be used in the module name, such as:
- "*: 1": Indicates all module output levels 1
- "Gst_element_:": Indicates that all modules starting with "gst_element_" Output Level 4
| level |
name |
meaning |
| 1 |
ERROR |
Logs all fatal errors |
| 2 |
WARNING |
Logs all warnings |
| 3 |
fixme |
Logs all fixme messages |
| 4 |
INFO |
Logs all informational messages |
| 5 |
D Ebug |
Logs all debug Messages |
| 6 |
log |
Logs all LOG message s |
| 7 |
trace |
Logs all TRACE messages |
| 9 |
Memdump |
Logs All memory dump messages |
- Fixme: This type of message indicates that a piece of code executed has not been fully implemented or needs more attention.
- INFO: Records occur only once, or are more important, or uncommon event messages.
- DEBUG: Record event messages with a limited number of occurrences, such as Setup, teardown, parameter changes ...
- LOG: Record recurring events, such as streaming ...
- TRACE: Records recurring events, such as Ref/unref
If the gst_debug_file environment variable is set, all log information will be relocated to the file specified by the variable, otherwise all information is output to the standard error output (stderr).
Registry Cache
When the GStreamer program starts, it searches for the plug-in according to the specified path and stores the plugin's information in the file system (cache). The file path where the cache is stored is
$ xdg_cache_home/gstreamer-1.0/registry-$arch.bin,
When gst_registry_1_0 or gst_registryis set, the cache is saved to the specified path.
During the search for the plug-in, GStreamer compares the validity of the cache and decides whether to update the cache. If there are any changes, the new cache information is written to the file system at the end of the initialization function.
GStreamer 1.0 Runtime environment variable settings