winegstreamer: Retrieve wg_parser streams through Unix library functions.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
507ba18d08
commit
f98722fe3b
|
@ -214,6 +214,9 @@ struct unix_funcs
|
|||
|
||||
HRESULT (CDECL *wg_parser_connect)(struct wg_parser *parser, uint64_t file_size);
|
||||
void (CDECL *wg_parser_disconnect)(struct wg_parser *parser);
|
||||
|
||||
uint32_t (CDECL *wg_parser_get_stream_count)(struct wg_parser *parser);
|
||||
struct wg_parser_stream *(CDECL *wg_parser_get_stream)(struct wg_parser *parser, uint32_t index);
|
||||
};
|
||||
|
||||
extern const struct unix_funcs *unix_funcs;
|
||||
|
|
|
@ -1039,13 +1039,14 @@ static BOOL decodebin_parser_filter_init_gst(struct parser *filter)
|
|||
{
|
||||
static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0};
|
||||
struct wg_parser *parser = filter->wg_parser;
|
||||
unsigned int i, stream_count;
|
||||
WCHAR source_name[20];
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < parser->stream_count; ++i)
|
||||
stream_count = unix_funcs->wg_parser_get_stream_count(parser);
|
||||
for (i = 0; i < stream_count; ++i)
|
||||
{
|
||||
sprintfW(source_name, formatW, i);
|
||||
if (!create_pin(filter, parser->streams[i], source_name))
|
||||
if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, i), source_name))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1664,7 +1665,7 @@ static BOOL wave_parser_filter_init_gst(struct parser *filter)
|
|||
static const WCHAR source_name[] = {'o','u','t','p','u','t',0};
|
||||
struct wg_parser *parser = filter->wg_parser;
|
||||
|
||||
if (!create_pin(filter, parser->streams[0], source_name))
|
||||
if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, 0), source_name))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -1744,13 +1745,14 @@ static BOOL avi_splitter_filter_init_gst(struct parser *filter)
|
|||
{
|
||||
static const WCHAR formatW[] = {'S','t','r','e','a','m',' ','%','0','2','u',0};
|
||||
struct wg_parser *parser = filter->wg_parser;
|
||||
uint32_t i, stream_count;
|
||||
WCHAR source_name[20];
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < parser->stream_count; ++i)
|
||||
stream_count = unix_funcs->wg_parser_get_stream_count(parser);
|
||||
for (i = 0; i < stream_count; ++i)
|
||||
{
|
||||
sprintfW(source_name, formatW, i);
|
||||
if (!create_pin(filter, parser->streams[i], source_name))
|
||||
if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, i), source_name))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1837,7 +1839,7 @@ static BOOL mpeg_splitter_filter_init_gst(struct parser *filter)
|
|||
static const WCHAR source_name[] = {'A','u','d','i','o',0};
|
||||
struct wg_parser *parser = filter->wg_parser;
|
||||
|
||||
if (!create_pin(filter, parser->streams[0], source_name))
|
||||
if (!create_pin(filter, unix_funcs->wg_parser_get_stream(parser, 0), source_name))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -317,6 +317,16 @@ static bool wg_format_compare(const struct wg_format *a, const struct wg_format
|
|||
return false;
|
||||
}
|
||||
|
||||
static uint32_t CDECL wg_parser_get_stream_count(struct wg_parser *parser)
|
||||
{
|
||||
return parser->stream_count;
|
||||
}
|
||||
|
||||
static struct wg_parser_stream * CDECL wg_parser_get_stream(struct wg_parser *parser, uint32_t index)
|
||||
{
|
||||
return parser->streams[index];
|
||||
}
|
||||
|
||||
static GstAutoplugSelectResult autoplug_blacklist(GstElement *bin, GstPad *pad, GstCaps *caps, GstElementFactory *fact, gpointer user)
|
||||
{
|
||||
const char *name = gst_element_factory_get_longname(fact);
|
||||
|
@ -1467,6 +1477,9 @@ static const struct unix_funcs funcs =
|
|||
|
||||
wg_parser_connect,
|
||||
wg_parser_disconnect,
|
||||
|
||||
wg_parser_get_stream_count,
|
||||
wg_parser_get_stream,
|
||||
};
|
||||
|
||||
NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out)
|
||||
|
|
Loading…
Reference in New Issue