mfplat-streaming-support: Remove more patches which were already implemented upstream.

I missed these the first time; thanks Rémi for pointing them out.
This commit is contained in:
Zebediah Figura 2022-09-05 00:15:06 -05:00
parent 2ee26de43f
commit 092bc29352
3 changed files with 0 additions and 538 deletions

View File

@ -1,73 +0,0 @@
From 7e5a1d66b93df6e2dd29a753190bbe9c0c31993e Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Wed, 17 Mar 2021 15:37:17 -0400
Subject: [PATCH 29/88] winegstreamer: Register the color conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/winegstreamer/mfplat.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 6f6ec956b2b..54874ad43ee 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -465,6 +465,26 @@ static const GUID *const wma_decoder_output_types[] =
&MFAudioFormat_Float,
};
+static WCHAR color_converterW[] = L"Color Converter";
+static const GUID *color_converter_supported_types[] =
+{
+ &MFVideoFormat_RGB24,
+ &MFVideoFormat_RGB32,
+ &MFVideoFormat_RGB555,
+ &MFVideoFormat_RGB8,
+ &MFVideoFormat_AYUV,
+ &MFVideoFormat_I420,
+ &MFVideoFormat_IYUV,
+ &MFVideoFormat_NV11,
+ &MFVideoFormat_NV12,
+ &MFVideoFormat_UYVY,
+ &MFVideoFormat_v216,
+ &MFVideoFormat_v410,
+ &MFVideoFormat_YUY2,
+ &MFVideoFormat_YVYU,
+ &MFVideoFormat_YVYU,
+};
+
static WCHAR h264_decoderW[] = L"H.264 Decoder";
static const GUID *h264_decoder_input_types[] =
{
@@ -516,7 +536,18 @@ mfts[] =
wma_decoder_output_types,
},
{
- &CLSID_MSH264DecoderMFT,
+ &CLSID_CColorConvertDMO,
+ &MFT_CATEGORY_VIDEO_EFFECT,
+ color_converterW,
+ MFT_ENUM_FLAG_SYNCMFT,
+ &MFMediaType_Video,
+ ARRAY_SIZE(color_converter_supported_types),
+ color_converter_supported_types,
+ ARRAY_SIZE(color_converter_supported_types),
+ color_converter_supported_types,
+ },
+ {
+ &CLSID_MSAACDecMFT,
&MFT_CATEGORY_VIDEO_DECODER,
h264_decoderW,
MFT_ENUM_FLAG_SYNCMFT,
@@ -532,7 +563,7 @@ HRESULT mfplat_DllRegisterServer(void)
{
unsigned int i, j;
HRESULT hr;
- MFT_REGISTER_TYPE_INFO input_types[4], output_types[2];
+ MFT_REGISTER_TYPE_INFO input_types[15], output_types[15];
for (i = 0; i < ARRAY_SIZE(mfts); i++)
{
--
2.34.1

View File

@ -1,376 +0,0 @@
From 4f6593d81e43fc0b8e06019e1931f9791856c184 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 15 Dec 2021 10:30:26 +0100
Subject: [PATCH 52/88] winegstreamer: Add videobox element and aperture
support.
---
dlls/winegstreamer/audioconvert.c | 4 +--
dlls/winegstreamer/colorconvert.c | 4 +--
dlls/winegstreamer/decode_transform.c | 23 ++++++++++++++-
dlls/winegstreamer/gst_private.h | 4 +--
dlls/winegstreamer/main.c | 6 ++--
dlls/winegstreamer/media_source.c | 2 +-
dlls/winegstreamer/quartz_parser.c | 2 +-
dlls/winegstreamer/unixlib.h | 10 +++++++
dlls/winegstreamer/wg_parser.c | 42 +++++++++++++++++++++++++--
dlls/winegstreamer/wm_reader.c | 6 ++--
10 files changed, 86 insertions(+), 17 deletions(-)
diff --git a/dlls/winegstreamer/audioconvert.c b/dlls/winegstreamer/audioconvert.c
index f8d5833aa22..28d449e9f9b 100644
--- a/dlls/winegstreamer/audioconvert.c
+++ b/dlls/winegstreamer/audioconvert.c
@@ -417,7 +417,7 @@ static HRESULT WINAPI audio_converter_SetInputType(IMFTransform *iface, DWORD id
struct wg_format output_format;
mf_media_type_to_wg_format(converter->output_type, &output_format);
- if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &format, 1, &output_format)))
+ if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &format, 1, &output_format, NULL)))
converter->stream = wg_parser_get_stream(converter->parser, 0);
}
@@ -513,7 +513,7 @@ static HRESULT WINAPI audio_converter_SetOutputType(IMFTransform *iface, DWORD i
struct wg_format input_format;
mf_media_type_to_wg_format(converter->input_type, &input_format);
- if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &input_format, 1, &format)))
+ if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &input_format, 1, &format, NULL)))
converter->stream = wg_parser_get_stream(converter->parser, 0);
}
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 6cad0c1706d..476851fa43a 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -423,7 +423,7 @@ static HRESULT WINAPI color_converter_SetInputType(IMFTransform *iface, DWORD id
struct wg_format output_format;
mf_media_type_to_wg_format(converter->output_type, &output_format);
- if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &format, 1, &output_format)))
+ if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &format, 1, &output_format, NULL)))
converter->stream = wg_parser_get_stream(converter->parser, 0);
}
@@ -533,7 +533,7 @@ static HRESULT WINAPI color_converter_SetOutputType(IMFTransform *iface, DWORD i
struct wg_format input_format;
mf_media_type_to_wg_format(converter->input_type, &input_format);
- if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &input_format, 1, &format)))
+ if (SUCCEEDED(hr = wg_parser_connect_unseekable(converter->parser, &input_format, 1, &format, NULL)))
converter->stream = wg_parser_get_stream(converter->parser, 0);
}
diff --git a/dlls/winegstreamer/decode_transform.c b/dlls/winegstreamer/decode_transform.c
index 6f1363ff1f3..04d46a73c3d 100644
--- a/dlls/winegstreamer/decode_transform.c
+++ b/dlls/winegstreamer/decode_transform.c
@@ -641,6 +641,9 @@ static DWORD CALLBACK helper_thread_func(PVOID ctx)
case HELP_REQ_START_PARSER:
{
struct wg_format input_format, output_format;
+ struct wg_rect wg_aperture = {0};
+ MFVideoArea *aperture = NULL;
+ UINT32 aperture_size;
decoder->help_request.type = HELP_REQ_NONE;
LeaveCriticalSection(&decoder->help_cs);
@@ -648,7 +651,25 @@ static DWORD CALLBACK helper_thread_func(PVOID ctx)
mf_media_type_to_wg_format(decoder->input_type, &input_format);
mf_media_type_to_wg_format(decoder->output_type, &output_format);
- wg_parser_connect_unseekable(decoder->wg_parser, &input_format, 1, &output_format);
+ if (SUCCEEDED(IMFMediaType_GetAllocatedBlob(decoder->output_type,
+ &MF_MT_MINIMUM_DISPLAY_APERTURE, (UINT8 **) &aperture, &aperture_size)))
+ {
+ TRACE("Decoded media's aperture: x: %u %u/65536, y: %u %u/65536, area: %u x %u\n",
+ aperture->OffsetX.value, aperture->OffsetX.fract,
+ aperture->OffsetY.value, aperture->OffsetY.fract, aperture->Area.cx, aperture->Area.cy);
+
+ /* TODO: verify aperture params? */
+
+ wg_aperture.left = aperture->OffsetX.value;
+ wg_aperture.top = aperture->OffsetY.value;
+ wg_aperture.right = aperture->Area.cx;
+ wg_aperture.bottom = aperture->Area.cy;
+
+ CoTaskMemFree(aperture);
+ }
+
+ wg_parser_connect_unseekable(decoder->wg_parser,
+ &input_format, 1, &output_format, aperture ? &wg_aperture : NULL);
EnterCriticalSection(&decoder->event_cs);
while (!decoder->helper_thread_shutdown && decoder->event.type != PIPELINE_EVENT_NONE)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index 49879fe416d..f1c7bc60428 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -69,7 +69,7 @@ void wg_parser_destroy(struct wg_parser *parser);
HRESULT wg_parser_connect(struct wg_parser *parser, uint64_t file_size);
HRESULT wg_parser_connect_unseekable(struct wg_parser *parser, const struct wg_format *in_format,
- uint32_t stream_count, const struct wg_format *out_formats);
+ uint32_t stream_count, const struct wg_format *out_formats, const struct wg_rect *apertures);
void wg_parser_disconnect(struct wg_parser *parser);
void wg_parser_begin_flush(struct wg_parser *parser);
@@ -82,7 +82,7 @@ uint32_t wg_parser_get_stream_count(struct wg_parser *parser);
struct wg_parser_stream *wg_parser_get_stream(struct wg_parser *parser, uint32_t index);
void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format);
-void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format);
+void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format, const struct wg_rect *aperture);
void wg_parser_stream_disable(struct wg_parser_stream *stream);
bool wg_parser_stream_get_event(struct wg_parser_stream *stream, struct wg_parser_event *event);
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index a9a9c72136d..74f0dd04e83 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -92,7 +92,7 @@ HRESULT wg_parser_connect(struct wg_parser *parser, uint64_t file_size)
}
HRESULT wg_parser_connect_unseekable(struct wg_parser *parser, const struct wg_format *in_format,
- uint32_t stream_count, const struct wg_format *out_formats)
+ uint32_t stream_count, const struct wg_format *out_formats, const struct wg_rect *apertures)
{
struct wg_parser_connect_unseekable_params params =
{
@@ -100,6 +100,7 @@ HRESULT wg_parser_connect_unseekable(struct wg_parser *parser, const struct wg_f
.in_format = in_format,
.stream_count = stream_count,
.out_formats = out_formats,
+ .apertures = apertures,
};
return __wine_unix_call(unix_handle, unix_wg_parser_connect_unseekable, &params);
@@ -181,12 +182,13 @@ void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, stru
__wine_unix_call(unix_handle, unix_wg_parser_stream_get_preferred_format, &params);
}
-void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format)
+void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format, const struct wg_rect *aperture)
{
struct wg_parser_stream_enable_params params =
{
.stream = stream,
.format = format,
+ .aperture = aperture,
};
__wine_unix_call(unix_handle, unix_wg_parser_stream_enable, &params);
diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c
index 11040ac159a..e5f25eed63a 100644
--- a/dlls/winegstreamer/media_source.c
+++ b/dlls/winegstreamer/media_source.c
@@ -358,7 +358,7 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
IMFMediaTypeHandler_GetCurrentMediaType(mth, &current_mt);
mf_media_type_to_wg_format(current_mt, &format);
- wg_parser_stream_enable(stream->wg_stream, &format);
+ wg_parser_stream_enable(stream->wg_stream, &format, NULL);
IMFMediaType_Release(current_mt);
IMFMediaTypeHandler_Release(mth);
diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c
index c44bd141c56..c03f4deca30 100644
--- a/dlls/winegstreamer/quartz_parser.c
+++ b/dlls/winegstreamer/quartz_parser.c
@@ -1528,7 +1528,7 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
ret = amt_to_wg_format(&pin->pin.pin.mt, &format);
assert(ret);
- wg_parser_stream_enable(pin->wg_stream, &format);
+ wg_parser_stream_enable(pin->wg_stream, &format, NULL);
/* We do need to drop any buffers that might have been sent with the old
* caps, but this will be handled in parser_init_stream(). */
diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h
index fdcecfc96d5..5946621fb9d 100644
--- a/dlls/winegstreamer/unixlib.h
+++ b/dlls/winegstreamer/unixlib.h
@@ -117,6 +117,14 @@ struct wg_format
} u;
};
+struct wg_rect
+{
+ uint32_t left;
+ uint32_t right;
+ uint32_t top;
+ uint32_t bottom;
+};
+
enum wg_parser_event_type
{
WG_PARSER_EVENT_NONE = 0,
@@ -183,6 +191,7 @@ struct wg_parser_connect_unseekable_params
const struct wg_format *in_format;
UINT32 stream_count;
const struct wg_format *out_formats;
+ const struct wg_rect *apertures;
};
struct wg_parser_get_next_read_offset_params
@@ -223,6 +232,7 @@ struct wg_parser_stream_enable_params
{
struct wg_parser_stream *stream;
const struct wg_format *format;
+ const struct wg_rect *aperture;
};
struct wg_parser_stream_get_event_params
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index dc655b275bd..f699ab21837 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -98,9 +98,10 @@ struct wg_parser_stream
struct wg_parser *parser;
GstPad *their_src, *post_sink, *post_src, *my_sink;
- GstElement *flip;
+ GstElement *flip, *box;
GstSegment segment;
struct wg_format preferred_format, current_format;
+ struct wg_rect aperture;
pthread_cond_t event_cond, event_empty_cond;
struct wg_parser_event event;
@@ -730,6 +731,7 @@ static NTSTATUS wg_parser_stream_enable(void *args)
const struct wg_parser_stream_enable_params *params = args;
struct wg_parser_stream *stream = params->stream;
const struct wg_format *format = params->format;
+ const struct wg_rect *aperture = params->aperture;
if (!stream->parser->seekable)
return S_OK;
@@ -765,6 +767,18 @@ static NTSTATUS wg_parser_stream_enable(void *args)
}
gst_util_set_object_arg(G_OBJECT(stream->flip), "method", flip ? "vertical-flip" : "none");
+
+ if (aperture)
+ {
+ if (aperture->left)
+ g_object_set(G_OBJECT(stream->box), "left", -aperture->left, NULL);
+ if (aperture->top)
+ g_object_set(G_OBJECT(stream->box), "top", -aperture->top, NULL);
+ if (aperture->right)
+ g_object_set(G_OBJECT(stream->box), "right", aperture->right - format->u.video.width, NULL);
+ if (aperture->bottom)
+ g_object_set(G_OBJECT(stream->box), "bottom", aperture->bottom - format->u.video.height, NULL);
+ }
}
gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure());
@@ -1357,7 +1371,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
if (!strcmp(name, "video/x-raw"))
{
- GstElement *capssetter, *deinterlace, *vconv, *flip, *vconv2;
+ GstElement *capssetter, *deinterlace, *vconv, *flip, *box, *vconv2;
/* Hack?: Flatten down the colorimetry to default values, without
* actually modifying the video at all.
@@ -1423,11 +1437,26 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
if (!(flip = create_element("videoflip", "good")))
goto out;
+ if (!(box = create_element("videbox", "base")))
+ goto out;
+
/* videoflip does not support 15 and 16-bit RGB so add a second videoconvert
* to do the final conversion. */
if (!(vconv2 = create_element("videoconvert", "base")))
goto out;
+ if (!parser->seekable)
+ {
+ if (stream->aperture.left)
+ g_object_set(G_OBJECT(box), "left", -stream->aperture.left, NULL);
+ if (stream->aperture.bottom)
+ g_object_set(G_OBJECT(box), "top", -stream->aperture.top, NULL);
+ if (stream->aperture.right)
+ g_object_set(G_OBJECT(box), "right", stream->aperture.right - stream->current_format.u.video.width, NULL);
+ if (stream->aperture.bottom)
+ g_object_set(G_OBJECT(box), "bottom", stream->aperture.bottom - stream->current_format.u.video.height, NULL);
+ }
+
/* The bin takes ownership of these elements. */
gst_bin_add(GST_BIN(parser->container), capssetter);
gst_element_sync_state_with_parent(capssetter);
@@ -1437,17 +1466,21 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
gst_element_sync_state_with_parent(vconv);
gst_bin_add(GST_BIN(parser->container), flip);
gst_element_sync_state_with_parent(flip);
+ gst_bin_add(GST_BIN(parser->container), box);
+ gst_element_sync_state_with_parent(box);
gst_bin_add(GST_BIN(parser->container), vconv2);
gst_element_sync_state_with_parent(vconv2);
gst_element_link(capssetter, deinterlace);
gst_element_link(deinterlace, vconv);
gst_element_link(vconv, flip);
- gst_element_link(flip, vconv2);
+ gst_element_link(flip, box);
+ gst_element_link(box, vconv2);
stream->post_sink = gst_element_get_static_pad(capssetter, "sink");
stream->post_src = gst_element_get_static_pad(vconv2, "src");
stream->flip = flip;
+ stream->box = box;
}
else if (!strcmp(name, "audio/x-raw"))
{
@@ -2138,6 +2171,7 @@ static NTSTATUS wg_parser_connect_unseekable(void *args)
const struct wg_parser_connect_unseekable_params *params = args;
const struct wg_format *out_formats = params->out_formats;
const struct wg_format *in_format = params->in_format;
+ const struct wg_rect *apertures = params->apertures;
uint32_t stream_count = params->stream_count;
struct wg_parser *parser = params->parser;
unsigned int i;
@@ -2160,6 +2194,8 @@ static NTSTATUS wg_parser_connect_unseekable(void *args)
{
parser->streams[i] = calloc(1, sizeof(*parser->streams[i]));
parser->streams[i]->current_format = out_formats[i];
+ if (apertures)
+ parser->streams[i]->aperture = apertures[i];
parser->streams[i]->enabled = true;
}
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index ee37abee811..569560d054e 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -1509,7 +1509,7 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
* video type will be BGR. */
stream->format.u.video.format = WG_VIDEO_FORMAT_BGR;
}
- wg_parser_stream_enable(stream->wg_stream, &stream->format);
+ wg_parser_stream_enable(stream->wg_stream, &stream->format, NULL);
}
wg_parser_end_flush(reader->wg_parser);
@@ -1776,7 +1776,7 @@ HRESULT wm_reader_set_output_props(struct wm_reader *reader, DWORD output,
}
stream->format = format;
- wg_parser_stream_enable(stream->wg_stream, &format);
+ wg_parser_stream_enable(stream->wg_stream, &format, NULL);
/* Re-decode any buffers that might have been generated with the old format.
*
@@ -1989,7 +1989,7 @@ HRESULT wm_reader_set_streams_selected(struct wm_reader *reader, WORD count,
FIXME("Ignoring selection %#x for stream %u; treating as enabled.\n",
selections[i], stream_numbers[i]);
TRACE("Enabling stream %u.\n", stream_numbers[i]);
- wg_parser_stream_enable(stream->wg_stream, &stream->format);
+ wg_parser_stream_enable(stream->wg_stream, &stream->format, NULL);
}
}
--
2.34.1

View File

@ -1,89 +0,0 @@
From 1c85ff3c7891c80fac65add4706243bb8fbc9110 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Thu, 18 Mar 2021 16:20:50 -0400
Subject: [PATCH 53/88] winegstreamer: Only require videobox element for parser
when needed.
---
dlls/winegstreamer/wg_parser.c | 38 ++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c
index f699ab21837..833671df20c 100644
--- a/dlls/winegstreamer/wg_parser.c
+++ b/dlls/winegstreamer/wg_parser.c
@@ -770,6 +770,15 @@ static NTSTATUS wg_parser_stream_enable(void *args)
if (aperture)
{
+ if (!stream->box && (stream->aperture.left || stream->aperture.top ||
+ (stream->aperture.right && stream->aperture.right != stream->current_format.u.video.width) ||
+ (stream->aperture.bottom && stream->aperture.bottom != stream->current_format.u.video.height)))
+ {
+ fprintf(stderr, "winegstreamer: failed to create videobox, are %u-bit GStreamer \"good\" plugins installed?\n",
+ 8 * (int)sizeof(void *));
+ return E_FAIL;
+ }
+
if (aperture->left)
g_object_set(G_OBJECT(stream->box), "left", -aperture->left, NULL);
if (aperture->top)
@@ -1437,8 +1446,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
if (!(flip = create_element("videoflip", "good")))
goto out;
- if (!(box = create_element("videbox", "base")))
- goto out;
+ box = gst_element_factory_make("videobox", NULL);
/* videoflip does not support 15 and 16-bit RGB so add a second videoconvert
* to do the final conversion. */
@@ -1447,6 +1455,14 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
if (!parser->seekable)
{
+ if (!box && (stream->aperture.left || stream->aperture.top ||
+ (stream->aperture.right && stream->aperture.right != stream->current_format.u.video.width) ||
+ (stream->aperture.bottom && stream->aperture.bottom != stream->current_format.u.video.height)))
+ {
+ fprintf(stderr, "winegstreamer: failed to create videobox, are %u-bit GStreamer \"good\" plugins installed?\n",
+ 8 * (int)sizeof(void *));
+ goto out;
+ }
if (stream->aperture.left)
g_object_set(G_OBJECT(box), "left", -stream->aperture.left, NULL);
if (stream->aperture.bottom)
@@ -1466,16 +1482,26 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
gst_element_sync_state_with_parent(vconv);
gst_bin_add(GST_BIN(parser->container), flip);
gst_element_sync_state_with_parent(flip);
- gst_bin_add(GST_BIN(parser->container), box);
- gst_element_sync_state_with_parent(box);
+ if (box)
+ {
+ gst_bin_add(GST_BIN(parser->container), box);
+ gst_element_sync_state_with_parent(box);
+ }
gst_bin_add(GST_BIN(parser->container), vconv2);
gst_element_sync_state_with_parent(vconv2);
gst_element_link(capssetter, deinterlace);
gst_element_link(deinterlace, vconv);
gst_element_link(vconv, flip);
- gst_element_link(flip, box);
- gst_element_link(box, vconv2);
+ if (box)
+ {
+ gst_element_link(flip, box);
+ gst_element_link(box, vconv2);
+ }
+ else
+ {
+ gst_element_link(flip, vconv2);
+ }
stream->post_sink = gst_element_get_static_pad(capssetter, "sink");
stream->post_src = gst_element_get_static_pad(vconv2, "src");
--
2.34.1