Commit 4592662d authored by Alfred Agrell's avatar Alfred Agrell Committed by Alexandre Julliard

winegstreamer: Add output_compressed parameter to wg_parser_create().

parent 21c5627e
......@@ -70,7 +70,7 @@ HRESULT wg_sample_queue_create(struct wg_sample_queue **out);
void wg_sample_queue_destroy(struct wg_sample_queue *queue);
void wg_sample_queue_flush(struct wg_sample_queue *queue, bool all);
wg_parser_t wg_parser_create(enum wg_parser_type type);
wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed);
void wg_parser_destroy(wg_parser_t parser);
HRESULT wg_parser_connect(wg_parser_t parser, uint64_t file_size);
......
......@@ -66,11 +66,12 @@ bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
return TRUE;
}
wg_parser_t wg_parser_create(enum wg_parser_type type)
wg_parser_t wg_parser_create(enum wg_parser_type type, bool output_compressed)
{
struct wg_parser_create_params params =
{
.type = type,
.output_compressed = output_compressed,
.err_on = ERR_ON(quartz),
.warn_on = WARN_ON(quartz),
};
......
......@@ -1643,7 +1643,7 @@ static HRESULT media_source_create(struct object_context *context, IMFMediaSourc
if (FAILED(hr = MFAllocateWorkQueue(&object->async_commands_queue)))
goto fail;
if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN)))
if (!(parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE)))
{
hr = E_OUTOFMEMORY;
goto fail;
......
......@@ -1444,14 +1444,14 @@ static HRESULT decodebin_parser_source_get_media_type(struct parser_source *pin,
return VFW_S_NO_MORE_ITEMS;
}
static HRESULT parser_create(enum wg_parser_type type, struct parser **parser)
static HRESULT parser_create(enum wg_parser_type type, BOOL output_compressed, struct parser **parser)
{
struct parser *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (!(object->wg_parser = wg_parser_create(type)))
if (!(object->wg_parser = wg_parser_create(type, output_compressed)))
{
free(object);
return E_OUTOFMEMORY;
......@@ -1471,7 +1471,7 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out)
struct parser *object;
HRESULT hr;
if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, &object)))
if (FAILED(hr = parser_create(WG_PARSER_DECODEBIN, FALSE, &object)))
return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_decodebin_parser, &filter_ops);
......@@ -2039,7 +2039,7 @@ HRESULT wave_parser_create(IUnknown *outer, IUnknown **out)
struct parser *object;
HRESULT hr;
if (FAILED(hr = parser_create(WG_PARSER_WAVPARSE, &object)))
if (FAILED(hr = parser_create(WG_PARSER_WAVPARSE, FALSE, &object)))
return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
......@@ -2117,7 +2117,7 @@ HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out)
struct parser *object;
HRESULT hr;
if (FAILED(hr = parser_create(WG_PARSER_AVIDEMUX, &object)))
if (FAILED(hr = parser_create(WG_PARSER_AVIDEMUX, FALSE, &object)))
return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
......@@ -2214,7 +2214,7 @@ HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out)
struct parser *object;
HRESULT hr;
if (FAILED(hr = parser_create(WG_PARSER_MPEGAUDIOPARSE, &object)))
if (FAILED(hr = parser_create(WG_PARSER_MPEGAUDIOPARSE, FALSE, &object)))
return hr;
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
......
......@@ -215,6 +215,7 @@ struct wg_parser_create_params
{
wg_parser_t parser;
wg_parser_type type;
UINT8 output_compressed;
UINT8 err_on;
UINT8 warn_on;
};
......
......@@ -78,6 +78,7 @@ struct wg_parser
pthread_mutex_t mutex;
pthread_cond_t init_cond;
bool output_compressed;
bool no_more_pads, has_duration, error;
bool err_on, warn_on;
......@@ -976,7 +977,7 @@ static void pad_added_cb(GstElement *element, GstPad *pad, gpointer user)
gst_caps_unref(caps);
/* For compressed stream, create an extra decodebin to decode it. */
if (format_is_compressed(&stream->codec_format))
if (!parser->output_compressed && format_is_compressed(&stream->codec_format))
{
if (!stream_decodebin_create(stream))
{
......@@ -1876,6 +1877,7 @@ static NTSTATUS wg_parser_create(void *args)
pthread_cond_init(&parser->read_cond, NULL);
pthread_cond_init(&parser->read_done_cond, NULL);
parser->init_gst = init_funcs[params->type];
parser->output_compressed = params->output_compressed;
parser->err_on = params->err_on;
parser->warn_on = params->warn_on;
GST_DEBUG("Created winegstreamer parser %p.", parser);
......
......@@ -1459,7 +1459,7 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
HRESULT hr;
WORD i;
if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN)))
if (!(wg_parser = wg_parser_create(WG_PARSER_DECODEBIN, FALSE)))
return E_OUTOFMEMORY;
reader->wg_parser = wg_parser;
......
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