It would be good if you could add an import library for
"mfreadwrite.dll" to the distribution. (There is already a header
file, "mfreadwrite.h".) The import library can be generated like this:

gendef -a - c:/Windows/System32/mfreadwrite.dll >mfreadwrite.def
dlltool -k --output-lib libmfreadwrite.a --def mfreadwrite.def

The DLL contains C functions for creating MediaFoundation source/sink
objects. For example, it contains the function
MFCreateSinkWriterFromURL[1] used in the example program "Tutorial:
Using the Sink Writer to Encode Video"[2].

[1] 
<https://docs.microsoft.com/en-us/windows/win32/api/mfreadwrite/nf-mfreadwrite-mfcreatesinkwriterfromurl>
[2] 
<https://docs.microsoft.com/en-gb/windows/win32/medfound/tutorial--using-the-sink-writer-to-encode-video>

Tested on the 32-bit and 64-bit toolchains. Copy the example program
from the tutorial (see [2]; the final listing is at the end of the
article). Fix the declaration of "main" (it must return int, not
void). Save it as "main.cpp". Run the commands in the batch script
below. You should see a video (20 seconds of green).

gendef -a - c:/Windows/System32/mfreadwrite.dll >mfreadwrite.def
dlltool -k --output-lib libmfreadwrite.a --def mfreadwrite.def
g++ -o a.exe main.cpp -L. -lmfreadwrite -levr -lmfplat -lmfuuid -lole32
a.exe
output.wmv


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to