Compare commits

...

10 Commits

Author SHA1 Message Date
Wim Taymans
4417183bae riff-media: fix MS and DVI ADPCM av_bps calculations
Align the calculations for the number of samples per block with the
calculations in adpcmdec.

For MS ADPCM we have in adpcmdec:

       samples = (blocksize - 7 * dec->channels) * 2 + 2 * dec->channels;
       outsize = 2 * samples;
       outbuf = gst_buffer_new_and_alloc (outsize);

This gives us the total output byte size in 16 bits samples. To get back
to the samples, dividing by the channels and 2, we get the right samples per
block as:

       int spb = ((strf->blockalign / strf->channels) - 7) * 2 + 2;

Which we can then use to calculate the bitrate in riff-media.

A similar calculation for DVI ADPCM is needed to get the right bitrate
in all cases.

Tested with the sample in https://bugzilla.gnome.org/show_bug.cgi?id=636245
and another (failing before this patch) sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9082>
2025-05-29 10:09:51 +02:00
Doug Nazar
581e72a23e rtsp-server: tests: Fix a few memory leaks
Also use any port to run server to avoid conflicts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9116>
2025-05-28 23:41:49 +00:00
Doug Nazar
feb6e1602a validate: Escape '%' in Valgrind log filenames
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9042>
2025-05-28 16:01:44 +00:00
Doug Nazar
822bef51f0 validate: Fix marking actions done
Don't take extra ref during calling done() from 'stream-selection'
Mark as done actions that are completed immediately

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9042>
2025-05-28 16:01:44 +00:00
Doug Nazar
5c4bf60c94 validate: Free log files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9042>
2025-05-28 16:01:44 +00:00
Doug Nazar
09cf44aa13 validate: Various minor cleanups for lost memory or use after free
Includes several missing unref(), clear() or free() calls.
Reset current_seek since we just cleared all the seeks.
Reset all_configs to NULL to prevent double clearing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9042>
2025-05-28 16:01:44 +00:00
Tim-Philipp Müller
d273b790e1 textoverlay: fix shading for RGBx/RGBA pixel format variants
... for cases where there's padding at the end of each row.

Fixes #4414.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9106>
2025-05-28 08:45:03 +00:00
Daniel Morin
e72e9a95d8 rtpsender: fix 'priority' GValue get/set
- 'priority' is declared as enum, we need to use g_value_[get|set]_enum()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9105>
2025-05-28 07:28:16 +00:00
Aleix Pol
e627d02171 qml6glitem,qtitem: Allow configuring if the item will consume input events
At the moment we are always accepting the input events to forward into
GStreamer infrastructure. This works but we might have other uses for
such events elsewhere in the QtQuick scene so allow opting out to this
behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9085>
2025-05-28 01:13:21 +00:00
Doug Nazar
c5f9d4073f adaptivedemux2: Fix race for expected error in test
After gst-validate-1.0 notices the first expected error on the bus, it will
queue the completion of that action while the pipeline is still processing the
error and getting to the basesrc for the second error.

Mark the second error as 'sometimes=true', as it's not critical to the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9060>
2025-05-27 20:35:41 +00:00
23 changed files with 127 additions and 30 deletions

View File

@ -168,6 +168,7 @@ gst_mockdecryptor_transform_caps (GstBaseTransform * base,
gst_caps_intersect_full (transformed_caps, filter, gst_caps_intersect_full (transformed_caps, filter,
GST_CAPS_INTERSECT_FIRST); GST_CAPS_INTERSECT_FIRST);
gst_caps_replace (&transformed_caps, intersection); gst_caps_replace (&transformed_caps, intersection);
gst_caps_unref (intersection);
} }
GST_DEBUG_OBJECT (base, "returning %" GST_PTR_FORMAT, transformed_caps); GST_DEBUG_OBJECT (base, "returning %" GST_PTR_FORMAT, transformed_caps);

View File

@ -488,6 +488,7 @@ _append_accept_caps_failure_details (GstValidatePadMonitor * monitor,
} }
} }
gst_caps_unref (refused_caps);
gst_caps_unref (possible_caps); gst_caps_unref (possible_caps);
gst_object_unref (pad); gst_object_unref (pad);

