OSD window generation system and generation method
By designing the OSD window generation system for hardware components and kernel components, using the Qt program and OpenGL environment, combined with the DRM driver interface, the problems of poor scalability and high cost in the existing technology are solved, flexible expansion and low-latency rendering are achieved, and the The need for independent and controllable design.
Patent Information
- Application Number
- CN202411164144.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
The existing OSD window generation technology has poor scalability, high cost, and cannot be modularly reused, making it difficult to promote and apply.
An OSD window generation system including hardware components, kernel components and user-side is designed. The system boot program, file system and Linux kernel are used to realize the generation and rendering of OSD windows through Qt program, OpenGL environment and DRM driver interface, avoiding Xorg Displays the delay response brought by the service.
It realizes flexible expansion and modular design, reduces design costs, is easy to maintain and promote, and provides low-latency 4K picture rendering capabilities.
Smart Images

Figure CN119127365A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of software development, in particular to an OSD window generation system and a generation method. Background Art
[0002] Most of the current OSD window generation technologies use FPGA to pre-process the signal, and then superimpose a new picture on the original input signal in a generative manner, and display different functions by detecting user buttons to adjust the relevant parameters of reality. The disadvantages of the above-mentioned prior art include poor scalability, high cost, inability to be modularly reused, and difficulty in large-scale promotion and application. Therefore, an OSD window generation system and generation method are designed and developed to solve the above problems. Summary of the invention
[0003] In order to solve the above technical problems, the present invention proposes an OSD window generation system and generation method. The technical problem to be solved by the present invention is achieved by adopting the following technical solutions:
[0004] An OSD window generation system includes a hardware component, a kernel component and a user end. The kernel component includes a system boot program, a file system and a Linux kernel. The Linux kernel is started by the boot program and an interface is provided by the file system to enable the OSD window to run on the user end.
[0005] The system boot program includes a memory management program, a scheduling program and an inter-process communication program.
[0006] The Linux kernel includes a device driver, a character device and a block device.
[0007] A method for generating an OSD window, the method comprising the following steps:
[0008] Step 1: Initialize the Qt program;
[0009] Step 2: Create an OSD window and set the OpenGL environment, handle window size changes, and perform rendering operations;
[0010] Step 3: Initialize the OpenGL environment, use the eglfs+kms plug-in to initialize OpenGL, set the OpenGL view projection matrix, and clear the color;
[0011] Step 4: Handle window size changes;
[0012] Step 5: In the paintGL() function, draw the OSD content;
[0013] Step 6: Update and display the OSD interface;
[0014] Step 7: Process user input response;
[0015] Step 8: Run the loop until the application is closed.
[0016] In the sixth step, the update() or repaint() function is called to trigger the redrawing of the OSD interface.
[0017] In the fourth step, in the resizeGL() function, update the OpenGL viewport and projection matrix according to the new window size.
[0018] The beneficial effects of the present invention are as follows: the scheme of the present invention satisfies the requirements of nationally produced, independently controllable design, can be flexibly expanded, and the modular design facilitates secondary development and transplantation. The cost is low and the design is simple. The design cost can be flexibly reduced according to demand, and it is easy to maintain and promote.
[0019] In the present invention, the OSD application layer code uses Qt+OpenGL+eglfs+kms plug-in, and the bottom driver uses the DRM driver interface to render 4K images, which can achieve low latency; thereby avoiding the delayed response caused by using the Xorg display service. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0021] Figure 1 It is a schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be explained more clearly and completely below in conjunction with the drawings in the embodiments. Of course, the described embodiments are only a part of the present invention but not all of it. Based on this embodiment, other embodiments obtained by those skilled in the art without creative labor are all within the protection scope of the present invention.
[0023] like Figure 1 As shown, an OSD window generation system includes hardware components, kernel components and user terminals. The kernel components include a system boot program, a file system and a Linux kernel. The Linux kernel is started by the boot program and an interface is provided by the file system to enable the OSD window to run on the user terminal.
[0024] The hardware components include a processor and a video signal input and output interface. The processor module provides a hardware carrier for the OSD menu to run. Through the operating system running on the hardware carrier, it indirectly provides all the hardware resources required for the OSD menu to run, including GPU, timer, clock counting metronome, display control unit, storage control unit, computing unit, communication interface unit, etc.
[0025] Among them, the GPU provides the functions required for display, which can convert the input signal into image data and send it to the software control unit of the OSD menu;
[0026] The timer provides the delay required by the operating system and the task logic is interconnected;
[0027] The clock counting metronome provides the task scheduling control function of the operating system;
[0028] The display control unit is responsible for processing the input video signal;
[0029] The storage unit provides enough functions for operating system loading, temporary data storage when the operating system is running, file system management, etc.
[0030] The computing unit provides all data processing capabilities, including decomposing each task into computing logic and returning it to the application;
[0031] The communication interface unit provides user key input, which may be I / O key input or serial port data command input.
[0032] The system boot program includes a memory management program, a scheduling program and an inter-process communication program.
[0033] The Linux kernel includes a device driver, a character device and a block device.
[0034] An OSDOSD window generation method, the method comprising the following steps:
[0035] Step 1: Initialize the Qt program; create a QApplication object, which is the entry point for all Qt GUI applications;
[0036] Step 2: Create an OSD window and set the OpenGL environment, handle window size changes, and perform rendering operations;
[0037] Step 3: Initialize the OpenGL environment, use the eglfs+kms plug-in to initialize OpenGL, set the OpenGL view projection matrix, and clear the color;
[0038] Step 4: Handle window size changes;
[0039] Step 5: In the paintGL() function, draw the OSD content;
[0040] Step 6: Update and display the OSD interface;
[0041] Step 7: Process user input response; if the OSD interface needs to respond to user input (such as keyboard and mouse events), you can rewrite keyPressEvent(), mousePressEvent() and other event processing functions. In these functions, you can update the OSD content or trigger other operations. ;
[0042] Step 8: Run the loop until the application is closed and call QApplication's exec() function to start Qt's event loop.
[0043] In the sixth step, the update() or repaint() function is called to trigger the redrawing of the OSD interface.
[0044] In the fourth step, in the resizeGL() function, update the OpenGL viewport and projection matrix according to the new window size.
[0045] In the second step, create a custom class (such as OSDWidget) that inherits from QOpenGLWidget to manage the OpenGL rendering of the OSD interface. In this class, you can override functions such as initializeGL(), resizeGL(), and paintGL() to set up the OpenGL environment, handle window size changes, and perform rendering operations.
[0046] In the third step, in the initializeGL() function, call initializeOpenGLFunctions() to initialize the OpenGL function.
[0047] In the fifth step, QPainter provides various methods to draw shapes, text, and images, which can be operated directly on the OpenGL surface; use QPainter to draw text, images, or other graphics in the OpenGL context.
[0048] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. An OSD window generation system, characterized in that: The system includes hardware components, kernel components and user terminals. The kernel components include a system boot program, a file system and a Linux kernel. The Linux kernel is started by the boot program and an interface is provided by the file system to enable an OSD window to run on the user terminal.
2. The OSD window generation system according to claim 1, characterized in that: The system boot program includes a memory management program, a scheduling program and an inter-process communication program.
3. The OSD window generation system according to claim 1, characterized in that: The Linux kernel includes a device driver, a character device and a block device.
4. An OSD window generation method using an OSD window generation system according to any one of claims 1 to 3, characterized in that: The method comprises the following steps: Step 1: Initialize the Qt program; Step 2: Create an OSD window and set the OpenGL environment, handle window size changes, and perform rendering operations; Step 3: Initialize the OpenGL environment, use the eglfs+kms plug-in to initialize OpenGL, set the OpenGL view projection matrix, and clear the color; Step 4: Handle window size changes; Step 5: In the paintGL() function, draw the OSD content; Step 6: Update and display the OSD interface; Step 7: Process user input response; Step 8: Run the loop until the application is closed.
5. The OSD window generation method according to claim 4, characterized in that: In the sixth step, the update() or repaint() function is called to trigger the redrawing of the OSD interface.
6. The OSD window generation method according to claim 4, characterized in that: In the fourth step, in the resizeGL() function, the OpenGL viewport and projection matrix are updated according to the new window size.
