Commit Graph

568 Commits

Author SHA1 Message Date
Zebediah Figura 408c178d11 winegstreamer: Do not compare FPS in wg_format_compare().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50667
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 10:55:40 +01:00
Zebediah Figura f98722fe3b 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>
2021-02-15 10:55:12 +01:00
Zebediah Figura 507ba18d08 winegstreamer: Move wg_parser sink disconnection code to the Unix library.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 10:55:05 +01:00
Zebediah Figura 6c67a0a6be winegstreamer: Move GST_Connect() to the Unix library.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 10:54:58 +01:00
Zebediah Figura c5c40f2260 winegstreamer: Move filter initialization out of GST_Connect().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 10:54:47 +01:00
Zebediah Figura c3d76ec9d6 winegstreamer: Pass the wg_parser object to gst_bus_set_sync_handler().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-15 10:54:43 +01:00
Zebediah Figura 9147fefbb2 winegstreamer: Move wg_parser_destroy() to the Unix library.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:51:59 +01:00
Zebediah Figura 10dde32dc6 winegstreamer: Move GStreamer library initialization to __wine_init_unix_lib().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:51:57 +01:00
Zebediah Figura dbd927f4ad winegstreamer: Move wg_parser object creation to a new Unix library.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:51:55 +01:00
Zebediah Figura db8746ffe9 winegstreamer: Separate parser and filter initialization.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-12 14:51:53 +01:00
Zebediah Figura 2d8add43a7 winegstreamer: Don't force existing_new_pad() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:32 +01:00
Zebediah Figura 070612814b winegstreamer: Avoid using Wine debug functions in existing_new_pad().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:30 +01:00
Zebediah Figura 68f0cc4a7b winegstreamer: Pass a wg_parser pointer to signal callbacks.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:28 +01:00
Zebediah Figura c46505c0ab winegstreamer: Defer source pin creation until after all pads are exposed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:25 +01:00
Zebediah Figura fd7c07ea34 winegstreamer: Separate parser_source and wg_parser_stream allocation.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:23 +01:00
Zebediah Figura d5a2599140 winegstreamer: Store the wg_parser_stream pointers as our sink pads' private data.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 10:11:21 +01:00
Zebediah Figura d355fa7988 winegstreamer: Don't force query_sink() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:14:01 +01:00
Zebediah Figura 29cea50d27 winegstreamer: Avoid using Wine debug functions in query_sink().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:59 +01:00
Zebediah Figura d028217a56 winegstreamer: Use amt_to_wg_format() in decodebin_parser_source_query_accept().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:57 +01:00
Zebediah Figura f0a0b9404e winegstreamer: Use wg_format_to_caps() in GST_QUERY_CAPS.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:54 +01:00
Zebediah Figura 897800fd44 winegstreamer: Compare wg_format structures in GST_QUERY_ACCEPT_CAPS.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:52 +01:00
Zebediah Figura 5bff63621e winegstreamer: Store the current stream format in the wg_parser_stream structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:49 +01:00
Zebediah Figura dfeafc7417 winegstreamer: Handle MPEG-1 audio formats in amt_to_wg_format().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-10 09:13:43 +01:00
Zebediah Figura 5a3dad108b winegstreamer: Store the preferred stream format as a wg_format structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 11:13:23 +01:00
Zebediah Figura 7fa0855fa1 winegstreamer: Use struct wg_format to convert from AM_MEDIA_TYPE to GstCaps.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 11:13:16 +01:00
Zebediah Figura fb096d54a8 winegstreamer: Introduce an intermediate media format structure.
The fundamental idea here is to provide a type which can be used in the unixlib
interface. Obviously GstCaps can't be used from PE, and while AM_MEDIA_TYPE can
in theory be used from the Unix library, allocation of the format block makes
things a little tricky. Moreover, we'd ideally like to use the same backend for
DirectShow and Media Foundation, and while it wouldn't be a problem currently,
in general AM_MEDIA_TYPE is not quite expressive enough to translate from
GstCaps to IMFMediaType, and the latter can't be used from the Unix library.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 11:13:13 +01:00
Zebediah Figura a3e7cfd4d7 winegstreamer: Do not use gst_segment_to_running_time().
It fails if samples lie outside of the current segment, but DirectShow filters
(in particular, the native AVI splitter) will happily set timestamps outside of
the current segment.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-09 11:13:04 +01:00
Zebediah Figura 41e53a122d winegstreamer: Factor out free_stream().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Zebediah Figura 45ebc26dcf winegstreamer: Use the "streams" array in wg_parser code.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Zebediah Figura 42dc1e93b2 winegstreamer: Store the stream duration also in the wg_parser_stream structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Zebediah Figura a03f7350b3 winegstreamer: Store the wg_parser_stream pointers also in struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Zebediah Figura a2ce39394e winegstreamer: Store the wg_parser pointer as our source pad's private data.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-05 15:38:21 +01:00
Zebediah Figura c0b087e4e9 winegstreamer: Reset the push offset in parser_init_stream().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:01 +01:00
Zebediah Figura 87daa41eb3 winegstreamer: Avoid accessing the DirectShow peer from GStreamer callbacks.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:01 +01:00
Zebediah Figura cb7fb16147 winegstreamer: Move the "flushing" field to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:01 +01:00
Zebediah Figura c711724074 winegstreamer: Move the "eos" field to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:01 +01:00
Zebediah Figura 763806843b winegstreamer: Move the stream event fields to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 15:41:01 +01:00
Zebediah Figura 7fe5f2755d winegstreamer: Move the "caps" field to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:13:48 +01:00
Zebediah Figura c6d85fc217 winegstreamer: Move the "flip" field to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:13:46 +01:00
Zebediah Figura b00e25a2e8 winegstreamer: Move the GstPad fields to struct wg_parser_stream.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:13:44 +01:00
Zebediah Figura 457f3a96c2 winegstreamer: Move the "segment" field of struct parser_source to a new "wg_parser_stream" object.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:13:41 +01:00
Zebediah Figura 84b64da8fc winegstreamer: Move the "mutex" field to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 09:13:36 +01:00
Zebediah Figura cd27f3ca00 winegstreamer: Duplicate the "sink_connected" field in struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:43 +01:00
Zebediah Figura 5736cb23ac winegstreamer: Move the "flushing" field to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:40 +01:00
Zebediah Figura 6e5af4fc7d winegstreamer: Move the read request fields to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:38 +01:00
Zebediah Figura eb37e5ba6b winegstreamer: Move the playback initialization fields to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:34 +01:00
Zebediah Figura 8a15c811ba winegstreamer: Move the "push_thread" field to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:31 +01:00
Zebediah Figura cde11289bf winegstreamer: Duplicate the file size into struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:52 +01:00
Zebediah Figura c45d4bcec3 winegstreamer: Move the push offset tracking fields to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:50 +01:00
Zebediah Figura 69bd54a53d winegstreamer: Move the "my_src" and "their_sink" fields to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:48 +01:00
Zebediah Figura d4bb0c4639 winegstreamer: Move the "element" field to struct wg_parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:46 +01:00
Zebediah Figura f5969e1e02 winegstreamer: Move the "bus" field of struct parser to a new "wg_parser" object.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 10:50:44 +01:00
Zebediah Figura 8c13dde595 winegstreamer: Don't force activate_mode() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:17:00 +01:00
Zebediah Figura 1dc7015cdb winegstreamer: Avoid using Wine debug functions in activate_mode().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:16:58 +01:00
Zebediah Figura 8e84f16066 winegstreamer: Don't grab filter_cs in activate_push().
There's no good reason to do this; we're not protecting anything that isn't
already protected by GStreamer locks.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:16:55 +01:00
Zebediah Figura 5482400a4e winegstreamer: Do not flush the upstream source pin in activate_push().
We don't do this in pull mode (and in general never have; avidemux and wavparse
are two examples of GStreamer elements that don't flush the upstream pad when
deactivating).

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-29 10:16:52 +01:00
Zebediah Figura ed3ed4d8ab winegstreamer: Make push_data() into a POSIX thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 09:42:05 +01:00
Zebediah Figura f7825f81b6 winegstreamer: Avoid using Wine debug functions in push_data().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 09:42:03 +01:00
Zebediah Figura b5f0b7901a winegstreamer: Use request_buffer_src() in push_data().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 09:42:01 +01:00
Zebediah Figura 4a4ac2730e winegstreamer: Use the "filesize" field in push_data().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-28 09:41:58 +01:00
Zebediah Figura ad6a3e7534 winegstreamer: Don't force request_buffer_src() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 10:22:13 +01:00
Zebediah Figura 3b885fb5f3 winegstreamer: Manage our own thread for read requests.
Synchronization around flushing (on both sides) is tricky here, and the
solution used by this patch means that a "kernel" thread can be blocked on a
"user" thread. However, since it's not a real kernel thread and can't bring
down the rest of the "kernel", I don't think this is a concern.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 10:22:06 +01:00
Zebediah Figura 2e41e3be57 winegstreamer: Don't force removed_decoded_pad() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 10:22:03 +01:00
Zebediah Figura cfce5054ac winegstreamer: Avoid using Wine debug functions in removed_decoded_pad().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 10:22:00 +01:00
Zebediah Figura 6e21a8cc31 winegstreamer: Don't force query_function() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:01:16 +01:00
Zebediah Figura e9a1366028 winegstreamer: Avoid using Wine debugging functions in query_function().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:01:12 +01:00
Zebediah Figura 1655dd4593 winegstreamer: Don't force event_src() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:01:08 +01:00
Zebediah Figura 3ed270206a winegstreamer: Avoid using Wine debugging functions in event_src().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:01:04 +01:00
Zebediah Figura 72a05ba397 winegstreamer: Don't force event_sink() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:00:58 +01:00
Zebediah Figura 16898714b1 winegstreamer: Avoid using Wine debug functions in event_sink().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 09:00:54 +01:00
Zebediah Figura 3d7486d66b winegstreamer: Don't force got_data_sink() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:59:12 +01:00
Zebediah Figura 2cdb12b08e winegstreamer: Avoid using Wine debug functions in got_data_sink().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:59:08 +01:00
Zebediah Figura 13ea906985 winegstreamer: Factor out get_stream_event().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:59:05 +01:00
Zebediah Figura 54e012b5b7 winegstreamer: Use pthread condition variables to queue stream events.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:59:02 +01:00
Zebediah Figura e785880a96 winegstreamer: Don't force no_more_pads() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:58:58 +01:00
Zebediah Figura 7875d8dd87 winegstreamer: Avoid using Wine debug functions in no_more_pads().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-25 09:58:55 +01:00
Zebediah Figura 4782f67bca winegstreamer: Don't force watch_bus() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:21 +01:00
Zebediah Figura 871c5673d9 winegstreamer: Avoid using Wine debug functions in watch_bus().
They depend on a valid TEB and can't be called from non-Wine threads.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:21 +01:00
Zebediah Figura 1f7ab818d8 winegstreamer: Use a pthread condition variable to wait for filter initialization.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:21 +01:00
Zebediah Figura 2546ad8115 winegstreamer: Store the segment parameters in the parser_event structure.
Instead of the segment event.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:20 +01:00
Zebediah Figura 911bc74a1e winegstreamer: Move pin duration and caps retrieval to GST_Connect().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:20 +01:00
Zebediah Figura 275b222662 winegstreamer: Use the "flushing" field to unblock the streaming thread when stopping.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 10:27:24 +01:00
Zebediah Figura 90107bba94 winegstreamer: Keep the stream in paused state for its entire lifetime.
This noticeably improves stream startup time. The process of typefinding and
negotiation takes about 70 ms for a simple test file on one machine, and this
is currently done twice. This patch replaces the second instance with a simple
seek, which takes less than 10 ms.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 10:27:21 +01:00
Zebediah Figura 36a7dd93d7 winegstreamer: Do not return GST_FLOW_NOT_LINKED if the DirectShow pin is not connected.
This is a fatal error condition for GStreamer, but should not cause errors for
DirectShow.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 10:27:18 +01:00
Zebediah Figura b3e2009b5e winegstreamer: Consistently use GST_STATE_PAUSED for test-play.
It does not matter whether we use PAUSED or PLAYING, but we should at least be
consistent.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 10:27:15 +01:00
Zebediah Figura ef79e902a6 winegstreamer: Flush connected pins directly in SetPositions().
Instead of propagating GStreamer flush events to corresponding DirectShow pins.