View File

@ -699,8 +699,6 @@ gst_validate_report_init (void)
gchar **wanted_files; gchar **wanted_files;
wanted_files = g_strsplit (file_env, G_SEARCHPATH_SEPARATOR_S, 0); wanted_files = g_strsplit (file_env, G_SEARCHPATH_SEPARATOR_S, 0);
/* FIXME: Make sure it is freed in the deinit function when that is
* implemented */
log_files = log_files =
g_malloc0 (sizeof (FILE *) * (g_strv_length (wanted_files) + 1)); g_malloc0 (sizeof (FILE *) * (g_strv_length (wanted_files) + 1));
for (i = 0; i < g_strv_length (wanted_files); i++) { for (i = 0; i < g_strv_length (wanted_files); i++) {
@ -745,6 +743,16 @@ gst_validate_report_deinit (void)
g_clear_object (&socket_client); g_clear_object (&socket_client);
g_clear_object (&server_connection); g_clear_object (&server_connection);
if (log_files) {
gint i;
for (i = 0; log_files[i]; i++) {
if (log_files[i] != stdout && log_files[i] != stderr)
fclose (log_files[i]);
}
g_free (log_files);
log_files = NULL;
}
} }
/** /**

View File

@ -90,6 +90,7 @@ gst_validate_reporter_get_priv (GstValidateReporter * reporter)
g_direct_equal, NULL, (GDestroyNotify) gst_validate_report_unref); g_direct_equal, NULL, (GDestroyNotify) gst_validate_report_unref);
g_mutex_init (&priv->reports_lock); g_mutex_init (&priv->reports_lock);
g_weak_ref_init (&priv->runner, NULL);
g_object_set_data_full (G_OBJECT (reporter), REPORTER_PRIVATE, priv, g_object_set_data_full (G_OBJECT (reporter), REPORTER_PRIVATE, priv,
(GDestroyNotify) _free_priv); (GDestroyNotify) _free_priv);
} }

View File

@ -2207,6 +2207,7 @@ select_stream_data_free (SelectStreamData * d)
{ {
gst_validate_action_unref (d->action); gst_validate_action_unref (d->action);
g_list_free_full (d->wanted_streams, g_free); g_list_free_full (d->wanted_streams, g_free);
g_rec_mutex_clear (&d->m);
} }
static void static void
@ -2311,7 +2312,7 @@ done:
if (selected_streams && d->message_sid && if (selected_streams && d->message_sid &&
d->wanted_n_calls >= 1 && d->n_calls == d->wanted_n_calls) { d->wanted_n_calls >= 1 && d->n_calls == d->wanted_n_calls) {
/* Consider action done once we get the STREAM_SELECTED signal */ /* Consider action done once we get the STREAM_SELECTED signal */
gst_validate_action_set_done (gst_validate_action_ref (d->action)); gst_validate_action_set_done (d->action);
gst_bus_disable_sync_message_emission (bus); gst_bus_disable_sync_message_emission (bus);
g_signal_handler_disconnect (bus, d->message_sid); g_signal_handler_disconnect (bus, d->message_sid);
d->message_sid = 0; d->message_sid = 0;
@ -2347,7 +2348,7 @@ stream_selection_scenario_stopping_cb (GstValidateScenario * scenario,
d->wanted_n_calls, d->n_calls); d->wanted_n_calls, d->n_calls);
} }
gst_validate_action_set_done (gst_validate_action_ref (d->action)); gst_validate_action_set_done (d->action);
if (bus && d->message_sid) { if (bus && d->message_sid) {
gst_bus_disable_sync_message_emission (bus); gst_bus_disable_sync_message_emission (bus);
@ -2911,6 +2912,8 @@ _execute_on_sub_scenario (GstValidateScenario * scenario,
data->subaction_done_sigid); data->subaction_done_sigid);
data->subaction_done_sigid = 0; data->subaction_done_sigid = 0;
} }
gst_validate_action_set_done (subaction);
} }
g_mutex_unlock (&data->sigid_lock); g_mutex_unlock (&data->sigid_lock);
validate_action_foreign_scenario_data_unref (data); validate_action_foreign_scenario_data_unref (data);
@ -4387,6 +4390,7 @@ _execute_appsrc_push (GstValidateScenario * scenario,
g_signal_emit_by_name (appsink, "pull-sample", &sample, NULL); g_signal_emit_by_name (appsink, "pull-sample", &sample, NULL);
g_strfreev (pipeline_elements);
goto push_sample; goto push_sample;
} }
@ -5290,6 +5294,7 @@ handle_bus_message (MessageData * d)
g_list_free_full (priv->seeks, g_list_free_full (priv->seeks,
(GDestroyNotify) gst_validate_seek_information_free); (GDestroyNotify) gst_validate_seek_information_free);
priv->seeks = NULL; priv->seeks = NULL;
priv->current_seek = NULL;
SCENARIO_UNLOCK (scenario); SCENARIO_UNLOCK (scenario);
GST_DEBUG_OBJECT (scenario, "Got EOS; generate 'stop' action"); GST_DEBUG_OBJECT (scenario, "Got EOS; generate 'stop' action");
@ -5958,6 +5963,7 @@ gst_validate_scenario_dispose (GObject * object)
} }
gst_object_replace ((GstObject **) & priv->clock, NULL); gst_object_replace ((GstObject **) & priv->clock, NULL);
gst_object_unref (runner);
G_OBJECT_CLASS (gst_validate_scenario_parent_class)->dispose (object); G_OBJECT_CLASS (gst_validate_scenario_parent_class)->dispose (object);
} }
@ -7598,6 +7604,7 @@ _execute_start_http_server (GstValidateScenario * scenario,
err->message); err->message);
REPORT_UNLESS (sscanf (line, "PORT: %d", &port) == 1, done, REPORT_UNLESS (sscanf (line, "PORT: %d", &port) == 1, done,
"Failed to parse port number from server output: %s", line); "Failed to parse port number from server output: %s", line);
g_free (line);
server.port = port; server.port = port;
server.subprocess = subprocess; server.subprocess = subprocess;

