From patchwork Sun Jan 2 09:49:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Diederick C. Niehorster" X-Patchwork-Id: 33007 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp15299849iog; Sun, 2 Jan 2022 01:50:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnGLYhbN0+kkXuvdyEEJl3HPn8kv2DxLAgyebwctzwGMumyLGImOAoxdx+grju5vcz/EnW X-Received: by 2002:a17:907:2bdb:: with SMTP id gv27mr32744653ejc.424.1641117047652; Sun, 02 Jan 2022 01:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641117047; cv=none; d=google.com; s=arc-20160816; b=o3Fsmzs7h4FasmNFV63YNjCcaY3KjwqBjJK5orLJxuyNMQ01uKh7VOaZmBaP2dXUS9 3eme9FUqQksI7MjLCoqi/NaGRwaSqehjBnHr5UAN+wacrzNlXj9e8trcC4qmC58YNjOh 3aKu3HRwkw6YELU3nzwmaiqkLJYqaX28rcq0zzYOTBlLbh/ZiSjp/GvCZvkhlUQtnqPn 9PEuRxRxrOye3TeSqkAsEr76Ueh0rHubjQc2dGoEGcS64/CGOyxh00EJHWDsOWyCtEIu zuadHGjnsxaqxChoKoOTNpUQ/zQ3UF/DOvXKK62+euqKY1qZCq9+tEmVIOqcRYjFSRix XyXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=xfUyrburxTLSjS3WPDQ5hizR+d1WD6259vs5Of7cQ0M=; b=ocFPNnkunxlBJzwZyWZArlnbTvLs39v/Cp0ZevbtwFfzFSwLBVIeKnTOjlFwjyjrY6 HePNxTpOrZfJpVKpZatZ4dcz0x1OGtyulRmhLZXzvX/R4kJ1jSL0H8J+Mdi52i/1/R0o XTX7fF5n69o74X0s01JO8B2OQdiRCABz0rxe6epD8bKmmx8oAHBMC2yQz08fq9BvLqCl 8nl042fPD84iSfDk2UDYCGZ0KmIvEnQ+y5L4/9Wia7VQhUyv9fnK/iaT5E2g1lxQLnSZ KF9QUFPPdEPr8uhjHvKVBzhiKzGHlxrLATXJdSnJEffyB4nKDgRx0FIr7/bEYIG5aM24 7Pqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=LX5bZTnT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g3si18272980ejt.950.2022.01.02.01.50.47; Sun, 02 Jan 2022 01:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=LX5bZTnT; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59CC168B161; Sun, 2 Jan 2022 11:50:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A10DD68B158 for ; Sun, 2 Jan 2022 11:50:23 +0200 (EET) Received: by mail-ed1-f49.google.com with SMTP id m21so126061633edc.0 for ; Sun, 02 Jan 2022 01:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UvQzKOkhQW3fcvaFJyP9AgnJW1wajYOmLfhSLTc1IjY=; b=LX5bZTnTbVf7xljvTFDInIiVFk7ktfzwiIGqkbbPmj+5gE9CVOgpTERIkopvNp88Z/ FWH6kAyGM92FKHtQPLH2UAYXw+lmhTe+Y71N00nJrWqPHuAExLUkak+hZbOYYM51u6Y/ 7RlA72oD8ECnUF0jdWGHSz2CFm4rl3svC9oGl81PHrBFD+od0H6ttBI3Uv00V1khayr0 dAkPK+71WQuFarAt4BDCI1z5l7w5Dg0gCTfVXy9DYUYIUZFOtzN06ViuFZ0cpNo4Cfcp 6Sswzm/XYua+kd8w77lxqaNBwLkXALDWRHSPjnNoWGviv73c7OlNqKXAqwKTRzfQ3dZb o6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UvQzKOkhQW3fcvaFJyP9AgnJW1wajYOmLfhSLTc1IjY=; b=H1+dWl99QAO9SGMlMJxGg85e26d+rb6jl18l2nI/u4EoUUJ4ctqgn46TyiVhf4RMEP bEUAWtkvVzBiZ9rYaPYFMvSYJCPvpiqfhoWh8vqg8fVgbVk2QuSs5dx2/FOZJyYcP7Jl HXikDSEe91sgiRfCVymvpnyt4AFaLyNcwBDlZY125RWMYlfWYfIJYTseux6Yo+lYhSEQ /JhSC4Gk169kAYPwgh0cWQ12A+ZKsgEOwylkYP8FXiQ5NlQ0t3zY3KHQpl3/H+WqPgMg MWEkLv5Ck/Px00A05gxpeOQpbi11q2CaDbLqeBG9sGGb46co7GHv+EYLBGDM6t795H+i tv0w== X-Gm-Message-State: AOAM532iav5ASkbsFGUopyx9GxdBgRtcuKnMqqmmioCnLNJzgv6T9fL9 AdfB5bPAcIsXzNMuym7sG+J6Rv5ieSCaKQ== X-Received: by 2002:a05:6402:2888:: with SMTP id eg8mr39757898edb.383.1641117022739; Sun, 02 Jan 2022 01:50:22 -0800 (PST) Received: from localhost.localdomain (83-83-48-81.cable.dynamic.v4.ziggo.nl. [83.83.48.81]) by smtp.gmail.com with ESMTPSA id oz31sm9711449ejc.35.2022.01.02.01.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jan 2022 01:50:22 -0800 (PST) From: Diederick Niehorster To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Jan 2022 10:49:38 +0100 Message-Id: <20220102094940.1765-4-dcnieho@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220102094940.1765-1-dcnieho@gmail.com> References: <20220102094940.1765-1-dcnieho@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/5] avdevice/dshow: fix crash on x86 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Diederick Niehorster Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: I6WMVID1Jdj3 fix regression introduced in 911ba8417e8881a7380842e69e11ca05fdc46575. Removal of WINAPI decoration from function signatures caused crashed when using dshow on x86. Fixes #9568 Signed-off-by: Diederick Niehorster --- libavdevice/dshow_capture.h | 120 ++++++++++++++--------------- libavdevice/dshow_enummediatypes.c | 8 +- libavdevice/dshow_enumpins.c | 8 +- libavdevice/dshow_filter.c | 24 +++--- libavdevice/dshow_pin.c | 48 ++++++------ 5 files changed, 104 insertions(+), 104 deletions(-) diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h index 5a2691518c..21f5cf7e83 100644 --- a/libavdevice/dshow_capture.h +++ b/libavdevice/dshow_capture.h @@ -70,7 +70,7 @@ enum dshowSourceFilterType { }; #define DECLARE_QUERYINTERFACE(prefix, class, ...) \ -long \ +long WINAPI \ ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \ { \ struct GUIDoffset ifaces[] = __VA_ARGS__; \ @@ -93,14 +93,14 @@ ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObje return E_NOINTERFACE; \ } #define DECLARE_ADDREF(prefix, class) \ -unsigned long \ +unsigned long WINAPI \ ff_dshow_##prefix##_AddRef(class *this) \ { \ dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1); \ return InterlockedIncrement(&this->ref); \ } #define DECLARE_RELEASE(prefix, class) \ -unsigned long \ +unsigned long WINAPI \ ff_dshow_##prefix##_Release(class *this) \ { \ long ref = InterlockedDecrement(&this->ref); \ @@ -167,34 +167,34 @@ struct DShowPin { IMemInputPinVtbl *imemvtbl; }; -long ff_dshow_pin_QueryInterface (DShowPin *, const GUID *, void **); -unsigned long ff_dshow_pin_AddRef (DShowPin *); -unsigned long ff_dshow_pin_Release (DShowPin *); -long ff_dshow_pin_Connect (DShowPin *, IPin *, const AM_MEDIA_TYPE *); -long ff_dshow_pin_ReceiveConnection (DShowPin *, IPin *, const AM_MEDIA_TYPE *); -long ff_dshow_pin_Disconnect (DShowPin *); -long ff_dshow_pin_ConnectedTo (DShowPin *, IPin **); -long ff_dshow_pin_ConnectionMediaType (DShowPin *, AM_MEDIA_TYPE *); -long ff_dshow_pin_QueryPinInfo (DShowPin *, PIN_INFO *); -long ff_dshow_pin_QueryDirection (DShowPin *, PIN_DIRECTION *); -long ff_dshow_pin_QueryId (DShowPin *, wchar_t **); -long ff_dshow_pin_QueryAccept (DShowPin *, const AM_MEDIA_TYPE *); -long ff_dshow_pin_EnumMediaTypes (DShowPin *, IEnumMediaTypes **); -long ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *); -long ff_dshow_pin_EndOfStream (DShowPin *); -long ff_dshow_pin_BeginFlush (DShowPin *); -long ff_dshow_pin_EndFlush (DShowPin *); -long ff_dshow_pin_NewSegment (DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double); - -long ff_dshow_meminputpin_QueryInterface (DShowMemInputPin *, const GUID *, void **); -unsigned long ff_dshow_meminputpin_AddRef (DShowMemInputPin *); -unsigned long ff_dshow_meminputpin_Release (DShowMemInputPin *); -long ff_dshow_meminputpin_GetAllocator (DShowMemInputPin *, IMemAllocator **); -long ff_dshow_meminputpin_NotifyAllocator (DShowMemInputPin *, IMemAllocator *, BOOL); -long ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *); -long ff_dshow_meminputpin_Receive (DShowMemInputPin *, IMediaSample *); -long ff_dshow_meminputpin_ReceiveMultiple (DShowMemInputPin *, IMediaSample **, long, long *); -long ff_dshow_meminputpin_ReceiveCanBlock (DShowMemInputPin *); +long WINAPI ff_dshow_pin_QueryInterface (DShowPin *, const GUID *, void **); +unsigned long WINAPI ff_dshow_pin_AddRef (DShowPin *); +unsigned long WINAPI ff_dshow_pin_Release (DShowPin *); +long WINAPI ff_dshow_pin_Connect (DShowPin *, IPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_ReceiveConnection (DShowPin *, IPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_Disconnect (DShowPin *); +long WINAPI ff_dshow_pin_ConnectedTo (DShowPin *, IPin **); +long WINAPI ff_dshow_pin_ConnectionMediaType (DShowPin *, AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_QueryPinInfo (DShowPin *, PIN_INFO *); +long WINAPI ff_dshow_pin_QueryDirection (DShowPin *, PIN_DIRECTION *); +long WINAPI ff_dshow_pin_QueryId (DShowPin *, wchar_t **); +long WINAPI ff_dshow_pin_QueryAccept (DShowPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_EnumMediaTypes (DShowPin *, IEnumMediaTypes **); +long WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *); +long WINAPI ff_dshow_pin_EndOfStream (DShowPin *); +long WINAPI ff_dshow_pin_BeginFlush (DShowPin *); +long WINAPI ff_dshow_pin_EndFlush (DShowPin *); +long WINAPI ff_dshow_pin_NewSegment (DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double); + +long WINAPI ff_dshow_meminputpin_QueryInterface (DShowMemInputPin *, const GUID *, void **); +unsigned long WINAPI ff_dshow_meminputpin_AddRef (DShowMemInputPin *); +unsigned long WINAPI ff_dshow_meminputpin_Release (DShowMemInputPin *); +long WINAPI ff_dshow_meminputpin_GetAllocator (DShowMemInputPin *, IMemAllocator **); +long WINAPI ff_dshow_meminputpin_NotifyAllocator (DShowMemInputPin *, IMemAllocator *, BOOL); +long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *); +long WINAPI ff_dshow_meminputpin_Receive (DShowMemInputPin *, IMediaSample *); +long WINAPI ff_dshow_meminputpin_ReceiveMultiple (DShowMemInputPin *, IMediaSample **, long, long *); +long WINAPI ff_dshow_meminputpin_ReceiveCanBlock (DShowMemInputPin *); void ff_dshow_pin_Destroy(DShowPin *); DShowPin *ff_dshow_pin_Create (DShowFilter *filter); @@ -212,13 +212,13 @@ struct DShowEnumPins { DShowFilter *filter; }; -long ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **); -unsigned long ff_dshow_enumpins_AddRef (DShowEnumPins *); -unsigned long ff_dshow_enumpins_Release (DShowEnumPins *); -long ff_dshow_enumpins_Next (DShowEnumPins *, unsigned long, IPin **, unsigned long *); -long ff_dshow_enumpins_Skip (DShowEnumPins *, unsigned long); -long ff_dshow_enumpins_Reset (DShowEnumPins *); -long ff_dshow_enumpins_Clone (DShowEnumPins *, DShowEnumPins **); +long WINAPI ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **); +unsigned long WINAPI ff_dshow_enumpins_AddRef (DShowEnumPins *); +unsigned long WINAPI ff_dshow_enumpins_Release (DShowEnumPins *); +long WINAPI ff_dshow_enumpins_Next (DShowEnumPins *, unsigned long, IPin **, unsigned long *); +long WINAPI ff_dshow_enumpins_Skip (DShowEnumPins *, unsigned long); +long WINAPI ff_dshow_enumpins_Reset (DShowEnumPins *); +long WINAPI ff_dshow_enumpins_Clone (DShowEnumPins *, DShowEnumPins **); void ff_dshow_enumpins_Destroy(DShowEnumPins *); DShowEnumPins *ff_dshow_enumpins_Create (DShowPin *pin, DShowFilter *filter); @@ -233,13 +233,13 @@ struct DShowEnumMediaTypes { AM_MEDIA_TYPE type; }; -long ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **); -unsigned long ff_dshow_enummediatypes_AddRef (DShowEnumMediaTypes *); -unsigned long ff_dshow_enummediatypes_Release (DShowEnumMediaTypes *); -long ff_dshow_enummediatypes_Next (DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *); -long ff_dshow_enummediatypes_Skip (DShowEnumMediaTypes *, unsigned long); -long ff_dshow_enummediatypes_Reset (DShowEnumMediaTypes *); -long ff_dshow_enummediatypes_Clone (DShowEnumMediaTypes *, DShowEnumMediaTypes **); +long WINAPI ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **); +unsigned long WINAPI ff_dshow_enummediatypes_AddRef (DShowEnumMediaTypes *); +unsigned long WINAPI ff_dshow_enummediatypes_Release (DShowEnumMediaTypes *); +long WINAPI ff_dshow_enummediatypes_Next (DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *); +long WINAPI ff_dshow_enummediatypes_Skip (DShowEnumMediaTypes *, unsigned long); +long WINAPI ff_dshow_enummediatypes_Reset (DShowEnumMediaTypes *); +long WINAPI ff_dshow_enummediatypes_Clone (DShowEnumMediaTypes *, DShowEnumMediaTypes **); void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *); DShowEnumMediaTypes *ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type); @@ -262,21 +262,21 @@ struct DShowFilter { void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type); }; -long ff_dshow_filter_QueryInterface (DShowFilter *, const GUID *, void **); -unsigned long ff_dshow_filter_AddRef (DShowFilter *); -unsigned long ff_dshow_filter_Release (DShowFilter *); -long ff_dshow_filter_GetClassID (DShowFilter *, CLSID *); -long ff_dshow_filter_Stop (DShowFilter *); -long ff_dshow_filter_Pause (DShowFilter *); -long ff_dshow_filter_Run (DShowFilter *, REFERENCE_TIME); -long ff_dshow_filter_GetState (DShowFilter *, DWORD, FILTER_STATE *); -long ff_dshow_filter_SetSyncSource (DShowFilter *, IReferenceClock *); -long ff_dshow_filter_GetSyncSource (DShowFilter *, IReferenceClock **); -long ff_dshow_filter_EnumPins (DShowFilter *, IEnumPins **); -long ff_dshow_filter_FindPin (DShowFilter *, const wchar_t *, IPin **); -long ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *); -long ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *); -long ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **); +long WINAPI ff_dshow_filter_QueryInterface (DShowFilter *, const GUID *, void **); +unsigned long WINAPI ff_dshow_filter_AddRef (DShowFilter *); +unsigned long WINAPI ff_dshow_filter_Release (DShowFilter *); +long WINAPI ff_dshow_filter_GetClassID (DShowFilter *, CLSID *); +long WINAPI ff_dshow_filter_Stop (DShowFilter *); +long WINAPI ff_dshow_filter_Pause (DShowFilter *); +long WINAPI ff_dshow_filter_Run (DShowFilter *, REFERENCE_TIME); +long WINAPI ff_dshow_filter_GetState (DShowFilter *, DWORD, FILTER_STATE *); +long WINAPI ff_dshow_filter_SetSyncSource (DShowFilter *, IReferenceClock *); +long WINAPI ff_dshow_filter_GetSyncSource (DShowFilter *, IReferenceClock **); +long WINAPI ff_dshow_filter_EnumPins (DShowFilter *, IEnumPins **); +long WINAPI ff_dshow_filter_FindPin (DShowFilter *, const wchar_t *, IPin **); +long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *); +long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *); +long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **); void ff_dshow_filter_Destroy(DShowFilter *); DShowFilter *ff_dshow_filter_Create (void *, void *, enum dshowDeviceType); diff --git a/libavdevice/dshow_enummediatypes.c b/libavdevice/dshow_enummediatypes.c index 82944507f6..4cb7057e17 100644 --- a/libavdevice/dshow_enummediatypes.c +++ b/libavdevice/dshow_enummediatypes.c @@ -26,7 +26,7 @@ DECLARE_QUERYINTERFACE(enummediatypes, DShowEnumMediaTypes, DECLARE_ADDREF(enummediatypes, DShowEnumMediaTypes) DECLARE_RELEASE(enummediatypes, DShowEnumMediaTypes) -long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n, +long WINAPI ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n, AM_MEDIA_TYPE **types, unsigned long *fetched) { int count = 0; @@ -50,20 +50,20 @@ long ff_dshow_enummediatypes_Next(DShowEnumMediaTypes *this, unsigned long n, return S_FALSE; return S_OK; } -long ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *this, unsigned long n) +long WINAPI ff_dshow_enummediatypes_Skip(DShowEnumMediaTypes *this, unsigned long n) { dshowdebug("ff_dshow_enummediatypes_Skip(%p)\n", this); if (n) /* Any skip will always fall outside of the only valid type. */ return S_FALSE; return S_OK; } -long ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *this) +long WINAPI ff_dshow_enummediatypes_Reset(DShowEnumMediaTypes *this) { dshowdebug("ff_dshow_enummediatypes_Reset(%p)\n", this); this->pos = 0; return S_OK; } -long ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *this, DShowEnumMediaTypes **enums) +long WINAPI ff_dshow_enummediatypes_Clone(DShowEnumMediaTypes *this, DShowEnumMediaTypes **enums) { DShowEnumMediaTypes *new; dshowdebug("ff_dshow_enummediatypes_Clone(%p)\n", this); diff --git a/libavdevice/dshow_enumpins.c b/libavdevice/dshow_enumpins.c index 6bf59928f9..759b589ade 100644 --- a/libavdevice/dshow_enumpins.c +++ b/libavdevice/dshow_enumpins.c @@ -26,7 +26,7 @@ DECLARE_QUERYINTERFACE(enumpins, DShowEnumPins, DECLARE_ADDREF(enumpins, DShowEnumPins) DECLARE_RELEASE(enumpins, DShowEnumPins) -long ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins, +long WINAPI ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins, unsigned long *fetched) { int count = 0; @@ -45,20 +45,20 @@ long ff_dshow_enumpins_Next(DShowEnumPins *this, unsigned long n, IPin **pins, return S_FALSE; return S_OK; } -long ff_dshow_enumpins_Skip(DShowEnumPins *this, unsigned long n) +long WINAPI ff_dshow_enumpins_Skip(DShowEnumPins *this, unsigned long n) { dshowdebug("ff_dshow_enumpins_Skip(%p)\n", this); if (n) /* Any skip will always fall outside of the only valid pin. */ return S_FALSE; return S_OK; } -long ff_dshow_enumpins_Reset(DShowEnumPins *this) +long WINAPI ff_dshow_enumpins_Reset(DShowEnumPins *this) { dshowdebug("ff_dshow_enumpins_Reset(%p)\n", this); this->pos = 0; return S_OK; } -long ff_dshow_enumpins_Clone(DShowEnumPins *this, DShowEnumPins **pins) +long WINAPI ff_dshow_enumpins_Clone(DShowEnumPins *this, DShowEnumPins **pins) { DShowEnumPins *new; dshowdebug("ff_dshow_enumpins_Clone(%p)\n", this); diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c index 61e057a836..4642ac077c 100644 --- a/libavdevice/dshow_filter.c +++ b/libavdevice/dshow_filter.c @@ -26,32 +26,32 @@ DECLARE_QUERYINTERFACE(filter, DShowFilter, DECLARE_ADDREF(filter, DShowFilter) DECLARE_RELEASE(filter, DShowFilter) -long ff_dshow_filter_GetClassID(DShowFilter *this, CLSID *id) +long WINAPI ff_dshow_filter_GetClassID(DShowFilter *this, CLSID *id) { dshowdebug("ff_dshow_filter_GetClassID(%p)\n", this); /* I'm not creating a ClassID just for this. */ return E_FAIL; } -long ff_dshow_filter_Stop(DShowFilter *this) +long WINAPI ff_dshow_filter_Stop(DShowFilter *this) { dshowdebug("ff_dshow_filter_Stop(%p)\n", this); this->state = State_Stopped; return S_OK; } -long ff_dshow_filter_Pause(DShowFilter *this) +long WINAPI ff_dshow_filter_Pause(DShowFilter *this) { dshowdebug("ff_dshow_filter_Pause(%p)\n", this); this->state = State_Paused; return S_OK; } -long ff_dshow_filter_Run(DShowFilter *this, REFERENCE_TIME start) +long WINAPI ff_dshow_filter_Run(DShowFilter *this, REFERENCE_TIME start) { dshowdebug("ff_dshow_filter_Run(%p) %"PRId64"\n", this, start); this->state = State_Running; this->start_time = start; return S_OK; } -long ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state) +long WINAPI ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state) { dshowdebug("ff_dshow_filter_GetState(%p)\n", this); if (!state) @@ -59,7 +59,7 @@ long ff_dshow_filter_GetState(DShowFilter *this, DWORD ms, FILTER_STATE *state) *state = this->state; return S_OK; } -long ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock) +long WINAPI ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock) { dshowdebug("ff_dshow_filter_SetSyncSource(%p)\n", this); @@ -73,7 +73,7 @@ long ff_dshow_filter_SetSyncSource(DShowFilter *this, IReferenceClock *clock) return S_OK; } -long ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock) +long WINAPI ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock) { dshowdebug("ff_dshow_filter_GetSyncSource(%p)\n", this); @@ -85,7 +85,7 @@ long ff_dshow_filter_GetSyncSource(DShowFilter *this, IReferenceClock **clock) return S_OK; } -long ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin) +long WINAPI ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin) { DShowEnumPins *new; dshowdebug("ff_dshow_filter_EnumPins(%p)\n", this); @@ -99,7 +99,7 @@ long ff_dshow_filter_EnumPins(DShowFilter *this, IEnumPins **enumpin) *enumpin = (IEnumPins *) new; return S_OK; } -long ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin) +long WINAPI ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin) { DShowPin *found = NULL; dshowdebug("ff_dshow_filter_FindPin(%p)\n", this); @@ -116,7 +116,7 @@ long ff_dshow_filter_FindPin(DShowFilter *this, const wchar_t *id, IPin **pin) return S_OK; } -long ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info) +long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info) { dshowdebug("ff_dshow_filter_QueryFilterInfo(%p)\n", this); @@ -128,7 +128,7 @@ long ff_dshow_filter_QueryFilterInfo(DShowFilter *this, FILTER_INFO *info) return S_OK; } -long ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph, +long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph, const wchar_t *name) { dshowdebug("ff_dshow_filter_JoinFilterGraph(%p)\n", this); @@ -139,7 +139,7 @@ long ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *graph, return S_OK; } -long ff_dshow_filter_QueryVendorInfo(DShowFilter *this, wchar_t **info) +long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *this, wchar_t **info) { dshowdebug("ff_dshow_filter_QueryVendorInfo(%p)\n", this); diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c index 2d1fa0e882..f846b68918 100644 --- a/libavdevice/dshow_pin.c +++ b/libavdevice/dshow_pin.c @@ -29,13 +29,13 @@ DECLARE_QUERYINTERFACE(pin, DShowPin, DECLARE_ADDREF(pin, DShowPin) DECLARE_RELEASE(pin, DShowPin) -long ff_dshow_pin_Connect(DShowPin *this, IPin *pin, const AM_MEDIA_TYPE *type) +long WINAPI ff_dshow_pin_Connect(DShowPin *this, IPin *pin, const AM_MEDIA_TYPE *type) { dshowdebug("ff_dshow_pin_Connect(%p, %p, %p)\n", this, pin, type); /* Input pins receive connections. */ return S_FALSE; } -long ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin, +long WINAPI ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin, const AM_MEDIA_TYPE *type) { enum dshowDeviceType devtype = this->filter->type; @@ -62,7 +62,7 @@ long ff_dshow_pin_ReceiveConnection(DShowPin *this, IPin *pin, return S_OK; } -long ff_dshow_pin_Disconnect(DShowPin *this) +long WINAPI ff_dshow_pin_Disconnect(DShowPin *this) { dshowdebug("ff_dshow_pin_Disconnect(%p)\n", this); @@ -75,7 +75,7 @@ long ff_dshow_pin_Disconnect(DShowPin *this) return S_OK; } -long ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin) +long WINAPI ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin) { dshowdebug("ff_dshow_pin_ConnectedTo(%p)\n", this); @@ -88,7 +88,7 @@ long ff_dshow_pin_ConnectedTo(DShowPin *this, IPin **pin) return S_OK; } -long ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type) +long WINAPI ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type) { dshowdebug("ff_dshow_pin_ConnectionMediaType(%p)\n", this); @@ -99,7 +99,7 @@ long ff_dshow_pin_ConnectionMediaType(DShowPin *this, AM_MEDIA_TYPE *type) return ff_copy_dshow_media_type(type, &this->type); } -long ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info) +long WINAPI ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info) { dshowdebug("ff_dshow_pin_QueryPinInfo(%p)\n", this); @@ -115,7 +115,7 @@ long ff_dshow_pin_QueryPinInfo(DShowPin *this, PIN_INFO *info) return S_OK; } -long ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir) +long WINAPI ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir) { dshowdebug("ff_dshow_pin_QueryDirection(%p)\n", this); if (!dir) @@ -123,7 +123,7 @@ long ff_dshow_pin_QueryDirection(DShowPin *this, PIN_DIRECTION *dir) *dir = PINDIR_INPUT; return S_OK; } -long ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id) +long WINAPI ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id) { dshowdebug("ff_dshow_pin_QueryId(%p)\n", this); @@ -134,12 +134,12 @@ long ff_dshow_pin_QueryId(DShowPin *this, wchar_t **id) return S_OK; } -long ff_dshow_pin_QueryAccept(DShowPin *this, const AM_MEDIA_TYPE *type) +long WINAPI ff_dshow_pin_QueryAccept(DShowPin *this, const AM_MEDIA_TYPE *type) { dshowdebug("ff_dshow_pin_QueryAccept(%p)\n", this); return S_FALSE; } -long ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes) +long WINAPI ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes) { const AM_MEDIA_TYPE *type = NULL; DShowEnumMediaTypes *new; @@ -154,31 +154,31 @@ long ff_dshow_pin_EnumMediaTypes(DShowPin *this, IEnumMediaTypes **enumtypes) *enumtypes = (IEnumMediaTypes *) new; return S_OK; } -long ff_dshow_pin_QueryInternalConnections(DShowPin *this, IPin **pin, +long WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *this, IPin **pin, unsigned long *npin) { dshowdebug("ff_dshow_pin_QueryInternalConnections(%p)\n", this); return E_NOTIMPL; } -long ff_dshow_pin_EndOfStream(DShowPin *this) +long WINAPI ff_dshow_pin_EndOfStream(DShowPin *this) { dshowdebug("ff_dshow_pin_EndOfStream(%p)\n", this); /* I don't care. */ return S_OK; } -long ff_dshow_pin_BeginFlush(DShowPin *this) +long WINAPI ff_dshow_pin_BeginFlush(DShowPin *this) { dshowdebug("ff_dshow_pin_BeginFlush(%p)\n", this); /* I don't care. */ return S_OK; } -long ff_dshow_pin_EndFlush(DShowPin *this) +long WINAPI ff_dshow_pin_EndFlush(DShowPin *this) { dshowdebug("ff_dshow_pin_EndFlush(%p)\n", this); /* I don't care. */ return S_OK; } -long ff_dshow_pin_NewSegment(DShowPin *this, REFERENCE_TIME start, REFERENCE_TIME stop, +long WINAPI ff_dshow_pin_NewSegment(DShowPin *this, REFERENCE_TIME start, REFERENCE_TIME stop, double rate) { dshowdebug("ff_dshow_pin_NewSegment(%p)\n", this); @@ -250,43 +250,43 @@ DECLARE_DESTROY(pin, DShowPin, ff_dshow_pin_Free) /***************************************************************************** * DShowMemInputPin ****************************************************************************/ -long ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *this, const GUID *riid, +long WINAPI ff_dshow_meminputpin_QueryInterface(DShowMemInputPin *this, const GUID *riid, void **ppvObject) { DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset); dshowdebug("ff_dshow_meminputpin_QueryInterface(%p)\n", this); return ff_dshow_pin_QueryInterface(pin, riid, ppvObject); } -unsigned long ff_dshow_meminputpin_AddRef(DShowMemInputPin *this) +unsigned long WINAPI ff_dshow_meminputpin_AddRef(DShowMemInputPin *this) { DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset); dshowdebug("ff_dshow_meminputpin_AddRef(%p)\n", this); return ff_dshow_pin_AddRef(pin); } -unsigned long ff_dshow_meminputpin_Release(DShowMemInputPin *this) +unsigned long WINAPI ff_dshow_meminputpin_Release(DShowMemInputPin *this) { DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset); dshowdebug("ff_dshow_meminputpin_Release(%p)\n", this); return ff_dshow_pin_Release(pin); } -long ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *this, IMemAllocator **alloc) +long WINAPI ff_dshow_meminputpin_GetAllocator(DShowMemInputPin *this, IMemAllocator **alloc) { dshowdebug("ff_dshow_meminputpin_GetAllocator(%p)\n", this); return VFW_E_NO_ALLOCATOR; } -long ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *this, IMemAllocator *alloc, +long WINAPI ff_dshow_meminputpin_NotifyAllocator(DShowMemInputPin *this, IMemAllocator *alloc, BOOL rdwr) { dshowdebug("ff_dshow_meminputpin_NotifyAllocator(%p)\n", this); return S_OK; } -long ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *this, +long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *this, ALLOCATOR_PROPERTIES *props) { dshowdebug("ff_dshow_meminputpin_GetAllocatorRequirements(%p)\n", this); return E_NOTIMPL; } -long ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample) +long WINAPI ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample) { DShowPin *pin = (DShowPin *) ((uint8_t *) this - imemoffset); enum dshowDeviceType devtype = pin->filter->type; @@ -354,7 +354,7 @@ long ff_dshow_meminputpin_Receive(DShowMemInputPin *this, IMediaSample *sample) return S_OK; } -long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this, +long WINAPI ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this, IMediaSample **samples, long n, long *nproc) { int i; @@ -366,7 +366,7 @@ long ff_dshow_meminputpin_ReceiveMultiple(DShowMemInputPin *this, *nproc = n; return S_OK; } -long ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *this) +long WINAPI ff_dshow_meminputpin_ReceiveCanBlock(DShowMemInputPin *this) { dshowdebug("ff_dshow_meminputpin_ReceiveCanBlock(%p)\n", this); /* I swear I will not block. */