A television-oriented multi-application collaborative rendering method, system, device and medium
By implementing cross-process communication and reflection mechanisms to achieve collaborative rendering of multiple applications in smart TV systems, the problem of system-level applications monopolizing information sources is solved, user experience and system compatibility are improved, and the flexibility and stability of multiple applications are ensured.
Patent Information
- Application Number
- CN202510894676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In existing smart TV systems, multi-application collaborative rendering is limited by the system-level application's exclusive control over the TV signal source and display Surface, making it difficult for third-party applications to embed into real-time TV images, thus limiting user experience and application flexibility.
By establishing a cross-process communication channel to receive source rendering requests from non-system applications, using reflection to call the private interface methods of the TV view component, dynamically replacing the screen carrier object, and reusing the open graphics library, source rendering is achieved.
It enables efficient multi-application collaborative rendering for non-system applications, improving user experience and system versatility and stability, supporting compatibility with TV devices from different manufacturers, and avoiding resource waste and memory leaks.
Smart Images

Figure CN120614490B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of television rendering, and more particularly to a multi-application collaborative rendering method, system, device, and medium for television. Background Technology
[0002] As the application scenarios of smart TVs continue to expand, users are no longer satisfied with the functional experience of a single application and are increasingly demanding collaborative rendering of multiple applications.
[0003] Currently, the picture-in-picture function of most smart TV systems relies on system-level applications or services to control access permissions between the TV signal source and the display Surface. This approach has several drawbacks. On the one hand, it creates a technical barrier, making it difficult for third-party applications to embed live TV footage into their interfaces, severely restricting the improvement of user experience. On the other hand, due to the system's exclusive control over resources, efficient collaboration between different applications is difficult, and users cannot freely combine application display methods and interaction logic according to their own needs, limiting application flexibility. Therefore, implementing multi-application collaborative rendering in non-system applications can break this limitation, meet users' needs for multitasking and diverse content viewing, greatly enhance the functionality and competitiveness of applications, bring users a richer and more convenient user experience, and also promote the diversification of the smart TV application ecosystem. Summary of the Invention
[0004] This invention provides a method, system, device, and medium for multi-application collaborative rendering for television, 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, comprising:
[0006] The system receives source rendering requests and a first screen carrier object from non-system applications through a preset cross-process communication channel. The cross-process communication channel is established through the AIDL interface, and the first screen carrier object is obtained from the screen carrier component created by the non-system application.
[0007] By invoking the private interface method of the TV view component through reflection, the second screen carrier object originally bound to the TV view component is replaced with the first screen carrier object. The control interface of the TV view component is then invoked according to the source rendering request to drive the source output to the first screen carrier object. This allows the open graphics library of the TV view component to be reused in the screen carrier component of the non-system application to achieve source rendering.
[0008] This invention establishes a cross-process communication channel, allowing the reception of source rendering requests and first-screen carrier objects from non-system applications. This breaks the traditional limitation that only the source management end can control the source and object, enabling non-system applications to participate in the source rendering process and facilitating efficient multi-application collaborative rendering. By using reflection to call the private interface methods of the TV view component, the originally bound second-screen carrier object is replaced with the first-screen carrier object, allowing the rendering output of the TV view component to be dynamically directed to the first-screen carrier provided by a non-system application, achieving 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 enhancing the user experience. Compared with existing technologies, this application can achieve efficient multi-application collaborative rendering and improve the user experience.
[0009] Furthermore, the first screen-carrying surface object is obtained from a screen-carrying component not created by the system application, specifically as follows:
[0010] Initialize the layout containing the screen carrier component in the user interface layer of non-system applications, and listen for the creation event of the first screen carrier surface object through the callback interface of the holder of the screen carrier component;
[0011] If creation is complete, the first screen carrier object is retrieved in the callback event indicating that the creation of the first screen carrier object is complete.
[0012] This approach, which initializes the layout containing the screen-carrying components through the user interface layer of non-system applications and listens for the creation event of the first screen-carrying surface object through a callback interface, ensures that the object is obtained in a timely manner after its creation. This prepares the surface for subsequent transmission to the backend source management terminal, which is a prerequisite for cross-process Surface transmission. It ensures that non-system applications can nest and display real-time TV source images, thereby achieving efficient multi-application collaborative rendering and improving the user experience.
[0013] Furthermore, the invocation of the private interface method of the TV view component via reflection specifically involves:
[0014] Obtain the manufacturer information of the TV view component, and search for the class name corresponding to the manufacturer information from the preset mapping table to obtain a list of candidate class names. The preset mapping table is a mapping relationship table established in advance 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 carrier object. If it does, the corresponding private interface method is called.
[0016] By obtaining the manufacturer information of the TV View component and looking up the corresponding class name list, and using reflection to dynamically detect and call private interface methods, compatibility and adaptation of TVView components from different manufacturers can be achieved. This ensures 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. This improves the system's versatility and stability, providing users with a wider and more consistent picture-in-picture experience.
[0017] Furthermore, after dynamically detecting whether the classes in the candidate class name list contain a private interface method for setting the first screen carrier object through reflection, the method further includes:
[0018] If the class in the candidate class name list does not contain a method for setting the first screen carrying surface object, then the system classes are traversed and fuzzy matching is used to determine whether the system class contains a preset system keyword;
[0019] If the system class contains the preset system keyword, then attempt to load the system class and check whether it contains the private interface method;
[0020] If the system class does not contain the private interface method, then the interface method corresponding to the TV native interface shall be used.
[0021] By dynamically adapting TV view components from different manufacturers, this approach ensures broad compatibility of multi-application collaborative rendering methods, avoids functional failures caused by differences in manufacturer interfaces, ensures the efficiency and stability of multi-application collaborative rendering, and thus improves the user experience.
[0022] Furthermore, after the driving signal source outputs to the first screen carrying surface object, the method further includes:
[0023] Based on the user's layout configuration requirements, obtain the device resolution of non-system applications;
[0024] Based on the device resolution, the adapted rendering size is calculated according to a preset adaptation formula, and the size and position of the image-carrying components are adjusted according to the rendering size, and source rendering is performed. The rendering size includes width and height.
[0025] By dynamically adjusting the size and position of the components that carry the picture based on the device resolution, the consistency and adaptability of the picture-in-picture window are ensured across different devices, thereby improving the flexibility and visual effects of multi-application collaborative rendering and enhancing the user experience.
[0026] Furthermore, after reusing the open graphics library of the television view component in the picture-carrying component of a non-system application to implement source rendering, the method further includes:
[0027] Non-system applications listen to the first screen carrying surface object;
[0028] If a destruction callback event is detected, the source management terminal is notified through the cross-process communication channel to release the relevant rendering resources.
[0029] By monitoring the first screen-carrying surface object, timely release and management of resources can be ensured, avoiding resource waste and potential memory leaks. This improves system efficiency and stability, ensures smoothness and responsiveness when multiple applications work together on the TV system, and enhances the user experience.
[0030] Furthermore, after reusing the open graphics library of the television view component in the picture-carrying component of a non-system application to implement source rendering, the method further includes:
[0031] If an abnormality is detected in the television signal source, error status information is sent back to non-system applications through the cross-process communication channel.
[0032] Non-system applications update the user interface based on the received error status information and display error messages according to preset rules.
[0033] This ensures that when an anomaly occurs in the television 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 provides a multi-application collaborative rendering system for television, comprising: a receiving module and a rendering module;
[0035] The receiving module is used to receive a source rendering request and a first screen carrier object transmitted by a non-system application through a preset cross-process communication channel. The cross-process communication channel is established through an AIDL interface, and the first screen carrier object is obtained from the screen carrier component created by the non-system application.
[0036] The rendering module is used to call the private interface method of the TV view component through reflection mechanism to replace the second screen carrier object originally bound to the TV view component with the first screen carrier object, and to call the control interface of the TV view component according to the source rendering request to drive the source output to the first screen carrier object, so as to reuse the open graphics library of the TV view component to realize source rendering in the screen carrier component of non-system applications.
[0037] This invention establishes a cross-process communication channel, allowing the reception of source rendering requests and first-screen carrier objects from non-system applications. This breaks the traditional limitation that only the source management end can control the source and object, enabling non-system applications to participate in the source rendering process and facilitating efficient multi-application collaborative rendering. By using reflection to call the private interface methods of the TV view component, the originally bound second-screen carrier object is replaced with the first-screen carrier object, allowing the rendering output of the TV view component to be dynamically directed to the first-screen carrier provided by a non-system application, achieving 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 enhancing the user experience. Compared with existing technologies, this application can achieve efficient multi-application collaborative rendering and improve the user experience.
[0038] Another embodiment of the present invention 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, wherein 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 also provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform the steps of the multi-application collaborative rendering method for television as described in the present invention. Attached Figure Description
[0040] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating an embodiment of the multi-application collaborative rendering method for television provided in this application;
[0042] Figure 2 This is a schematic diagram of the structure of one embodiment of the multi-application collaborative rendering system for television provided in this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort 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 one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0045] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0046] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0047] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0048] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0049] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0050] With the increasing popularity of smart TVs, users' demand for multi-application collaborative rendering is constantly growing. Existing picture-in-picture functionality typically involves system-level applications exclusively controlling the TV signal source and display surface, creating a technical barrier that prevents third-party applications from embedding real-time TV footage, limiting user experience and application flexibility. Therefore, achieving multi-application collaborative rendering in non-system applications is crucial. It can enhance application functionality and competitiveness, meet users' multitasking needs, and promote the diversified development of the smart TV application ecosystem.
[0051] See Figure 1 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: Receive the source rendering request and the first screen carrier object transmitted by the non-system application through a preset cross-process communication channel. The cross-process communication channel is established through the AIDL interface, and the first screen carrier object is obtained from the screen carrier component created by the non-system application.
[0053] In some embodiments, the first screen carrier object is obtained from a screen carrier component created by a non-system application. Specifically, the layout containing the screen carrier component is initialized in the user interface layer of the non-system application, and the creation event of the first screen carrier object is listened to through the callback interface of the holder of the screen carrier component. If the creation is completed, the first screen carrier object is obtained in the callback event of the completion of the creation of the first screen carrier object. Specifically, the process is as follows: First, in the user interface layer of non-system applications, SurfaceView or its subclasses are used as the screen carrier component, and the screen carrier component is configured accordingly in the layout file, such as setting its position, size, and other attributes. Then, the listener of the callback interface (i.e., SurfaceHolder) is set through the holder of the screen carrier component (i.e., SurfaceHolder.Callback) to wait for and receive the event notification sent by the screen carrier component regarding the creation of the first carrier screen object (Surface object). Subsequently, after the screen carrier component completes the creation of its internal first carrier screen object, it will automatically call the corresponding method of the previously set callback interface, i.e., surfaceCreated(), through the holder to notify that the first carrier screen object has been created. Once the notification that the first carrier screen object has been created is received from the screen carrier component, the created first carrier screen object 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 image carrier component is like a container specifically designed to display images. In smart TV applications, it can be understood as a reserved display area for later displaying TV images or other multimedia content.
[0055] It should be noted that the holder of the screen-carrying component can be understood as the object that manages and operates the component. Through it, you can obtain the Surface and set callbacks to listen for changes in the Surface's lifecycle.
[0056] This approach, which initializes the layout containing the screen-carrying components through the user interface layer of non-system applications and listens for the creation event of the first screen-carrying surface object through a callback interface, ensures that the object is obtained in a timely manner after its creation. This prepares the surface for subsequent transmission to the backend source management terminal, which is a prerequisite for cross-process Surface transmission. It ensures that non-system applications can nest and display real-time TV source images, thereby achieving efficient multi-application collaborative rendering and improving the user experience.
[0057] In some embodiments, the cross-process communication channel is established through an AIDL interface. Specifically: First, an AIDL interface file (e.g., ISurfaceService.aidl) is created, declaring the methods to be called and the data types to be passed between the non-system application and the source management terminal. This interface defines the methods for the non-system application and the source management terminal to pass Surface objects and send source control commands. This interface file is compiled into Java code by Android tools. Then, on the main interface control terminal of the non-system application, a service implementing the AIDL interface is created. This service listens for connection requests from the source management terminal and passes the Surface object to the source management terminal when the request arrives. Then, the source management terminal 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 terminal can call the methods in the interface to receive the Surface object passed from the non-system application. In this way, the non-system application and the source management terminal establish a cross-process communication channel through the AIDL interface, realizing the cross-process transfer of Surface objects, thus providing a foundation for subsequent rendering operations.
[0058] In some embodiments, the source rendering request and the first screen carrier object transmitted by the non-system application are received through a preset cross-process communication channel. Specifically, after the cross-process communication channel is established between the non-system application and the source management terminal, the non-system application can transmit the source rendering request and the first screen carrier object to the source management terminal through the cross-process communication channel. This process utilizes Android's Binder mechanism to ensure the secure transmission of the first screen carrier object between different processes.
[0059] It should be noted that the signal source rendering request is a command sent by a non-application system to the signal source management terminal to control the signal source, such as start, stop and channel switching. The signal source management terminal uses this command to control the interaction between the TV view component and the system signal source module to realize the rendering of the signal source on the non-system application's screen carrying component.
[0060] It's important to note that non-system applications refer to ordinary user applications running on the smart TV system. They typically lack system-level permissions and interact with users through a user interface, but cannot directly access system-level resources (such as the TVView component). Therefore, they need to send requests to the source management terminal via inter-process communication (such as AIDL) to indirectly control and display the TV source. The source management terminal refers to the background service or application in the system responsible for managing and controlling the TV source. It has permissions to access and operate the TVView component and can control the output of the TV source based on requests from non-system applications. It receives Surface objects and source rendering requests from non-system applications via AIDL and renders the TV image onto the specified Surface, enabling the function of nested display of real-time TV images by non-system applications.
[0061] It should be noted that traditional picture-in-picture can only be controlled by the source management terminal. This solution, through the AIDL interface, allows non-system applications to send the Surface object of the user interface layer to the source management terminal for the first time to achieve cross-process rendering, that is, to render the TV picture on a non-system application.
[0062] Step S102: The private interface method of the TV view component is called through the reflection mechanism to replace the second screen carrier object originally bound to the TV view component with the first screen carrier object. The control interface of the TV view component is called according to the source rendering request to drive the source to output to the first screen carrier object, so as to reuse the open graphics library of the TV view component to realize source rendering in the screen carrier component of the non-system application.
[0063] In some embodiments, the step of invoking the private interface method of the TV view component via reflection specifically involves: 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; traversing the candidate class name list and dynamically detecting whether the classes in the candidate class name list contain a private interface method for setting the first screen carrying surface object through reflection; if so, invoking the corresponding private interface method. Specifically, firstly, 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 device manufacturer information. Next, it searches for the class name corresponding to the manufacturer information in 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 the possible class names of TV view components from different manufacturers. For example, for Sony, possible class names include "com.sony.tv.TvView" and "com.sony.tv.TvSurfaceView"; for Samsung, possible class names include "com.samsung.android.tv.TvView" and "com.samsung.tv.TvSurface"; Then, the candidate class name list is traversed. For each class name in the list, the reflection mechanism is used to try to obtain the class. The class is dynamically loaded using the Class.forName(className) method. For classes that are successfully loaded, the reflection mechanism is used to dynamically detect whether the class contains a private interface method for setting the first screen carrier object. If a class is found to contain the private interface method, the Method.invoke() method in the reflection mechanism is used to call the corresponding method, and the first screen carrier object is passed in as a parameter to replace the second screen carrier object originally bound to the TV view component with the first screen carrier object.
[0064] It should be noted that reflection is a technique that dynamically obtains class information and calls its methods at runtime. In Java, you can obtain the class object of a class using the Class.forName() method, and then use the getDeclaredMethod() method to check whether the class contains a specific method.
[0065] By obtaining the manufacturer information of the TV View component and looking up the corresponding class name list, and using reflection to dynamically detect and call private interface methods, compatibility and adaptation of TVView components from different manufacturers can be achieved. This ensures 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. This improves the system's versatility and stability, providing users with a wider and more consistent picture-in-picture experience.
[0066] In some embodiments, after dynamically detecting whether the classes in the candidate class name list contain a private interface method for setting the first screen carrier surface object through reflection, the method further includes: if the classes in the candidate class name list do not contain a method for setting the first screen carrier surface object, then traversing system classes and determining whether the system class contains a preset system keyword through fuzzy matching; if the system class contains the preset system keyword, then 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, then using the interface method corresponding to the TV native interface. Specifically, if the classes in the candidate class name list do not contain a private interface method for setting the first screen carrier surface object, such as setSessionSurface, then traversing system classes and determining whether the system class contains a preset system keyword, such as "Tv" and "View", through fuzzy matching. For system classes containing the 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, then calling the method to replace the screen carrier surface object; if neither the candidate class name list nor the system class contains the target method, then using the interface method corresponding to the TV native interface.
[0067] It should be noted that if a system class containing the target method is not found, it may also be displayed as unsupported on the screen-carrying component of a non-system application.
[0068] It should be noted that traditional TV view components (or similar TV rendering components from various vendors) typically only allow binding of fixed Surfaces within system services, without exposing rendering Surface replacement interfaces externally. Furthermore, the coupling between the rendering Surface and OpenGL ES prevents runtime switching of the target Surface. These limitations make it difficult for non-system applications to achieve nested display and dynamic rendering of TV source images, significantly restricting application flexibility and scalability. In contrast, this application cleverly bypasses the system layer's exclusive control over TV source images through cross-process Surface transfer and reflection technology, enabling non-privileged applications to nest and display real-time TV images. Its core innovation lies in dynamically replacing the rendering target and multi-vendor adaptation layers, allowing background services to take over the Surface and direct TV source output to non-system applications.
[0069] By dynamically adapting TV view components from different manufacturers, this approach ensures broad compatibility of multi-application collaborative rendering methods, avoids functional failures caused by differences in manufacturer interfaces, ensures the efficiency and stability of multi-application collaborative rendering, and thus improves the user experience.
[0070] In some embodiments, the second screen carrier object originally bound to the TV view component is replaced with the first screen carrier object. Specifically, after determining the private interface method (such as setSessionSurface) of the TV view component, the second screen carrier object originally bound to the TV view component is replaced with the first screen carrier object passed by a non-system application. In this way, the rendering output target of the TV view component is switched from the original second screen carrier object to the first screen carrier object.
[0071] In some embodiments, the control interface of the TV view component is invoked according to the source rendering request to drive the source output to the first screen carrier object, so as to reuse the open graphics library of the TV view component in the screen carrier component of the non-system application to realize source rendering. Specifically, since the TV view component has already created an OpenGL ES graphics context, i.e., an open graphics library, during initialization, the source management end reuses the OpenGL ES graphics context of the TV view component through a shared context mechanism. In this way, the rendering of the TV source can utilize existing graphics resources and states without recreating them, thereby improving rendering efficiency. Finally, the TV picture is displayed in the screen carrier component of the non-system application, realizing the nested display of real-time TV source picture in a non-system application.
[0072] It should be noted that, in order to adapt to TVs of all brands, the source management terminal can use a class loader to identify and use TV view component classes (such as TizenView and BraviaView) provided by different TV manufacturers, and convert the TV view components into a unified standard interface (i.e., 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-carrying surface object, the method further includes: obtaining the device resolution of a non-system application according to the user's layout configuration requirements; calculating the adapted rendering size based on the device resolution using a preset adaptation formula, adjusting the size and position of the screen-carrying component according to the rendering size, and performing signal source rendering, wherein the rendering size includes width and height. Specifically, firstly, according to the user's needs (e.g., 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 suitable rendering size is calculated using a preset adaptation formula. This adaptation formula takes into account the proportional relationship between the actual resolution of the device and the reference resolution during design, thereby calculating the appropriate rendering width and height on the current device; finally, the size and position of the screen-carrying component (e.g., 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 (e.g., the offset of the upper left corner). After adjusting the size and position, source rendering can be performed, which means displaying the TV picture 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 according to the user's expected size and proportion on different devices, while avoiding image distortion or exceeding the screen range.
[0074] In some embodiments, the expression of the adaptation formula is:
[0075] W r =(W d / W s )×W o ;
[0076] H r =(H d / H s )×H o ;
[0077] In the formula, W r and H r To adjust the rendered size; W d and H d For resolution parameters not used in system applications; Ws and H s For reference resolution (e.g., 1920×1080); W o and H o This is the original rendering size.
[0078] It should be noted that the cross-resolution dynamic adaptation algorithm provided in this application can ensure that the PiP window ratio is consistent across different TV models, while supporting dynamic switching of window position and size at runtime to meet the layout requirements of multiple scenarios (such as multi-channel PiP preview and user interaction adjustment); and combined with the Surface takeover mechanism, it forms a complete "decoupled multi-source rendering" system.
[0079] By dynamically adjusting the size and position of the components that carry the picture based on the device resolution, the consistency and adaptability of the picture-in-picture window are ensured across different devices, thereby improving the flexibility and visual effects of multi-application collaborative rendering and enhancing the user experience.
[0080] In some embodiments, after reusing the open graphics library of the TV view component in the screen carrier component of the non-system application to implement source rendering, the method further includes: the non-system application listening to the first screen carrier surface object; if a destruction callback event is detected, 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 carrier surface component, it listens for the creation and destruction events of the first screen carrier surface object through the listener SurfaceHolder.Callback that implements the callback interface. If the destruction of the first screen carrier surface object is detected (e.g., surfaceDestroyed()), the method in the AIDL interface (e.g., 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 and releasing the resources related to the Surface.
[0081] By monitoring the first screen-carrying surface object, timely release and management of resources can be ensured, avoiding resource waste and potential memory leaks. This improves system efficiency and stability, ensures smoothness and responsiveness when multiple applications work together on the TV system, and enhances the user experience.
[0082] In some embodiments, after reusing the open graphics library of the TV view component in the screen-carrying component of the non-system application to implement source rendering, the method further includes: if a TV source abnormality is detected, sending error status information back to the non-system application through the cross-process communication channel; the non-system application updates the user interface according to the received error status information and displays error prompts according to preset rules. Specifically, the source management terminal is responsible for interacting with the TV source module and periodically or in real time detects the status of the TV source, such as signal strength, whether the screen is black, decoding errors, etc. When the source management terminal detects a TV source abnormality (such as signal loss, decoding failure, channel unavailability, etc.), it generates corresponding error status information and sends the error status information to the non-system application through the cross-process communication channel. The error status information includes the abnormality type, abnormality description, etc. After receiving these error messages, the non-system application updates the user interface according to preset rules to display corresponding error prompts, informing the user of the current TV source status problem. This ensures that the user is aware of the abnormality of the TV source in a timely manner, improving the user experience.
[0083] This ensures that when an anomaly occurs in the television 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] This invention establishes a cross-process communication channel, allowing the reception of source rendering requests and first-screen carrier objects from non-system applications. This breaks the traditional limitation that only the source management end can control the source and object, enabling non-system applications to participate in the source rendering process and facilitating efficient multi-application collaborative rendering. By using reflection to call the private interface methods of the TV view component, the originally bound second-screen carrier object is replaced with the first-screen carrier object, allowing the rendering output of the TV view component to be dynamically directed to the first-screen carrier provided by a non-system application, achieving 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 enhancing the user experience. Compared with existing technologies, this application can achieve efficient multi-application collaborative rendering and improve the user experience.
[0085] like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided;
[0086] One embodiment of the present invention provides a multi-application collaborative rendering system for television, including: a receiving module 100 and a rendering module 200;
[0087] The receiving module 100 is used to receive a source rendering request and a first screen carrier object transmitted by a non-system application through a preset cross-process communication channel. The cross-process communication channel is established through an AIDL interface, and the first screen carrier object is obtained from the screen carrier 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 reflection mechanism to replace the second screen carrier object originally bound to the TV view component with the first screen carrier object, and to call the control interface of the TV view component according to the source rendering request to drive the source output to the first screen carrier object, so as to reuse the open graphics library of the TV view component to realize source rendering in the screen carrier component that is not a system application.
[0089] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the multi-application collaborative rendering method for television provided by any of the above-described method embodiments of the present invention.
[0090] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0091] Based on the above embodiments of the multi-application collaborative rendering method for television, 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, it implements the multi-application collaborative rendering method for television according to any embodiment of the present invention.
[0092] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0093] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0094] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting various parts of the terminal device via various interfaces and lines.
[0095] Based on the above-described 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 executed, it controls the device where the computer-readable storage medium is located to execute the multi-application collaborative rendering method for television described in any of the above-described method embodiments of the present invention.
[0096] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0097] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and 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: The system receives source rendering requests and a first screen carrier object from non-system applications through a preset cross-process communication channel. The cross-process communication channel is established through the AIDL interface, and the first screen carrier object is obtained from the screen carrier component created by the non-system application. By invoking the private interface method of the TV view component through reflection mechanism, the second screen carrier object originally bound to the TV view component is replaced with the first screen carrier object. 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 carrier object, so as to reuse the open graphics library of the TV view component to realize source rendering in the screen carrier component of non-system application. Specifically, the step of invoking the private interface method of the TV view component via reflection involves: 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. The preset mapping table is a mapping relationship table established in advance based on the component manufacturer information and potential TV view class names. The candidate class name list is traversed, and the reflection mechanism is used to dynamically detect whether the classes in the candidate class name list contain a private interface method for setting the first screen carrying surface object. If so, the corresponding private interface method is invoked.
2. The multi-application collaborative rendering method for television according to claim 1, characterized in that, The first screen-carrying surface object is obtained from a screen-carrying component created by a non-system application, specifically: Initialize the layout containing the screen carrier component in the user interface layer of non-system applications, and listen for the creation event of the first screen carrier surface object through the callback interface of the holder of the screen carrier component; If creation is complete, the first screen carrier object is retrieved in the callback event indicating that the creation of the first screen carrier object is complete.
3. The multi-application collaborative rendering method for television according to claim 1, characterized in that, After dynamically detecting whether the classes in the candidate class name list contain a private interface method for setting the first screen carrier object through reflection, the method further includes: If the class in the candidate class name list does not contain a method for setting the first screen carrying surface object, then the system classes are traversed and fuzzy matching is used to determine whether the system class contains a preset system keyword; If the system class contains the preset system keyword, then attempt to load the system class and check whether it contains the private interface method; If the system class does not contain the private interface method, then the interface method corresponding to the TV native interface shall be used.
4. The multi-application collaborative rendering method for television according to any one of claims 1-3, characterized in that, After the driving signal source outputs to the first screen carrying surface object, the following is also included: Based on the user's layout configuration requirements, obtain the device resolution of non-system applications; Based on the device resolution, the adapted rendering size is calculated according to a preset adaptation formula, and the size and position of the image-carrying components are adjusted according to the rendering size, and source rendering is performed. The rendering size includes width and height.
5. The multi-application collaborative rendering method for television according to any one of claims 1-3, characterized in that, After implementing source rendering using an open graphics library that reuses the television view component in the picture-carrying component of a non-system application, the method further includes: Non-system applications listen to the first screen carrying surface object; If a destruction callback event is detected, the source management terminal is notified through the cross-process communication channel to release the relevant rendering resources.
6. The multi-application collaborative rendering method for television according to any one of claims 1-3, characterized in that, After implementing source rendering using an open graphics library that reuses the television view component in the picture-carrying component of a non-system application, the method further includes: If an abnormality is detected in the television signal source, error status information is sent back to non-system applications through the cross-process communication channel. Non-system applications update the user interface based on the received error status information and display error messages according to preset rules.
7. A multi-application collaborative rendering system for television, characterized in that, include: Receive module and rendering module; The receiving module is used to receive a source rendering request and a first screen carrier object transmitted by a non-system application through a preset cross-process communication channel. The cross-process communication channel is established through an AIDL interface, and the first screen carrier object is obtained from the screen carrier component created by the non-system application. The rendering module is used to call the private interface method of the TV view component through reflection mechanism to replace the second screen carrier object originally bound to the TV view component with the first screen carrier object, and to call the control interface of the TV view component according to the source rendering request to drive the source output to the first screen carrier object, so as to reuse the open graphics library of the TV view component to realize source rendering in the screen carrier component of non-system application. Specifically, the step of invoking the private interface method of the TV view component via reflection involves: 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. The preset mapping table is a mapping relationship table established in advance based on the component manufacturer information and potential TV view class names. The candidate class name list is traversed, and the reflection mechanism is used to dynamically detect whether the classes in the candidate class name list contain a private interface method for setting the first screen carrying surface object. If so, the corresponding private interface method is invoked.
8. 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 multi-application collaborative rendering method for television as claimed in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-application collaborative rendering method for television as described in any one of claims 1-6.
Citation Information
Patent Citations
Cross-process off-screen rendering method and device, electronic equipment and storage medium
CN112486620A
Video picture exception recovery method and device based on TIF framework, medium and equipment
CN117499740A