View File

@ -518,7 +518,8 @@ gst_validate_deinit (void)
g_list_free (core_config); g_list_free (core_config);
core_config = NULL; core_config = NULL;
g_list_free_full (all_configs, (GDestroyNotify) gst_structure_free); g_list_free_full (g_steal_pointer (&all_configs),
(GDestroyNotify) gst_structure_free);
gst_validate_deinit_runner (); gst_validate_deinit_runner ();
gst_validate_scenario_deinit (); gst_validate_scenario_deinit ();

View File

@ -651,9 +651,6 @@ class Test(Loggable):
return command return command
def use_valgrind(self, command, subenv): def use_valgrind(self, command, subenv):
vglogsfile = os.path.splitext(self.logfile)[0] + '.valgrind'
self.extra_logfiles.add(vglogsfile)
vg_args = [] vg_args = []
for o, v in [('trace-children', 'yes'), for o, v in [('trace-children', 'yes'),
@ -675,7 +672,7 @@ class Test(Loggable):
if not self.options.redirect_logs: if not self.options.redirect_logs:
vglogsfile = os.path.splitext(self.logfile)[0] + '.valgrind' vglogsfile = os.path.splitext(self.logfile)[0] + '.valgrind'
self.extra_logfiles.add(vglogsfile) self.extra_logfiles.add(vglogsfile)
vg_args.append("--%s=%s" % ('log-file', vglogsfile)) vg_args.append("--%s=%s" % ('log-file', vglogsfile.replace("%", "%%")))
for supp in self.get_valgrind_suppressions(): for supp in self.get_valgrind_suppressions():
vg_args.append("--suppressions=%s" % supp) vg_args.append("--suppressions=%s" % supp)

View File

@ -481,6 +481,7 @@ _set_videoconvert (ValidateSsimOverride * o,
caps = gst_pad_get_current_caps (pad); caps = gst_pad_get_current_caps (pad);
gst_object_unref (pad); gst_object_unref (pad);
gst_caps_replace (&priv->last_caps, caps); gst_caps_replace (&priv->last_caps, caps);
gst_caps_unref (caps);
gst_video_info_init (&priv->in_info); gst_video_info_init (&priv->in_info);
gst_video_info_init (&priv->out_info); gst_video_info_init (&priv->out_info);

View File

@ -86,6 +86,8 @@ GST_START_TEST (monitors_cleanup)
g_object_get_data ((GObject *) sink->sinkpads->data, "validate-monitor"); g_object_get_data ((GObject *) sink->sinkpads->data, "validate-monitor");
gst_check_objects_destroyed_on_unref (monitor, pmonitor1, pmonitor2, NULL); gst_check_objects_destroyed_on_unref (monitor, pmonitor1, pmonitor2, NULL);
gst_check_objects_destroyed_on_unref (pipeline, src, sink, NULL); gst_check_objects_destroyed_on_unref (pipeline, src, sink, NULL);
gst_object_unref (runner);
} }
GST_END_TEST; GST_END_TEST;

View File

@ -154,6 +154,7 @@ GST_START_TEST (buffer_before_segment)
_check_reports_refcount (srcpad, 2); _check_reports_refcount (srcpad, 2);
gst_object_unref (srcpad); gst_object_unref (srcpad);
gst_check_object_destroyed_on_unref (sink); gst_check_object_destroyed_on_unref (sink);
gst_object_unref (monitor);
ASSERT_OBJECT_REFCOUNT (runner, "runner", 2); ASSERT_OBJECT_REFCOUNT (runner, "runner", 2);
gst_object_unref (runner); gst_object_unref (runner);
} }
@ -221,11 +222,15 @@ GST_START_TEST (buffer_outside_segment)
buffer = gst_discont_buffer_new (); buffer = gst_discont_buffer_new ();
GST_BUFFER_PTS (buffer) = 10 * GST_SECOND; GST_BUFFER_PTS (buffer) = 10 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = GST_SECOND; GST_BUFFER_DURATION (buffer) = GST_SECOND;
fail_if (GST_PAD_IS_FLUSHING (gst_element_get_static_pad (identity, pad = gst_element_get_static_pad (identity, "sink");
"sink"))); fail_if (GST_PAD_IS_FLUSHING (pad));
fail_if (GST_PAD_IS_FLUSHING (gst_element_get_static_pad (identity, gst_clear_object (&pad);
"src"))); pad = gst_element_get_static_pad (identity, "src");
fail_if (GST_PAD_IS_FLUSHING (gst_element_get_static_pad (sink, "sink"))); fail_if (GST_PAD_IS_FLUSHING (pad));
gst_clear_object (&pad);
pad = gst_element_get_static_pad (sink, "sink");
fail_if (GST_PAD_IS_FLUSHING (pad));
gst_clear_object (&pad);
fail_unless_equals_int (gst_pad_push (srcpad, buffer), GST_FLOW_OK); fail_unless_equals_int (gst_pad_push (srcpad, buffer), GST_FLOW_OK);
reports = gst_validate_runner_get_reports (runner); reports = gst_validate_runner_get_reports (runner);

