DavidJr.
Members-
Content Count
39 -
Joined
-
Last visited
Community Reputation
1 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Yes. I purchased a license. great stuff! Thanks!
-
I am glad I found this thread the other day. I was able ot get a large 3MF file to load much faster using OXml instead using the DOM method. so I concure for OXml suggestion.
-
Hi, Have you tried this (saxforpascal) with Delphi 11.3? Or is there anything newer that may work. I am opening 3MF files and the XML files that are big take too long so I was wanting to convert to using SAX implementation of XML parsing. Thanks, David
-
I have abandoned the FMX option. Thanks.
-
I have done everything. The camera permissions is open. In VCL I am using other libraries that work just fine. Its the FMX app that doesn't work.
-
The example did not work, The Camera is in a state of "Stopped" after calling "StartCapture"
-
I have absolutely done all of that. I am not even getting any errors in the IDE.
-
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
thats exactly what I did. thanks. -
Sorry just my luck I'd leave out some information. This is a Windows 10 OS, NOT Android.
-
Hi, I am following this example for setting up a VideoCaptureDevice app: https://docwiki.embarcadero.com/RADStudio/Sydney/en/Video_Capturing I could not get the VideoCaptureDevice to start. I tried 4 known good cameras and get the same thing, I modified the code a bit to give me an indicator that I am indeed setting up the app right, still nothing. The app compiles just fine, just won't start capture. My version of Delphi is 10.2.3 and the following is my current code: unit FMXCamera_Main; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects, FMX.ListBox, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FMX.Media, FMX.Edit; type TForm1 = class(TForm) Layout1: TLayout; btnStart: TButton; ComboBox1: TComboBox; Image1: TImage; procedure FormCreate(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure btnStartClick(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } public { Public declarations } VideoCamera: TVideoCaptureDevice; procedure SampleBufferSync; procedure SampleBufferReady(Sender: TObject; const ATime: TMediaTime); end; var Form1: TForm1; implementation // Delphi version of the implementation {$R *.fmx} procedure TForm1.btnStartClick(Sender: TObject); begin if(VideoCamera <> nil) then begin if(VideoCamera.State = TCaptureDeviceState.Stopped) then begin VideoCamera.OnSampleBufferReady := SampleBufferReady; VideoCamera.CaptureSettingPriority := TVideoCaptureSettingPriority.FrameRate; VideoCamera.StartCapture; if(VideoCamera.State = TCaptureDeviceState.Capturing) then begin btnStart.Text := 'Stop'; end else begin VideoCamera.StopCapture; btnStart.Text := 'Start'; end; end else begin VideoCamera.StopCapture; btnStart.Text := 'Start'; end; end else begin Caption := 'Video capture devices not available.'; end; end; procedure TForm1.ComboBox1Change(Sender: TObject); begin VideoCamera := TVideoCaptureDevice(TCaptureDeviceManager.Current.GetDevicesByName(ComboBox1.Selected.Text)); if (VideoCamera <> nil) then begin btnstart.Text := 'Start '+VideoCamera.Name; btnStart.Enabled := true; end; end; procedure TForm1.FormCreate(Sender: TObject); var DeviceList: TCaptureDeviceList; i: integer; begin DeviceList := TCaptureDeviceManager.Current.GetDevicesByMediaType(TMediaType.Video); for i := 0 to DeviceList.Count - 1 do begin ComboBox1.Items.Add(DeviceList[i].Name); end; end; procedure TForm1.FormDestroy(Sender: TObject); begin if(VideoCamera <> nil) then begin VideoCamera.StopCapture; end; end; procedure TForm1.SampleBufferReady(Sender: TObject; const ATime: TMediaTime); begin TThread.Synchronize(TThread.CurrentThread, SampleBufferSync); //Resize the image so that the video is buffered in its original size Image1.Width := Image1.Bitmap.Width; Image1.Height := Image1.Bitmap.Height; end; procedure TForm1.SampleBufferSync; begin VideoCamera.SampleBufferToBitmap(Image1.Bitmap, true); end; end.
-
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
thanks. I resolved that issue, I should have replied sooner. I have long running procedure holding up the UI those same procedures replied on UI values as well. -
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
that's an interesting idea. I want to add that it seems to be message related. So if I move the mouse outside the window and the procedure finishes the TTask.Wait() then it pauses after a long run... then I can move the mouse around (without clicking on another window) and it resumes and finishes like its supposed to. But adding in booleans to allow a triggered set of actions in the Timer handler to maybe create messages is worth a try. When I did strictly linux/unix programming I never had these issues, Windows is definitely a complex system. -
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
-
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
Also I do call CheckSynchronize from the main UI, there is no problem getting information from threads to main UI. -
Windows VCL application pauses when window is not focused...
DavidJr. replied to DavidJr.'s topic in VCL
yes, it would be a problem, but I am not doing that. I call a property and a "getter" method will return a value, and that all works fine. The issue is in the methods that reside in the UI thread that do work. Not everything is in a separate thread, but all the heavy work is in separate threads, but the act of pulling in tmp files is all in the main UI thread and the reason is its a legacy app that I have not the abilty to do a complete re-write. Now the procedure that is called by a timer event is a big one and so I must disable the timer until the procedure completes, the procedure does call other methods. I wished I could share the source but its big and a lot of unrelated code that works exactly as intended its only the stuff that's called in the UI. I know its preferred to post source code, but this code isn't something I own and its against the company policy.