BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Crop transformation filter (dspack), how to change output me

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia
View previous topic :: View next topic  
Author Message
Whome
Guest





PostPosted: Fri Feb 16, 2007 11:44 pm    Post subject: Crop transformation filter (dspack), how to change output me Reply with quote



http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.zip
http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.pas.txt

I can't change output media type if I want to crop video frame. No
matter what I try in "GetMediaType" method, graphedit displays output
pin identical to input pin.

See source and full project in .zip and .txt source.

Another issue is flip image because RGB32 is upside down. RGB24 format
is fine. But this can wait until I manage to crop rightside and
bottomside from the video.

Any hints available?
Back to top
Whome
Guest





PostPosted: Mon Feb 19, 2007 9:38 pm    Post subject: Re: Crop transformation filter (dspack), how to change outpu Reply with quote



http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.pas.txt
http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.zip

I updated example project and .pas file. I can now flip mirrored example
video (included in zip) fine. But I cant make cropping work.

Inputpin format and outputpin formats are identicals in filtergaph. How
can I give different outputpin format?


ps: test program has crop_right=0, crop_bottom=0, but even if I put
cropping it still dispalays "input pin=output pin" formats. You may edit
source code and change variables.

Quote:
http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.zip
http://koti.mbnet.fi/akini/delphi/dspack/SimpleTransform.pas.txt

I can't change output media type if I want to crop video frame. No
matter what I try in "GetMediaType" method, graphedit displays output
pin identical to input pin.

See source and full project in .zip and .txt source.

Another issue is flip image because RGB32 is upside down. RGB24 format
is fine. But this can wait until I manage to crop rightside and
bottomside from the video.

Any hints available?
Back to top
Lee_Nover
Guest





PostPosted: Fri Mar 02, 2007 7:22 pm    Post subject: Re: Crop transformation filter (dspack), how to change outpu Reply with quote



Quote:
Any hints available?

you're not setting the VideoInfoHeader params of the format

in GetMediaType do:

const
fccVIH2 = $F72A76A0; // VideoInfoHeader2
fccVIH = $05589F80; // VideoInfoHeader
var
BIH: PBitmapInfoHeader;
LSrc, LDst: PRect;


case MediaType.formattype.D1 of
fccVIH2:
begin
BIH := @PVideoInfoHeader2(MediaType.pbFormat).bmiHeader;
LSrc := @PVideoInfoHeader2(MediaType.pbFormat).rcSource;
LDst := @PVideoInfoHeader2(MediaType.pbFormat).rcTarget;
end;

fccVIH:
begin
BIH := @PVideoInfoHeader(MediaType.pbFormat).bmiHeader;
LSrc := @PVideoInfoHeader(MediaType.pbFormat).rcSource;
LDst := @PVideoInfoHeader(MediaType.pbFormat).rcTarget;
end
else
Result := E_UNEXPECTED;
Exit;
end;

if OutWidth <> 0 then
begin
LSrc.Right := FOutputFrame.Width;
LSrc.Bottom := FOutputFrame.Height;
LDst.Right := FOutputFrame.Width;
LDst.Bottom := FOutputFrame.Height;

BIH.biWidth := FOutputFrame.Width;
BIH.biHeight := FOutputFrame.Height;
end;
BIH.biSizeImage := BIH.biWidth * BIH.biHeight * BIH.biBitCount div 8;
MediaType.lSampleSize := BIH.biSizeImage;
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.