Video data processing method and device, storage medium and electronic equipment
By obtaining the image quality parameters set in the local operating system, rendering and synthesizing video data to satisfy the image quality parameters, the problem that the video data displayed by the GLSurfaceView display control does not meet the image quality parameters, and the display effect of video data is improved and user experience.
Patent Information
- Application Number
- CN202310942804.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the video data displayed by the GLSurfaceView display control does not meet the picture quality parameters set in the local operating system, resulting in a decrease in the display effect of the video data.
By obtaining the image quality parameters set in the local operating system, rendering the image data based on these parameters, and synthesizing the rendered image data to generate video data that meets the image quality parameters, and finally displaying the video data through the GLSurfaceView display control.
The video data is displayed on the screen to meet the picture quality parameters set in the local operating system, thereby improving the video data display effect and user experience.
Smart Images

Figure CN119450141A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a video data processing method, device, storage medium and electronic device. Background Art
[0002] Each frame of video presented to the user on the screen is usually the local operating system processing the image data drawn on the upper layer, and finally displayed on the screen by various display controls. Due to the configuration problem of the local operating system, the video data displayed by some display controls are not effective for the image quality parameters set in the local operating system, thereby reducing the display effect of the video data. Based on this, how to make the video displayed on the screen meet the image quality parameters set in the local operating system to enhance the display effect of the video is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a video data processing method, device, storage medium and electronic device. Based on the technical solution provided by the present application, the video data presented on the screen can meet the image quality parameters set in the local operating system, thereby enhancing the display effect of the video data and improving the user experience.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to the first aspect of an embodiment of the present application, a video data processing method is provided, the method comprising: obtaining image quality parameters set in a local operating system; rendering image data based on the image quality parameters; synthesizing the image data to obtain video data; and displaying the video data through a GLSurfaceView display control, the video data satisfying the image quality parameters.
[0006] In some embodiments of the present application, based on the aforementioned solution, the obtaining of the image quality parameters set in the local operating system includes: actively pulling the image quality parameters set in the local operating system when rendering each frame of image data.
[0007] In some embodiments of the present application, based on the aforementioned solution, actively pulling the image quality parameters set in the local operating system includes: actively pulling the image quality parameters set in the local operating system based on a reflection mechanism.
[0008] In some embodiments of the present application, based on the aforementioned solution, the obtaining of the image quality parameters set in the local operating system includes: using the pre-stored image quality parameters as the image quality parameters set in the local operating system.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the method further includes: monitoring the image quality parameters set in the local operating system; if the monitored image quality parameters change, reading the changed image quality parameters; and updating the pre-stored image quality parameters based on the changed image quality parameters.
[0010] In some embodiments of the present application, based on the aforementioned scheme, rendering the image data based on the image quality parameters includes: acquiring pre-drawn image data; based on the image data, determining a target rendering algorithm from a plurality of pre-built rendering algorithms; and based on the image quality parameters, rendering the image data through the target rendering algorithm.
[0011] In some embodiments of the present application, based on the aforementioned scheme, each rendering algorithm is suitable for rendering a specific type of image, and determining the target rendering algorithm from a plurality of pre-built rendering algorithms includes: determining the image type in the image data; and determining a rendering algorithm that matches the image type from a plurality of pre-built rendering algorithms as the target rendering algorithm.
[0012] In some embodiments of the present application, based on the aforementioned scheme, synthesizing the image data to obtain video data includes: obtaining image data rendered based on the image quality parameters from a buffer queue; and synthesizing the image data to obtain the video data.
[0013] In some embodiments of the present application, based on the aforementioned solution, the local operating system includes an Android system.
[0014] According to the second aspect of an embodiment of the present application, a video data processing device is provided, comprising: an acquisition unit for acquiring image quality parameters set in a local operating system; a rendering unit for rendering image data based on the image quality parameters; a synthesis unit for synthesizing the image data to obtain video data; and a display unit for displaying the video data through a GLSurfaceView display control, wherein the video data satisfies the image quality parameters.
[0015] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, characterized in that at least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor to implement the operations performed by the method described in any one of the first aspects above.
[0016] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the method described in any one of the first aspects above.
[0017] The technical solution of the present application first obtains the image quality parameters set in the local operating system; then renders the image data based on the image quality parameters; then synthesizes the image data to obtain video data; and finally displays the video data through the GLSurfaceView display control, and the video data meets the image quality parameters. Since the video data displayed by the GLSurfaceView display control is not effective for the image quality parameters set in the local operating system, the technical solution of the present application clarifies at what specific position and in what manner the GLSurfaceView display control can actively render and adjust the video data to be displayed based on the image quality parameters set in the local operating system during the process of processing the video data for display, so that the video data finally displayed on the screen meets the image quality parameters set in the local operating system, thereby improving the display effect of the video data, and improving the viewing and usage experience of the user.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 A schematic diagram showing a flow chart of a video data processing method according to an embodiment of the present application is shown;
[0021] Figure 2 A schematic diagram of a video data display process according to an embodiment of the present application is shown;
[0022] Figure 3 A detailed flow chart of obtaining image quality parameters set in a local operating system according to an embodiment of the present application is shown;
[0023] Figure 4 A schematic diagram showing the location of rendered image data according to an embodiment of the present application is shown;
[0024] Figure 5 A detailed flow chart of rendering image data based on the image quality parameters according to an embodiment of the present application is shown;
[0025] Figure 6 A detailed flow chart of synthesizing the image data to obtain video data according to an embodiment of the present application is shown;
[0026] Figure 7 A block diagram of a video data processing device according to an embodiment of the present application is shown;
[0027] Figure 8 A schematic structural diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0029] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0031] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0032] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those shown or described.
[0034] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] Some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0036] It should be noted that the local operating system in this application refers to a collection of system software that manages computer hardware resources, controls the running of other programs and provides users with an interactive operation interface, such as the Android system, Windows system, Linux system, iOS system, etc. Specifically, this application is not limited here, but the technical solution of this application is particularly suitable for application in scenarios where the local system is the Android system. The following embodiments all take the Android system as an example.
[0037] In order to enable those skilled in the art to better understand the technical solution of the present application, Figure 2 The background technology of this application is described in detail.
[0038] See also Figure 2 , shows a schematic diagram of the video data display process according to an embodiment of the present application.
[0039] Figure 2 The following respectively shows the process of processing the video data to be displayed based on the View display control and the GLSurfaceView display control in the Android system and then displaying it on the screen.
[0040] Figure 2 The professional terms appearing in the text are defined as follows:
[0041] View and GLSurfaceView are two different display controls for displaying video data.
[0042] Canvas refers to the canvas.
[0043] Skia refers to a 2D vector graphics processing library that includes fonts, coordinate conversion, and bitmap graphics with high performance and simplicity.
[0044] hwui is mainly a module added by the Android system for 2D hardware drawing to improve the drawing performance of the entire system.
[0045] OpenGL ES (OpenGL for Embedded Systems) is a cross-platform API for 3D graphics application programming interfaces used in embedded devices. It is a subset of OpenGL and is used for drawing 2D or 3D graphics, rendering images and videos, etc.
[0046] The Graphics class is the abstract base class for all graphics contexts, allowing applications to draw on components (already implemented on various devices) as well as on closed-screen images; the Graphics object encapsulates the state information required for the basic rendering operations supported by Java.
[0047] Surface refers to the reserved memory area used to store the image data obtained by drawing, that is, the pixel data;
[0048] BufferQueue is a buffer queue, which connects the party that generates the image data buffer (the producer) to the party that receives the data for display or further processing (the consumer).
[0049] Layer refers to an independent image buffer.
[0050] SurfaceFlinger is an independent frame buffer management service that receives image data from all Surface inputs, calculates the position of each Surface in the final synthesized video data based on parameters such as ZOrder, transparency, size, and position, and then passes the calculated data to Hwcomposer or OpenGL ES for further processing.
[0051] Hwcomposer refers to the HAL layer module for window Layer synthesis and display in the Android system. It is usually implemented and completed by display device manufacturers to provide hardware support for the SurfaceFlinger service.
[0052] VO is the channel for transmitting and displaying the data synthesized by hwcomposer.
[0053] Display Driver refers to the display driver.
[0054] GPU Driver refers to the GPU driver.
[0055] Based on the above Figure 2 The following is an explanation of the professional terms that appear in the text. The following is a detailed explanation of the process of processing the video data to be displayed based on the View display control and the GLSurfaceView display control in the Android system and displaying it on the screen.
[0056] from Figure 2 It can be seen that the two display controls correspond to two different upper-layer drawing methods. Based on the View display control, the upper-layer drawing is drawn by calling the Canvas API. Canvas drawing can be divided into software drawing (Skia / CPU) and hardware accelerated drawing (Hwui / GPU). Whether it is software drawing or hardware accelerated drawing, the drawn image data will eventually be saved on the underlying Surface. Surface will hand over the image data to the corresponding Layer in BufferQueue, and then synthesize it through SurfaceFlinger and hwcomposer; finally, it will flow to different channels for display, among which hwcomposer will synthesize video data or image data, and video data and image data will flow to different display paths. The picture will go through the picture channel, and the video data will flow to the screen through the VO channel for display.
[0057] Based on the GLSurfaceView display control, the upper layer is drawn directly using GLSurfaceView. After OpenGL ES rendering processing, the drawn image data is saved on the underlying Surface. Surface will hand over the image data to the corresponding Layer in BufferQueue, and then SurfaceFlinger will synthesize it. The synthesis is not performed by hwcomposer, but directly calls OpenGL ES synthesis, and then it is directly transmitted to the screen for display through the GPU.
[0058] The image quality parameters set in the Android system are only effective for video data synthesized through hwcomposer and using the VO channel, and are not effective for video data synthesized through OpenGL ES. In other words, if the image quality parameters are adjusted in the Android system, the video data using the VO channel will meet the image quality parameters adjusted by the Android system, while the video data synthesized through OpenGL ES will not meet the adjusted image quality parameters. Therefore, it can be understood that the video data synthesized through OpenGL ES will have a technical defect of poor display effect.
[0059] It should be noted that different display controls are used in different application scenarios. For example, View display controls are generally used in scenarios where the screen is updated passively, such as chess; Surfaceview is generally used in scenarios where the screen is updated actively, such as a person running all the time, and is particularly suitable for 2D game development; GLsurfaceview display controls are particularly suitable for 3D game development with high frame rates because their image rendering efficiency is 30 times that of Surfaceview display controls. Therefore, assuming that a 3D game application is installed in the Android system, it is understandable that the game screen finally presented by the 3D game application will not match the image quality parameters set in the Android system, thereby reducing the user experience of 3D games.
[0060] Based on the above explanation of the background technology, the purpose of this application is to overcome the technical defect that the video data displayed by the GLsurfaceview display control is not satisfied with the picture quality parameters set in the local operating system. In order to solve this technical defect, it is necessary to have solutions for three aspects. The first aspect is how to obtain the picture quality parameters set in the local operating system; the second aspect is to determine at what position the video data to be displayed can be adjusted based on the picture quality parameters set in the local operating system; the third aspect is how to adjust the video data to be displayed based on the picture quality parameters set in the local operating system.
[0061] The following will propose corresponding technical solutions around the above three aspects.
[0062] See also Figure 1 , shows a schematic flow chart of a video data processing method according to an embodiment of the present application, which specifically includes the following steps S110 to S140:
[0063] S110, obtaining image quality parameters set in the local operating system.
[0064] It should be noted that the picture quality parameters refer to parameters that can affect the picture quality of the displayed video data, namely, Picture Quality (PQ) parameters, including but not limited to color temperature, saturation, picture contrast, etc. For example, in some smart playback devices (such as smart TVs, all-in-one conference machines, mobile phones, etc.), picture quality parameters can affect the picture quality of the played video.
[0065] It can be understood that step S110 is a solution proposed for the above-mentioned first aspect.
[0066] In some implementations, the specific implementation of obtaining the image quality parameters set in the local operating system includes at least the following two implementations.
[0067] The first implementation includes the following step S111A:
[0068] S111A, when rendering each frame of image data, actively pull the image quality parameters set in the local operating system.
[0069] For example, if the video data to be displayed is processed based on GLSurfaceView, then GLSurfaceView.Renderer exposes the onDrawFrame() method for refreshing each frame of displayed video data, so we can actively pull the image quality parameters set in the local operating system when rendering each frame of image data.
[0070] In some implementations, the specific implementation of actively pulling the image quality parameters set in the local operating system can be performed according to the following step S1111A:
[0071] S1111A, actively pulls the image quality parameters set in the local operating system based on the reflection mechanism.
[0072] The reflection mechanism means that in the running state, for any class, all the properties and methods of this class can be known; and for any object, any method of it can be called; this function of dynamically obtaining information and dynamically calling object methods.
[0073] It should be noted that, generally, the local operating system blocks the methods of reading and writing the image quality parameters set by it from the upper layer. Therefore, it is generally difficult to directly call the API to read the image quality parameters set in the local operating system. However, the image quality parameters set in the local operating system can be obtained through the reflection mechanism, thereby obtaining a solution to the first aspect mentioned above.
[0074] The second implementation method includes the following step S111B:
[0075] S111B, using the pre-stored image quality parameters as the image quality parameters set in the local operating system.
[0076] It can be understood that before rendering each frame of image data, the image quality parameters set in the local operating system can be obtained, and the obtained image quality parameters can be stored, so that when rendering each frame of image data, the pre-stored image quality parameters can be directly used as the image quality parameters set in the local operating system.
[0077] In some implementations, the method for obtaining the pre-stored image quality parameters in step S111B may be as follows: Figure 3 The steps presented in the detailed flow diagram shown are executed, including S1111B to S1113B:
[0078] S1111B, monitoring the image quality parameters set in the local operating system.
[0079] Specifically, a listener may be created in advance so that the image quality parameters set in the local operating system can be monitored in real time. For example, if the video data to be displayed is processed based on GLSurfaceView, then after creating a listener, GLSurfaceView may register the listener.
[0080] S1112B: If the monitored image quality parameter changes, read the changed image quality parameter.
[0081] Specifically, if the image quality parameters set in the local operating system change, the listener will be actively triggered to receive the event of the image quality parameter change, so as to obtain the changed image quality parameters.
[0082] S1113B: Update the pre-stored image quality parameters based on the changed image quality parameters.
[0083] It can be understood that based on step S1113B, the pre-stored image quality parameters can be kept consistent with the image quality parameters set in the local operating system in real time.
[0084] The above two specific implementations of how to obtain the image quality parameters set in the local operating system can both be used as solutions for the above first aspect. By comparing the two specific implementations, it can be found that:
[0085] The first implementation method is an active pull solution. Regardless of whether the current user is adjusting the image quality parameters of the local operating system, the smart playback device will actively read the image quality parameters of the local operating system when rendering each frame of image data. Regardless of whether the image quality parameters have changed, the image data rendering algorithm will be processed according to the read image quality parameters. This solution has higher performance requirements because the image quality parameters must be read for each frame, but it has good real-time performance because the latest image quality parameters are obtained for each frame, so the effect is also very good.
[0086] The second implementation method is a passive reception scheme, which reads the set image quality parameters only when the image quality parameters of the local operating system change. The real-time performance may not be so high, but the performance is good. The image quality parameters will not be read for every frame, but when the image quality parameters change, the image quality parameters will be saved and used until the image quality parameters are adjusted again. For real-time performance, there may be a slight delay only for the current frame when the change occurs, but the passive reception scheme is more friendly overall. Therefore, developers can select a matching scheme according to the real-time situation to obtain the set image quality parameters in the local operating system, and this application does not limit this.
[0087] Continue to see Figure 1 , S120, rendering image data based on the image quality parameters.
[0088] Step S120 includes a solution for the second aspect, namely determining at which position the video data to be displayed can be adjusted based on the image quality parameters set in the local operating system.
[0089] Based on the relevant configuration of the local operating system and the comprehensive study of the display process of video data by the display control, it can be determined that if the video data to be displayed is intervened before the image data is delivered to SurfaceFlinger for synthesis, the final displayed video data can meet the image quality parameters set in the local operating system.
[0090] It can be understood that the solution to the second aspect mentioned above is: before synthesizing the image data of each frame, it is rendered according to the picture quality parameters set in the local operating system, so that the video data finally presented on the screen can meet the set picture quality parameters, thereby improving the user experience, interactive experience, etc.
[0091] In order to enable those skilled in the art to better understand the position of intervening in the video data to be displayed based on the image quality parameters set in the local operating system in the present application, the following will be combined with Figure 4 Give an example.
[0092] See also Figure 4, shows a schematic diagram of the location of rendered image data according to an embodiment of the present application.
[0093] in, Figure 4 The Android system is taken as an example, and the processing of video data to be displayed based on the View display control and the GLSurfaceView display control in the Android system, as well as the display flow channel are demonstrated.
[0094] from Figure 4 It can be seen that because the video data to be displayed processed by the View display control is displayed to the screen through the VO channel, the image quality parameters set in the Android system will automatically take effect on the video data to be displayed at the VO channel, so that the video data displayed through the VO channel is finally displayed on the screen to meet the image quality parameters set in the Android system. Based on the description of the background technology section of this application, it can be seen that because the video data displayed through the OpenGL ES channel is not effective for the image quality parameters set in the Android system, if the video data to be displayed processed by the GLSurfaceView display control is not actively intervened, then the video data finally presented on the screen will not meet the image quality parameters set in the local operating system, resulting in a reduction in the user experience.
[0095] As described above, if the video data to be displayed processed based on the GLSurfaceView display control is intervened, the video data to be displayed can be intervened before the image data is delivered to SurfaceFlinger for synthesis.
[0096] For example, each frame of video data displayed on the screen is first drawn by GLSurfaceView to obtain the corresponding image data, and then delivered to OPenGL ES for related rendering and synthesis processing. The image data processed by OPenGL ES is saved on the underlying Surface. Therefore, after the image data is drawn by GLSurfaceView, that is, before it flows into OPenGL ES for processing, the image data can be rendered, and the rendering is performed according to the image quality parameters set in the Android system, so that the final displayed video data can meet the image quality parameters set in the Android system.
[0097] Continue to see Figure 1 In step S120, a solution for the third aspect is also included, that is, determining how to adjust the video data to be displayed based on the image quality parameters set in the local operating system.
[0098] In some embodiments, the Figure 5 The steps shown are executed, specifically including S121 to S123:
[0099] S121, obtaining pre-drawn image data.
[0100] Combination Figure 4 For example, you can get the image data drawn by GLSurfaceView.
[0101] Continue to see Figure 5 , S122, based on the image data, determine a target rendering algorithm from a plurality of pre-constructed rendering algorithms.
[0102] It can be understood that in order to ensure that the video data finally displayed on the screen meets the image quality parameters set in the local operating system, the video data to be displayed needs to be rendered, that is, the drawn image data needs to be rendered, which can be rendered using a pre-built rendering algorithm.
[0103] It should be noted that the pre-built multiple rendering algorithms can realize targeted rendering of different types of image data. Exemplarily, a detail enhancement rendering algorithm, a color enhancement rendering algorithm, and a face beautification rendering algorithm can be pre-built, wherein the detail enhancement rendering algorithm is mainly used to process image data containing details, such as texture, hair, etc.; the color enhancement rendering algorithm is mainly used to process image data that requires large-area color processing, such as green plants, flowers, etc.; the face beautification rendering algorithm is used to identify and process image data including face images. Specifically, multiple different rendering algorithms can also be designed according to actual conditions so that image data can be rendered.
[0104] In some implementations, determining the target rendering algorithm from the pre-constructed plurality of rendering algorithms may be to randomly determine a rendering algorithm from the pre-constructed plurality of rendering algorithms as the target rendering algorithm.
[0105] In some implementations, determining the target rendering algorithm from the pre-built plurality of rendering algorithms may be performed according to the following steps S1221 to S1222:
[0106] S1221: Determine the image type in the image data.
[0107] S1222: Determine a rendering algorithm that matches the image type from a plurality of pre-built rendering algorithms as a target rendering algorithm.
[0108] It can be understood that each rendering algorithm is suitable for rendering a specific type of image, that is, each type of image data corresponds to a rendering algorithm. Therefore, based on the correspondence between the image type and the rendering algorithm, the rendering algorithm matching the image type can be determined as the target rendering algorithm.
[0109] Exemplarily, if it is determined that the image type in the image data is a green plant type, then a color enhancement rendering algorithm may be selected as a target rendering algorithm for the image data.
[0110] Continue to see Figure 5 , S123, based on the image quality parameters, rendering the image data through the target rendering algorithm.
[0111] For example, the GLSurfaceView of the Android system has exposed an interface for custom rendering of image data, namely the setRender (Render render) method, and the video frame refresh method onDrawFrame() is in Render. The draw() method of GLFilter (i.e., the target rendering algorithm) is what actually implements image data rendering. Therefore, GLFilter.draw() can be called in the onDrawFrame() method to render the image data, thereby enabling custom processing of the drawn image data based on the image quality parameters set in the Android system.
[0112] Among them, GLFilter can be produced first (that is, multiple rendering algorithms are built in advance), different GLFilters correspond to rendering different types of image data, and then in the rendering process, by calling the GLES20.glUniform1f(intlocation,float x) provided by the system, GLSurfaceView can consume GLFilter, thereby processing the pixel data of the image data.
[0113] Continue to see Figure 1 , S130, synthesizing the image data to obtain video data.
[0114] In some embodiments, the image data is synthesized to obtain video data, which can be performed as follows: Figure 6 The steps shown are executed, specifically including S131 to S132.
[0115] S131, acquiring image data rendered based on the image quality parameters from a buffer queue.
[0116] S132, synthesizing the image data to obtain the video data.
[0117] It should be noted that each frame of video data is actually composed of multiple layers. For example, in the display interface of a mobile phone, it can be obtained by synthesizing three layers: the status bar at the top, the navigation bar at the bottom, and the application interface in the middle. Therefore, the image data obtained after drawing includes data in multiple layers to be synthesized. Therefore, synthesizing the image data is equivalent to synthesizing the layers corresponding to the video data to be displayed, so as to obtain the video data to be displayed.
[0118] For example, see Figure 2 The video data display process diagram shown in the figure shows that the image data obtained by drawing will be saved on the underlying Surface and handed over to the corresponding Layer through BufferQueue (buffer queue), so that it can be synthesized through SurfaceFlinger to obtain the video data finally displayed on the screen.
[0119] Continue to see Figure 1 , S140, displaying the video data through a GLSurfaceView display control, wherein the video data satisfies the image quality parameters.
[0120] For example, if in the Android system, the GLSurfaceView display control processes the displayed video data in the following manner: Figure 4 The execution of the streaming channel shown, that is, the execution according to the above steps S110 to S130 of the present application, will eventually make the video data presented on the screen of the smart playback device meet the image quality parameters set in the Android system, thereby improving the display effect of the presented video data and enhancing the user experience of the smart playback device.
[0121] In the technical solutions provided in some embodiments of the present application, the image quality parameters set in the local operating system are first obtained; then, based on the image quality parameters, the image data is rendered; then, the image data is synthesized to obtain video data; finally, the video data is displayed through the GLSurfaceView display control, and the video data meets the image quality parameters. Since the video data displayed by the GLSurfaceView display control is not effective for the image quality parameters set in the local operating system, the technical solution of the present application clarifies at what specific position and in what manner the GLSurfaceView display control can actively render and adjust the video data to be displayed based on the image quality parameters set in the local operating system during the process of processing the video data for display, so that the video data finally displayed on the screen meets the image quality parameters set in the local operating system, thereby improving the display effect of the video data, and improving the viewing and usage experience of the user.
[0122] Based on the same inventive concept, an embodiment of the present invention provides a video data processing device, which can be used to execute the video data processing method in the above embodiment of the present application. For details not disclosed in the embodiment of the present application, please refer to the embodiment of the video data processing method in the above embodiment of the present application.
[0123] See also Figure 7 , shows a block diagram of a video data processing device according to an embodiment of the present application.
[0124] like Figure 7 As shown, a video data processing device 700 according to an embodiment of the present application includes: an acquisition unit 701 , a rendering unit 702 , a synthesis unit 703 , and a display unit 704 .
[0125] Among them, the acquisition unit 701 is used to obtain the image quality parameters set in the local operating system; the rendering unit 702 is used to render image data based on the image quality parameters; the synthesis unit 703 is used to synthesize the image data to obtain video data; the display unit 704 is used to display the video data through the GLSurfaceView display control, and the video data meets the image quality parameters.
[0126] In some embodiments of the present application, based on the aforementioned solution, the acquisition unit 701 is further used to actively pull the image quality parameters set in the local operating system when rendering each frame of image data.
[0127] In some embodiments of the present application, based on the above-mentioned solution, the acquisition unit 701 is further used to: actively pull the image quality parameters set in the local operating system based on the reflection mechanism.
[0128] In some embodiments of the present application, based on the above-mentioned solution, the acquisition unit 701 is further used to: use the pre-stored image quality parameters as the image quality parameters set in the local operating system.
[0129] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit 701 is also used to: monitor the image quality parameters set in the local operating system; if the monitored image quality parameters change, read the changed image quality parameters; and update the pre-stored image quality parameters based on the changed image quality parameters.
[0130] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit 702 is also used to: obtain pre-drawn image data; based on the image data, determine a target rendering algorithm from a plurality of pre-built rendering algorithms; based on the image quality parameters, render the image data through the target rendering algorithm.
[0131] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit 702 is further used to: determine the image type in the image data; and determine a rendering algorithm that matches the image type from a plurality of pre-built rendering algorithms as a target rendering algorithm.
[0132] In some embodiments of the present application, based on the aforementioned solution, the synthesis unit 703 is further used to: obtain image data rendered based on the image quality parameters from a buffer queue; and synthesize the image data to obtain the video data.
[0133] In some embodiments of the present application, based on the aforementioned solution, the local operating system includes an Android system.
[0134] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program instruction is stored. The at least one computer program instruction is loaded and executed by a processor to implement the operations performed by the method described above.
[0135] Based on the same inventive concept, an embodiment of the present application also provides an electronic device.
[0136] See also Figure 8 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application, wherein the electronic device includes one or more memories 804, one or more processors 802, and at least one computer program (computer program instruction) stored in the memory 804 and executable on the processor 802, and when the processor 802 executes the computer program, the method described above is implemented.
[0137] Among them, Figure 8In the embodiment of the present invention, a bus architecture (represented by bus 800) is shown, which may include any number of interconnected buses and bridges, and bus 800 links various circuits including one or more processors represented by processor 802 and memory represented by memory 804. Bus 800 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 805 provides an interface between bus 800 and receiver 801 and transmitter 803. Receiver 801 and transmitter 803 may be the same element, namely a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 802 is responsible for managing bus 800 and general processing, while memory 804 may be used to store data used by processor 802 when performing operations.
[0138] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hard wiring, or a combination of any of these. In addition, each functional unit may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0140] The units described as separate components may or may not be physically separated, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed in multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store computer program instructions.
[0142] The above description is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.
Claims
1. A video data processing method, characterized in that: The method comprises: Get the image quality parameters set in the local operating system; Rendering image data based on the image quality parameters; synthesizing the image data to obtain video data; The video data is displayed through a GLSurfaceView display control, and the video data satisfies the image quality parameters.
2. The method according to claim 1, characterized in that The obtaining of the image quality parameters set in the local operating system includes: When rendering each frame of image data, the image quality parameters set in the local operating system are actively pulled.
3. The method according to claim 2, characterized in that The actively pulling the image quality parameters set in the local operating system includes: Actively pull the image quality parameters set in the local operating system based on the reflection mechanism.
4. The method according to claim 1, characterized in that: The obtaining of the image quality parameters set in the local operating system includes: The pre-stored image quality parameters are used as the image quality parameters set in the local operating system.
5. The method according to claim 4, characterized in that The method further comprises: Monitoring image quality parameters set in the local operating system; If the monitored image quality parameter changes, read the changed image quality parameter; The pre-stored image quality parameters are updated based on the changed image quality parameters.
6. The method according to claim 1, characterized in that The rendering of the image data based on the image quality parameter includes: Obtain pre-drawn image data; Based on the image data, determining a target rendering algorithm from a plurality of pre-built rendering algorithms; Based on the image quality parameter, the image data is rendered using the target rendering algorithm.
7. The method according to claim 6, characterized in that Each rendering algorithm is suitable for rendering a specific type of image. The target rendering algorithm is determined from a plurality of pre-built rendering algorithms, including: determining an image type in the image data; A rendering algorithm matching the image type is determined from a plurality of pre-built rendering algorithms as a target rendering algorithm.
8. The method according to claim 1, characterized in that The synthesizing the image data to obtain video data includes: Acquire image data rendered based on the image quality parameters from a buffer queue; The image data is synthesized to obtain the video data.
9. The method according to any one of claims 1 to 8, characterized in that: The local operating system includes an Android system.
10. A video data processing device, characterized in that: The device comprises: An acquisition unit, used for acquiring image quality parameters set in a local operating system; A rendering unit, used for rendering image data based on the image quality parameters; A synthesis unit, used for synthesizing the image data to obtain video data; A display unit is used to display the video data through a GLSurfaceView display control, and the video data meets the image quality parameters.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed by the method according to any one of claims 1 to 9.
12. An electronic device, characterized in that: The method comprises one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the method according to any one of claims 1 to 9.