Commit graph

160 commits

Author SHA1 Message Date
Alistair Leslie-Hughes 073f0af574 mfreadwrite: Remove DECLSPEC_HIDDEN usage. 2023-07-12 10:54:56 +02:00
Ziqing Hui cfbcd014c6 mfreadwrite/tests: Add tests for MP4 sink writer. 2023-05-17 07:13:09 -05:00
Ziqing Hui d1c317720a mfreadwrite: Fix an address of operator typo. 2023-04-21 22:33:29 +02:00
Zebediah Figura ef354da590 winegstreamer: Set the MF_MT_DEFAULT_STRIDE attribute in mf_media_type_from_wg_format(). 2023-04-07 13:26:58 +02:00
Adrian Thiele 0d4f63b34c mfreadwrite/reader: Release device manager in source_reader_release. 2023-03-01 21:39:30 +01:00
Adrian Thiele eeb25932c7 mfreadwrite/tests: Check refcount of device manager after release. 2023-03-01 21:39:30 +01:00
Zebediah Figura 81b09cdee2 mfreadwrite/tests: Test an audio/video file. 2023-02-09 17:54:55 +01:00
Zebediah Figura b924671ea8 mfreadwrite/tests: Avoid depending on sample size in test_source_reader().
At the same time, avoid depending on file length.
2023-02-09 17:54:55 +01:00
Henri Verbeet 76db4b2459 mfreadwrite/reader: Only attempt to copy sample buffers from responses with non-NULL samples.
For example, queueing a MF_SOURCE_READERF_ENDOFSTREAM response will set
a NULL sample. This fixes a regression introduced by commit
68fa3f6736.
2022-08-23 16:18:51 -05:00
Nikolay Sivov 2a5cf1b62a mfreadwrite/writer: Implement Flush().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-18 21:42:19 +02:00
Nikolay Sivov b3a01e2bf0 mfreadwrite/writer: Implement PlaceMarker().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-18 21:42:19 +02:00
Nikolay Sivov 4e410f0769 mfreadwrite/writer: Reference user callback.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-18 21:42:19 +02:00
Nikolay Sivov 862ac14e10 mfreadwrite/writer: Add sample/marker queue for each stream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-18 21:42:19 +02:00
Nikolay Sivov b6a7a3851e mfreadwrite/writer: Update some stats on MEStreamSinkRequestSample.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:19 +02:00
Nikolay Sivov 080fe842e2 mfreadwrite/writer: Update some stats counters on WriteSample().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:17 +02:00
Nikolay Sivov d4ccba0eae mfreadwrite/writer: Notify encoder on BeginWriting().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:16 +02:00
Nikolay Sivov 17da8aa927 mfreadwrite/writer: Implement GetServiceForStream().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:15 +02:00
Nikolay Sivov 764bcdb1ae mfreadwrite/writer: Start presentation clock on BeginWrite().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:13 +02:00
Nikolay Sivov 974842f6d9 mfreadwrite/writer: Partially implement BeginWriting().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:12 +02:00
Nikolay Sivov 98f0e8bca3 mfreadwrite/writer: Implement AddStream().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:10 +02:00
Nikolay Sivov b5040bce82 mfreadwrite/writer: Make sure output pointer is initialized.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-17 16:42:08 +02:00
Nikolay Sivov 4244b4b138 mfreadwrite/writer: Create output stream if it wasn't provided.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-11 16:51:09 +02:00
Nikolay Sivov aaebf839f7 mfreadwrite/writer: Create archive sink automatically when writer is created from url/bytestream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-11 16:51:07 +02:00
Derek Lesho 474d1824c4 mfreadwrite: Update source reader MF_SOURCE_READER_ANY_STREAM behavior based on tests.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
2022-06-09 10:46:55 +02:00
Derek Lesho 35f9b6f0b1 mfreadwrite/tests: Test timestamp-based MF_SOURCE_READER_ANY_STREAM behavior.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
2022-06-09 10:46:55 +02:00
Nikolay Sivov 5b04d18945 mfreadwrite/reader: Propagate resource sharing mode to the sample allocator.
Issue found by Derek Lesho.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 17:52:20 +02:00
Nikolay Sivov 68fa3f6736 mfreadwrite/reader: Allocate output samples on read requests.
Instead of tracking when free notifications, simply propagate allocation
error to the caller. Behavior spotted by Giovanni.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-16 20:46:49 +02:00
Giovanni Mascellani a233c49519 mfreadwrite/reader: Unset sample allocator callbacks while destroying the source reader.
The sample allocator callbacks own a reference to the source reader,
which creates a reference loop and prevents the source reader from
being properly destroyed.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 10:11:42 +02:00
Giovanni Mascellani cdb0471eca mfreadwrite/reader: Make the stream sample allocator callback own a reference to the source reader.
The stream sample allocator callback NotifyRelease() method assumes that
the source reader is valid. Therefore it must own a reference to it,
otherwise it might get called while the source reader is being destroyed,
causing a crash.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 10:11:39 +02:00
Eric Pouech 2ebd4e36b9 mfreadwrite: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-15 10:40:09 +01:00
Nikolay Sivov c8c40e9734 mfreadwrite/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:41 +01:00
Nikolay Sivov a5770a0402 mfreadwrite/reader: Stop media source when shutdown is not allowed.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-11 10:57:17 +01:00
Rémi Bernon be85638b5b mfreadwrite/reader: Use separate refcount for events callbacks.
This resolves circular dependency, with source and streams holding
references to the callbacks, subscribed to their event queues.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-11 10:57:17 +01:00
Nikolay Sivov 305a315a25 mfreadwrite/reader: Use resolver functionality for content type resolution.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 10:44:10 +01:00
Eric Pouech 715a6bfc63 mfreadwrite: Use correct integral types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-02 18:43:10 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Nikolay Sivov 159e1c5fa4 mfreadwrite/reader: Add m4v format magic.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 21:53:56 +01:00
Nikolay Sivov 33208d8a65 mfreadwrite/tests: Use CRT allocation functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-20 18:15:02 +01:00
Rémi Bernon ff0a13c86e mfreadwrite/reader: Add recognition of ftypeMSNV mp4 header.
Needed by Greedfall intro videos.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-28 13:05:38 +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 865bbff0d9 winegstreamer: Ensure that the source reports both PCM and floating point audio formats.
The patch is originally by Derek Lesho, with some changes by
Giovanni Mascellani and Nikolay Sivov.

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-14 20:56:02 +02:00
Giovanni Mascellani ac39b313b6 mfreadwrite: Accept new media type only when format data are equal.
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-07 22:22:49 +02:00
Giovanni Mascellani aef6a2343c mfreadwrite/tests: Test setting a non-native bit depth on the reader.
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-07 22:22:49 +02:00
Alexandre Julliard 5d82baf974 winecrt0: Add a default implementation DllRegisterServer()/DllUnregisterServer().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Alexandre Julliard bd6b53740c winecrt0: Add a default implementation for DllCanUnloadNow().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Nikolay Sivov 129e5660e3 mfreadwrite/reader: Add missing allocation check (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:35:21 +02:00
Nikolay Sivov 437bc14ac3 mfreadwrite: Use CRT functions for heap allocations.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-08 12:14:31 +02:00
Giovanni Mascellani c35adbac8f mfreadwrite/tests: Fix testing of a source with one stream.
Even when a lower stream count was requested, most of the implementation
still used ARRAY_SIZE(source->streams) as actual count, so the
implemented behaviour was not the desired one. Also, it implied
undefined behaviour.

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-04-06 22:46:12 +02:00
Nikolay Sivov b50b65ab93 mfreadwrite/reader: Improve decoder output samples handling.
Equivalent of 706fd3dcce, but for the reader.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:13:43 +02:00
Nikolay Sivov 657a76ce23 mfreadwrite/reader: Use shared multi-threaded queue internally.
Using dedicated queue prevents potential lockups with event queue,
specifically when waiting on event queue for seek to finish blocks
events delivery.

The issue was diagnosed by Giovanni.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-26 16:48:30 +01:00