View File

@ -206,6 +206,10 @@ _create_issues (GstValidateRunner * runner)
gst_object_unref (sinkpad); gst_object_unref (sinkpad);
gst_object_unref (funnel_sink1); gst_object_unref (funnel_sink1);
gst_object_unref (funnel_sink2); gst_object_unref (funnel_sink2);
free_element_monitor (fakemixer);
free_element_monitor (sink);
free_element_monitor (src2);
free_element_monitor (src1);
gst_check_objects_destroyed_on_unref (fakemixer, funnel_sink1, funnel_sink2, gst_check_objects_destroyed_on_unref (fakemixer, funnel_sink1, funnel_sink2,
NULL); NULL);
gst_check_objects_destroyed_on_unref (src1, srcpad1, NULL); gst_check_objects_destroyed_on_unref (src1, srcpad1, NULL);

View File

@ -37,6 +37,9 @@ GST_START_TEST (test_expression_parser)
fail_unless_equals_uint64 (start, 50 * GST_SECOND); fail_unless_equals_uint64 (start, 50 * GST_SECOND);
gst_validate_action_unref (action); gst_validate_action_unref (action);
gst_mini_object_unref (GST_MINI_OBJECT (seek_type));
gst_mini_object_unref (GST_MINI_OBJECT (set_vars));
gst_object_unref (scenario);
gst_object_unref (runner); gst_object_unref (runner);
} }

