Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

SampleGrabberSinkCallback #330

Closed
RayBatts opened this issue Apr 3, 2014 · 2 comments
Closed

SampleGrabberSinkCallback #330

RayBatts opened this issue Apr 3, 2014 · 2 comments
Labels

Comments

@RayBatts
Copy link
Contributor

RayBatts commented Apr 3, 2014

From the docs: http://sharpdx.org/documentation/api/t-sharpdx-mediafoundation-samplegrabbersinkcallback

The sample-grabber sink enables an application...

Implement the SampleGrabberSinkCallback interface.

Although reflecting into SharpDX.MediaFoundation.SampleGrabberSinkCallback shows that it is implemented as a class, not an interface. Is this incorrect, or is there a different way to setup a custom SampleGrabberSinkCallback? Is there possibly a helper method to set callbacks on the OnProcessSample event or something that I'm missing?

@xoofx
Copy link
Member

xoofx commented Apr 3, 2014

Unfortunately, the SampleGrabberSinkCallback is not implemented as a callback in C#. It is requiring some manual code to handle it and there are probably lots of interfaces like this in MediaFoundation that are not covered. Though at the moment, I have no time to fix this particular issue for MediaFoundation, but if someone is interested, this can be done by following the "Shadow pattern" that is used in many places in SharpDX to provide C++ interface callback in C#

@RayBatts
Copy link
Contributor Author

RayBatts commented Apr 3, 2014

No problem, I'll look into implementing this and submitting back into a PR if I can. Thanks for the tip!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants