sharpdx / SharpDX

SharpDX GitHub Repository
http://sharpdx.org
MIT License
1.68k stars 642 forks source link

Question about returning unsigned long in Interfaces.cs #1130

Open HopingCoding opened 5 years ago

HopingCoding commented 5 years ago

Some MediaFoundation classes return UInt64. Example: https://docs.microsoft.com/en-us/windows/desktop/medfound/mf-mt-frame-rate-attribute

However in the autogenerated Interfaces.cs of SharpDX I could not find any GetULong() instead the GetLong() is used which casts ulong to long and therefore might cause troubles with overflows.

I am suspecting this, because the following call returns wrong framerate values in certain videos which have fractional framerates:

var mediaType = sourceReader.GetCurrentMediaType(_videoStreamIndex); var rate = mediaType.Get(MediaTypeAttributeKeys.FrameRate); //returns 42949672960497499