Page 1 of 1
TRVCamMultiview.OnViewerPaint problems
Posted: Thu Dec 08, 2022 9:11 am
by mitzi
Hello,
I implemented exposure adjustment to frame via TRVCamera.OnPaint successfully. Then I tried the same for TRVCamMultiview.OnViewerPaint but I started to get Scanline errors (I use Scanline for getting pixels) and frame is drawn outside main camera area. I use Viewer.FrameRect but it seems it is wrong. Correct Frame is ensured by checking ViewerIndex.
RVMedia 9.2, VCL, FFMPEG, Delphi 11.2, 64bit
Re: TRVCamMultiview.OnViewerPaint problems
Posted: Sun Dec 11, 2022 7:12 pm
by Sergey Tkachenko
Please send me a test project (as simple as possible)
Re: TRVCamMultiview.OnViewerPaint problems
Posted: Mon Dec 12, 2022 7:48 am
by mitzi
Here's example crated by combination of your demos.
Re: TRVCamMultiview.OnViewerPaint problems
Posted: Mon Dec 12, 2022 3:21 pm
by Sergey Tkachenko
I cannot see scanline error.
You cannot use FrameRect.
You can get the video client area as RVCamMultiView1.Viewers[ViewerIndex].GetViewerRects, but there is no method that allow to get video rectangle inside this area. I'll add this method in the next update (GetVideoRect).
Also, in full screen mode, a copy of this MultiView is created that is not accessible. I'll add property FullScreenMultiView.
The code will be:
Code: Select all
procedure TfrmMain.RVCamMultiView1ViewerPaint(Sender: TObject; Viewer: TRVCamView; ViewerIndex: Integer; VideoFrame: TBitmap; ACanvas: TCanvas; var CanDrawFrame: Boolean);
var
VideoRect, AudioRect: TRect;
begin
if (ViewerIndex<>4) or (VideoFrame.Width=0) then
Exit;
FVideoFrame.Assign(VideoFrame);
CanDrawFrame:=False;
GBlur(FVideoFrame,3);
if RVCamMultiView1.FullScreenMultiView <> nil then
RVCamMultiView1.FullScreenMultiView.Viewers[ViewerIndex].GetViewerRects(VideoRect, AudioRect)
else
RVCamMultiView1.Viewers[ViewerIndex].GetViewerRects(VideoRect, AudioRect);
inc(VideoRect.Top, RVConvertFrom96DPI(Viewer.CaptionHeight, Self));
VideoRect := Viewer.GetVideoRect(VideoRect, FVideoFrame.Width, FVideoFrame.Height);
ACanvas.StretchDraw(VideoRect, FVideoFrame.GetBitmap);
end;
RVConvertFrom96DPI is declared in MRVCore.pas
Re: TRVCamMultiview.OnViewerPaint problems
Posted: Mon Dec 12, 2022 7:10 pm
by Sergey Tkachenko
Added in RVMedia 9.3 (just uploaded)