General > The Campus

Security cameras and CreateThread API problem

(1/3) > >>

minor28:
I have four outdoor security Besder cameras. Three slightly older (1, 2 and 3) and one a little newer. They differ in how to log in. My problem is that when I run only one camera, each camera works as it should. When I run all four at the same time, it seems as if a "queuing system" is formed. Images pauses a while and then at a fast pace showing a couple of images. This despite the fact that I run each camera in four separate threads.

This is how I do it:

To avoid sharing same memory locations.
1. Each camera has been allocated space for storing the required data for managing the data stream (CAMERADATA struct Structures.inc).
2. Each camera has been allocated space for storing info about images (IMGINFO struct Structures.inc).

3. A static window is registred as videoclass and four videoclass windows are created.
3. Each camera is logged in one after the other (LoginProcess.asm) and each thread is created with DataStreamParser as thread processs.

I attach Structures.inc, Source.asm (main file), LoginProcess.asm and DataStreamParser.asm.

I understand that it can be difficult to get to grips with the problem. I myself have struggled with this for a long time. As I see it, it has to do with createthread. If anyone can look at this and possibly suggest how I could avoid the "queuing system" I would be grateful.

LiaoMi:
Hi minor28,

which of your open source code is responsible for multi-threading? As far as I can tell, you have attached thread handlers, this is not enough for analyzing the source code of a multithreaded program. Based on your description, the error may be in the program's multithreading manager. In addition, it can be a GUI bug, there are many options here. Try to isolate the problem, for example, use two cameras, compare the results, create debug functions and functions for logging all processing steps with timers. It will be difficult to help here without the complete code.

P.S>You can replace the cameras with your server program, your program will, for example, send 4 different video streams, so you can test any situation.

stevenxie:
minor28, very good!  :thumbsup:
In this program code you refer to the vasily.In inc.while,.if,.break and so on advanced simulation syntax macro, really admire you very much.You can provide the Header. in this postinc, WndProc.asm, BesderHash.asm, base64.asm, VideoWndProc.Is it a asm,LoginCamera4.asm,include LoginCamera123.asm?

fearless:
Maybe its the receive event, perhaps you have to implement a buffering system to smooth out the processing of frames and add a timer system to fetch the next frame at the correct time to display to prevent the sudden fast display of lots of frames?

minor28:
Thank you for your answers,

LiaoMi:
In succession, each camera is connected to the network and after the connection, a thread is created. Se LoginProcess.asm line 84 to 99. Thread process is DataStreamParser.

Not shure I know anything about a program's multithreading manager.

I doubt it's a gui bug.

One camera, two cameras OK. Three cameras problem to a lesser extent. Four cameras problem.

No server is involved.

fearless:
I have tried timers. The data stream is buffered, which means that a pause in the handling means that more frames are displayed in too fast a sequence.

Navigation

[0] Message Index

[#] Next page

Go to full version