TRVCamMultiview.OnViewerPaint problems

RVMedia support and discussion (components for displaying and controlling IP cameras, webcams, video conferencing, video chats, recording audio and video files)
Post Reply
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

TRVCamMultiview.OnViewerPaint problems

Post 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
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamMultiview.OnViewerPaint problems

Post by Sergey Tkachenko »

Please send me a test project (as simple as possible)
mitzi
Posts: 31
Joined: Thu Oct 10, 2019 12:14 pm

Re: TRVCamMultiview.OnViewerPaint problems

Post by mitzi »

Here's example crated by combination of your demos.
Attachments
CamListMulti.zip
(4.63 KiB) Downloaded 2434 times
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamMultiview.OnViewerPaint problems

Post 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
Sergey Tkachenko
Site Admin
Posts: 17520
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TRVCamMultiview.OnViewerPaint problems

Post by Sergey Tkachenko »

Added in RVMedia 9.3 (just uploaded)
Post Reply