This is mainly to avoid more callbacks from GStreamer and further separate the
Win32 and Unix code.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 10:27:07 +01:00
Zebediah Figura 9c138562fe winegstreamer: Manage our own streaming thread.
This is a rather large and complex change. It comprises several parts:

(1) Instead of directly sending EOS, segment, and sample events to the
    downstream DirectShow sink, first queue them in a local buffer (i.e.
    "pin->event").

(2) Spawn a separate thread per source pin (i.e. "stream_thread") which consumes
    said events and sends them downstream.

(3) When flushing or stopping, explicitly wait for this thread to pause or stop
    (respectively).

There are a few reasons for this:

(1) It reduces the number of Unix -> PE callbacks we need to make, easing PE
    conversion. This is not a great advantage *a priori*, and may not be worth a
    similar dedicated "handler" thread for most modules, but winegstreamer is
    different—we were already marshalling these calls onto another thread, and
    now that marshalling can go away (almost).

(2) Because GStreamer can only do pad negotiation (and hence autoplugging) while
    running (in contrast to DirectShow, which can do it while stopped), we
    currently have to renegotiate every time the pipeline is started. Most
    applications don't start the graph more than once, but even that requires
    two negotiations, and startup time is demonstrably too high. It would be
    nice to keep the graph in PAUSED state all of the time, but this is
    difficult to do without more fine-grained control over the streaming thread.
    [In particular, we cannot reliably wait for all samples to be delivered
    except by stopping the GStreamer pipeline.]

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 11:20:57 +01:00
Derek Lesho 41e49d4596 winegstreamer: Reformat type-setting functions to prevent the need for a conditionally initialized variable.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Derek Lesho aae9333cd2 winegstreamer: Correct mistaken enum value in ProcessMessage.
This is the message session relies on succeeding.

Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 21:44:17 +01:00
Giovanni Mascellani cc116548fd winegstreamer: Wait on error conditions when initializing GStreamer.
GStreamer doesn't necessarily signal all error when setting the
PLAYING or PAUSED state. If Wine just waits on no-more-pads, it risks
a deadlock if an error is signaled after gst_element_get_state was
called.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 20:21:40 +01:00
Zebediah Figura 690afb42f6 strmbase: Rename csFilter to filter_cs.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 08:52:32 +01:00
Zebediah Figura 6fdfacb5bf winegstreamer: Do not call gst_pad_event_default().
This matches the behaviour of GstBaseSrc and GstBaseSink. In particular, we
now return FALSE for unhandled source events.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 08:52:29 +01:00
Zebediah Figura 0529fe3168 winegstreamer: Do not handle GST_EVENT_TAG in event_src().
GST_EVENT_TAG is a downstream-only event.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 08:52:26 +01:00
Zebediah Figura c38fcd19b3 winegstreamer: Explicitly store a GstCaps pointer in the parser_source structure.
gst_pad_get_current_caps() is not guaranteed to return the updated caps when
GST_EVENT_CAPS is handled by the event handler, or even after
gst_pad_event_default(). The actual implementation of gst_pad_send_event() in
fact sets it later. Avoid a potential race condition by using our own caps
pointer.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:36 +01:00
Zebediah Figura 85d81ae9a9 winegstreamer: Avoid leaking GstEvent objects.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:36 +01:00
Zebediah Figura b554086282 winegstreamer: Unify the decodebin parser definitions under the name "decodebin_parser".
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:36 +01:00
Zebediah Figura 6f18c09978 winegstreamer: Rename gstdemux to parser.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:36 +01:00
Zebediah Figura b39bbeb9e0 winegstreamer: Rename gstdemux_source to parser_source.
"gstdemux" is not a very specific name, or accurate (it does not always demux,
nor is it the only object which may demux using GStreamer). Also, while it
does not risk colliding with GStreamer definitions as-is (lacking an
underscore), I am inclined to avoid using "gst" or "gstreamer" as a prefix for
our definitions, simply for the sake of clarity.

