Commit 563ccc4d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Set the stream's current format and connected state through Unix library functions.

parent 442c9d43
......@@ -219,6 +219,8 @@ struct unix_funcs
struct wg_parser_stream *(CDECL *wg_parser_get_stream)(struct wg_parser *parser, uint32_t index);
void (CDECL *wg_parser_stream_get_preferred_format)(struct wg_parser_stream *stream, struct wg_format *format);
void (CDECL *wg_parser_stream_enable)(struct wg_parser_stream *stream, const struct wg_format *format);
void (CDECL *wg_parser_stream_disable)(struct wg_parser_stream *stream);
};
extern const struct unix_funcs *unix_funcs;
......
......@@ -1507,6 +1507,7 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
struct wg_parser_stream *stream = pin->wg_stream;
unsigned int buffer_size = 16384;
ALLOCATOR_PROPERTIES ret_props;
struct wg_format format;
bool ret;
if (IsEqualGUID(&pin->pin.pin.mt.formattype, &FORMAT_VideoInfo))
......@@ -1526,11 +1527,10 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
buffer_size = format->nAvgBytesPerSec;
}
ret = amt_to_wg_format(&pin->pin.pin.mt, &stream->current_format);
ret = amt_to_wg_format(&pin->pin.pin.mt, &format);
assert(ret);
stream->enabled = true;
unix_funcs->wg_parser_stream_enable(pin->wg_stream, &format);
gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure());
/* 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(). */
......@@ -1543,9 +1543,8 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
static void source_disconnect(struct strmbase_source *iface)
{
struct parser_source *pin = impl_source_from_IPin(&iface->pin.IPin_iface);
struct wg_parser_stream *stream = pin->wg_stream;
stream->enabled = false;
unix_funcs->wg_parser_stream_disable(pin->wg_stream);
}
static void free_source_pin(struct parser_source *pin)
......
......@@ -332,6 +332,18 @@ static void CDECL wg_parser_stream_get_preferred_format(struct wg_parser_stream
*format = stream->preferred_format;
}
static void CDECL wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format)
{
stream->current_format = *format;
stream->enabled = true;
gst_pad_push_event(stream->my_sink, gst_event_new_reconfigure());
}
static void CDECL wg_parser_stream_disable(struct wg_parser_stream *stream)
{
stream->enabled = false;
}
static GstAutoplugSelectResult autoplug_blacklist(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user)
{
const char *name = gst_element_factory_get_longname(fact);
......@@ -1487,6 +1499,8 @@ static const struct unix_funcs funcs =
wg_parser_get_stream,
wg_parser_stream_get_preferred_format,
wg_parser_stream_enable,
wg_parser_stream_disable,
};
NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment