Video content multiplexing rendering method and device, electronic equipment and storage medium
By using a unique player instance and visual copy instance to share memory buffers in video playback, the problem of resource redundancy and incoherence of playback when video content is displayed in multiple locations is solved, and efficient video content reuse rendering is achieved, improving system performance and user experience.
Patent Information
- Application Number
- CN202510513702.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, when playing videos, especially when displaying the same video at different display locations, there are problems of resource redundancy and incoherence in playback, resulting in high system resource occupancy and inability to effectively share video content.
The video content multiplexing rendering method is adopted to create a unique player instance and use a visual copy instance to copy the decoded video content to different display locations, avoiding repeated creation of player instances, and using shared memory buffers and visual copy instances to achieve multiple displays.
It significantly reduces system resource consumption, reduces memory and video memory usage, realizes resource redundancy and playback coherence of video content rendering in multiple locations, and improves the smoothness and efficiency of video playback.
Smart Images

Figure CN120390121A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of front - end design, and in particular, to a method, device, electronic device, and storage medium for video content reuse rendering. Background Art
[0002] In video application scenarios, the need for video content copy rendering is widespread. In the existing video playback technology of desktop client graphics frameworks, when the same video needs to be displayed in different places, an independent player component is usually reinstantiated. In this approach, each player instance needs to separately occupy system resources (such as memory and CPU), resulting in resource redundancy and the problem of discontinuous playback. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, device, electronic device, and storage medium for video content reuse rendering, which can reduce memory occupancy, save resources, and avoid the problem of discontinuous video playback when the same video needs to be displayed in different places. To achieve the above purpose, the technical solutions adopted by the present invention are as follows:
[0004] In a first aspect, the present invention provides a method for video content reuse rendering, the method comprising: constructing a player instance for the video content; creating a visual copy instance when it is determined that the video content is to be displayed at different display positions; copying the video content decoded by the player instance to the different display positions through the visual copy instance.
[0005] In a second aspect, the present invention provides a device for video content reuse rendering, comprising: an establishment module and a rendering module; the establishment module is used to construct a player instance for a video card; the establishment module is further used to create a visual copy instance when it is determined that the video content is to be displayed at different display positions; the rendering module is used to copy the video content decoded by the player instance to the different display positions through the visual copy instance.
[0006] In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, the memory storing machine - executable instructions that can be executed by the processor, and the processor can execute the machine - executable instructions to implement the video content reuse rendering method according to any one of the foregoing embodiments.
[0007] In a fourth aspect, the present invention provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the video content reuse rendering method according to any one of the foregoing embodiments.
[0008] The video content multiplexing rendering method, device, electronic device, and storage medium provided by the embodiments of the present invention. The method includes: constructing a player instance for the video content. When it is determined that the video content is to be displayed at the same display position, a visual copy instance is created, and the video content decoded by the player instance is shared to the different display positions through the visual copy instance. In the present invention, only a single player instance needs to be created for the same video content to complete the decoding operation. If it is necessary to perform copy rendering on this video content and display it at different display positions, the decoded video data can be directly obtained from the existing player instance through the visual copy instance, without the need to repeatedly create new player instances. This method only needs to maintain decoder instances corresponding to the number of video sources, regardless of the number of rendering points, significantly reducing resource consumption. The obtained video content is copied to different display positions through the visual copy instance for display, and the entire process effectively solves the problems of resource redundancy and discontinuous playback in multi-position rendering of video content under the desktop client graphics framework.
[0009] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given in conjunction with the accompanying drawings and are described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the accompanying drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative efforts.
[0011] Figure 1 Shows a schematic diagram of a video card in an embodiment of the present invention;
[0012] Figure 2 Is a schematic flowchart of the video content multiplexing rendering method provided by the embodiments of the present invention;
[0013] Figure 3 Is an effect diagram of the video content multiplexing rendering method provided by the embodiments of the present invention;
[0014] Figure 4 Is a functional module diagram of the video content multiplexing rendering device provided by the embodiments of the present invention;
[0015] Figure 5 Is a structural block diagram of the electronic device provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention described and illustrated herein can be arranged and designed in a variety of different configurations.
[0017] Therefore, the detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0018] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0019] Video content has already become one of the key ways for people to obtain information, entertain and socialize. At the same time, the presentation forms of video content are becoming increasingly rich and diverse and highly personalized. For example, card-style display provides a simple and easy-to-browse presentation way for video content; the small window or picture-in-picture mode allows users to perform other operations while watching the video, greatly improving the usage efficiency; and the multi-display collaborative display brings a brand-new visual experience to users, further expanding the application scenarios of video content.
[0020] Take the video card as an example. Please refer to Figure 1 , Figure 1 which shows a schematic diagram of a video card in an embodiment of the present invention. A video card is a card with a built-in player instance, which can cover different types of video information, such as game screens, audio screens, landscape screens, and so on. In addition, video description information, video tags, user interaction elements, and design elements such as backgrounds and borders can also be included on the video card. Taking Figure 1Taking the video card 1 in [as an example], this card can not only display the currently playing video and advertisement content simultaneously, but also particularly display a download button, facilitating users to download relevant content with one click. Thus, it can be seen that the video card can play video content in real time and support real-time preview of video content in any state. It also has functions such as loading advertisements and game co-operation components to enrich its application scenarios.
[0021] In the above various application scenarios of video content, the demand for copying and rendering of video content widely exists, that is, the same video content is displayed at different positions on the screen. No matter in what form the video content is displayed, the smooth playback of the video content must be maintained, and black screens, freezes or re-buffering are not allowed. In addition, at different rendering positions, the video content should maintain the same playback progress, aspect ratio and quality.
[0022] The inventor found during the research process that: in the implementation of video playback under the current desktop client graphics framework, the existing video copying and rendering solutions have problems of repeated initialization of player instances and high system resource occupancy. This problem is particularly obvious in scenarios such as dynamic deformation of video cards, small window mode, picture-in-picture mode, multi-monitor collaborative display, and separate playback when the application is minimized.
[0023] To solve the above technical problems, the embodiments of the present invention provide a method for multiplexing and rendering video content, which can solve the problems of high resource occupancy and discontinuous playback when the same video content is displayed at multiple positions. Please refer to Figure 2 , Figure 2 is a schematic flowchart of the method for multiplexing and rendering video content provided by the embodiments of the present invention. The method includes steps S201 to S203. The execution subject of the method can be a server or a PC. Taking the PC as an example, the description is as follows:
[0024] S201: Construct a player instance for the video content;
[0025] S202: When it is determined to display the video content at different display positions, create a visual copy instance;
[0026] In the embodiments of the present invention, the visual copy instance is an object that realizes the function of copying and rendering visual elements.
[0027] S203: Copy the video content decoded by the player instance to different display positions through the visual copy instance.
[0028] In the solutions of steps S201 to S203 provided by the embodiments of the present invention, only one unique player instance needs to be created for the same video content to complete the decoding operation. If it is necessary to copy and render this video content and display it at different display positions, the decoded data can be directly obtained from the existing player instance through the visual copy instance, without the need to repeatedly create new player instances. This method only needs to maintain the decoder instances corresponding to the number of video sources, regardless of the number of rendering points, significantly reducing resource consumption. The visual copy instance shares the obtained video content to be displayed at different display positions, and the whole process effectively solves the problems of resource redundancy and discontinuous playback in the multi-position rendering of video content under the desktop client graphics framework.
[0029] For the convenience of intuitively understanding the above technical effects, please refer to Figure 3 , Figure 3 which is a schematic diagram of a scenario provided by the embodiments of the present invention. In the left figure of Figure 3 , it is assumed that the user is playing a target video, and the target video is decoded and played through a player. When the system detects that the user performs a separation operation on the target video, the system can copy and render its picture into an independent form through the visual copy instance, so that the target video content is independently displayed at a certain position on the desktop, separated from the original playback container, as shown in the right figure of Figure 3 . The user can continue to play and watch the target video in this window, and only one player instance is needed throughout the process.
[0030] Next, the embodiments of the present invention will introduce the above video content reuse process in detail and clearly in combination with relevant drawings.
[0031] In step S201, the PC side first constructs a player instance for the video content to decode the video content to be displayed. In this way, only one unique player instance needs to be created for the same video content to complete the decoding operation. If it is necessary to copy and render this video content, the decoded data can be directly obtained from the existing player instance, without the need to repeatedly create new player instances, and this method significantly reduces resource consumption.
[0032] For example, in the scenario of dynamic deformation of video cards, a general video playback container can be designed first to carry the player instance and its control elements. This player instance will be responsible for the video decoding work of the video card. For the convenience of subsequent management and reference, a unique identifier can also be assigned to the player instance. In this way, whether it is for video decoding or other related operations, the corresponding player instance can be easily located and managed through this identifier.
[0033] It can be understood that in other video content application scenarios, such as the small window mode, the picture-in-picture mode, or the collaborative display of multiple monitors, etc., player instances can also be correspondingly constructed for decoding video content. In this way, regardless of the display mode, video content can be efficiently decoded to provide data for subsequent copy and rendering requirements.
[0034] In an embodiment of the present invention, in order to facilitate the management of all player instances, an embodiment of the present invention can also pre-construct a player management center scheduling module, which is mainly responsible for the life cycle and resource scheduling of each player instance, realizes the allocation of playback addresses, and can initialize the corresponding video stream according to the URL of the data source. In addition, for the player management center scheduling module, an embodiment of the present invention can also design a playback status callback interface for capturing key playback events (such as buffer completion, start of playback, etc.), configuring playback quality parameters, and dynamically adjusting the decoder working mode according to the device performance.
[0035] In order to support the status synchronization of the same video content at multiple display positions, an embodiment of the present invention can also construct a mechanism that enables multiple components or modules to perceive and synchronize the state changes of video playback (such as play, pause, stop, etc.) in real time, so as to ensure that the playback behaviors in all playback modes are consistent. For example, when a video content is displayed simultaneously in multiple places, such as the main window, the floating window, the small window, etc. If the user presses the "pause" button in a certain window, all other windows should immediately synchronize this operation and pause the video playback. Through the player management center scheduling module, this kind of synchronization can be achieved.
[0036] In step S202, when it is determined to display video content at different display positions, a visual copy instance is created.
[0037] In an embodiment of the present invention, when the system detects that the user has a reuse requirement for video content, it can be determined that the video content needs to be displayed at different display positions. The specific triggering methods of such reuse requirements may vary according to different video application scenarios.
[0038] For example, in the video card dynamic deformation scenario, when the user performs an effective hovering operation on the video card, the system can recognize the reuse requirement; another example is that when the user separates the playing video content into an independent small window, that is, when the system detects the separation operation of the user for the video content, this can also be regarded as a manifestation form of the reuse requirement; furthermore, when the user drags the video content to another monitor for playback, that is, when the system detects the drag operation of the user for the video content, it can also be regarded by the system as a signal indicating the existence of the reuse requirement. Through the above methods, the present invention can flexibly respond to the diverse operations of the user and ensure that the video content can be displayed in different display positions in a timely and accurate manner.
[0039] To avoid the problem of resource waste caused by the process of displaying the same video content at different display positions, for this video content, the embodiments of the present invention do not need to re-instantiate a new player, but create a visual copy instance. Through the visual element copy and rendering technology of the visual copy instance, the visual sharing of a single player instance for multiple rendering targets can be realized.
[0040] In the embodiments of the present invention, the visual copy instance can copy the already rendered content (such as video, picture or other display content) to other places for display without re-executing the original rendering process. Simply put, it is "render once, display multiple times". The working process of the visual copy instance designed in the embodiments of the present invention is as follows:
[0041] First, based on the rendering tree structure of the desktop client graphics framework, a mapping relationship from the source visual element (such as a control, picture, video, etc., which is a piece of content displayed on the screen) to the target rendering area is created. It can be understood that in a desktop application, the content on the screen is managed by a structure called the "rendering tree". Each displayed content (such as a control, picture or video) can be regarded as a node in this tree. The visual copy instance will establish a mapping relationship between the "source visual element" (i.e., the content to be copied) and the "target rendering area" (i.e., the place where the copied content is to be displayed). Then, through the shared memory buffer mechanism, the rendered image data of the source visual element is captured and stored; multiple rendering targets provide access channels to the same rendering result, achieving the effect of "render once, display multiple times". That is to say, when the source visual element is rendered, its image data will be captured and stored in a shared memory buffer. This buffer is like a temporary "storage warehouse" for storing the rendered content. Through the shared memory buffer, multiple different rendering targets (such as different windows, controls, etc.) can access the same rendering result simultaneously. In this way, no matter how many places need to display this content, it only needs to be rendered once.
[0042] Based on the visual copy instance created according to the embodiments of the present invention, in step S203, the embodiments of the present invention can use the constructed player instance as the video content source, obtain the video content decoded by the player instance through the visual copy instance and render it, and then copy it to multiple display positions. For example, if a video content is being played in the main window, its picture can be synchronously rendered to a floating window, a small window or other displays through the visual copy instance. If the visual copy instance is not adopted, the system may need to create a new player instance for the small window and re-decode and render the video content. This will not only increase the system burden but also may cause the playback progress of the two windows to be out of sync.
[0043] In step S203, in the embodiment of the present invention, the video content decoded by the player instance is first obtained through a visual copy instance. The process includes steps a1 to a2, which are described as follows:
[0044] Step a1: Construct a memory block and store the video content decoded by the player instance in the memory block.
[0045] In the embodiment of the present invention, by constructing a memory block to store the video content decoded by the player instance, shared access to video data can be achieved.
[0046] Optionally, in the embodiment of the present invention, a read-write lock mechanism can also be applied to ensure the thread safety of the writing and reading of the video data stored in the memory block.
[0047] Step a2: Bind the visual copy instance to the player instance so that the visual copy instance obtains the video content from the memory block.
[0048] In the embodiment of the present invention, binding the visual copy instance to the player instance means binding the source attribute of the visual copy instance to the visual object of the player instance. In this way, after the visual object is instantiated, when the visual copy instance reads the memory block address to obtain and render the video visual object, different rendering containers can reuse this visual object to achieve the effect of displaying the same visual image in different rendering containers.
[0049] In an embodiment of the present invention, after the visual copy instance obtains the video content from the memory block, the PC side can also enable the graphics processor to accelerate the rendering cache to achieve millisecond-level visual synchronization (delay less than 5 milliseconds) from the source player instance to the alienated rendering target.
[0050] Through the above implementation, for the same video content, the PC side only needs one player instance to decode the video. The decoding result is stored in the memory block and can be shared with the visual copy instance, and then shared by the visual copy instance to multiple display positions, realizing a one-to-one relationship between the number of player instances and the number of video sources rather than the number of rendering points, effectively reducing the system resource occupancy by 67% to 85%. In addition, this way of sharing the rendering cache through the visual copy instance can also significantly reduce the GPU texture memory occupancy.
[0051] In step S203, in order to enable the video content to be correctly displayed at the display position, the embodiment of the present invention provides an implementation, including steps b1 to b2, which are described as follows:
[0052] Step b1: Determine the rendering containers required for different display positions respectively;
[0053] Step b2: The visual copy instance obtains the video content and renders it;
[0054] Step b3: Display the rendered video content at the display position corresponding to the rendering container through the rendering container.
[0055] In the embodiment of the present invention, the rendering container is used to carry and display video content. At different display positions, the video content can be presented through different rendering containers.
[0056] Optionally, in order to apply to scenarios such as dynamic deformation of video cards, small window mode, picture-in-picture mode, multi-monitor collaborative display, and separate playback when the application is minimized, the rendering containers in the embodiment of the present invention include: independent forms; floating controls; interface element decoration containers. Among them, the independent form is similar to a small window and can exist independently of the main application interface, such as in the small window mode or picture-in-picture mode. The floating control is a temporary area floating on the interface, usually used for pop-up prompts or dynamic effects. The interface element decoration container is a special desktop client graphic framework function that allows additional content to be superimposed on existing UI elements (such as the effect when hovering and magnifying).
[0057] In order to enable different rendering containers to use the rendering results of the visual copy instance in a unified manner, the embodiment of the present invention can design a rendering container abstraction interface. In this way, for the rendering containers required at different display positions, the embodiment of the present invention does not need to rewrite the logic for each rendering container, and can also easily expand to support new container types. No matter which container is used, the rendering behavior of the video remains consistent.
[0058] For example, when it is necessary to separate the currently playing video into an independent small window, through the rendering container abstraction interface, the video content can be bound to a new independent form, and its size, position, and dragging function can be set; for another example, when the user hovers the mouse pointer over a video card, through the rendering container abstraction interface, a temporary floating control is created, the video content is bound to the control, and its display position is adjusted according to the mouse position. For another example, to superimpose some dynamic effects (such as border highlighting, magnification animation) on the existing video card, through the rendering container abstraction interface, the video content can be rendered to the interface element decoration container.
[0059] In an embodiment of the present invention, the PC side can also configure size and position adjustment strategies for each rendering container to ensure that the video content is correctly displayed at the display position corresponding to each rendering container.
[0060] For example, as an implementation method, for each rendering container (such as independent forms, floating controls, interface element decoration containers, etc.), dedicated "adapters" can also be designed on the PC side according to their characteristics to ensure that the video content can be correctly displayed in these containers and meet specific size, position, and interaction requirements.
[0061] In one embodiment of the present invention, the PC side can also build a container lifecycle management mechanism to provide unified creation, activation, and release interfaces for each rendering container.
[0062] In one embodiment of the present invention, when the rendering container is an interface element decoration container, if a deformation requirement of the video card is detected on the PC side, after rendering the video content through the visual replication instance, the interface element decoration container performs a deformation operation on the rendered video content.
[0063] The interface element decoration container designed in the embodiment of the present invention is a special visual layer that can be superimposed above the existing interface elements without disturbing the layout structure of the original elements. It has an independent rendering pipeline and can add additional visual effects without modifying the appearance of the original elements. There is no need to create a complete new control instance for each decorated element, so as to achieve the effect of reducing system resource occupancy. Specifically, the implementation process of the interface element decoration container is as follows:
[0064] First, initialize the decorator instance and create a global decorator manager. Among them, the global decorator manager is responsible for the lifecycle control and resource allocation of all decorator instances. Place a transparent container (decorative layer host container) on the topmost interface (top layer of the visual tree) of the application. This container is used to store and manage all decorators to ensure that they can be effectively controlled and used.
[0065] Second, obtain the visual attribute information such as the position and size of the target interface element (such as a button, picture, or text box), calculate and store the absolute coordinate position of the target interface element in the visual tree, that is, the precise position of the element relative to the entire screen, and store this position information. Furthermore, establish a spatial mapping relationship between the decorative layer and the target interface element to ensure that it can correctly cover or follow these target interface elements without taking the decorative layer as a child element of the target element. That is to say, the decorative layer will not affect the layout structure of the target interface element and will not be affected by the layout changes of the target interface element, so as to ensure that the decorative layer can follow the position change of the target element. Once the position of the target element is detected to change, the decorative layer will also adjust its position accordingly to maintain consistency with the target interface element.
[0066] Furthermore, create a specific drawing area for the decorator, and customize the drawing logic and establish a caching mechanism within this specific drawing area. The drawing area is separate from the main interface layout system of the application. In this way, the main layout system is responsible for managing the positions and sizes of all regular interface elements (such as buttons, text boxes, etc.) in the application. The rendering context of the decorator is independent and will not be affected by the main layout system, nor will it affect the main layout system. Through the customized drawing logic, various visual effects can be achieved, such as shape drawing, image rendering, and animation effects (including gradients, rotations, zooms, etc.). Through the caching mechanism, the number of repeated drawings can be reduced, thereby improving the rendering efficiency and making the application run more smoothly.
[0067] Finally, create a resource release mechanism for the decorator and build a decorator instance pool. When the decorator completes its task, use the resource release mechanism to release the resources it occupies, such as memory, graphics cache, textures, etc. By releasing these resources, memory leaks and resource waste can be avoided, and the overall performance of the system can be improved. The decorator instance pool is a collection that stores decorator instances. These instances can be taken out and used when needed instead of creating new instances every time, which can reduce the overhead of creating and destroying instances and improve efficiency. In high-frequency interaction scenarios (such as when the user frequently clicks a button or swipes the screen), if a new decorator instance needs to be created every time, it may lead to performance bottlenecks. Through the instance pool, the instances that have been created but are temporarily unused can be saved and reused directly the next time they are needed, thereby improving the response speed and performance.
[0068] Based on the functions of the above interface element decoration container, in an embodiment of the present invention, when a deformation requirement for a video card is detected, an interface element decoration container can be constructed at the position where the video card is located. As an independent logical layer from the main layout system, it provides a deformation isolation layer for the deformation requirement. Then, to achieve the deformation effect, the embodiment of the present invention can first generate a cloned card of the video card, and then perform deformation operations on the cloned card in this deformation isolation layer. In this way, the user can intuitively see the deformation effect of the video card. This deformation effect is essentially the effect presented by the cloned card in the deformation isolation layer. Due to the existence of the interface element decoration container, the entire deformation process will not cause the main layout system to become disordered, ensuring the stability of the system.
[0069] In an embodiment of the present invention, in order to ensure the rendering synchronization of the video content decoded by the player instance and the video content captured by the visual replication instance, the embodiment of the present invention can also implement conditional rendering logic to update the visual replication instance cache only when the video frame changes.
[0070] In an embodiment of the present invention, to reduce unnecessary calculations and resource consumption, the system can intelligently identify which parts of the video frame have changed (such as moving objects, updated pixels), mark these areas as "invalid areas". Then, the visual replication instance only updates these marked areas, while keeping the other unchanged parts intact. In this way, the repeated rendering of the entire screen is avoided, significantly reducing the workload of the GPU, thereby improving performance and efficiency.
[0071] Meanwhile, to ensure the rendering result, the embodiment of the present invention can also configure the property value of the bitmap scaling mode attribute to high quality in the desktop client graphics framework to ensure the clarity of the enlarged video picture.
[0072] In an embodiment of the present invention, when the sharing of video content is completed, the binding relationship between the player instance and the visual replication instance is released to achieve the purpose of resource recycling.
[0073] In an embodiment of the present invention, the system can also predict possible upcoming actions or changes by analyzing the current scene and the user's operation habits. For example, in a video application, if the user is watching a video and is likely to drag the video into a small window to continue playing, the system can predict the resources required for the small window rendering. Another example is that when the user scrolls a list containing multiple video cards, the system can predict which video cards are about to enter the visible area and prepare the thumbnails or initial frames of these videos in advance. Next, the system can load the required resources into the memory according to the prediction result. In this way, when the user actually triggers the relevant operation, the system can directly obtain the resources from the memory instead of reloading them from the hard disk or other places, thus avoiding delays. For example, when the user drags the video into the small window, the video will instantly appear in the small window without any buffering or loading process. Or when the user quickly scrolls the list, the video cards can be smoothly displayed without any blank or delay phenomenon.
[0074] In one embodiment of the present invention, when the system detects insufficient memory or high pressure, it can quickly identify which resources are inactive through the "weak reference mode" and clean them from the memory, thereby avoiding memory overflow or performance degradation. For example, the user opens a main window and a small window, and the same video is being played in both windows. The main window is active, and the small window is minimized by you and does not need to be displayed temporarily. The system will manage the rendering resources of the small window (such as video frame buffer, window frame, etc.) with "weak references". If the system memory is sufficient at this time, these resources will continue to be retained so that you can quickly use them when you restore the small window at any time. However, if the system memory starts to become tight (for example, you are running many other programs simultaneously), the system will preferentially clean up these small window resources managed by "weak references" to release memory for more important tasks.
[0075] In summary, the video content reuse rendering method provided by the embodiment of the present invention has the following advantages:
[0076] First of all, in the embodiment of the present invention, only a single player instance needs to be constructed for the video content, that is, only the decoder instances corresponding to the number of video sources need to be maintained, regardless of the number of rendering points. When the video content needs to be displayed at multiple different display positions, the decoding results of the player instance can be shared through the visual copy instance, which can eliminate duplicate decoding calculations and reduce the processing load by 50% to 80%. Through the visual element copy rendering function of the visual copy instance, the memory and video memory occupancy are significantly reduced, the system instability caused by the competition of multiple decoder instances is avoided, and the player re-initialization delay (200 - 500ms) in the traditional solution is eliminated.
[0077] Secondly, when rendering the same video content at multiple display positions through the visual copy instance, the GPU can be used to directly process the rendering resources of the visual copy instance, achieving sub-millisecond visual synchronous rendering. The change of the rendering position does not affect the underlying playback logic, ensuring content continuity.
[0078] In addition, the method provided by the embodiment of the present invention is applicable to various rendering containers such as independent forms, floating controls, and interface element decoration containers, supports third-party decoders or custom playback controls, and supports multiple service scenarios through a unified rendering container interface, improving the code reuse rate and architecture consistency.
[0079] Generally speaking, the video content reuse rendering method provided by the embodiment of the present invention effectively solves the problems of resource redundancy and playback coherence in multi-position rendering of video content under the desktop client graphics framework by innovatively applying the visual element copy rendering mechanism and combining a flexible rendering container architecture, providing an efficient and smooth general rendering reuse solution for modern video applications.
[0080] To execute the corresponding steps in the above embodiments and all possible ways, the following presents an implementation of a video content multiplexing device based on a desktop client graphics framework. Please refer to Figure 4 , Figure 4 FIG. Figure 4 is a functional module diagram of a video content multiplexing device based on a desktop client graphics framework provided by an embodiment of the present invention. It should be noted that the basic principle and the technical effects produced by the video content multiplexing device based on the desktop client graphics framework provided in this embodiment are the same as those in the above embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference may be made to the corresponding content in the above embodiments. The video content multiplexing rendering device 40 includes: a building module 401 and a rendering module 402;
[0081] The building module 401 is configured to build a player instance for a video card;
[0082] The building module 401 is further configured to create a visual copy instance when it is determined that the video content is to be displayed at different display positions;
[0083] The rendering module 402 is configured to copy the video content decoded by the player instance to different display positions through the visual copy instance.
[0084] It can be understood that the building module 401 and the rendering module 402 can cooperate to execute Figure 2 each step in to achieve the corresponding technical effects.
[0085] Optionally, the rendering module 402 is specifically configured to determine the rendering containers required for different display positions respectively; obtain the video content by the visual copy instance and render it; display the rendered video content at the display position corresponding to the rendering container through the rendering container.
[0086] Optionally, the rendering module 402 is further configured to configure a size and position adjustment strategy for each rendering container so that the video content is displayed at the display position corresponding to each rendering container.
[0087] Optionally, the rendering containers include: a stand-alone form; a floating control; an interface element decoration container.
[0088] Optionally, when the rendering container is an interface element decoration container, if the rendering module 402 detects a deformation requirement for the video card, after rendering the video content through the visual copy instance, the interface element decoration container performs a deformation operation on the rendered video content.
[0089] Optionally, the rendering module 402 is further specifically configured to construct a memory block and store the video content decoded by the player instance in the memory block; bind the visual copy instance to the player instance so that the visual copy instance obtains the video content from the memory block.
[0090] Optionally, the rendering module 402 is further configured to release the binding relationship between the player instance and the visual copy instance after the copying of the video content is completed.
[0091] It should be noted that the division of modules in the above embodiments of the present application is illustrative. It is only a logical function division, and there may be other division methods in actual implementation. In addition, each functional unit in the various embodiments of the present application may be integrated in one processing unit, may exist separately physically, or two or more units may be integrated in one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units.
[0092] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program executable codes.
[0093] The embodiment of the present invention further provides an electronic device. Please refer to Figure 5 , Figure 5 which is a structural block diagram of the electronic device provided by the embodiment of the present invention, including: a memory 501, a processor 502, and a communication interface 503. The memory 501, the processor 502, and the communication interface 503 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses or signal lines.
[0094] Optionally, the bus 504 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 only a thick line is used to represent it in Figure 5 , but it does not mean that there is only one bus or one type of bus.
[0095] In the embodiment of the present invention, the processor 502 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiment of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiment of the present invention can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor. The software module may be located in the memory 501, and the processor 502 reads the program instructions in the memory 501 and combines its hardware to complete the steps of the above method.
[0096] In the embodiment of the present invention, the memory 501 may be a non-volatile memory, such as a Hard Disk Drive (HDD) or a Solid-State Drive (SSD), etc., or may also be a volatile memory, such as RAM. The memory may also be any other medium that can be used to carry or store the desired program executable code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present invention may also be a circuit or any other device capable of implementing a storage function, for storing instructions and / or data.
[0097] The memory 501 can be used to store software programs and modules, such as the instructions / modules of the video content multiplexing and rendering device 40 provided in the embodiment of the present invention, and can be stored in the memory 501 in the form of software or firmware, or solidified in the operating system (OS) of the electronic device 50. The processor 502 executes various functional applications and data processing by executing the software programs and modules stored in the memory 501. The communication interface 503 can be used for signaling or data communication with other node devices.
[0098] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the devices and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0099] It can be understood that Figure 5 The structure shown is only schematic, and the electronic device 50 may further include more or fewer components than those shown in Figure 5 or have a different configuration from that shown in Figure 5 shown. Figure 5 Each of the components shown can be implemented by hardware, software, or a combination thereof.
[0100] Based on the above embodiments, the present application also provides a storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a computer, the computer is caused to execute the video content multiplexing rendering provided in the above embodiments.
[0101] Based on the above embodiments, the embodiments of the present invention also provide a computer program. When the computer program runs on a computer, the computer is caused to execute the video content multiplexing rendering provided in the above embodiments.
[0102] Based on the above embodiments, the embodiments of the present invention also provide a chip. The chip is used to read the computer program stored in the memory and is used to execute the video content multiplexing rendering provided in the above embodiments.
[0103] ]>The embodiments of the present invention also provide a computer program product, including instructions. When the instructions run on a computer, the computer is caused to execute the video content multiplexing rendering provided in the above embodiments.
[0104] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by instructions. These instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0105] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions in the process Figure 1one or more processes and / or blocks Figure 1 the functions specified in one or more blocks.
[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 one or more processes and / or blocks Figure 1 or more processes and / or blocks.
[0107] The above is only a specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for multiplexing and rendering video content, characterized in that, The method comprises: Construct a player instance for the video content; When it is determined that the video content is to be presented at a different display location, creating a visual replication instance; The video content decoded by the player instance is copied to the different display position by the visual copy instance.
2. The video content multiplexing rendering method according to claim 1, wherein Copying the video content decoded by the player instance to the different display position by a visual copy instance, comprising: Determining the rendering containers required for the different display positions; Obtaining and rendering the video content by the visual replication instance; The rendered video content is displayed through the rendering container at a display position corresponding to the rendering container.
3. The video content multiplexing rendering method according to claim 2, characterized in that, The method further comprises: A size and position adjustment strategy is configured for each rendering container, so that the video content is displayed at the display position corresponding to each rendering container.
4. The video content multiplexing rendering method according to claim 2, wherein The rendering container includes: an independent window; a floating control; and an interface element decoration container.
5. The video content multiplexing rendering method according to claim 2, wherein The method further comprises: When the rendering container is an interface element modification container, if it is detected that a deformation requirement exists for the video card, the interface element modification container performs a deformation operation on the rendered video content after rendering the video content through a visual replication instance.
6. The video content multiplexing rendering method according to any one of claims 1 to 5, characterized in that, Sharing the video content decoded by the player instance to the different display positions through the visual replication instance further includes: Constructing a memory block, and storing the video content decoded by the player instance in the memory block; Binding the visual replication instance to the player instance so that the visual replication instance obtains the video content from the memory block.
7. The video content multiplexing rendering method according to claim 6, wherein The method further comprises: After the copying of the video content is completed, the binding relationship between the player instance and the visual copy instance is released.
8. A video content multiplexing and rendering device, characterized in that include: Building modules and rendering modules; The building module is used to build a player instance for the video card; The establishing module is further configured to create a visual replication instance when it is determined that the video content is to be displayed at a different display position; The rendering module is used to copy the video content decoded by the player instance to the different display position through a visual copy instance.
9. An electronic device, characterized in that, The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the video content multiplexing rendering method according to any one of claims 1 to 7.
10. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, the video content multiplexing and rendering method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Video picture processing method and device and electronic equipment
CN108282686A
Multi-display-screen synchronous display method and device, video processing equipment and storage medium
CN112804410A
Method and terminal for making and playing interactive video based on 3D rendering
CN113784167A
Screen sharing control method and device, electronic equipment and storage medium
CN114816306A
Video playing method, electronic equipment and computer program product
CN115866307A
