diff options
author | Snir Sheriber <ssheribe@redhat.com> | 2018-11-08 17:32:06 +0200 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2022-03-06 14:53:30 +0000 |
commit | 8f87611d01f7275cf46ff5cc0b93cd4caedc7027 (patch) | |
tree | b894fe97826827808935bde6397a3730b03990cd | |
parent | 04a663f7d7b8ec4a237d588b212d480a9f6e5bb1 (diff) |
Allows to change settings in code easily
Avoid to have different settings based on code path used.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r-- | src/channel-display-gst.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c index f508771..deb7f5b 100644 --- a/src/channel-display-gst.c +++ b/src/channel-display-gst.c @@ -29,6 +29,11 @@ #include <gst/video/gstvideometa.h> +#define SYNC FALSE // TRUE will sync buffer times with clock time +#define LIVE TRUE // TRUE will add pipeline latency estimation (should be effective only with SYNC) +#define DROP FALSE // TRUE if you want pipeline to decide to drop frames + + typedef struct SpiceGstFrame SpiceGstFrame; /* GStreamer decoder implementation */ @@ -417,7 +422,7 @@ static void app_source_setup(GstElement *pipeline G_GNUC_UNUSED, caps = gst_caps_from_string(gst_opts[decoder->base.codec_type].dec_caps); g_object_set(source, "caps", caps, - "is-live", TRUE, + "is-live", LIVE, "format", GST_FORMAT_TIME, "max-bytes", G_GINT64_CONSTANT(0), "block", TRUE, @@ -444,8 +449,8 @@ add_elem_cb(GstBin * pipeline, GstBin * bin, GstElement * element, SpiceGstDecod if (GST_IS_BASE_SINK(element)) { g_object_set(element, - "sync", FALSE, - "drop", FALSE, + "sync", SYNC, + "drop", DROP, NULL); spice_debug("^^^^SINK^^^^"); } @@ -479,8 +484,8 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder) caps = gst_caps_from_string("video/x-raw,format=BGRx"); g_object_set(sink, "caps", caps, - "sync", FALSE, - "drop", FALSE, + "sync", SYNC, + "drop", DROP, NULL); gst_caps_unref(caps); g_object_set(playbin, |