Skip to content

Commit

Permalink
Add: Default value for fps parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Kasiewicz, Marek <[email protected]>
  • Loading branch information
Sakoram committed Feb 6, 2025
1 parent b4b64f5 commit 7a906b0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ecosystem/gstreamer_plugin/gst_mtl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define NS_PER_S (1000 * NS_PER_MS)
#endif

#define DEFAULT_FRAMERATE 30
#define DEFAULT_FRAMERATE 25

enum {
PROP_GENERAL_0,
Expand Down
3 changes: 3 additions & 0 deletions ecosystem/gstreamer_plugin/gst_mtl_st20p_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ static void gst_mtl_st20p_rx_init(Gst_Mtl_St20p_Rx* src) {
GstElement* element = GST_ELEMENT(src);
GstPad* srcpad;

src->fps_n = DEFAULT_FRAMERATE;
src->fps_d = 1;

srcpad = gst_element_get_static_pad(element, "src");
if (!srcpad) {
GST_ERROR_OBJECT(src, "Failed to get src pad from child element");
Expand Down
5 changes: 4 additions & 1 deletion ecosystem/gstreamer_plugin/gst_mtl_st20p_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void gst_mtl_st20p_tx_class_init(Gst_Mtl_St20p_TxClass* klass) {
g_object_class_install_property(
gobject_class, PROP_ST20P_TX_FRAMERATE,
gst_param_spec_fraction("tx-fps", "Video framerate", "Framerate of the video.", 1,
1, G_MAXINT, G_MAXINT, 0, 1,
1, G_MAXINT, 1, DEFAULT_FRAMERATE, 1,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

g_object_class_install_property(
Expand Down Expand Up @@ -201,6 +201,9 @@ static void gst_mtl_st20p_tx_init(Gst_Mtl_St20p_Tx* sink) {
GstElement* element = GST_ELEMENT(sink);
GstPad* sinkpad;

sink->fps_n = DEFAULT_FRAMERATE;
sink->fps_d = 1;

sinkpad = gst_element_get_static_pad(element, "sink");
if (!sinkpad) {
GST_ERROR_OBJECT(sink, "Failed to get sink pad from child element");
Expand Down
3 changes: 3 additions & 0 deletions ecosystem/gstreamer_plugin/gst_mtl_st40p_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ static void gst_mtl_st40p_tx_init(Gst_Mtl_St40p_Tx* sink) {
GstElement* element = GST_ELEMENT(sink);
GstPad* sinkpad;

sink->fps_n = DEFAULT_FRAMERATE;
sink->fps_d = 1;

sinkpad = gst_element_get_static_pad(element, "sink");
if (!sinkpad) {
GST_ERROR_OBJECT(sink, "Failed to get sink pad from child element");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def test_video_resolutions(
input_file=input_file_path,
output_file=os.path.join(media, "output_video.yuv"),
type="st20",
tx_first=False,
sleep_interval=1,
tx_first=True,
sleep_interval=0,
)
finally:
# Remove the video file after the test
Expand Down

0 comments on commit 7a906b0

Please sign in to comment.