From 0c642349ff79dc2af6ad3797a5f9af10c31699c9 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Wed, 27 Jan 2021 19:37:21 +0100 Subject: [PATCH] Draft: pipeline: reintroduce image snapshots Adds back possibility to save JPEG snapshots of the pipeline's stream. This change depends on fixing a crash in pipewiresink: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/418 --- gaeguli/gaeguli-internal.h | 9 ++++++--- gaeguli/pipeline.c | 7 +------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gaeguli/gaeguli-internal.h b/gaeguli/gaeguli-internal.h index 11ecb5f..2e7590d 100644 --- a/gaeguli/gaeguli-internal.h +++ b/gaeguli/gaeguli-internal.h @@ -34,11 +34,14 @@ #define GAEGULI_PIPELINE_TAG "gaeguli.pipeline_id" -#define GAEGULI_PIPELINE_VSRC_STR "\ - %s ! capsfilter name=caps ! %s ! pipewiresink mode=provide stream-properties=%s " +#define GAEGULI_PIPELINE_VSRC_BASE_STR "\ + %s ! capsfilter name=caps ! %s ! tee name=t ! pipewiresink mode=provide stream-properties=%s " #define GAEGULI_PIPELINE_IMAGE_STR "\ - valve name=valve drop=1 ! jpegenc name=jpegenc ! jifmux name=jifmux ! fakesink name=fakesink async=0" + t. ! valve name=valve drop=1 ! jpegenc name=jpegenc ! jifmux name=jifmux ! fakesink name=fakesink async=0" + +#define GAEGULI_PIPELINE_VSRC_STR \ + GAEGULI_PIPELINE_VSRC_BASE_STR GAEGULI_PIPELINE_IMAGE_STR #define GAEGULI_PIPELINE_GENERAL_H264ENC_STR "\ pipewiresrc path=%u do-timestamp=true ! queue name=enc_first ! videoconvert ! x264enc name=enc tune=zerolatency key-int-max=%d ! \ diff --git a/gaeguli/pipeline.c b/gaeguli/pipeline.c index 10474ff..14488a6 100644 --- a/gaeguli/pipeline.c +++ b/gaeguli/pipeline.c @@ -604,12 +604,7 @@ _get_vsrc_pipeline_string (GaeguliPipeline * self) g_autofree gchar *source = _get_source_description (self); g_autofree gchar *props = _get_stream_props_description (self); - /* FIXME - pipewiresink along with another sink in the pipeline * - * do not provide the captured video to the consumer pipeline. * - * Hence its inclusion is diabled. * - * This should be a sepearate target. */ - return g_strdup_printf - (GAEGULI_PIPELINE_VSRC_STR, source, + return g_strdup_printf (GAEGULI_PIPELINE_VSRC_STR, source, self->source == GAEGULI_VIDEO_SOURCE_NVARGUSCAMERASRC ? "" : GAEGULI_PIPELINE_DECODEBIN_STR, props); }