"parser" is the common term for both DirectShow filters and GStreamer elements
which "drive" the pipeline, i.e. explicitly pull data from upstream and push
data downstream. While it's arguably still not specific enough (i.e. should be
specifically identified as a DirectShow parser), I think that the differing
terminology in Media Foundation (where the counterpart is a "media source")
makes the choice of a shorter name justifiable.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-18 22:46:36 +01:00
Zebediah Figura 20beb7abbe winegstreamer: Don't bother setting the GStreamer pipeline to PLAYING.
It's entirely unnecessary; only renderers and live sources care about this.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:14:35 +01:00
Zebediah Figura 3bf543589d winegstreamer: Don't force autoplug_blacklist() onto a Wine thread.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:14:33 +01:00
Zebediah Figura c59bd77679 winegstreamer: Avoid using Wine debug functions in autoplug_blacklist().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:14:07 +01:00
Zebediah Figura 0d570d63a9 winegstreamer: Get rid of the unknown_type() callback.
This information is already printed by GStreamer via GST_MESSAGE_ERROR.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 16:14:01 +01:00
Anton Baskanov 2752029e92 winegstreamer: Split audio data to fit in the sample buffer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50355
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-05 10:19:01 +01:00
Anton Baskanov 291d5a9c10 winegstreamer: Move sample sending to a helper function.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-05 10:18:58 +01:00
Anton Baskanov 472adf6509 winegstreamer: Unmap and unref the buffer and release the sample before returning.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-02 14:37:07 +01:00
Zebediah Figura 6f15875443 winegstreamer: Remove the color matrix setting for the other videoconvert as well.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49535
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-09 10:29:18 +01:00
Zebediah Figura 43a5234bd9 winegstreamer: Clean up a newly allocated buffer on error in bytestream_wrapper_pull().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Zebediah Figura 251262a44a Revert "winegstreamer: Avoid performing color matrix conversions in videoconvert.".
This reverts commit fd25ba65e0.

