ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Bug in IO.DShowParams.SetVideoInput()
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Oribi

Netherlands
17 Posts

Posted - Dec 21 2017 :  08:15:10  Show Profile  Reply
There appears to be a bug in the TImageEnIO.IO.DShowParams.SetVideoInput() method.

The specified video input is never selected.

I traced the problem to the SetMediaType() procedure in ieds.pas
This procedure contaisns the following if statement


if ((width >= pSCC^.MinOutputSize.cx) and (width <= pSCC^.MaxOutputSize.cx))
and ((height >= pSCC^.MinOutputSize.cy) and (height <= pSCC^.MaxOutputSize.cy))
and ((ihBitmapWidth = 0) or (ihBitmapWidth = width))
and ((ihBitmapHeight = 0) or (ihBitmapHeight = height))
and ((format = '') or (CompareGUID(formatID, pmt^.subtype)))
and ((bitrate > 0) and (ihBitRate = bitrate)) or ((bitrate = 0) and (ihBitRate > bestBitrate)) then
begin
  selectedIndex := i;
  bestBitrate := ih^.dwBitRate;
end;


I think the last "and" should be enclosed in an extra "()".
With the new code it works as expected.


if ((width >= pSCC^.MinOutputSize.cx) and (width <= pSCC^.MaxOutputSize.cx))
and ((height >= pSCC^.MinOutputSize.cy) and (height <= pSCC^.MaxOutputSize.cy))
and ((ihBitmapWidth = 0) or (ihBitmapWidth = width))
and ((ihBitmapHeight = 0) or (ihBitmapHeight = height))
and ((format = '') or (CompareGUID(formatID, pmt^.subtype)))
and (((bitrate > 0) and (ihBitRate = bitrate)) or ((bitrate = 0) and (ihBitRate > bestBitrate))) then
begin
  selectedIndex := i;
  bestBitrate := ih^.dwBitRate;
end;

xequte

39145 Posts

Posted - Dec 22 2017 :  18:40:53  Show Profile  Reply
Thanks for the report, we'll have a fix in the next update.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: