Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gstreamer_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Falron98 committed Jan 13, 2025
2 parents fbf0b65 + fadcff0 commit 534b5e2
Show file tree
Hide file tree
Showing 14 changed files with 252 additions and 832 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ permissions:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: 'ubuntu-22.04'
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -61,10 +60,9 @@ jobs:

- name: Install the build dependency
run: |
sudo apt-get update -y
sudo apt-get install -y sudo git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev
sudo apt-get install -y dpdk-dev
sudo apt-get install -y systemtap-sdt-dev
sudo apt-get update --fix-missing -y
sudo apt-get install --no-install-recommends -y sudo git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev llvm clang
sudo apt-get install --no-install-recommends -y dpdk-dev systemtap-sdt-dev software-properties-common
- name: Git config
run: |
Expand Down
37 changes: 35 additions & 2 deletions ecosystem/gstreamer_plugin/gst_mtl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ gboolean gst_mtl_common_parse_sampling(gint sampling, enum st30_sampling* st_sam
void gst_mtl_common_init_general_argumetns(GObjectClass* gobject_class) {
g_object_class_install_property(
gobject_class, PROP_GENERAL_LOG_LEVEL,
g_param_spec_boolean("silent", "Silent", "Turn on silent mode.", FALSE,
G_PARAM_READWRITE));
g_param_spec_uint("log-level", "Log Level", "Set the log level (INFO 1 to CRIT 5).",
1, MTL_LOG_LEVEL_MAX, 1,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

g_object_class_install_property(
gobject_class, PROP_GENERAL_DEV_ARGS_PORT,
Expand Down Expand Up @@ -391,3 +392,35 @@ gboolean gst_mtl_common_parse_dev_arguments(struct mtl_init_params* mtl_init_par
gst_mtl_port_idx++;
return ret;
}

mtl_handle gst_mtl_common_init_handle(struct mtl_init_params* p, StDevArgs* devArgs,
guint* log_level) {
struct mtl_init_params mtl_init_params = {0};

if (!p || !devArgs || !log_level) {
GST_ERROR("Invalid input");
return NULL;
}

mtl_init_params.num_ports = 0;

if (gst_mtl_common_parse_dev_arguments(&mtl_init_params, devArgs) == FALSE) {
GST_ERROR("Failed to parse dev arguments");
return NULL;
}
mtl_init_params.flags |= MTL_FLAG_BIND_NUMA;

/*
* Log levels range from 1 to LOG_LEVEL_MAX.
* We avoid using 0 (DEBUG) in normal scenarios,
* so it's acceptable to use 0 as a placeholder.
*/
if (*log_level && *log_level < MTL_LOG_LEVEL_MAX) {
mtl_init_params.log_level = *log_level;
} else {
mtl_init_params.log_level = MTL_LOG_LEVEL_INFO;
}
*log_level = mtl_init_params.log_level;

return mtl_init(&mtl_init_params);
}
9 changes: 9 additions & 0 deletions ecosystem/gstreamer_plugin/gst_mtl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
#define PAYLOAD_TYPE_VIDEO (112)
#define PAYLOAD_TYPE_ANCILLARY (113)

#ifndef NS_PER_MS
#define NS_PER_MS (1000 * 1000)
#endif

#ifndef NS_PER_S
#define NS_PER_S (1000 * NS_PER_MS)
#endif

enum {
PROP_GENERAL_0,
Expand Down Expand Up @@ -95,4 +101,7 @@ void gst_mtl_common_get_general_argumetns(GObject* object, guint prop_id,
StDevArgs* devArgs, SessionPortArgs* portArgs,
guint* log_level);

mtl_handle gst_mtl_common_init_handle(struct mtl_init_params* p, StDevArgs* devArgs,
guint* log_level);

#endif /* __GST_MTL_COMMON_H__ */
Loading

0 comments on commit 534b5e2

Please sign in to comment.