Skip to content

Commit

Permalink
Adress review 3
Browse files Browse the repository at this point in the history
  • Loading branch information
DawidWesierski4 committed Jan 29, 2025
1 parent f2b53a4 commit e2bd061
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ecosystem/gstreamer_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ These are also general parameters accepted by plugins, but the functionality the

> **Warning:**
> Generally, the `log-level`, `dev-port`, `dev-ip`, `tx-queues`, and `rx-queues` are used to initialize the MTLlibrary. As the MTL library handle is shared between MTL
> GStreamer plugins of the same pipeline, you only need to pass them once when specifying the arguments for thefirst pipeline. Nothing happens when you specify them elsewhere;
> GStreamer plugins of the same pipeline, you only need to pass them once when specifying the arguments for the firstly initialized pipeline. Nothing happens when you specify them elsewhere;
> they will just be ignored after the initialization of MTL has already happened.

### 2.3. General capabilities
Expand Down
7 changes: 5 additions & 2 deletions ecosystem/gstreamer_plugin/gst_mtl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ gboolean gst_mtl_common_parse_dev_arguments(struct mtl_init_params* mtl_init_par
mtl_handle gst_mtl_common_init_handle(StDevArgs* devArgs, guint* log_level,
gboolean force_to_initialize_new_instance) {
struct mtl_init_params mtl_init_params = {0};
mtl_handle ret;
pthread_mutex_lock(&common_handle.mutex);

if (!force_to_initialize_new_instance && common_handle.mtl_handle) {
Expand Down Expand Up @@ -460,9 +461,11 @@ mtl_handle gst_mtl_common_init_handle(StDevArgs* devArgs, guint* log_level,

if (force_to_initialize_new_instance) {
GST_INFO("MTL shared handle ignored");

ret = mtl_init(&mtl_init_params);
pthread_mutex_unlock(&common_handle.mutex);

return mtl_init(&mtl_init_params);
return ret;
}

common_handle.mtl_handle = mtl_init(&mtl_init_params);
Expand All @@ -482,7 +485,7 @@ mtl_handle gst_mtl_common_init_handle(StDevArgs* devArgs, guint* log_level,
* shared value will be used).
*/
gint gst_mtl_common_deinit_handle(mtl_handle handle) {
int ret;
gint ret;

pthread_mutex_lock(&common_handle.mutex);

Expand Down

0 comments on commit e2bd061

Please sign in to comment.