Television-oriented multi-application collaborative rendering method, system, equipment and medium
Through cross-process communication and reflection mechanisms, non-system applications can achieve multi-application collaborative rendering on smart TVs, solving the problem of system-level exclusive control, improving user experience and device adaptability, and ensuring the efficiency and stability of multi-application collaborative rendering.
Patent Information
- Application Number
- CN202510894676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-09
AI Technical Summary
In existing smart TV systems, multi-application collaborative rendering is limited by the exclusive control of system-level applications, making it difficult for third-party applications to be embedded in real-time TV images, limiting the user experience and application flexibility and collaborative efficiency.
By establishing a cross-process communication channel and reflection mechanism, non-system applications are allowed to participate in the source rendering process, dynamically replace the screen-bearing objects of the TV view component, and reuse the open graphics library to achieve multi-application collaborative rendering.
It achieves efficient nested display and flexible rendering of non-system applications on TV, improves user experience and system stability, adapts to devices from different manufacturers, and avoids resource waste and memory leaks.
Smart Images

Figure CN120614490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of television rendering, and in particular to a television-oriented multi-application collaborative rendering method, system, device and medium. Background Art
[0002] With the continuous expansion of smart TV application scenarios, users are no longer satisfied with the functional experience of a single application, and the demand for collaborative rendering of multiple applications is becoming more urgent.
[0003] Currently, the picture-in-picture function of most smart TV systems is controlled by system-level applications or services to control access to TV signal sources and display surfaces. This approach has many flaws. On the one hand, it forms a technical barrier, making it difficult for third-party applications to embed real-time TV images into their own interfaces, seriously restricting the improvement of user experience. On the other hand, due to the system's exclusive use of resources, it is difficult for different applications to achieve efficient collaboration. Users cannot freely combine the display mode and interaction logic of applications according to their own needs, which limits the flexibility of applications. Therefore, implementing multi-application collaborative rendering in non-system applications can break this limitation, meet users' needs for multi-tasking and diversified content viewing, greatly enhance the functionality and competitiveness of applications, and bring users a richer and more convenient user experience. At the same time, it also promotes the development of the smart TV application ecosystem in a diversified direction. Summary of the Invention
[0004] The present invention provides a television-oriented multi-application collaborative rendering method, system, device and medium, which can achieve efficient multi-application collaborative rendering and improve user experience.
[0005] An embodiment of the present invention provides a multi-application collaborative rendering method for television, including:
[0006] Receiving a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application;
[0007] The private interface method of the TV view component is called through the reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and the control interface of the TV view component is called according to the source rendering request to drive the source output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the screen bearing component of the non-system application to realize source rendering.
[0008] The embodiment of the present invention allows receiving source rendering requests and first screen bearing surface objects from non-system applications by establishing a cross-process communication channel, breaking the limitation of traditional methods that only the source management end can control the source and object, so that non-system applications can also participate in the rendering process of the source, which is helpful for the subsequent efficient multi-application collaborative rendering; calling the private interface method of the TV view component through the reflection mechanism, replacing the originally bound second screen bearing surface object with the first screen bearing surface object, so that the rendering output of the TV view component can be dynamically directed to the first screen bearing surface provided by the non-system application, realizing flexible switching of rendering targets; by reusing the open graphics library of the TV view component, the overhead of recreating and initializing graphics resources when switching rendering targets is avoided, significantly improving the efficiency of multi-application collaborative rendering, and thus improving user experience. Compared with the existing technology, the present application can achieve efficient multi-application collaborative rendering and improve user experience.
[0009] Furthermore, the first screen bearing surface object is obtained from a screen bearing component created by a non-system application, specifically:
[0010] Initializing a layout including the screen bearing component in the user interface layer of the non-system application, and monitoring a creation event of the first screen bearing surface object through a callback interface of the holder of the screen bearing component;
[0011] If the creation is completed, the first screen bearing surface object is obtained in the callback event of the creation completion of the first screen bearing surface object.
[0012] In this way, the layout including the screen-bearing components is initialized through the user interface layer of the non-system application, and the creation event of the first screen-bearing surface object is listened to through the callback interface. This can ensure that the object is obtained in time after the screen-bearing surface object is created, and prepare for its subsequent transfer to the background source management end. This is the prerequisite for realizing cross-process Surface transfer, ensuring that non-system applications can nestedly display real-time TV source images, thereby realizing efficient multi-application collaborative rendering and improving user experience.
[0013] Furthermore, the private interface method of the TV view component is called through the reflection mechanism, specifically:
[0014] Obtaining the manufacturer information of the TV view component, and searching for the class name corresponding to the manufacturer information in a preset mapping table to obtain a candidate class name list, wherein the preset mapping table is a mapping relationship table pre-established based on the component manufacturer information and potential TV view class names;
[0015] The candidate class name list is traversed, and a reflection mechanism is used to dynamically detect whether the class in the candidate class name list contains a private interface method for setting the first screen bearing surface object. If so, the corresponding private interface method is called.
[0016] In this way, by obtaining the manufacturer information of the TV view component and finding the corresponding class name list, and using the reflection mechanism to dynamically detect and call private interface methods, compatibility and adaptation of TVView components from different manufacturers can be achieved, ensuring that the multi-application collaborative rendering method can run effectively on TV devices of various brands and models, avoiding compatibility issues caused by differences in manufacturer interfaces, thereby improving the versatility and stability of the system and providing users with a broader and more consistent picture-in-picture function experience.
[0017] Furthermore, after dynamically detecting whether a class in the candidate class name list includes a private interface method for setting the first screen bearing surface object through a reflection mechanism, the method further includes:
[0018] If the class in the candidate class name list does not include a method for setting the first screen bearing surface object, then traversing the system class and determining whether the system class includes a preset system keyword through fuzzy matching;
[0019] If the system class contains the preset system keyword, then try to load the system class and detect whether it contains the private interface method;
[0020] If the system class does not include the private interface method, the interface method corresponding to the TV native interface is used.
[0021] In this way, by dynamically adapting to TV view components from different manufacturers, the wide compatibility of the multi-application collaborative rendering method is ensured, functional failures caused by differences in manufacturer interfaces are avoided, and the efficiency and stability of multi-application collaborative rendering are ensured, thereby improving the user experience.
[0022] Furthermore, after the driving signal source is output to the first screen bearing surface object, the method further includes:
[0023] Obtain device resolution for non-system applications based on user layout configuration requirements;
[0024] Based on the device resolution, an adapted rendering size is calculated according to a preset adaptation formula, and the size and position of the screen carrying component are adjusted according to the rendering size, and source rendering is performed, wherein the rendering size includes width and height.
[0025] In this way, by dynamically adjusting the size and position of the screen-carrying components according to the device resolution, the consistency and adaptability of the picture-in-picture window on different devices are ensured, thereby improving the flexibility and visual effects of multi-application collaborative rendering and enhancing the user experience.
[0026] Furthermore, after implementing source rendering by reusing the open graphics library of the TV view component in the picture bearing component of the non-system application, the method further includes:
[0027] The non-system application monitors the first screen bearing surface object;
[0028] If a destruction callback event is monitored, the source management end is notified through the cross-process communication channel to release related rendering resources.
[0029] In this way, by monitoring the first screen-bearing surface object, the timely release and management of resources can be ensured, resource waste and potential memory leaks can be avoided, thereby improving the efficiency and stability of the system, ensuring the smoothness and response speed of multiple applications working together on the TV system, and improving the user experience.
[0030] Furthermore, after the open graphics library of the TV view component is reused in the picture bearing component of the non-system application to realize the source rendering, the method further includes:
[0031] If an abnormality in the TV signal source is detected, error status information is called back to the non-system application via the cross-process communication channel;
[0032] The non-system application updates the user interface according to the received error status information and displays an error prompt according to a preset rule.
[0033] This ensures that when an anomaly occurs in the TV signal source, non-system applications can receive error notifications in a timely manner and update the user interface accordingly, thereby improving the reliability and stability of the system.
[0034] Another embodiment of the present invention further provides a multi-application collaborative rendering system for television, comprising: a receiving module and a rendering module;
[0035] The receiving module is configured to receive a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application;
[0036] The rendering module is configured to call the private interface method of the TV view component through a reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and call the control interface of the TV view component according to the signal source rendering request to drive the signal source to be output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the non-system application's screen bearing component to implement signal source rendering.
[0037] The embodiment of the present invention allows receiving source rendering requests and first screen bearing surface objects from non-system applications by establishing a cross-process communication channel, breaking the limitation of traditional methods that only the source management end can control the source and object, so that non-system applications can also participate in the rendering process of the source, which is helpful for the subsequent efficient multi-application collaborative rendering; calling the private interface method of the TV view component through the reflection mechanism, replacing the originally bound second screen bearing surface object with the first screen bearing surface object, so that the rendering output of the TV view component can be dynamically directed to the first screen bearing surface provided by the non-system application, realizing flexible switching of rendering targets; by reusing the open graphics library of the TV view component, the overhead of recreating and initializing graphics resources when switching rendering targets is avoided, significantly improving the efficiency of multi-application collaborative rendering, and thus improving user experience. Compared with the existing technology, the present application can achieve efficient multi-application collaborative rendering and improve user experience.
[0038] Another embodiment of the present invention also provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the multi-application collaborative rendering method for television as described in the present invention.
[0039] Another embodiment of the present invention further provides a computer-readable storage medium item, comprising: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of the multi-application collaborative rendering method for television as described in the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0041] Figure 1 This is a flowchart of an embodiment of a multi-application collaborative rendering method for television provided by the present application;
[0042] Figure 2 This is a structural diagram of an embodiment of a multi-application collaborative rendering system for television provided by this application. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0045] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0046] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0047] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.
[0048] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0049] In the description of the embodiments of the present application, unless otherwise expressly specified or limited, technical terms such as "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integration; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components or interactions between two components. Those skilled in the art can understand the specific meanings of the above terms in the embodiments of the present application based on specific circumstances.
[0050] With the increasing popularity of smart TVs, user demand for multi-application collaborative rendering continues to grow. Existing picture-in-picture functionality typically relies on system-level applications that exclusively utilize the TV signal source and display surface. This creates a technical barrier, hindering third-party applications from embedding live TV content, limiting user experience and application flexibility. Therefore, enabling multi-application collaborative rendering in non-system applications is crucial. It can enhance application functionality and competitiveness, meet user multitasking needs, and promote the diversified development of the smart TV application ecosystem.
[0051] See also Figure 1 In order to achieve efficient multi-application collaborative rendering and improve user experience, an embodiment of the present invention provides a multi-application collaborative rendering method for television, including steps S101 to S102;
[0052] Step S101: receiving a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application;
[0053] In some embodiments, the first screen bearing surface object is obtained from a screen bearing component created by a non-system application, specifically: a layout including the screen bearing component is initialized in the user interface layer of the non-system application, and a creation event of the first screen bearing surface object is listened to through the callback interface of the holder of the screen bearing component; if the creation is completed, the first screen bearing surface object is obtained in the callback event of the creation completion of the first screen bearing surface object. Specifically: first, in the user interface layer of non-system applications, use SurfaceView or its subclass as the screen bearing component, and configure the screen bearing component accordingly in the layout file, such as setting its position, size and other attributes. After that, set the listener of the callback interface (that is, SurfaceHolder.Callback) through the holder of the screen bearing component (that is, SurfaceHolder) to wait for and receive the event notification sent by the screen bearing component about the creation of the first bearing screen object (Surface object); then, when the screen bearing component completes the creation of the first bearing screen object inside it, it will automatically call the corresponding method of the callback interface set previously through the holder, that is, surfaceCreated(), to notify that the first screen bearing object has been created. Once the notification of the completion of the creation of the first bearing screen object sent by the screen bearing component is received, the first screen bearing surface object that has been created can be obtained in the corresponding callback method, and stored or passed to other modules for subsequent processing and use.
[0054] It should be noted that the screen carrying component is like a container specifically used to display the screen. In smart TV applications, it can be understood as a reserved display area for subsequent display of TV screens or other multimedia content.
[0055] It should be noted that the holder of the screen-bearing component can be understood as the object that manages and operates the component, through which the Surface can be obtained and callbacks can be set to monitor changes in the life cycle of the Surface.
[0056] In this way, the layout including the screen-bearing components is initialized through the user interface layer of the non-system application, and the creation event of the first screen-bearing surface object is listened to through the callback interface. This can ensure that the object is obtained in time after the screen-bearing surface object is created, and prepare for its subsequent transfer to the background source management end. This is the prerequisite for realizing cross-process Surface transfer, ensuring that non-system applications can nestedly display real-time TV source images, thereby realizing efficient multi-application collaborative rendering and improving user experience.
[0057] In some embodiments, the cross-process communication channel is established through an AIDL interface. Specifically: first, an AIDL interface file (such as ISurfaceService.aidl) is created to declare the methods that need to be called and the data types that need to be transferred between the non-system application and the source management end. This interface defines the method for the non-system application and the source management end to transfer Surface objects and send source control instructions. This interface file will be compiled into Java code by the Android tool; then, a service (Service) that implements the AIDL interface is created on the main interface control end of the non-system application. This service listens for connection requests from the source management end and transfers the Surface object to the source management end when the request arrives; then the source management end obtains the AIDL interface instance of the non-system application by binding to the service of the non-system application. Through this instance, the source management end can call the method in the interface and receive the Surface object transferred by the non-system application. In this way, the non-system application and the source management end establish a cross-process communication channel through the AIDL interface, realize the cross-process transfer of Surface objects, thereby providing a basis for subsequent rendering operations.
[0058] In some embodiments, a source rendering request and a first screen bearing surface object transmitted by a non-system application are received through a preset cross-process communication channel. Specifically, after a cross-process communication channel is established between the non-system application and the source management end, the non-system application can transmit the source rendering request and the first screen bearing surface object to the source management end through the cross-process communication channel. This process utilizes Android's Binder mechanism to ensure the secure transmission of the first screen bearing surface object between different processes.
[0059] It should be noted that the source rendering request is an instruction sent by the non-application system to the source management end to control the signal source, such as startup, shutdown and channel switching. The source management end controls the interaction between the TV view component and the system source module based on this to realize the rendering of the signal source on the screen carrying component of the non-system application.
[0060] It should be noted that non-system applications refer to ordinary user applications running in the smart TV system, which usually do not have system-level permissions. They interact with users through the interface, but cannot directly access system-level resources (such as TVView components). Therefore, they need to send requests to the source management end through cross-process communication (such as AIDL) to achieve indirect control and display of the TV source. The source management end refers to the background service or application in the system responsible for managing and controlling the TV source. It has the permission to access and operate the TVView component, can control the output of the TV source according to the request of the non-system application, receive the Surface object and source rendering request passed by the non-system application through AIDL, and render the TV screen to the specified Surface, realizing the function of non-system application nested display of real-time TV screen.
[0061] It should be noted that traditional picture-in-picture can only be controlled by the source management end Surface. This solution allows non-system applications to send the Surface object of the user interface layer to the source management end for the first time through the AIDL interface to achieve cross-process rendering, that is, rendering the TV screen on non-system applications.
[0062] Step S102: Call the private interface method of the TV view component through the reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and call the control interface of the TV view component according to the source rendering request to drive the source output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the screen bearing component of the non-system application to realize source rendering.
[0063] In some embodiments, the calling of the private interface method of the TV view component through the reflection mechanism is specifically as follows: obtaining the manufacturer information of the TV view component, and searching the class name corresponding to the manufacturer information from a preset mapping table to obtain a candidate class name list, wherein the preset mapping table is a mapping relationship table established in advance based on the component manufacturer information and the potential TV view class name; traversing the candidate class name list, and dynamically detecting through the reflection mechanism whether the class in the candidate class name list contains a private interface method for setting the first screen bearing surface object; if so, calling the corresponding private interface method. Specifically, first, the source management end obtains the manufacturer information of the TV view component by calling the interface or method provided by the system. For example, in the Android system, Build.MANUFACTURER can be used to obtain the manufacturer information of the device; then, the class name corresponding to the manufacturer information is searched from the preset mapping table to obtain a list of candidate class names. This preset mapping table is established in advance based on the component manufacturer information and potential TV view class names. It stores possible class names of TV view components of different manufacturers. For example, for Sony manufacturers, possible class names include "com.sony.tv.TvView", "com.sony.tv.TvSurfaceView", etc.; for Samsung manufacturers, possible class names include "com.samsung.android.tv.TvView", "com.samsung.tv.TvSurface", etc. Then, traverse the list of candidate class names, and for each class name in the list, use the reflection mechanism to try to obtain the class, and dynamically load the class through the Class.forName(className) method. For the successfully loaded class, continue to use the reflection mechanism to dynamically detect whether the class contains a private interface method for setting the first screen bearing surface object. If it is detected that a class contains the private interface method, use the Method.invoke() method in the reflection mechanism to call the corresponding method, and pass the first screen bearing surface object as a parameter to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object.
[0064] It should be noted that the reflection mechanism is a technology that dynamically obtains class information and calls its methods at runtime. In Java, you can use the Class.forName() method to obtain the class object of a class, and then use the getDeclaredMethod() method to detect whether the class contains a specific method.
[0065] In this way, by obtaining the manufacturer information of the TV view component and finding the corresponding class name list, and using the reflection mechanism to dynamically detect and call private interface methods, compatibility and adaptation of TVView components from different manufacturers can be achieved, ensuring that the multi-application collaborative rendering method can run effectively on TV devices of various brands and models, avoiding compatibility issues caused by differences in manufacturer interfaces, thereby improving the versatility and stability of the system and providing users with a broader and more consistent picture-in-picture function experience.
[0066] In some embodiments, after dynamically detecting whether a class in the candidate class name list contains a private interface method for setting the first screen bearing surface object through a reflection mechanism, the method further includes: if a class in the candidate class name list does not contain a method for setting the first screen bearing surface object, traversing the system class and determining whether the system class contains a preset system keyword through fuzzy matching; if the system class contains the preset system keyword, attempting to load the system class and detecting whether it contains the private interface method; if the system class does not contain the private interface method, using the interface method corresponding to the TV native interface. Specifically, if a class in the candidate class name list does not contain a private interface method for setting the first screen bearing surface object, such as setSessionSurface, traversing the system class and determining whether the system class contains a preset system keyword, such as "Tv" and "View", through fuzzy matching. For a system class containing a preset system keyword, attempting to load the class and detecting whether it contains the target private interface method; if a system class containing the target method is found, calling the method to replace the screen bearing surface object; if neither the candidate class name list nor the system class contains the target method, using the interface method corresponding to the TV native interface.
[0067] It should be noted that if the system class containing the target method is not found, it may also be displayed as unsupported on the screen-bearing component of the non-system application.
[0068] It should be noted that traditional TV view components (or similar TV rendering components from various manufacturers) are usually only allowed to bind fixed Surfaces within the system service, and do not expose the rendering Surface replacement interface. At the same time, there is a coupling between the rendering Surface and OpenGL ES, which makes it impossible to switch the target Surface at runtime. These limitations make it difficult for non-system applications to achieve nested display and dynamic rendering of TV source images, greatly limiting the flexibility and scalability of applications. In contrast, this application cleverly bypasses the system layer's exclusive control over TV sources through cross-process Surface transfer and reflection technology, and achieves the nested display of real-time TV images by non-privileged applications. Its core innovation lies in the dynamic replacement of rendering targets and multi-vendor adaptation layers, allowing background services to take over the Surface and direct TV source output to non-system applications.
[0069] In this way, by dynamically adapting to TV view components from different manufacturers, the wide compatibility of the multi-application collaborative rendering method is ensured, functional failures caused by differences in manufacturer interfaces are avoided, and the efficiency and stability of multi-application collaborative rendering are ensured, thereby improving the user experience.
[0070] In some embodiments, the second screen bearing surface object originally bound to the TV view component is replaced with the first screen bearing surface object. Specifically, after determining the private interface method of the TV view component (such as setSessionSurface), the second screen bearing surface object originally bound to the TV view component is replaced with the first screen bearing surface object passed by the non-system application. In this way, the rendering output target of the TV view component is switched from the original second screen bearing surface object to the first screen bearing surface object.
[0071] In some embodiments, the control interface of the television view component is called according to the source rendering request to drive the source output to the first screen bearing surface object, so as to reuse the open graphics library of the television view component in the screen bearing component of the non-system application to realize source rendering. Specifically, since the television view component has created an OpenGL ES graphics context, that is, an open graphics library, during initialization, the source management end reuses the OpenGL ES graphics context of the television view component through a shared context mechanism. In this way, the rendering of the television source can utilize existing graphics resources and states without the need to recreate them, thereby improving rendering efficiency. Finally, the television picture is displayed in the screen bearing component of the non-system application, realizing the nested display of real-time television source pictures by non-system-level applications.
[0072] It should be noted that in order to adapt to all brands of TVs, the source management end can use the class loader to identify and use the TV view component classes provided by different TV manufacturers (such as TizenView, BraviaView), and convert the TV view components into a unified standard interface (that is, the TvViewAdapter interface) to shield manufacturer differences and provide unified control capabilities.
[0073] In some embodiments, after the driving signal source is output to the first screen-bearing surface object, it also includes: obtaining the device resolution of the non-system application according to the user layout configuration requirements; based on the device resolution, calculating the adaptive rendering size according to the preset adaptation formula, and adjusting the size and position of the screen-bearing component according to the rendering size, and performing signal source rendering, wherein the rendering size includes width and height. Specifically, first, according to the user's needs (for example, the user wants to adjust the size or position of the picture-in-picture window), since different TV devices may have different screen sizes and resolutions, it is necessary to obtain the specific resolution parameters of the non-system application; then, based on the obtained device resolution, a pre-set adaptation formula is used to calculate the appropriate rendering size. This adaptation formula takes into account the proportional relationship between the actual resolution of the device and the reference resolution at the time of design, thereby calculating the appropriate rendering width and height on the current device; finally, the size and position of the bearing screen component (such as SurfaceView) are adjusted according to the calculated rendering size. This adjustment process includes setting the width and height of the component, as well as its position on the screen (such as the offset of the upper left corner). After adjusting the size and position, you can perform source rendering, which means displaying the TV image on the screen according to the new settings. The purpose of these steps is to ensure that the picture-in-picture window can be displayed correctly on different devices according to the size and ratio expected by the user, while avoiding picture distortion or exceeding the screen range.
[0074] In some embodiments, the adaptation formula is expressed as:
[0075] W r =(W d / W s )×W o ;
[0076] H r =(H d / H s )×H o ;
[0077] Where W r and H r is the rendered size after adjustment; W d and H d It is the resolution parameter for non-system applications; Ws and H s is the reference resolution (such as 1920×1080); W o and H o The original rendering size.
[0078] It should be noted that the cross-resolution dynamic adaptation algorithm provided by this application can ensure the uniformity of the PiP window ratio under different TV models, while supporting dynamic switching of window position and size during runtime to meet the layout requirements of multiple scenes (such as multi-channel PiP preview, user interactive adjustment); and combined with the Surface takeover mechanism, a complete "decoupled multi-source rendering" system is formed.
[0079] In this way, by dynamically adjusting the size and position of the screen-carrying components according to the device resolution, the consistency and adaptability of the picture-in-picture window on different devices are ensured, thereby improving the flexibility and visual effects of multi-application collaborative rendering and enhancing the user experience.
[0080] In some embodiments, after the source rendering is implemented by reusing the open graphics library of the TV view component in the screen bearing component of the non-system application, it also includes: the non-system application monitors the first screen bearing surface object; if a destruction callback event is monitored, the source management end is notified through the cross-process communication channel to release the relevant rendering resources. Specifically, when the non-system application initializes the screen bearing surface component, the creation and destruction events of the first screen bearing surface object are monitored by implementing the listener SurfaceHolder.Callback of the callback interface. If it is detected that the first screen bearing surface object is destroyed (such as surfaceDestroyed()), the method in the AIDL interface (such as onSurfaceDestroyed()) is called to notify the source management end of the destruction event. After receiving the destruction notification, the source management end performs corresponding resource release operations, such as stopping the rendering of the TV source, releasing the resources related to the Surface, etc.
[0081] In this way, by monitoring the first screen-bearing surface object, the timely release and management of resources can be ensured, resource waste and potential memory leaks can be avoided, thereby improving the efficiency and stability of the system, ensuring the smoothness and response speed of multiple applications working together on the TV system, and improving the user experience.
[0082] In some embodiments, after the source rendering is implemented by reusing the open graphics library of the TV view component in the screen carrying component of the non-system application, it also includes: if a TV source abnormality is detected, the error status information is called back to the non-system application through the cross-process communication channel; the non-system application updates the user interface based on the received error status information and displays an error prompt according to preset rules. Specifically, the source management end is responsible for interacting with the TV source module, and will regularly or in real time detect the status of the TV source, such as signal strength, whether it is a black screen, decoding errors, etc. When the source management end detects a TV source abnormality (such as signal loss, decoding failure, channel unavailable, etc.), it will generate corresponding error status information and send the error status information to the non-system application through the cross-process communication channel, wherein the error status information includes the abnormality type, abnormality description, etc. After the non-system application receives these error messages, it will update the user interface according to the preset rules to display the corresponding error prompt to inform the user of the current TV source status problem. This can ensure that the user is aware of the abnormality of the TV source in a timely manner and improve the user experience.
[0083] This ensures that when an anomaly occurs in the TV signal source, non-system applications can receive error notifications in a timely manner and update the user interface accordingly, thereby improving the reliability and stability of the system.
[0084] The embodiment of the present invention allows receiving source rendering requests and first screen bearing surface objects from non-system applications by establishing a cross-process communication channel, breaking the limitation of traditional methods that only the source management end can control the source and object, so that non-system applications can also participate in the rendering process of the source, which is helpful for the subsequent efficient multi-application collaborative rendering; calling the private interface method of the TV view component through the reflection mechanism, replacing the originally bound second screen bearing surface object with the first screen bearing surface object, so that the rendering output of the TV view component can be dynamically directed to the first screen bearing surface provided by the non-system application, realizing flexible switching of rendering targets; by reusing the open graphics library of the TV view component, the overhead of recreating and initializing graphics resources when switching rendering targets is avoided, significantly improving the efficiency of multi-application collaborative rendering, and thus improving user experience. Compared with the existing technology, the present application can achieve efficient multi-application collaborative rendering and improve user experience.
[0085] like Figure 2 As shown, based on the above method embodiment, a corresponding device embodiment is provided;
[0086] An embodiment of the present invention provides a multi-application collaborative rendering system for television, comprising: a receiving module 100 and a rendering module 200;
[0087] The receiving module 100 is configured to receive a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application;
[0088] The rendering module 200 is used to call the private interface method of the TV view component through the reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and call the control interface of the TV view component according to the source rendering request to drive the source output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the screen bearing component of the non-system application to realize source rendering.
[0089] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present invention, which can implement any of the above-mentioned method embodiments of the present invention to provide a multi-application collaborative rendering method for television.
[0090] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Furthermore, in the drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which may be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement the present invention without inventive effort.
[0091] Based on the above-mentioned embodiment of the multi-application collaborative rendering method for TV, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the multi-application collaborative rendering method for TV of any embodiment of the present invention is implemented.
[0092] For example, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more module elements may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0093] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0094] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0095] Based on the above-mentioned method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the multi-application collaborative rendering method for TV as described in any one of the above-mentioned method embodiments of the present invention.
[0096] Wherein, the module / unit integrated in the device / terminal equipment, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0097] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A multi-application collaborative rendering method for television, characterized in that: include: Receiving a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application; The private interface method of the TV view component is called through the reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and the control interface of the TV view component is called according to the source rendering request to drive the source output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the screen bearing component of the non-system application to realize source rendering.
2. The TV-oriented multi-application collaborative rendering method according to claim 1, characterized in that: The first screen bearing surface object is obtained from a screen bearing component created by a non-system application, specifically: Initializing a layout including the screen bearing component in the user interface layer of the non-system application, and monitoring a creation event of the first screen bearing surface object through a callback interface of the holder of the screen bearing component; If the creation is completed, the first screen bearing surface object is obtained in the callback event of the creation completion of the first screen bearing surface object.
3. The TV-oriented multi-application collaborative rendering method according to claim 1, characterized in that: The private interface method of the TV view component is called through the reflection mechanism, specifically: Obtaining the manufacturer information of the TV view component, and searching for the class name corresponding to the manufacturer information from a preset mapping table to obtain a candidate class name list, wherein the preset mapping table is a mapping relationship table pre-established based on the component manufacturer information and potential TV view class names; The candidate class name list is traversed, and a reflection mechanism is used to dynamically detect whether the class in the candidate class name list contains a private interface method for setting the first screen bearing surface object. If so, the corresponding private interface method is called.
4. The TV-oriented multi-application collaborative rendering method according to claim 3, characterized in that: After dynamically detecting whether a class in the candidate class name list includes a private interface method for setting the first screen bearing surface object through a reflection mechanism, the method further includes: If the class in the candidate class name list does not include a method for setting the first screen bearing surface object, then traversing the system class and determining whether the system class includes a preset system keyword through fuzzy matching; If the system class contains the preset system keyword, then try to load the system class and detect whether it contains the private interface method; If the system class does not include the private interface method, the interface method corresponding to the TV native interface is used.
5. The TV-oriented multi-application collaborative rendering method according to any one of claims 1 to 4, characterized in that: After the driving signal source is output to the first screen bearing surface object, the method further includes: Obtain device resolution for non-system applications based on user layout configuration requirements; Based on the device resolution, an adapted rendering size is calculated according to a preset adaptation formula, and the size and position of the screen carrying component are adjusted according to the rendering size, and source rendering is performed, wherein the rendering size includes width and height.
6. The TV-oriented multi-application collaborative rendering method according to any one of claims 1 to 4, characterized in that: After implementing source rendering by reusing the open graphics library of the television view component in the picture bearing component of the non-system application, the method further includes: The non-system application monitors the first screen bearing surface object; If a destruction callback event is monitored, the source management end is notified through the cross-process communication channel to release related rendering resources.
7. The TV-oriented multi-application collaborative rendering method according to any one of claims 1 to 4, characterized in that: After implementing source rendering by reusing the open graphics library of the television view component in the picture bearing component of the non-system application, the method further includes: If an abnormality in the TV signal source is detected, error status information is called back to the non-system application via the cross-process communication channel; The non-system application updates the user interface according to the received error status information and displays an error prompt according to a preset rule.
8. A multi-application collaborative rendering system for television, characterized in that: include: Receiving module and rendering module; The receiving module is configured to receive a source rendering request and a first screen bearing surface object transmitted by a non-system application through a preset cross-process communication channel, wherein the cross-process communication channel is established through an AIDL interface, and the first screen bearing surface object is obtained from a screen bearing component created by the non-system application; The rendering module is configured to call the private interface method of the TV view component through a reflection mechanism to replace the second screen bearing surface object originally bound to the TV view component with the first screen bearing surface object, and call the control interface of the TV view component according to the signal source rendering request to drive the signal source to be output to the first screen bearing surface object, so as to reuse the open graphics library of the TV view component in the non-system application's screen bearing component to implement signal source rendering.
9. A terminal device, characterized in that: include: one or more processors; a memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the TV-oriented multi-application collaborative rendering method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-application collaborative rendering method for television according to any one of claims 1 to 7 is implemented.