FactoryXCode / MfPack

Delphi translations for Microsoft Media Foundation and related API's
Mozilla Public License 2.0
79 stars 22 forks source link

Can't compile CameraCapture.Asynchronous.pas - E2291 Missing implementation of interface method IMFSourceReaderCallback.OnReadSample #46

Closed jdredd87 closed 1 year ago

jdredd87 commented 1 year ago

Using Delphi 11.2 32bit and 64bit.

TCameraCaptureAsync = class(TCameraCapture, IMFSourceReaderCallback)

[dcc64 Error] CameraCapture.Asynchronous.pas(94): E2291 Missing implementation of interface method IMFSourceReaderCallback.OnReadSample [dcc64 Fatal Error] Form.Main.pas(97): F2063 Could not compile used unit 'CameraCapture.Asynchronous.pas'

Not sure what the deal is here.

FactoryXCode commented 1 year ago

Hi,

The implementation of IMFSourceReaderCallback is from line 109 until 119.

{$region 'IMFSourceReaderCallback methods'}
    function OnReadSample(hrStatus: HRESULT;
                          dwStreamIndex: DWord;
                          dwStreamFlags: DWord;
                          llTimestamp: LONGLONG;
                          pSample: IMFSample): HRESULT; stdcall;

    function OnFlush(dwStreamIndex: DWord): HRESULT; stdcall;
    function OnEvent(dwStreamIndex: DWord;
                     pEvent: IMFMediaEvent): HRESULT; stdcall;

    function ReadNextSample(): Boolean;
    {$endregion}

Are you sure you didn't delete this region? This sample only works with MfPack version 3.1.3 and above.

jdredd87 commented 1 year ago

It is a fresh new clean clone of the repo.

AND ... that the above code is there.

I am not 100% sure why it is not liking it.

For sake of things, I deleted the folder and did a fresh clone again and still the same thing.

Also searched entire system, make sure no other rouge copy from previous checkout. Nope.

Only one instance of mfPack on here.

FactoryXCode commented 1 year ago

I think there was a damaged file. I uploaded all files again. I just tested it again with Delphi 10.4. All project settings to default, no issues anymore..

jdredd87 commented 1 year ago

This seemed to have fixed it. Was able to clone it again and it compiles. Thanks.