View File

@ -8,7 +8,7 @@ meta,
expected-issues = { expected-issues = {
# First attempt to play while the mpd is not available # First attempt to play while the mpd is not available
"expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Service Unavailable.*\"", "expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Service Unavailable.*\"",
"expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Got error: Internal data stream error.*\"", "expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Got error: Internal data stream error.*\", sometimes=true",
"expected-issue, issue-id=\"scenario::execution-error\", details=\".*Error message happened while executing action.*\"", "expected-issue, issue-id=\"scenario::execution-error\", details=\".*Error message happened while executing action.*\"",
# Spurious error that happens racily when tearing down the pipeline # Spurious error that happens racily when tearing down the pipeline
"expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Stream doesn't contain enough.*\", sometimes=true", "expected-issue, issue-id=\"runtime::error-on-bus\", details=\".*Stream doesn't contain enough.*\", sometimes=true",

View File

@ -90,7 +90,7 @@ gst_webrtc_rtp_sender_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_PRIORITY: case PROP_PRIORITY:
gst_webrtc_rtp_sender_set_priority (sender, g_value_get_uint (value)); gst_webrtc_rtp_sender_set_priority (sender, g_value_get_enum (value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -107,7 +107,7 @@ gst_webrtc_rtp_sender_get_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_PRIORITY: case PROP_PRIORITY:
GST_OBJECT_LOCK (sender); GST_OBJECT_LOCK (sender);
g_value_set_uint (value, sender->priority); g_value_set_enum (value, sender->priority);
GST_OBJECT_UNLOCK (sender); GST_OBJECT_UNLOCK (sender);
break; break;
case PROP_TRANSPORT: case PROP_TRANSPORT:

View File

@ -2163,14 +2163,16 @@ gst_base_text_overlay_shade_xRGB (GstBaseTextOverlay * overlay,
{ {
gint i, j; gint i, j;
guint8 *dest_ptr; guint8 *dest_ptr;
guint stride;
dest_ptr = dest->data[0]; dest_ptr = GST_VIDEO_FRAME_PLANE_DATA (dest, 0);
stride = GST_VIDEO_FRAME_PLANE_STRIDE (dest, 0);
for (i = y0; i < y1; i++) { for (i = y0; i < y1; i++) {
for (j = x0; j < x1; j++) { for (j = x0; j < x1; j++) {
gint y, y_pos, k; gint y, y_pos, k;
y_pos = (i * 4 * overlay->width) + j * 4; y_pos = (i * stride) + j * 4;
for (k = 0; k < 4; k++) { for (k = 0; k < 4; k++) {
y = dest_ptr[y_pos + k] - overlay->shading_value; y = dest_ptr[y_pos + k] - overlay->shading_value;
dest_ptr[y_pos + k] = CLAMP (y, 0, 255); dest_ptr[y_pos + k] = CLAMP (y, 0, 255);
@ -2240,13 +2242,15 @@ gint x0, gint x1, gint y0, gint y1) \
{ \ { \
gint i, j;\ gint i, j;\
guint8 *dest_ptr;\ guint8 *dest_ptr;\
guint stride;\
\ \
dest_ptr = dest->data[0];\ dest_ptr = GST_VIDEO_FRAME_PLANE_DATA (dest, 0);\
stride = GST_VIDEO_FRAME_PLANE_STRIDE (dest, 0);\
\ \
for (i = y0; i < y1; i++) {\ for (i = y0; i < y1; i++) {\
for (j = x0; j < x1; j++) {\ for (j = x0; j < x1; j++) {\
gint y, y_pos, k;\ gint y, y_pos, k;\
y_pos = (i * 4 * overlay->width) + j * 4;\ y_pos = (i * stride) + j * 4;\
for (k = OFFSET; k < 3+OFFSET; k++) {\ for (k = OFFSET; k < 3+OFFSET; k++) {\
y = dest_ptr[y_pos + k] - overlay->shading_value;\ y = dest_ptr[y_pos + k] - overlay->shading_value;\
dest_ptr[y_pos + k] = CLAMP (y, 0, 255);\ dest_ptr[y_pos + k] = CLAMP (y, 0, 255);\

View File

@ -1342,8 +1342,9 @@ gst_riff_create_audio_caps (guint16 codec_id,
* so either we calculate the bitrate or mark it as invalid as this * so either we calculate the bitrate or mark it as invalid as this
* would probably confuse timing */ * would probably confuse timing */
strf->av_bps = 0; strf->av_bps = 0;
if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0) { if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0 &&
int spb = ((strf->blockalign - strf->channels * 7) / 2) * 2; (strf->blockalign / strf->channels) >= 7) {
int spb = ((strf->blockalign / strf->channels) - 7) * 2 + 2;
strf->av_bps = strf->av_bps =
gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb); gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb);
GST_DEBUG ("fixing av_bps to calculated value %d of MS ADPCM", GST_DEBUG ("fixing av_bps to calculated value %d of MS ADPCM",
@ -1464,8 +1465,9 @@ gst_riff_create_audio_caps (guint16 codec_id,
* header, so either we calculate the bitrate or mark it as invalid * header, so either we calculate the bitrate or mark it as invalid
* as this would probably confuse timing */ * as this would probably confuse timing */
strf->av_bps = 0; strf->av_bps = 0;
if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0) { if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0 &&
int spb = ((strf->blockalign - strf->channels * 4) / 2) * 2; (strf->blockalign / strf->channels) >= 4) {
int spb = ((strf->blockalign / strf->channels) - 4) * 2 + 1;
strf->av_bps = strf->av_bps =
gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb); gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb);
GST_DEBUG ("fixing av_bps to calculated value %d of IMA DVI ADPCM", GST_DEBUG ("fixing av_bps to calculated value %d of IMA DVI ADPCM",

View File

@ -207,6 +207,16 @@ QtGLVideoItem::getForceAspectRatio()
return this->priv->force_aspect_ratio; return this->priv->force_aspect_ratio;
} }
void
QtGLVideoItem::setAcceptEvents(bool accept)
{
if (accept == acceptEvents)
return;
acceptEvents = accept;
Q_EMIT acceptEventsChanged(acceptEvents);
}
bool bool
QtGLVideoItem::itemInitialized() QtGLVideoItem::itemInitialized()
{ {
@ -495,18 +505,21 @@ QtGLVideoItem::wheelEvent(QWheelEvent * event)
g_object_unref (element); g_object_unref (element);
} }
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
QtGLVideoItem::hoverEnterEvent(QHoverEvent *) QtGLVideoItem::hoverEnterEvent(QHoverEvent *event)
{ {
mouseHovering = true; mouseHovering = true;
event->setAccepted(acceptEvents);
} }
void void
QtGLVideoItem::hoverLeaveEvent(QHoverEvent *) QtGLVideoItem::hoverLeaveEvent(QHoverEvent *event)
{ {
mouseHovering = false; mouseHovering = false;
event->setAccepted(acceptEvents);
} }
void void
@ -535,6 +548,7 @@ QtGLVideoItem::hoverMoveEvent(QHoverEvent * event)
} }
} }
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
@ -597,6 +611,7 @@ QtGLVideoItem::touchEvent(QTouchEvent * event)
g_object_unref (element); g_object_unref (element);
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
@ -649,12 +664,14 @@ QtGLVideoItem::mousePressEvent(QMouseEvent * event)
{ {
forceActiveFocus(); forceActiveFocus();
sendMouseEvent(event, TRUE); sendMouseEvent(event, TRUE);
event->setAccepted(acceptEvents);
} }
void void
QtGLVideoItem::mouseReleaseEvent(QMouseEvent * event) QtGLVideoItem::mouseReleaseEvent(QMouseEvent * event)
{ {
sendMouseEvent(event, FALSE); sendMouseEvent(event, FALSE);
event->setAccepted(acceptEvents);
} }
void void

View File

@ -71,6 +71,10 @@ class QtGLVideoItem : public QQuickItem, protected QOpenGLFunctions
READ getForceAspectRatio READ getForceAspectRatio
WRITE setForceAspectRatio WRITE setForceAspectRatio
NOTIFY forceAspectRatioChanged) NOTIFY forceAspectRatioChanged)
Q_PROPERTY(bool acceptEvents
READ getAcceptEvents
WRITE setAcceptEvents
NOTIFY acceptEventsChanged)
public: public:
QtGLVideoItem(); QtGLVideoItem();
@ -82,6 +86,9 @@ public:
bool getForceAspectRatio(); bool getForceAspectRatio();
bool itemInitialized(); bool itemInitialized();
bool getAcceptEvents() const { return acceptEvents; }
void setAcceptEvents(bool accept);
QSharedPointer<QtGLVideoItemInterface> getInterface() { return proxy; }; QSharedPointer<QtGLVideoItemInterface> getInterface() { return proxy; };
/* private for C interface ... */ /* private for C interface ... */
QtGLVideoItemPrivate *priv; QtGLVideoItemPrivate *priv;
@ -89,6 +96,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void itemInitializedChanged(); void itemInitializedChanged();
void forceAspectRatioChanged(bool); void forceAspectRatioChanged(bool);
void acceptEventsChanged(bool acceptEvents);
private Q_SLOTS: private Q_SLOTS:
void handleWindowChanged(QQuickWindow * win); void handleWindowChanged(QQuickWindow * win);
@ -117,6 +125,7 @@ private:
quint32 mousePressedButton; quint32 mousePressedButton;
bool mouseHovering; bool mouseHovering;
bool acceptEvents = true;
QSharedPointer<QtGLVideoItemInterface> proxy; QSharedPointer<QtGLVideoItemInterface> proxy;
}; };

View File

@ -193,6 +193,16 @@ Qt6GLVideoItem::setForceAspectRatio(bool force_aspect_ratio)
emit forceAspectRatioChanged(force_aspect_ratio); emit forceAspectRatioChanged(force_aspect_ratio);
} }
void
Qt6GLVideoItem::setAcceptEvents(bool accept)
{
if (accept == acceptEvents)
return;
acceptEvents = accept;
Q_EMIT acceptEventsChanged(acceptEvents);
}
bool bool
Qt6GLVideoItem::getForceAspectRatio() Qt6GLVideoItem::getForceAspectRatio()
{ {
@ -487,18 +497,22 @@ Qt6GLVideoItem::wheelEvent(QWheelEvent * event)
g_object_unref (element); g_object_unref (element);
} }
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
Qt6GLVideoItem::hoverEnterEvent(QHoverEvent *) Qt6GLVideoItem::hoverEnterEvent(QHoverEvent *event)
{ {
mouseHovering = true; mouseHovering = true;
event->setAccepted(acceptEvents);
} }
void void
Qt6GLVideoItem::hoverLeaveEvent(QHoverEvent *) Qt6GLVideoItem::hoverLeaveEvent(QHoverEvent *event)
{ {
mouseHovering = false; mouseHovering = false;
event->setAccepted(acceptEvents);
} }
void void
@ -527,6 +541,7 @@ Qt6GLVideoItem::hoverMoveEvent(QHoverEvent * event)
} }
} }
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
@ -589,6 +604,7 @@ Qt6GLVideoItem::touchEvent(QTouchEvent * event)
g_object_unref (element); g_object_unref (element);
g_mutex_unlock (&this->priv->lock); g_mutex_unlock (&this->priv->lock);
event->setAccepted(acceptEvents);
} }
void void
@ -641,12 +657,14 @@ Qt6GLVideoItem::mousePressEvent(QMouseEvent * event)
{ {
forceActiveFocus(); forceActiveFocus();
sendMouseEvent(event, TRUE); sendMouseEvent(event, TRUE);
event->setAccepted(acceptEvents);
} }
void void
Qt6GLVideoItem::mouseReleaseEvent(QMouseEvent * event) Qt6GLVideoItem::mouseReleaseEvent(QMouseEvent * event)
{ {
sendMouseEvent(event, FALSE); sendMouseEvent(event, FALSE);
event->setAccepted(acceptEvents);
} }
void void

View File

@ -73,7 +73,10 @@ class Qt6GLVideoItem : public QQuickItem, protected QOpenGLFunctions
READ getForceAspectRatio READ getForceAspectRatio
WRITE setForceAspectRatio WRITE setForceAspectRatio
NOTIFY forceAspectRatioChanged) NOTIFY forceAspectRatioChanged)
Q_PROPERTY(bool acceptEvents
READ getAcceptEvents
WRITE setAcceptEvents
NOTIFY acceptEventsChanged)
public: public:
Qt6GLVideoItem(); Qt6GLVideoItem();
~Qt6GLVideoItem(); ~Qt6GLVideoItem();
@ -83,6 +86,8 @@ public:
void setForceAspectRatio(bool); void setForceAspectRatio(bool);
bool getForceAspectRatio(); bool getForceAspectRatio();
bool itemInitialized(); bool itemInitialized();
bool getAcceptEvents() const { return acceptEvents; }
void setAcceptEvents(bool accept);
QSharedPointer<Qt6GLVideoItemInterface> getInterface() { return proxy; }; QSharedPointer<Qt6GLVideoItemInterface> getInterface() { return proxy; };
/* private for C interface ... */ /* private for C interface ... */
@ -91,6 +96,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void itemInitializedChanged(); void itemInitializedChanged();
void forceAspectRatioChanged(bool); void forceAspectRatioChanged(bool);
void acceptEventsChanged(bool acceptEvents);
private Q_SLOTS: private Q_SLOTS:
void handleWindowChanged(QQuickWindow * win); void handleWindowChanged(QQuickWindow * win);
@ -120,6 +126,7 @@ private:
quint32 mousePressedButton; quint32 mousePressedButton;
bool mouseHovering; bool mouseHovering;
bool acceptEvents = true;
QSharedPointer<Qt6GLVideoItemInterface> proxy; QSharedPointer<Qt6GLVideoItemInterface> proxy;
}; };

