Commit Graph

521 Commits

Author SHA1 Message Date
Zebediah Figura 2652416be7 winegstreamer: Get rid of the WMReader typedef.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 19:38:25 +02:00
Zebediah Figura bf7c05d87a wmvcore: Move the async reader implementation to winegstreamer.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 19:38:20 +02:00
Zebediah Figura ba3fa4254b winegstreamer: Get rid of the WMSyncReader typedef.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 19:38:11 +02:00
Zebediah Figura e4767ea612 wmvcore: Move the sync reader implementation to winegstreamer.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 19:38:04 +02:00
Zebediah Figura 009c1d66fa winegstreamer: Translate GST_AUDIO_CHANNEL_POSITION_MONO to SPEAKER_FRONT_CENTER.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 19:37:43 +02:00
Zebediah Figura fd6315eb8f winegstreamer: Trace the unfiltered caps in sink_query_cb().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:54 +02:00
Zebediah Figura 3efb72de5a winegstreamer: Avoid seeking past the end of an IMFByteStream.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51837
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:51 +02:00
Zebediah Figura 585acfa041 winegstreamer: Avoid passing a NULL buffer to wg_parser_push_data() in the case of a zero-length read.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:49 +02:00
Zebediah Figura 59997c355f winegstreamer: Use array_reserve() to reallocate read buffers.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:46 +02:00
Zebediah Figura 8e9d7b031f winegstreamer: Handle zero-length reads in src_getrange_cb().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:44 +02:00
Zebediah Figura 4ba31162c3 winegstreamer: Convert the Unix library to the __wine_unix_call interface.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:31:47 +02:00
Zebediah Figura 494039d0d0 winegstreamer: Return void from wg_parser_stream_seek().
We do not expect this to fail.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:31:47 +02:00
Zebediah Figura 84b870bb1f winegstreamer: Move Unix library definitions into a separate header.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 11:31:47 +02:00
Zebediah Figura a87abdbe85 winegstreamer: Remove the no longer used start_dispatch_thread() declaration.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-02 00:42:58 +02:00
Zebediah Figura 45690320f9 winegstreamer: Set unlimited buffering using a flag for wg_parser_create().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-02 00:42:55 +02:00
Zebediah Figura 3643f73ab6 winegstreamer: Initialize GStreamer in wg_parser_create().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51086
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-02 00:42:29 +02:00
Zebediah Figura eab189810d winegstreamer: Use a single wg_parser_create() entry point.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-02 00:42:13 +02:00
Zebediah Figura 959bc42892 winegstreamer: Move the GstAutoplugSelectResult definition to wg_parser.c.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-02 00:41:55 +02:00
Giovanni Mascellani d869f4a8bc winegstreamer/media_source: Implement paused state.
For asynchronous elements like a media source the paused state is rather
similar to the playing state. The most revelant difference is that
RequestSample commands are not immediately executed, but are scheduled
in an internal queue. As soon as playback is restarted, all pending
operations are submitted again (or they are discarded if playback is
stopped).

This patch implements such a queue, together with proper event emitting
when the media source is paused. Also, the characteristic
MFMEDIASOURCE_CAN_PAUSE is announced.

This patch is required for correct playback of some videos in Deep Rock
Galactic.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:37:52 +02:00
Giovanni Mascellani f45c8fd2b8 winegstreamer/media_source: Only seek if it was requested by the caller.
When starting a media source, the caller can specify a timestamp to seek
to by mean of a PROPVARIANT argument. If the PROPVARIANT is empty, then
no seek operation has to take place: playback has to either restart from
the beginning (if the media source was previously in stopped state) or
from where it was left (if the media source was in paused state).

Also, when a PROPVARIANT is empty it is a bug to use its content, because
there is no guarantee that it is initialized to a sensible value.

This patch fixes both bugs by gating the seek operation with the check
that the PROPVARIANT has the right type.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:37:48 +02:00
Giovanni Mascellani c9f0a3ce5c winegstreamer/media_source: Emit absolute presentation timestamp.
Currently the media source emit a presentation timestamp relative to
when the playback was last restarted. I.e., the frame that sits two
seconds inside a media file will get timestamp 2 if playback was
started at the beginning of the file, but will get timestamp 1 if
playback was last restarted at second 1.

This does not match Windows behavior, where each frame always gets
the same timestamp independently from where playback was started.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-27 20:37:44 +02:00
Zebediah Figura 176654fa29 Revert "winegstreamer: Replace source pad interface with GstAppSrc.".
This reverts commit 1aa359a100.

appsrc suffers from a rather problematic race condition surrounding flushes [1].
Essentially, it's possible for a flushing seek to begin and end between
wg_parser_get_next_read_request and wg_parser_push_data. The race condition is
not easy to fix, and in light of it it's not clear if we want to use appsrc.

