winegstreamer: Move videoflip configuration to wg_parser_stream_set_current_format().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-02-16 19:28:27 -06:00 committed by Alexandre Julliard
parent ccc6c98075
commit 5167b8c39a
2 changed files with 27 additions and 5 deletions

View File

@ -1430,7 +1430,6 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props)
{
struct parser_source *pin = impl_source_from_IPin(&iface->pin.IPin_iface);
struct wg_parser_stream *stream = pin->wg_stream;
unsigned int buffer_size = 16384;
ALLOCATOR_PROPERTIES ret_props;
struct wg_format format;
@ -1440,10 +1439,6 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
{
VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pin->pin.pin.mt.pbFormat;
buffer_size = format->bmiHeader.biSizeImage;
gst_util_set_object_arg(G_OBJECT(stream->flip), "method",
(format->bmiHeader.biCompression == BI_RGB
|| format->bmiHeader.biCompression == BI_BITFIELDS) ? "vertical-flip" : "none");
}
else if (IsEqualGUID(&pin->pin.pin.mt.formattype, &FORMAT_WaveFormatEx)
&& (IsEqualGUID(&pin->pin.pin.mt.subtype, &MEDIASUBTYPE_PCM)

View File

@ -358,6 +358,33 @@ static void CDECL wg_parser_stream_enable(struct wg_parser_stream *stream, const
{
stream->current_format = *format;
stream->enabled = true;
if (format->major_type == WG_MAJOR_TYPE_VIDEO)
{
switch (format->u.video.format)
{
case WG_VIDEO_FORMAT_BGRA:
case WG_VIDEO_FORMAT_BGRx:
case WG_VIDEO_FORMAT_BGR:
case WG_VIDEO_FORMAT_RGB15:
case WG_VIDEO_FORMAT_RGB16:
gst_util_set_object_arg(G_OBJECT(stream->flip), "method", "vertical-flip");
break;
case WG_VIDEO_FORMAT_AYUV:
case WG_VIDEO_FORMAT_I420:
case WG_VIDEO_FORMAT_NV12:
case WG_VIDEO_FORMAT_UYVY:
case WG_VIDEO_FORMAT_YUY2:
case WG_VIDEO_FORMAT_YV12:
case WG_VIDEO_FORMAT_YVYU:
case WG_VIDEO_FORMAT_UNKNOWN:
case WG_VIDEO_FORMAT_CINEPAK:
gst_util_set_object_arg(G_OBJECT(stream->flip), "method", "none");
break;
}
}
gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure());
}