Commit graph

447 commits

Author SHA1 Message Date
Nikolay Sivov 4690a7df51 mfplat: Partially implement MFInitMediaTypeFromAMMediaType().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-27 16:53:13 +02:00
Nikolay Sivov 1e2f552428 mfplat: Partially implement MFInitMediaTypeFromVideoInfoHeader().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-27 16:53:13 +02:00
Nikolay Sivov 43e70580f4 mfplat/tests: Add some tests for legacy media type conersion functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-27 16:53:09 +02:00
Nikolay Sivov 6b418e8213 mfplat: Implement Write() for file streams.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-15 18:14:01 +02:00
Nikolay Sivov da581d383d mfplat: Add some attributes related to transcoding.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-08-09 21:07:47 +02:00
Giovanni Mascellani a04e890f37 mfplat/tests: Merge and reorganize image format tests.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-07-26 22:37:48 +02:00
Giovanni Mascellani 51835957d0 mfplat/tests: Mark some tests as broken on Win 8 and 10 v1507.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-07-26 22:37:48 +02:00
Giovanni Mascellani 0a78a9f56d mfplat/tests: Remove duplicated tests.
The same tests are already performed in test_MFGetPlaneSize().

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-07-01 19:16:16 +02:00
Giovanni Mascellani 2f83de8cff mfplat/buffer: Deduplicate common code between Lock2D() and Lock2DSize().
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-07-01 19:16:16 +02:00
Zhiyi Zhang 2e0a56257a mfplat/tests: Fix resource leaks.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53235
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
2022-06-30 12:32:48 +02:00
Giovanni Mascellani fcb8edee6b mfplat/buffer: Fix the image copy function for IMC2/IMC4 buffers with odd height.
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-06-28 10:25:49 +02:00
Giovanni Mascellani 496073d506 mfplat/tests: Use a more unique pattern when testing image formats.
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-06-28 10:25:44 +02:00
Giovanni Mascellani fcabfeea8f mfplat/buffer: Fix size for IMC2/IMC4 buffers with odd height.
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-06-28 10:25:37 +02:00
Giovanni Mascellani 433845277b mfplat/tests: Test interaction between Lock2D() and LockRect().
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-06-16 22:32:37 +02:00
Giovanni Mascellani 0d63116b27 mfplat/tests: Test interaction between Lock() and LockRect().
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-06-16 22:32:37 +02:00
Andrew Eikum 0416d2f167 mfplat/tests: Add tests for IMFByteStream position.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-20 12:24:38 +02:00
Andrew Eikum 0c2f1121cc mfplat: Consolidate stream and file IMFByteStream Read/Write callback vtables.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-20 12:24:38 +02:00
Andrew Eikum 411ef13e7c mfplat: Simplify IMFByteStream async Read/Write methods.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-20 12:24:38 +02:00
Andrew Eikum 4c999efdfb mfplat: Consolidate stream and file IMFByteStream vtables.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-20 12:24:38 +02:00
Nikolay Sivov e3f226fde0 mfplat: Allow NULL size pointer in IMFAttributes::GetAllocatedBlob().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-12 12:34:17 +02:00
Andrew Eikum ca10760d2e mfplat: Allow NULL length pointer in IMFAttributes::GetAllocatedString.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 11:38:09 +02:00
Nikolay Sivov 1d7d3f58d6 mfplat/sample: Fix use-after-free of a critical section.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 11:37:31 +02:00
Giovanni Mascellani b180775121 mfplat: Avoid a race condition when releasing a tracked sample.
Right now, if the same tracked sample is released at the same time
from two different threads it might happen that neither of them calls
the callback, because they might go through the critical section at
the same time (while neither has decremented the reference count yet).

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-04 21:27:25 +02:00
Fabian Maurer f5d41f28f6 mfplat: Prevent use after free (Coverity).
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-27 16:14:24 +02:00
Nikolay Sivov b159edc679 mfplat: Fix alignment used by audio buffers created with MFCreateMediaBufferFromMediaType().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 17:34:48 +02:00
Giovanni Mascellani 52b5caa488 mfplat: Do not allocate more memory than requested.
It is totally fine (though maybe a little strange) to allocate 10 bytes
requesting an alignment to a megabyte boundary or more, and this
shouldn't result in wasting an (nearly) entire megabyte of memory.

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-03-17 10:48:32 +01:00
Giovanni Mascellani 20c4896b12 mfplat: Align buffers at no less than 16 bytes boundaries.
This is what seems to be happening on Windows 10. On the other hand, I
am not seeing on native the current behavior of interpreting a zero
alignment parameter as a request to align to 64 bytes boundaries.

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-03-17 10:48:32 +01:00
Giovanni Mascellani 44c9ea5043 mfplat: Do not mark the buffer as locked if Lock2D() fails.
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-03-17 10:48:32 +01:00
Giovanni Mascellani cc9722e4e0 mfplat: Do not allocate more memory than required.
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-03-17 10:48:32 +01:00
Giovanni Mascellani 135bdc21e8 mfplat: Fix buffer reading with IMF2DBuffer::Lock().
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-03-17 10:48:32 +01:00
Giovanni Mascellani 8adb6d80d5 mfplat/tests: Check that Lock() and Lock2D() see the same content.
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-03-17 10:48:32 +01:00
Giovanni Mascellani 4b36913660 mfplat: Properly align memory allocated by IMF2DBuffer.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:31:14 +01:00
Giovanni Mascellani 0ecde5505c mfplat: Properly align system memory buffers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-10 18:27:44 +01:00
Eric Pouech 02c3bc5fc5 mfplat/tests: 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-03-04 10:06:01 +01:00
Eric Pouech de243ad218 mfplat/tests: Use correct integral type.
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-03-04 10:06:01 +01:00
Alistair Leslie-Hughes 4662dbd796 mfplat: Correctly calculate url scheme length.
When a url is passed in, for example "http://..."
We need to include the : in the scheme string not exclude it.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-23 17:28:46 +01:00
Nikolay Sivov 6dc3d258ce mfplat: Add VT_R4 case for propvariant tracing.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-21 12:32:06 +01:00
Nikolay Sivov 6971e7e021 mfplat: Fix playback rate handling in system time source.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-17 18:58:36 +01:00
Eric Pouech d9ade7461e mfplat: 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-16 18:29:29 +01:00
Giovanni Mascellani 3a0eb8bde9 mfplat: Fix MFGetPlaneSize() behavior for invalid formats.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Nikolay Sivov ee8ddf37c9 mfplat/tests: Add a separate test function for MFGetPlaneSize().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Rémi Bernon 899ae42b20 mf: Handle MESourceSeeked and MEStreamSeeked state change events.
If a session is paused then started again, or if a start position is
provided we wait forever for the source to send a MESourceStarted event,
when it sends a MESourceSeeked instead.

This causes a deadlock in Bright Memory: Infinite as the game then waits
for the Start command to complete, while the session is stuck in the
SESSION_STATE_STARTING_SOURCES state.

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>
2022-02-14 21:20:42 +01:00
Nikolay Sivov 381c2a9ae1 mfplat: Implement MFAverageTimePerFrameToFrameRate().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 10:44:10 +01:00
Nikolay Sivov 3a8bdf8bdc mfplat: Better handle source resolution when content type is not specified for the stream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 10:44:10 +01:00
Nikolay Sivov 68d2b338da mfplat: Implement MFCreateTempFile().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 10:44:10 +01:00
Nikolay Sivov c058e562fc mfplat: Remove duplicated includes.
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 98c0f3dac4 mfplat: 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-03 10:50:33 +01:00
André Zwing 30c1522273 mfplat: Remove duplicated space in spec.
Signed-off-by: André Zwing <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:54 +01:00
Fabian Maurer 93eda568b9 mfplat/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 15:57:48 +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