[1] https://www.winehq.org/pipermail/wine-devel/2021-September/196043.html

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51774
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-24 07:51:34 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Derek Lesho b9a7e961cd winegstreamer: Fix return code in init_gst failure case.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-17 10:43:30 +02:00
Derek Lesho 1aa359a100 winegstreamer: Replace source pad interface with GstAppSrc.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Derek Lesho 8b7390f80d winegstreamer: Allocate source media buffers in the PE components.
This necessitates an extra blit for the input data, but this is necessary for
both WoW64 support and an internal rework of the source path in wg_parser to use
GstAppSrc. Since source data is usually compressed and not a bottleneck, we
don't expect this to affect performance.

Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Derek Lesho 67734bfce3 winegstreamer: Duplicate source shutdown path into constructor with leak fixes.
Instead of having mixing together IMFMediaSource::Shutdown() and the
constructors' failure paths, creating confusion about what should be released
where, designate ::Shutdown/::Release to shutting down fully initialized objects
without checks, and keep the partially-created object cleanup code in the
constructor.

Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Zebediah Figura 721b1eb2eb winegstreamer: Properly clean up from failure in wg_parser_connect().
In particular, unset the sink_connected value, and make sure that subsequent
wg_parser_get_read_request calls don't hang.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Zebediah Figura 830efe873a winegstreamer: Factor out more of the init_gst callback into wg_parser_connect().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Zebediah Figura d90ab0805f winegstreamer: Always return S_FALSE from DllCanUnloadNow().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 09:34:28 +02:00
Paul Gofman f49b8602e3 winegstreamer: Create media source read thread after initializing wg_parser.
Fixes race condition as wg_parser is used right away in the created
thread.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 18:27:42 +02:00
Zebediah Figura ddf3b93ac1 winegstreamer: Don't try to convert duration from byte length.
This effectively reverts 613446d018.

Duration and convert queries, in general, appear to be handled by the first
upstream element that knows how. If two different elements respond to each
query, we may treat the byte duration of the whole file as if it were the
duration of a single stream, or treat an undecoded byte duration as if it were a
decoded byte duration.

The aforementioned commit was written in order to ensure that we receive a valid
duration for test.mp3 in quartz_test.exe, and is obviated by the previous
patches which retry duration queries until successful (or EOS).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51126
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:47 +02:00
Anton Baskanov e0a281102b winegstreamer: Continue polling if duration is unavailable after duration-changed.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:44 +02:00
Anton Baskanov 8efac25a0a winegstreamer: Always wait for duration-changed when querying for duration.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51126
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:42 +02:00
Anton Baskanov 08041f9cb4 winegstreamer: Inline query_duration() into wg_parser_connect().
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:16:39 +02:00
Nikolay Sivov 04ebeff225 winegstreamer: Use consistent trace format for MF objects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:30:19 +02:00
Zebediah Figura 82c3205c26 winegstreamer: Switch to the quartz debug channel.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:16:12 +02:00
Zebediah Figura e36e384cb4 winegstreamer: Avoid using Wine debugging functions at all in the Unix library.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:16:10 +02:00
Zebediah Figura 4d2c94e1dd winegstreamer: Factor out create_element().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:16:06 +02:00
Zebediah Figura bcc19e88fb winegstreamer: Avoid using WARN_ON from a GStreamer callback.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:16:03 +02:00
Giovanni Mascellani a9db6c050d winegstreamer: Set MF_MT_ALL_SAMPLES_INDEPENDENT for audio types.
The stricter checks imposed by commit
ac39b313b6, while being valid in general,
require that media source attaches to media types the attributes that
application can request.

This patch exposes the MF_MT_ALL_SAMPLES_INDEPENDENT attribute to audio
streams (similarly to what is already done for video streams), which is
for example requested by The Medium.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 17:49:12 +02:00
Zebediah Figura 5b156eecba winegstreamer: Change the formatting of error and warning messages a bit.
The TestBot treats anything containing the string ": error: " as a compiler
error. It may be possible for the TestBot to be smarter, but it seems easier
just to tweak winegstreamer.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-29 22:43:21 +02:00
Giovanni Mascellani 997074224a winegstreamer: Expose the MF_MT_VIDEO_ROTATION attribute.
The stricter checks imposed by commit
ac39b313b6, while being valid in general,
require that media source attaches to media types the attributes that
application can request.

This patch exposes the MF_MT_VIDEO_ROTATION attribute, which is for
example requested by Legend of Keepers.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-17 20:01:53 +02:00
Nikolay Sivov 457258e7df winegstreamer: Let async command handle request token.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:42:25 +02:00
Giovanni Mascellani 8a506ea9b2 winegstreamer: Improve reported supported rates values for the media source.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Nikolay Sivov 0393a0e2b5 winegstreamer: Fix assert condition.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Zebediah Figura 3c7bcb830f winegstreamer: Make the file_size field of struct parser into a local variable.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 09:56:33 +02:00
Zebediah Figura 2e26556643 winegstreamer: Shut down the read thread before releasing the IMFByteStream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 09:56:31 +02:00
Giovanni Mascellani 02325ccb67 winegstreamer: Advertise support for thinned or reverse playback.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00
Zebediah Figura cf02b0bdfa winegstreamer: Use a static buffer to enumerate stream types in media_stream_init_desc().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 18:49:09 +02:00