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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Bug in IO.DShowParams.SetVideoInput()

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Oribi Posted - Dec 21 2017 : 08:15:10
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;

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 22 2017 : 18:40:53
Thanks for the report, we'll have a fix in the next update.

Nigel
Xequte Software
www.imageen.com