View File

@ -207,6 +207,7 @@ test_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
onvif_event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s); onvif_event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s);
gst_element_send_event (GST_ELEMENT (src), onvif_event); gst_element_send_event (GST_ELEMENT (src), onvif_event);
gst_object_unref (clock);
} }
if (src->segment->rate < 1.0) { if (src->segment->rate < 1.0) {

View File

@ -2403,6 +2403,8 @@ GST_START_TEST (test_record_tcp)
g_free (session); g_free (session);
/* release the reference to server_sink, obtained in media_constructed_cb */ /* release the reference to server_sink, obtained in media_constructed_cb */
gst_object_unref (server_sink); gst_object_unref (server_sink);
gst_rtsp_thread_pool_cleanup ();
} }
GST_END_TEST; GST_END_TEST;

View File

@ -64,6 +64,9 @@ main (int argc, char *argv[])
/* create a server instance */ /* create a server instance */
server = gst_rtsp_server_new (); server = gst_rtsp_server_new ();
/* set port to any */
gst_rtsp_server_set_service (server, "0");
/* attach the server to the default maincontext */ /* attach the server to the default maincontext */
if ((id = gst_rtsp_server_attach (server, NULL)) == 0) if ((id = gst_rtsp_server_attach (server, NULL)) == 0)
goto failed; goto failed;
@ -84,6 +87,9 @@ main (int argc, char *argv[])
/* ERRORS */ /* ERRORS */
failed: failed:
{ {
g_object_unref (server);
g_main_loop_unref (loop);
g_print ("failed to attach the server\n"); g_print ("failed to attach the server\n");
return -1; return -1;
} }