The relevant commit breaks visual correctness in many applications, for the sake
of performance. As such I am rather inclined to revert it for 6.0, especially as
a full solution will probably involve a revert of this patch along with upstream
changes to GStreamer.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49535
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 11:09:05 +01:00
Derek Lesho f7230992cc winegstreamer: Implement Get(Input/Output)CurrentType functions for audio converter transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 10:18:45 +01:00
Derek Lesho 8771d06b94 winegstreamer: Implement ::SetOutputType for audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 10:18:20 +01:00
Derek Lesho c880e5b1a0 winegstreamer: Implement ::SetInputType for audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-04 10:18:18 +01:00
Derek Lesho c7345a51f7 winegstreamer: Implement ::ProcessMessage for audio conversion MFT.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Derek Lesho 8e6a4b239a winegstreamer: Implement ::GetOutputAvailableType for audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Derek Lesho 8aa77a4450 winegstreamer: Implement ::GetInputAvailableType for audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Derek Lesho 508b124f80 winegstreamer: Register the audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Derek Lesho 35c0da85ef winegstreamer: Introduce audio conversion transform.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Derek Lesho d52f2a0f99 winegstreamer: Use gst_audio_info_to_caps for media type translation.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:39 +01:00
Nikolay Sivov 8315486d64 winegstreamer: Fix possible leak on error path (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-26 23:25:24 +01:00
Gijs Vermeulen 3bcabb2422 winegstreamer: Initialise type_handler to NULL in media_stream_init_desc().
Otherwise it is used uninitialised if a failure occurs.

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-25 21:39:18 +01:00
Zebediah Figura 54d74a053b winegstreamer: Don't query the pad position in IMediaSeeking::SetPositions().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 21:05:04 +01:00
Zebediah Figura 1bb7ef1c1a winegstreamer: Return the seeking start time from IMediaSeeking::GetCurrentPosition().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-23 21:05:04 +01:00
Zebediah Figura ef7dcc7d51 winegstreamer: Don't fail parser_init_stream() if a source pin is not connected.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-17 19:36:40 +01:00
Zebediah Figura 60814198fe winegstreamer: Don't fail state change methods if the sink pin is not connected.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-17 19:36:38 +01:00
Derek Lesho 59c55e96f5 winegstreamer: Set MF_PD_DURATION on source's presentation descriptor.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 21:38:06 +01:00
Derek Lesho e12b7d2104 winegstreamer: Implement IMFMediaSource::GetCharacteristics.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 21:38:06 +01:00
Derek Lesho 964cf9cfce winegstreamer: Require media source's IMFByteStream to be seekable.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 21:38:06 +01:00
Derek Lesho 96097c072b winegstreamer: Implement IMFMediaStream::GetMediaSource.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-06 12:00:17 +01:00
Derek Lesho 03eaa2cc93 winegstreamer: Implement IMFMediaStream::RequestSample.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 22:14:11 +01:00
Derek Lesho 12f1afbffe winegstreamer: Implement IMFMediaSource::Start.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 22:14:11 +01:00
Derek Lesho e2893c3452 winegstreamer: Implement IMFMediaSource::CreatePresentationDescriptor.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-28 20:36:32 +01:00
Derek Lesho f26e81cf38 winegstreamer: Replace gst_pad_get_current_caps with gst_pad_query_caps.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-28 20:36:29 +01:00
Derek Lesho 93107c08f5 winegstreamer: Insert audioconvert into decoded audio streams.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-26 22:25:06 +01:00
Derek Lesho 528e6870ad winegstreamer: Insert videoconvert into decoded-video streams.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-26 22:24:47 +01:00
Zebediah Figura 63cf882e39 winegstreamer: DirectShow and GStreamer proportions are inverted with respect to each other.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Zebediah Figura 458dfcb95a winegstreamer: Respect integer promotion rules when clamping timestamp + diff.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Anton Baskanov 0542a34c24 winegstreamer: Expose 15/16-bit RGB formats.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-07 10:15:49 +02:00
Anton Baskanov e484056171 winegstreamer: Add a second videoconvert to handle 15/16-bit RGB formats.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-07 10:15:47 +02:00
Anton Baskanov 9afc5ed72e winegstreamer: Fix RGB565 conversion in amt_from_gst_video_info().
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-07 10:15:46 +02:00
Anton Baskanov e47b45e2f5 winegstreamer: Use RGB15/16 formats instead of BGR15/16.
Gstreamer stores the first component in the most significant bits, same as DirectShow.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-07 10:15:43 +02:00
Derek Lesho 4228016b0c winegstreamer: Implement IMFMediaStream::GetStreamDescriptor.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:02:17 +02:00
Derek Lesho 7d4395a00e winegstreamer: Use decodebin to initialize media streams.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:02:15 +02:00
Derek Lesho a4d6ad6d49 winegstreamer: Add a GstPad wrapping the media source's bytestream.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-29 12:02:12 +02:00
Zebediah Figura 025b3de29c winegstreamer: Avoid leaking a newly allocated buffer on failure in request_buffer_src().
According to the GStreamer documentation, the contents of "buffer" should be
considered undefined on failure, which means that the caller has no way of
freeing a newly allocated buffer.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:48:40 +02:00
Zebediah Figura 622f2ce991 winegstreamer: Don't set the buffer offset in request_buffer_src().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-25 10:48:34 +02:00
Michael Stefaniuc 60a8f050a5 winegstreamer: Drop redundant NULL check before heap_free().
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:36:20 +02:00
Zebediah Figura 21d2e68d8e winegstreamer: Dereference messages dropped from watch_bus().
From GStreamer documentation: "If the handler returns GST_BUS_DROP, it should
unref the message, else the message should not be unreffed by the sync handler."

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-10 10:24:28 +02:00
Derek Lesho e7b8911695 winegstreamer: Implement IMFMediaSource::Shutdown.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Derek Lesho d832ebf1b0 winegstreamer: Implement source event methods.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Derek Lesho 784ae1e9bd winegstreamer: Add stub media source.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Derek Lesho a6be76bb9c winegstreamer: Add stub bytestream handler.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-07 21:07:00 +02:00
Zebediah Figura 0c34a2c97a winegstreamer: Fix a leak in gstdecoder_source_get_media_type().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 22:07:40 +02:00
Zebediah Figura 3231901ad8 Revert "winegstreamer: Check for failure from gst_video_info_set_format().".
This reverts commit ddd43e0a80.

This function returns void before 1.12.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49647
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-03 10:19:19 +02:00
Zebediah Figura e707578007 winegstreamer: Release the IAsyncReader on disconnection.
This allows "Zero Escape: Nine Hours, Nine Persons, Nine Doors" to start.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zebediah Figura 5ea1287e08 winegstreamer: Preserve the frame rate when converting video formats.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 10:17:47 +02:00
Zebediah Figura ddd43e0a80 winegstreamer: Check for failure from gst_video_info_set_format().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 22:30:48 +02:00
Zebediah Figura 1a72836c37 winegstreamer: deinterlace belongs to the "good" set, not the "base" set.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 13:07:21 +02:00
Zebediah Figura eadcba7925 winegstreamer: Append a deinterlace element to the video post-processing chain.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30366
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-02 18:01:21 +02:00
Zebediah Figura 7be64a8d3e winegstreamer: Don't store DirectShow caps.
Primarily so that we can connect using video caps that can't be translated into
DirectShow caps. They will later be converted into translatable caps once the
DirectShow source pin is connected.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47642
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 09:12:55 +02:00
Zebediah Figura fd25ba65e0 winegstreamer: Avoid performing color matrix conversions in videoconvert.
This reduces the time videoconvert takes to process I420 -> YV12 from 15 ms to 0.8 ms on my system.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 10:11:42 +02:00
Zebediah Figura 930dc23c7c winegstreamer: Prefer YUV formats to RGB ones.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-23 10:11:39 +02:00
Zebediah Figura d085e5ba72 winegstreamer: Clear the "colorimetry" and "chroma-site" fields in amt_to_gst_caps_video().
These fields don't prevent us from connecting, but they may force videoconvert
to do an expensive conversion where not necessary.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-19 10:39:00 +02:00
Akihiro Sagawa bd28efb4c7 winegstreamer: Also wait for EOS events when retrieving duration.
The mpegaudioparse element will not send a duration-changed message if no
Xing or VBRI headers are present.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-14 19:35:20 +02:00
Zebediah Figura 613446d018 winegstreamer: Try to convert the duration from bytes if the pad doesn't support querying time directly.
This can help mpegaudioparse report a usable duration, and presumably also
other elements built from baseparse.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 10:50:28 +02:00
Zebediah Figura 9cc742d258 winegstreamer: Calculate duration independently per pin.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 10:50:28 +02:00
Zebediah Figura 1e079a0ca4 winegstreamer: Don't query our own source pad to convert duration.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 10:50:28 +02:00
Anton Baskanov a18bc50f2f winegstreamer: Commit allocator before pausing the stream.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 12:09:44 +02:00
Akihiro Sagawa 49c33c920e winegstreamer: Unref the GstCaps object in init_new_decoded_pad().
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:07:44 +02:00
Zebediah Figura 1a4e9a84c2 winegstreamer: Remove some no longer necessary callbacks.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:02:08 +02:00
Zebediah Figura 5d0e10b77c winegstreamer: Delay-load mfplat.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:03 +02:00
Zebediah Figura ecac569df2 winegstreamer: Remove some unused imports.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:03 +02:00
Zebediah Figura ac531be92e winegstreamer: Check the format GUID, size, and pointer in amt_to_gst_caps().
Some application filters enumerate types without a format block.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:21:41 +02:00
Zebediah Figura b9b2a04fe7 winegstreamer: Set the bit depth for UYVY video.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 12:18:49 +01:00
Zebediah Figura bdf8f6753d winegstreamer: Flip only RGB video.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-27 12:18:46 +01:00
Zebediah Figura 5814d19373 winegstreamer: Also clear the pixel-aspect-ratio field in amt_to_gst_caps_video().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 21:19:32 +01:00
Rémi Bernon b3a33f065d winegstreamer: Check the callback list before waiting.
Some callbacks may be pushed during pipeline initialization and before
the dispatch thread is actually started and waiting for them, which
sometimes causes some hangs.

This fixes Fallout 3 and Panzer Corps -and possibly others- intro videos
hanging forever.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 21:18:08 +01:00
Derek Lesho 3ddf3a720f winegstreamer: Move broad callback handling code to gst_cbs.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-20 22:37:58 +01:00
Derek Lesho 168ec2c82a winegstreamer: Make callback parameter names more generic.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-20 22:37:56 +01:00
Zebediah Figura 5ca1d28e8d winegstreamer: Clamp both timestamp and timestamp + diff to 0.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 09:44:06 +01:00
Zebediah Figura 38c50751fe winegstreamer: Also use GST_QOS_TYPE_OVERFLOW for samples that arrive on time.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 09:44:03 +01:00
Zebediah Figura 8575484f21 winegstreamer: Use the image size provided by GStreamer.
If the stride is not equal to the width, this calculation will be invalid.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-16 21:42:47 +01:00
Zebediah Figura 1bb868e9c1 winegstreamer: Use amt_from_gst_video_info() in gstdecoder_source_get_media_type().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-16 21:42:43 +01:00
Zebediah Figura 3178f1d0af winegstreamer: Use accessor macros for GstVideoInfo fields.
As the documentation prescribes.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-16 21:42:39 +01:00
Zebediah Figura 57492f55fd winegstreamer: Allocate media type format blocks with CoTaskMemAlloc().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-16 21:42:35 +01:00
Zebediah Figura d61504f16b winegstreamer: Read into an existing buffer if requested.
oggdemux needs this.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-11 15:55:38 +01:00
Zebediah Figura 74dc0c5df9 winegstreamer: Reimplement COM registration and vending locally.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-09 12:10:52 +01:00
Zebediah Figura fe6220dba7 winegstreamer: Use nAvgBytesPerSec to determine buffer size only for raw audio formats.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-28 11:27:16 +01:00
Zebediah Figura 2620d649c3 winegstreamer: Defer a seek to pause time if necessary.
This fixes background music in Tomb Raider II.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-28 11:27:13 +01:00
Zebediah Figura 7987e84229 winegstreamer: Don't fail seeking methods if we couldn't query duration.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48315
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-28 11:27:10 +01:00
Zebediah Figura 18bdaaaa26 winegstreamer: Don't query or set GStreamer duration if the filter is stopped.
This check is not equivalent to the existence of "their_src" for the
MPEG-1 splitter, since that always exposes a source audio pin.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-28 11:27:05 +01:00
Zebediah Figura 540f2983a9 winegstreamer: Decommit the source allocator when cleaning up the stream.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-20 16:23:09 +01:00
Zebediah Figura 6745afd81d winegstreamer: Negotiate allocators per source pin.
In particular, pass the correct buffer size for the format we have chosen.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48570
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-16 20:49:19 +01:00
Zebediah Figura c90a36e38c winegstreamer: Read samples synchronously in push_data().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-16 20:49:16 +01:00
Zebediah Figura c366415360 strmbase: Merge enumpins.c into filter.c.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 09:45:56 +01:00
Zebediah Figura d263c4a366 winegstreamer: Get rid of the mp3 decoder.
In the unlikely event that we are hotplugging not from an IAsyncReader, we
already have the ACM wrapper and l3codeca.acm available to do the same thing.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-29 09:45:32 +01:00
Zebediah Figura 943b6564f5 winegstreamer: Get rid of the AudioConvert filter.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 14:25:38 +01:00
Zebediah Figura 1052d5cfb1 winegstreamer: Allow converting to 16-bit 2-channel PCM within the splitter filter.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 14:25:34 +01:00
Zebediah Figura 11b30ffc07 winegstreamer: Append an audioconvert element to raw audio streams.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 14:25:31 +01:00
Zebediah Figura aa7017510d winegstreamer: Correctly represent non-32-bit float types.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 14:25:27 +01:00
Zebediah Figura ec0d6323d0 winegstreamer: Report MEDIASUBTYPE_IEEE_FLOAT for float types.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 14:25:23 +01:00
Zebediah Figura 841502993f winegstreamer: Get rid of the YUV-to-(A)RGB converters.
This is handled by the splitter filter now.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-27 14:39:20 +01:00