[PATCH 0/3] MR3807: include: Do not import strmif.idl in mediaobj.idl.
From: Zebediah Figura <zfigura(a)codeweavers.com> For IReferenceClock. Currently we rely on it getting included via the following path: wmsdk.idl -> wmsdkidl.idl -> drmexternals.idl -> wmdrmsdk.idl -> mfobjects.idl -> mediaobj.idl -> strmif.idl However, mediaobj.idl should not pull in strmif.idl. -- In general I think it is also good practice to explicitly include all of the used headers directly in a module, as is done in the Linux kernel. --- dlls/wmvcore/async_reader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wmvcore/async_reader.c b/dlls/wmvcore/async_reader.c index 95f617b5cf8..3a8556a5f0a 100644 --- a/dlls/wmvcore/async_reader.c +++ b/dlls/wmvcore/async_reader.c @@ -26,6 +26,7 @@ #define EXTERN_GUID DEFINE_GUID #include "initguid.h" +#include "strmif.h" #include "wmvcore_private.h" #include "wmsdk.h" -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3807
From: Zebediah Figura <zfigura(a)codeweavers.com> This means that mfobjects.idl no longer pulls in mediaobj.idl. Since it still needs AM_MEDIA_TYPE to be declared (though not defined), add a typedef. Reorder includes in a couple files to avoid multiple-definition errors. strmiids and mfplat were getting strmif.h through mfobjects.h, and dsdmo was getting it through dmo.h. --- dlls/dsdmo/main.c | 1 + dlls/mfplat/mediatype.c | 1 + include/mediaobj.idl | 7 ++++++- include/mfapi.h | 1 + libs/strmiids/evr.c | 5 ++++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c index 2393b92185e..0879c4e0516 100644 --- a/dlls/dsdmo/main.c +++ b/dlls/dsdmo/main.c @@ -21,6 +21,7 @@ #include "mmreg.h" #include "mmsystem.h" #include "uuids.h" +#include "strmif.h" #include "initguid.h" #include "medparam.h" #include "dsound.h" diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 16854c7a5a4..eed06ef02ef 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -22,6 +22,7 @@ #include "dxva2api.h" #include "uuids.h" +#include "strmif.h" #include "initguid.h" #include "ks.h" #include "ksmedia.h" diff --git a/include/mediaobj.idl b/include/mediaobj.idl index 4c2e4963174..127b95e7fc3 100644 --- a/include/mediaobj.idl +++ b/include/mediaobj.idl @@ -19,8 +19,10 @@ import "unknwn.idl"; import "objidl.idl"; -import "strmif.idl"; +cpp_quote("#ifdef __strmif_h__") +cpp_quote("typedef AM_MEDIA_TYPE DMO_MEDIA_TYPE;") +cpp_quote("#else") typedef struct _DMOMediaType { GUID majortype; @@ -34,6 +36,9 @@ typedef struct _DMOMediaType BYTE *pbFormat; } DMO_MEDIA_TYPE; +typedef LONGLONG REFERENCE_TIME; +cpp_quote("#endif") + /***************************************************************************** * IEnumDMO interface */ diff --git a/include/mfapi.h b/include/mfapi.h index 3185fc6944f..105b093893f 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -507,6 +507,7 @@ typedef enum struct tagVIDEOINFOHEADER; typedef struct tagVIDEOINFOHEADER VIDEOINFOHEADER; +typedef struct _AMMediaType AM_MEDIA_TYPE; HRESULT WINAPI MFAddPeriodicCallback(MFPERIODICCALLBACK callback, IUnknown *context, DWORD *key); HRESULT WINAPI MFAllocateSerialWorkQueue(DWORD target_queue, DWORD *queue); diff --git a/libs/strmiids/evr.c b/libs/strmiids/evr.c index 74ec145e4d4..3213b054a46 100644 --- a/libs/strmiids/evr.c +++ b/libs/strmiids/evr.c @@ -16,9 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* Don't define those GUIDs here */ +/* strmiids needs guids from evr.idl, but not the rest of the MF guids. + * We also need to avoid redefining the rest of the DirectShow guids from + * strmif.h. */ #include "propidl.h" #include "mfidl.h" +#include "strmif.h" #include "initguid.h" -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3807
From: Zebediah Figura <zfigura(a)codeweavers.com> dsound_private.h pulls in mediaobj.h, which previously pulled in strmif.h. We were including that under the initguid.h, which meant that strmif.h GUIDs were being defined in both dsound_main.o and uuid. Now that mediaobj.h does not pull in strmif.h anymore, we don't need this include. --- dlls/dsound/dsound_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index 08c08d841b4..f0ceb2ce0b8 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -52,7 +52,6 @@ #include "unknwn.h" #include "oleidl.h" #include "shobjidl.h" -#include "strmif.h" #include "propkey.h" #include "initguid.h" -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3807
participants (2)
-
Zebediah Figura -
Zebediah Figura (@zfigura)