Video switching method and electronic device
By transmitting video playback control information in multi-screen collaboration technology, the problem of screen flickering and freezing when switching video streams is solved, achieving smooth video stream switching effects and improving user experience.
Patent Information
- Application Number
- PCT/CN2024/071677
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-28
- Filing Date
- 2024-01-10
- Publication Date
- 2024-10-03
AI Technical Summary
In multi-screen collaboration technology, flickering screens, black screens, or freezes are prone to occur when switching video streams between electronic devices, making it impossible to switch video streams smoothly.
By transmitting the video playback control information corresponding to the video stream in the first electronic device, the second electronic device can generate and display switching animations based on this information, thereby smoothly adjusting the position and size of the screen projection window when the video stream is switched.
It achieves a smooth transition when switching video streams, improving the user experience and the quality of collaborative operations between devices.
Smart Images

Figure CN2024071677_03102024_PF_FP_ABST
Abstract
Description
Video switching method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 28, 2023, with application number 202310341966.0 and application name “A video switching method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of electronic equipment, and in particular to a video switching method and electronic equipment. Background Art
[0003] With the development of electronic devices, interactions between them are becoming increasingly frequent. Multi-screen collaboration is a distributed technology that enables cross-system and cross-device collaboration, enabling resource sharing and collaborative operations between electronic devices. As one of the primary modes of electronic device interaction, multi-screen collaboration can overcome the shortcomings of individual devices, fully leverage the strengths of different devices, and thus enhance the user experience.
[0004] Taking the establishment of a collaborative operation connection between a first electronic device and a second electronic device as an example, the first electronic device can transmit video data to the second electronic device by transmitting a video stream, so as to realize the projection of the video played on the first electronic device to the second electronic device for display and playback.
[0005] However, when the display state of the window playing the video stream on the first electronic device changes, for example, when the first electronic device switches from landscape mode to portrait mode, the display content in the projection window of the second electronic device may flicker, go black, or freeze during the process of switching the display state of the projection window, resulting in an inability to smoothly switch the video stream.
[0006] Summary of the Invention
[0007] The embodiment of the present application provides a video switching method and electronic device, which can be applied in a collaborative operation scenario in which a first electronic device projects a screen to a second electronic device. Specifically, the first electronic device can transmit control information (such as position information, etc.) of the video playback control corresponding to the video stream to the second electronic device. When the first electronic device switches the display state of the window playing the video stream (that is, when switching the video stream), the second electronic device can determine the position information of the projection window transformation based on the control information, and then can generate and display a switching animation, so that the second electronic device can smoothly switch the video stream.
[0008] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0009] In a first aspect, a video switching method is provided, which can be applied to a second electronic device. Specifically, the method includes: the second electronic device receives a first video stream sent by a first electronic device, wherein the first video stream is display data when the first electronic device displays a window of a first application in a first state. Then, the second electronic device displays the first video stream in a first window on its display interface. Next, the second electronic device may also receive a second video stream and first control information sent by the first electronic device. The second video stream is display data when the first electronic device displays a window of the first application in a second state, the first control information is associated with the position of a first control in the window of the first application displayed in the second state, and the first control is a control for playing a video in the window of the first application. Then, the second electronic device can generate a switching animation based on the first window information, the first control information, and the second window information, so that the second electronic device switches from displaying the window of the first application in the first state to displaying the window of the first application in the second state. The first window information is associated with the first window, and the second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state. Furthermore, the display content of the switching animation generated by the second electronic device is related to the first application. Finally, after the switching animation display is completed, the second electronic device can display the first video stream in the second window of its display interface. The second window is associated with the second window information, that is, the position and size of the second window can be determined based on the second window information.
[0010] In this method, the second electronic device is able to receive the first control information sent by the first electronic device. In this way, when the state of the window of the first application displayed by the first electronic device changes, that is, when the video stream sent by the first electronic device to the first electronic device is switched from the first video stream to the second video stream, the second electronic device can determine the transformation position of the first window based on the first control information, the first window information and the second window information, and then generate and display the switching animation, so that the second electronic device can smoothly switch from displaying the window of the first application in the first state (i.e., the first window) to displaying the window of the first application in the second state (i.e., the second window), thereby improving the smoothness of the second electronic device switching the video stream.
[0011] In combination with the first aspect, in an optional implementation, the first control information is further associated with the size of the first control in the window of the first application displayed in the second state.
[0012] In this implementation, the second electronic device can more accurately determine the transformation position and size of the first window based on the first control information, that is, the position and size of the first control in the window of the first application displayed in the second state, which can further improve the smoothness of switching video streams by the second electronic device.
[0013] In conjunction with the first aspect, in an optional implementation, the first window information is associated with at least one of a position or a size of a window of a first application displayed in a first state by the first electronic device. Prior to displaying the first video stream in the first window of the second electronic device, the method further includes: the second electronic device receiving, from the first electronic device, at least one of a position or a size of a window of the first application displayed in the first state by the first electronic device.
[0014] In this implementation, the second electronic device can more accurately determine the first window information based on at least one of the position or size of the window of the first application displayed in the first state by the first electronic device. Furthermore, the second electronic device can accurately determine the position and size of the first window based on the first window information to display the first video stream in the first window, thereby realizing the function of projecting the first video stream on the second electronic device and improving the user experience. In addition, the second electronic device can also more accurately determine the starting position and size of the switching effect based on the first window information, thereby further improving the smoothness of the second electronic device switching video streams.
[0015] In combination with the first aspect, in an optional implementation, before the second electronic device generates a switching animation based on the first window information, the first control information and the second window information, the method also includes: the second electronic device receives the position of the window of the first application displayed in the second state by the first electronic device sent by the first electronic device.
[0016] In this way, the second electronic device can accurately determine the second window information based on the position of the window of the first application displayed in the second state by the first electronic device. Furthermore, when generating a switching animation, the second electronic device can determine the end position of the window displaying the switching animation based on the second window information, thereby further improving the smoothness of the second electronic device switching video streams.
[0017] In conjunction with the first aspect, in an optional implementation, the second window information is further associated with the size of the window of the first application displayed in the second state on the first electronic device. Therefore, before the second electronic device generates the transition animation based on the first window information, the first control information, and the second window information, the method further includes: the second electronic device receiving, from the first electronic device, the size of the window of the first application displayed in the second state on the first electronic device.
[0018] In this way, the second electronic device can accurately determine the second window information based on the size of the window of the first application displayed in the second state by the first electronic device. Furthermore, when generating a switching animation, the second electronic device can determine the size of the window displaying the switching animation at the end position based on the second window information, thereby further improving the smoothness of the second electronic device switching video streams.
[0019] In combination with the first aspect, in an optional implementation, before the second electronic device receives the second video stream and the first control information sent by the first electronic device, the method further includes: the second electronic device receives a switching instruction.
[0020] In this implementation, the switching instruction may be sent by the first electronic device, and the switching instruction may be initiated by the user through a switching operation. The switching instruction may be used to instruct the first electronic device to change the screen orientation from landscape to portrait, that is, to enable the second electronic device to switch from receiving the first video stream to receiving the second video stream in response to the switching instruction, and to receive the first control information to generate a switching animation, thereby enabling the second electronic device to smoothly switch the video stream.
[0021] In combination with the first aspect, in an optional implementation, the first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
[0022] In conjunction with the first aspect, in an optional implementation, the second electronic device generates a switching animation based on the first window information, the first control information, and the second window information, including: the second electronic device shrinks the first window based on the first window information and the first control information, and the size and position of the shrunken first window are associated with the first control information. The second electronic device then enlarges the first window based on the second window information, and the size and position of the enlarged first window are associated with the second window information.
[0023] In this implementation, the transition effect generated by the second electronic device can determine the size and position of the first window based on the first window information, the first control information, and the second window information, so that the first window can first be reduced to the position and size associated with the first control information, and then enlarged to the position and size associated with the second control information. In this way, the transition effect can dynamically change so that the second electronic device can smoothly switch from the first window to the second window, further improving the smoothness of the transition effect display.
[0024] In combination with the first aspect, in an optional implementation, the second electronic device shrinks the first window according to the first window information and the first control information, including: the second electronic device shrinks the first window to a first point, where the first point is determined according to the first control information.
[0025] In conjunction with the first aspect, in one optional implementation, the first point is the center point of the first control in the window of the first application displayed in the second state on the second electronic device. This not only reduces the difficulty of generating the switching animation on the second electronic device, but also visually improves the smoothness of the switching animation, thereby enhancing the user experience.
[0026] In conjunction with the first aspect, in an optional implementation, the second electronic device displays one or more of the following animations: rotation, fade, or fly-in / fly-out while shrinking the first window. The second electronic device displays one or more of the following animations: rotation, fade, or fly-in / fly-out while enlarging the first window.
[0027] In this implementation, the second electronic device can also display various animations such as rotation, fade-in and fade-out, and fly-in and fly-out while shrinking and enlarging the projection window. This can increase the diversity of the switching animations generated by the second electronic device, enhance the display effect of the switching animations, and improve the user experience.
[0028] In conjunction with the first aspect, in one optional implementation, the display content of the switching animation is one or more of: the last frame image of the first video stream, the first frame image of the second video stream, a mask image, a preset image, and a preset video. This ensures the continuity of the display content of the switching animation, further improving the smoothness of switching video streams on the second electronic device.
[0029] In conjunction with the first aspect, in an optional implementation, the method further includes: the second electronic device reducing the first window at a first speed, and then enlarging the first window at a second speed. The first speed and the second speed can be determined based on the cache capacity and decoding capability of the second electronic device. Specifically, the cache capacity of the second electronic device represents the ability of the second electronic device to cache the video stream, and the decoding capability of the second electronic device represents the ability of the second electronic device to decode the video stream.
[0030] In this implementation, the second electronic device can determine the speed of reducing and enlarging the projection window based on the decoding capability and cache capability of the second electronic device, which can further improve the smoothness of the switching animation changes.
[0031] In conjunction with the first aspect, in an optional implementation, the method for generating a switching animation by a second electronic device based on the first window information, the first control information, and the second window information may specifically include: the second electronic device may determine a movement distance based on the first window information, the first control information, and the second window information. The second electronic device may also determine a movement time based on the cache capacity and decoding capacity of the second electronic device. Finally, the second electronic device may determine a first speed and a second speed based on the movement distance and the movement time.
[0032] In this implementation, the second electronic device can estimate the speed of the transition animation based on the distance and time it moves. This allows the second electronic device to determine the speed at which to shrink the projection window and the speed at which to enlarge it, improving the smoothness of the transition animation.
[0033] In conjunction with the first aspect, in one optional implementation, the movement distance includes: a first distance and a second distance, and the movement time includes: a first time and a second time. A specific method for the second electronic device to determine the first speed and the second speed based on the movement distance and the movement time may include: first, the second electronic device determines the first distance based on the first window information and the first control information, and determines the second distance based on the first control information and the second window information. Then, the second electronic device determines the first time based on the second electronic device's cache capacity, and determines the second time based on the second electronic device's decoding capacity. Next, the second electronic device determines a first estimated speed based on the first distance and the first time, and determines a second estimated speed based on the second distance and the second time. Finally, if the first estimated speed is less than or equal to the second estimated speed, the second electronic device may determine that both the first speed and the second speed are the first estimated speed. If the first estimated speed is greater than the second speed, the second electronic device may determine that both the first speed and the second speed are the second estimated speed. In this way, the second electronic device can reserve sufficient time for caching and decoding the switched second video stream, thereby ensuring smooth playback of the switched second video stream after the switching animation is displayed.
[0034] In conjunction with the first aspect, in an optional implementation, the movement distance includes: a first distance and a second distance, and the movement time includes: a first time and a second time. The specific method for the second electronic device to determine the first speed and the second speed based on the movement distance and the movement time may further include: first, the second electronic device determines the first distance based on the first window information and the first control information, and determines the second distance based on the first control information and the second window information. Then, the second electronic device determines the first time based on the second electronic device's decoding capabilities, determines the second speed based on the second distance and the first time, and then determines the second time based on the first distance and the second speed. Finally, the second electronic device determines a third time based on the second electronic device's buffering capabilities. Finally, if the second time is greater than or equal to the third time, the second electronic device determines that the first speed is the same as the second speed. If the second time is less than the third time, the second electronic device determines the first speed based on the first distance and the third time. In this way, the second electronic device can ensure sufficient time to cache the switched second video stream, so that after the switching animation is displayed, the switched second video stream can be played smoothly.
[0035] In a second aspect, a video switching method is provided, which can be applied to a first electronic device. Specifically, the method includes: the first electronic device sends a first video stream, wherein the first video stream is display data when the first electronic device displays the window of the first application in the first state. The first electronic device obtains first control information, and the first control information is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing video in the window of the first application. Then, the first electronic device sends a second video stream and the first control information. The second video stream is display data when the first electronic device displays the window of the first application in the second state, and the first control information is used for the second electronic device to generate a switching animation, and the switching animation includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state.
[0036] In this method, the first electronic device can obtain the first control information and send the first control information to the second electronic device. In this way, when the state of the window of the first application displayed by the first electronic device changes, that is, when the video stream sent by the first electronic device to the first electronic device is switched from the first video stream to the second video stream, the second electronic device can determine the transformation position of the first window in the display interface of the second electronic device according to the first control information, and then generate and display the switching effect, so that the second electronic device can smoothly switch from displaying the window of the first application in the first state (i.e., the first window) to displaying the window of the first application in the second state (i.e., the second window), thereby improving the smoothness of the second electronic device switching video streams.
[0037] In conjunction with the second aspect, in one optional implementation, the first control information is further associated with the size of the first control within the window of the first application displayed in the second state. This allows the second electronic device to more accurately determine the transformed position and size of the first window based on the first control information, i.e., the position and size of the first control within the window of the first application displayed in the second state, further improving the smoothness of switching video streams on the second electronic device.
[0038] In combination with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device obtains at least one of the position or size of the window of the first application displayed by the first electronic device in the first state. Then, the first electronic device sends at least one of the position or size of the window of the first application displayed by the first electronic device in the first state. At least one of the position or size of the window of the first application displayed by the first electronic device in the first state can be used to determine the first window information, and the first window information can be used by the second electronic device to generate a switching animation.
[0039] In combination with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device obtains at least one of the position or size of the window of the first application displayed by the first electronic device in the second state. The first electronic device sends at least one of the position or size of the window of the first application displayed by the first electronic device in the second state, wherein at least one of the position or size of the window of the first application displayed by the first electronic device in the second state is used to determine the second window information, and the second window information is used by the second electronic device to generate a switching animation.
[0040] In this way, the second electronic device can accurately determine the second window information based on at least one of the position or size of the window of the first application displayed in the second state by the first electronic device. Furthermore, the second electronic device can determine the end position of the window displaying the switching animation based on the second window information, thereby improving the smoothness of the switching of the video stream by the second electronic device.
[0041] In combination with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device sends a switching instruction, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
[0042] In combination with the second aspect, in an optional implementation, the first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
[0043] In a third aspect, a video switching device is provided, comprising: a receiving module, a display module, a control perception module, and a motion effect control module. The receiving module is configured to receive a first video stream transmitted by a first electronic device, the first video stream being display data when the first electronic device displays a window of a first application in a first state. The display module is configured to display the first video stream in a first window of a second electronic device. The receiving module is further configured to receive a second video stream transmitted by the first electronic device, the second video stream being display data when the first electronic device displays a window of the first application in a second state. The control perception module is configured to receive first control information transmitted by the first electronic device, the first control information being associated with the position of a first control in the window of the first application displayed in the second state. The first control is a control for playing a video in the window of the first application. The motion effect control module is configured to generate a switching motion effect based on the first window information, the first control information, and the second window information. The first window information is associated with the first window, and the second window information is associated with the position of the window of the first application displayed in the second state by the first electronic device. Specifically, the switching motion effect includes the second electronic device switching from displaying the window of the first application in the first state to displaying the window of the first application in the second state, wherein the displayed content of the switching motion effect is related to the first application. The display module is further configured to display the first video stream in a second window of a second electronic device after the switching animation effect display is completed, wherein the second window is associated with the second window information.
[0044] In a fourth aspect, a video switching device is provided, which includes: a sending module and a control perception module. The sending module is used to send a first video stream, which is display data when the first electronic device displays the window of the first application in the first state. The control perception module is used to obtain and send first control information, and the first control information is associated with the position of the first control in the window of the first application displayed in the second state. The first control is a control for playing video in the window of the first application. The first control information is used for the second electronic device to generate a switching animation, and the switching animation includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state. The sending module is also used to send a second video stream, which is display data when the first electronic device displays the window of the first application in the second state.
[0045] In a fifth aspect, an electronic device is provided, comprising: a memory, one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in the first aspect and any one of its optional methods, or the electronic device executes the method as described in the second aspect and any one of its optional methods.
[0046] In a sixth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method according to the first aspect and any one of its optional methods, or the electronic device executes the method according to the second aspect and any one of its optional methods.
[0047] In the seventh aspect, a computer program product is provided, which, when running on a computer, enables the computer to execute the method according to the first aspect and any one of its optional methods, or enables the computer to execute the method according to the second aspect and any one of its optional methods.
[0048] It can be understood that the beneficial effects that can be achieved by the video switching device of the third aspect, the video switching device of the fourth aspect, the electronic device of the fifth aspect, the computer-readable storage medium of the sixth aspect, and the computer program product of the seventh aspect can be referred to the beneficial effects of the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] FIG1 is a schematic diagram of a screen projection scenario provided in an embodiment of the present application;
[0050] FIG2 is a schematic diagram showing the principle of transmitting video data provided by the related art;
[0051] FIG3 is a schematic diagram showing the principle of a video stream switching method provided by the related art;
[0052] FIG4 is a schematic diagram showing the principle of a video switching method according to an embodiment of the present application;
[0053] FIG5 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0054] FIG6 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0055] FIG7 is a second schematic diagram of the principle of the video switching method provided in an embodiment of the present application;
[0056] FIG8 is a third schematic diagram of the principle of the video switching method provided in an embodiment of the present application;
[0057] FIG9 is a flowchart of a video switching method according to an embodiment of the present application;
[0058] FIG10 is a schematic diagram of a mobile phone display interface provided in an embodiment of the present application;
[0059] FIG11 is a schematic diagram of first control information provided in an embodiment of the present application;
[0060] FIG12 is a schematic diagram of mapping first control information provided by an embodiment of the present application;
[0061] FIG13 is a first schematic diagram of a switching effect provided in an embodiment of the present application;
[0062] FIG14 is a second schematic diagram of a switching effect provided in an embodiment of the present application;
[0063] FIG15 is a fourth schematic diagram of the principle of the video switching method provided in an embodiment of the present application;
[0064] FIG16 is a second flow chart of a video switching method according to an embodiment of the present application;
[0065] FIG17 is a third schematic diagram of a switching effect provided in an embodiment of the present application;
[0066] FIG18 is a fourth schematic diagram of a switching effect provided in an embodiment of the present application;
[0067] FIG19 is a schematic diagram of a mobile phone display interface provided in an embodiment of the present application;
[0068] FIG20 is a first structural diagram of a video switching device provided in an embodiment of the present application;
[0069] FIG21 is a second structural diagram of a video switching device provided in an embodiment of the present application;
[0070] FIG22 is a schematic diagram showing the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0072] With the development of electronic devices, the degree of intelligence of electronic devices such as smartphones, laptops, tablets, and smart screens has increased rapidly, and the interaction between electronic devices has become more and more frequent. Multi-screen collaboration technology is a distributed technology that can achieve cross-system and cross-device collaboration, and carry out resource sharing and collaborative operations between electronic devices. As one of the main ways for electronic devices to interact, multi-screen collaboration can make up for the shortcomings of electronic devices themselves, give full play to the advantages of different electronic devices, and thus improve user experience. For example, smartphones have the advantage of being easy to carry and are mainly used for users' daily communication and social interaction. However, the screen of smartphones is small, and it is difficult for users to get a high user experience in application scenarios such as watching videos or playing games. Large-screen devices such as computers, smart screens, and TVs have the advantages of large screens and high display resolutions. Therefore, users can project the screen on their smartphones to other devices (such as computers or smart screens, etc.) through window projection to get a high user experience.
[0073] Please refer to the screen projection scenario shown in Figure 1. The user can project video a played on the main control side electronic device (hereinafter referred to as the first electronic device) to a large-screen device such as the collaborative side electronic device (hereinafter referred to as the second electronic device) for display and playback. The playback interface of video a on the second electronic device is larger, so that the user can obtain a higher video viewing experience.
[0074] In one implementation, after establishing a collaborative operation connection between a first electronic device and a second electronic device, the first electronic device may transmit video data to the second electronic device in the form of a video stream. For example, Miracast, AirPlay, or HiSight technology may be used to transmit video data from the first electronic device to the second electronic device in the form of a video stream.
[0075] Specifically, Figure 2 is a schematic diagram of the principle of transmitting video data provided by the relevant technology. As shown in Figure 2, a collaborative connection can be established between the first electronic device and the second electronic device through a collaborative module. Exemplarily, a socket channel can be established between the first electronic device and the second electronic device through a collaborative module. The socket channel can be based on, for example, a multicast source discovery protocol (MSDP) or a hisight protocol. The socket channel can be used as an information channel for the first electronic device to send video stream data to the second electronic device. Another socket channel can also be established between the first electronic device and the second electronic device as a control channel. The control channel can be used for the second electronic device to send control instructions to the first electronic device to achieve control of the first electronic device (or called reverse control).
[0076] Specifically, when a first electronic device sends video stream data to a second electronic device, the first electronic device may first compress each frame of video a to obtain video stream data consisting of multiple video frames (i.e., encode video a to obtain the video stream data). The first electronic device then sends the video stream data to the second electronic device via a socket channel (information channel). The second electronic device receives and caches the video stream data, decodes the video stream data, and then plays video a.
[0077] However, in the related technologies of multi-screen collaboration, the first electronic device will not transmit the control information of the video playback control in its display interface (for example, size information, position information, etc.) to the second electronic device during the process of transmitting video stream data, that is, the second electronic device cannot obtain the control information of the video playback control in the first electronic device. In this way, when the display state of the window playing the video stream in the first electronic device changes. For example, when the window playing the video stream of the first electronic device switches from a horizontal screen state to a vertical screen state, when the second electronic device switches the display state of the projection window, the display content in the projection window is prone to flickering, black screen or freeze, etc., which makes it impossible to switch the video stream smoothly.
[0078] In this case, when the second electronic device has not yet completed decoding the video stream after the display state changes, it can usually use a preset image (for example, a mask image) as a transition between the two video streams before and after the change, and then play the video stream after the decoding of the changed video stream is completed. In this way, when the second electronic device switches the video stream, the video screen is prone to flickering, stretching, or freezing, which further makes it impossible for the second electronic device to switch between the two video streams smoothly.
[0079] In one application scenario, take the example of a collaborative operation application scenario in which a first electronic device projects a screen onto a second electronic device, where the first electronic device switches between horizontal and vertical video streams. Specifically, the first electronic device switches from playing a horizontal video stream to playing a vertical video stream, that is, the video stream sent by the first electronic device to the second electronic device switches from a horizontal video stream to a vertical video stream. The horizontal video stream is a video stream played by the first electronic device in the horizontal state, and the vertical video stream is a video stream played by the first electronic device in the vertical state.
[0080] Specifically, the screen of the first electronic device usually has two screen states: landscape state and portrait state. When the first electronic device is in the portrait state, the first electronic device displays a portrait interface. When the first electronic device is in the landscape state, the first electronic device displays a landscape interface. This allows the first electronic device to present a normal perspective of the application interface to the user in both the portrait state and the landscape state, so that the user can browse the application interface normally.
[0081] It should be noted that the screen shape of the first electronic device is usually rectangular. Therefore, among the screen states of the first electronic device, the horizontal screen state is usually the state of the first electronic device when the bottom of the screen (the bottom of the screen is the side indicated by the direction of gravity acceleration, that is, the side of the screen close to the ground) is the long side. The vertical screen state is usually the state of the first electronic device when the bottom of the screen is the short side. Alternatively, when the side of the screen of the first electronic device corresponding to the jaw or forehead of the user who is using the screen is the long side, the first electronic device is in the horizontal screen state; when the side of the screen of the first electronic device corresponding to the jaw or forehead of the user who is using the screen is the short side, the first electronic device is in the vertical screen state.
[0082] When the first electronic device is in landscape mode and displays a landscape interface, the user can rotate the first electronic device to a certain angle to switch from the landscape mode to the portrait mode. Correspondingly, when the first electronic device is in portrait mode and displays a portrait interface, the user can also rotate the first electronic device to a certain angle to switch from the portrait mode to the landscape mode.
[0083] Please refer to the schematic diagram of the video stream switching principle in the related art shown in Figure 3. Take the first electronic device as a mobile phone and the second electronic device as a computer as an example. First, the mobile phone plays the horizontal video stream (i.e., the mobile phone plays the video stream in horizontal mode) and sends the horizontal video stream to the computer. The computer receives the horizontal video stream, caches and decodes it, and then plays the vertical video stream. Then, after T milliseconds (ms), the mobile phone performs the switching animation and plays the vertical video stream (i.e., the mobile phone plays the video stream in vertical mode) and sends the vertical video stream to the computer. The computer receives the vertical video stream, caches and decodes it, and then plays the vertical video stream. However, because the mobile phone does not transmit the control information of the video playback control in the window playing the vertical video stream to the computer, the computer cannot determine the transition position of the switching animation between the vertical and horizontal video streams, resulting in the inability to determine the switching animation. In this case, the computer usually directly recreates the session to receive the vertical video stream and switch to playing the vertical video stream. In addition, due to the influence of the computer's decoding capabilities, it is also easy to cause abnormal phenomena such as screen flickering or freezing during the video stream switching process.
[0084] Please continue to refer to Figure 3. For computers with strong decoding capabilities, the speed of decoding the vertical screen video stream is faster and the decoding time T1 is shorter. Therefore, the computer can quickly switch from playing the vertical screen video stream to the vertical screen video stream, which causes the screen to flicker during the video stream switching process. For computers with weak decoding capabilities, the speed of decoding the vertical screen video stream is slower and the decoding time T2 is longer. Therefore, the computer switches from playing the vertical screen video stream to the vertical screen video stream slowly, which causes the screen to freeze during the video stream switching process. This will cause the computer to be unable to switch video streams smoothly.
[0085] In order to solve the problem that the collaborative side electronic device (such as the above-mentioned computer) cannot smoothly switch between two video streams in the application scenario of multi-screen collaboration. The embodiment of the present application provides a video switching method. In the collaborative operation scenario where the main control side electronic device projects the screen to the collaborative side electronic device, when the video stream of the main control side electronic device is switched, that is, when the display state of the window playing the video stream changes, the collaborative side electronic device can receive the control information of the video playback control corresponding to the switched video stream sent by the main control side electronic device, and determine the transformation position of the projection window in the process of the collaborative side electronic device switching the two video streams according to the control information, and then generate and display the switching animation, so that the collaborative side electronic device can smoothly switch the two video streams.
[0086] Specifically, please refer to Figure 4, which is a schematic diagram of the principle of the video switching method provided by an embodiment of the present application. As shown in Figure 4, take the master-side electronic device as a mobile phone, the collaborative-side electronic device as a computer, and the mobile phone switching from the first video stream to the second video stream as an example. When the mobile phone plays the first video stream, it sends the first video stream to the computer. The first video stream is the display data when the mobile phone displays the window of the first application in the first state. The computer receives the first video stream, caches and decodes it, and then plays the first video stream in the first window. After the mobile phone switches from playing the first video stream to the second video stream, that is, after the mobile phone switches from displaying the window of the first application in the first state to displaying the window of the first application in the second state, it sends the second video stream and the first control information to the computer. The second video stream is the display data when the mobile phone displays the window of the first application in the second state. The first control information is associated with the position of the first control in the window of the first application displayed in the second state. The first control is the control used to play the video in the window of the first application. In this way, the computer can determine the change position of the first window based on the first window information, the first control information, and the second window information, and generate and display the switching animation, so that the computer can smoothly switch from playing the first video stream to playing the second video stream.
[0087] In some embodiments, the computer can also obtain the computer's decoding capability parameters, and determine the conversion speed (or moving speed) of the switching effect between the first video stream and the second video stream based on the decoding capability parameters, so as to avoid abnormal phenomena such as screen flickering or freezing when the computer switches to the second video stream, thereby further improving the smoothness of the computer switching between the two video streams.
[0088] The video switching method provided in the embodiment of the present application can be applied to the application scenario in which the first electronic device casts a screen to the second electronic device. For example, in the embodiment of the present application, the first electronic device and the second electronic device may include but are not limited to smart phones, netbooks, tablet computers, smart watches, smart bracelets, phone watches, smart cameras, PDAs, personal computers (personal computers, PCs), personal digital assistants (personal digital assistants, PDAs), portable multimedia players (portable multimedia players, PMPs), augmented reality (AR) / virtual reality (VR) devices, televisions, projection devices, or somatosensory game consoles in human-computer interaction scenarios. Alternatively, the first electronic device and the second electronic device may also be electronic devices of other types or structures, which are not limited in the present application.
[0089] Usually, in order to maximize the advantages of multi-screen collaborative operation technology, multi-screen collaborative operation technology is mostly used between portable devices (i.e., the first electronic device) and large-screen devices (i.e., the second electronic device). For example, the portable device is a smart phone, and the large-screen device is a laptop. For another example, the portable device is a tablet computer, and the large-screen device is a TV. Of course, this application does not limit the specific devices in the multi-window projection scenario. As mentioned above, the first electronic device and the second electronic device can be any electronic device that supports multi-screen collaborative operation technology, such as a smart phone, a netbook, a tablet computer, a smart watch, a smart bracelet, a phone watch, a smart camera, a PDA, a PMP, an AR / VR device, or a TV.
[0090] In an embodiment of the present application, a wireless communication connection can be established between the first electronic device and the second electronic device through methods such as "touch and touch", "scan" (such as scanning a QR code or a barcode), and "approach automatic discovery" (such as with the help of Bluetooth or wireless fidelity (Wi-Fi)). Among them, the first electronic device and the second electronic device can follow a wireless transmission protocol and transmit information through a wireless connection transceiver. Among them, the wireless transmission protocol may include but is not limited to Bluetooth (BT) transmission protocol or Wi-Fi transmission protocol. For example, the Wi-Fi transmission protocol may be a Wi-Fi P2P transmission protocol. The wireless connection transceiver includes but is not limited to Bluetooth, Wi-Fi and other transceivers. Information transmission between the first electronic device and the second electronic device is achieved through wireless pairing. Among them, the information transmitted between the first electronic device and the second electronic device includes but is not limited to content data to be displayed (such as standard video streams) and control instructions.
[0091] Alternatively, a wired communication connection may be established between the first electronic device and the second electronic device. For example, a wired communication connection may be established between the first electronic device and the second electronic device via a video graphics array (VGA), a digital visual interface (DVI), a high-definition multimedia interface (HDMI), or a data transmission cable. Information transmission is achieved between the first electronic device and the second electronic device via the established wired communication connection. This application does not limit the specific connection method between the first electronic device and the second electronic device.
[0092] Fig. 5 shows a schematic diagram of the hardware structure of the electronic device 100. For example, the electronic device 100 shown in Fig. 5 may be a first electronic device or a second electronic device.
[0093] As shown in Figure 5, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0094] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0095] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0096] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0097] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0098] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0099] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0100] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0101] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0102] The modem processor includes a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is passed to the application processor.
[0103] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0104] Exemplarily, when the electronic device 100 is the first electronic device in the aforementioned embodiment, the first electronic device can send video streams, control information, control instructions, etc. to the second electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0105] Exemplarily, when the electronic device 100 is the second electronic device in the aforementioned embodiment, the second electronic device can receive the video stream, control information, control instructions, etc. sent by the first electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0106] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0107] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0108] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0109] For example, when the electronic device 100 is the first electronic device in the aforementioned embodiment, the display screen 194 of the first electronic device may display the video stream selected for playback by the user on the first electronic device. Furthermore, when the user clicks or touches the screen, some functional controls, such as switching controls and collaborative controls, may be displayed.
[0110] For example, when electronic device 100 is the second electronic device in the aforementioned embodiment, the display screen 194 of the second electronic device can display the video stream selected by the user for playback on the first electronic device. Furthermore, when the video stream switches, a switching animation can be displayed. Furthermore, when the user clicks or touches the screen, some functional controls, such as switching controls and collaborative controls, can be displayed.
[0111] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0112] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0113] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0114] Exemplarily, when the electronic device 100 is the second electronic device in the aforementioned embodiment, the processor 110 can determine the transformation position of the projection window during the process of switching the first video stream to the second video stream based on the first window information, the first control information and the second window information by running the instructions stored in the internal memory 121, and generate and display the switching animation so that the computer can smoothly switch between the two video streams.
[0115] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0116] When the electronic device 100 displays video content, the audio module 170 can synchronously play audio content corresponding to the video content.
[0117] For example, when the electronic device 100 is the first electronic device in the aforementioned embodiment, if the first electronic device displays content, the audio module 170 of the first electronic device can synchronously play the audio content corresponding to the video content. If the first electronic device projects the video content to the second electronic device, the audio module 170 of the first electronic device may not play the audio content corresponding to the video content.
[0118] For example, when the electronic device 100 is the second electronic device in the aforementioned embodiment, if the second electronic device displays video content, the audio module 170 of the second electronic device can synchronously play the audio content corresponding to the video content. If the second electronic device displays the video content projected by the first electronic device in the screen projection scene, the audio module 170 of the second electronic device can synchronously play the audio content corresponding to the projected video content.
[0119] In some embodiments, when the video switching method in the embodiment of the present application is implemented based on the electronic device 100 shown in Figure 5, when the electronic device 100 is the first electronic device and the second electronic device in the aforementioned embodiment, take the first electronic device casting the screen to the second electronic device, and the first electronic device switches from playing the first video stream to the second video stream as an example. The processor 110 of the first electronic device can obtain the first control information by running the instructions stored in the internal memory 121. And send the second video stream and the first control information to the second electronic device through the antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc. The second electronic device receives the second video stream and the first control information through the antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc. The processor 110 of the second electronic device can determine the switching effect between the first video stream and the second video stream based on the first control information, the first window information, and the second window information by running the instructions stored in the internal memory 121. Furthermore, the second electronic device can execute the switching effect with the processor 110 and display the switching effect through the display screen 194.
[0120] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0121] FIG6 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
[0122] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0123] The application layer can include a series of application packages.
[0124] As shown in Figure 6, the application package may include short messaging applications, video applications, office applications, game applications, life applications, shopping applications, or functional applications, etc. Specifically, for example, applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short messaging.
[0125] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0126] As shown in FIG6 , the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a collaboration module, a control perception module, a motion effect control module, and the like.
[0127] The cooperation module is used to establish a cooperative operation connection with other electronic devices so that the electronic devices can realize the cooperative operation function.
[0128] The control sensing module is used to obtain information about the control that plays the video stream (such as the position and size of the control) in the electronic device. This information is also used to transmit this information to the electronic device so that the electronic device can determine the transition position of the switching effect based on the control information.
[0129] The motion effect control module is used to determine the position information of the switching motion effect transformation based on the control information obtained by the control perception module to generate the switching motion effect.
[0130] In some embodiments, the application framework layer may further include a decoding capability adaptation module and a decoding monitoring module.
[0131] The decoding capability adaptation module is used to obtain the decoding capability parameters of the electronic device, so as to determine the conversion speed of the switching animation according to the decoding capability parameters, so as to generate the switching animation.
[0132] The decoding monitoring module is used to monitor the actual decoding capability parameters of the electronic device for the video stream when the electronic device displays the switching animation effect, so as to update the decoding capability parameters of the electronic device.
[0133] The motion effect control module can also be used to determine the conversion speed of the switching motion effect based on the decoding capability parameters obtained by the decoding capability adaptation module, so that the switching motion effect can smoothly switch between two video streams.
[0134] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0135] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0136] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0137] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0138] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0139] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0140] Android Runtime includes core libraries and a virtual machine. Android Runtime is responsible for scheduling and management of the Android system.
[0141] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0142] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0143] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), screen projection module, etc.
[0144] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0145] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0146] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0147] A 2D graphics engine is a drawing engine for 2D drawings.
[0148] The screen projection module is used for the electronic device 100 to project the screen to other devices, or to receive projection data from other devices. The screen projection module can realize the selection of the projection application, the transmission of projection data, the reception of projection data, and the display of projection data.
[0149] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, etc., which are not limited in this embodiment of the present application.
[0150] In some embodiments, when the video switching method in the embodiment of the present application is implemented based on the electronic device 100 shown in Figure 6, when the electronic device 100 is the first electronic device and the second electronic device in the aforementioned embodiment, take the first electronic device casting the screen to the second electronic device, and the first electronic device switches from the first video stream to the second video stream as an example. In conjunction with the principle schematic diagram shown in Figure 7, the first electronic device and the second electronic device can establish a collaborative operation connection through a collaborative module. The first electronic device can obtain the first control information in the first electronic device through the control perception module and send it to the control perception module of the second electronic device. The control perception module of the second electronic device receives the first control information and sends it to the motion effect control module. Based on the first control information, the first window information and the second window information, the motion effect control module can determine and display the switching motion effect between the first video stream and the second video stream.
[0151] In some embodiments, when the second electronic device includes a decoding capability adaptation module and a decoding monitoring module, the decoding capability adaptation module of the second electronic device can obtain the decoding capability parameters of the second electronic device and send them to the animation control module. The decoding monitoring module of the second electronic device can obtain the actual decoding capability parameters of the second electronic device for the video stream. The animation control module can determine and adjust the conversion speed of the switching animation based on the decoding capability parameters to achieve smooth switching between the first video stream and the second video stream.
[0152] The video switching method provided in the embodiment of the present application is described below by taking the first electronic device as a mobile phone and the second electronic device as a computer as an example.
[0153] Among them, both mobile phones and computers have the ability to operate in collaboration, and mobile phones can cast video streams to computers for playback. Take the example of a mobile phone switching from playing a horizontal screen video stream (i.e., the first video stream) to playing a vertical screen video stream (i.e., the second video stream), that is, the video stream sent by the mobile phone to the computer switches from playing a horizontal screen video stream to playing a vertical screen video stream. Among them, the horizontal screen video stream is the video stream played by the mobile phone in the horizontal state (i.e., the second state), and the vertical screen video stream is the video stream played by the mobile phone in the vertical state (i.e., the second state).
[0154] FIG8 is a third schematic diagram of the principle of the video switching method provided by an embodiment of the present application. As shown in FIG8 , first, when the mobile phone plays a horizontal screen video stream, it sends a horizontal screen video stream to the computer. The computer displays the horizontal screen video stream in the first window. After the mobile phone switches from playing a horizontal screen video stream to playing a vertical screen video stream, the vertical screen video stream and the first control information are sent to the computer. The first control information is associated with the position of the control for playing the video in the window in which the mobile phone plays the vertical screen video stream. The computer can generate and display a switching animation based on the first window information, the first control information and the second window information, so that the computer can smoothly switch from the horizontal screen video stream to the vertical screen video stream.
[0155] Specifically, FIG9 is a flowchart of a video switching method according to an embodiment of the present application. As shown in FIG9 , the video switching method according to an embodiment of the present application mainly includes steps S101 to S108:
[0156] S101. The mobile phone and the computer establish a collaborative operation connection.
[0157] In an embodiment of the present application, a mobile phone can establish a collaborative operation connection with a computer. In this way, the mobile phone can send information such as a video stream to the computer, and the computer can receive and play the video stream, so that the mobile phone can project the video to the computer for playback, thus achieving collaborative operation of the mobile phone and the computer.
[0158] For example, the mobile phone can establish a collaborative operation connection with the computer based on a wireless connection method such as Bluetooth transmission protocol or Wi-Fi transmission protocol, or the mobile phone can also establish a collaborative operation connection with the computer based on a wired connection method such as HDMI or a data transmission cable. This application does not make specific limitations on this.
[0159] In some embodiments, the mobile phone can establish an information channel with the computer to transmit the video stream. The mobile phone can also establish a control channel with the computer to transmit control information for projecting the video stream.
[0160] S102. The mobile phone sends a horizontal screen video stream to the computer.
[0161] In an embodiment of the present application, when a mobile phone plays a horizontal video stream, the horizontal video stream is sent to a computer. The horizontal video stream can be video data provided by a first application, such as a video application or an information application. The mobile phone can then display a window of the first application on its display screen and play the horizontal video stream within that window. This horizontal video stream is also the display data when the mobile phone displays the window of the first application in horizontal mode.
[0162] It should be noted that in the embodiments of the present application, when a mobile phone plays a horizontal video stream, it means that the video stream is played in a horizontal state (or a horizontal screen interface, a horizontal screen window). When a mobile phone plays a vertical video stream, it means that the video stream is played in a vertical state (or a vertical screen interface, a vertical screen window). When a mobile phone plays a horizontal video stream, it means that the video stream is played in a horizontal state (or a horizontal screen interface, a horizontal screen window).
[0163] Specifically, the horizontal video stream may be encoded video data, for example, the horizontal video stream may be encoded binary video stream data. In one implementation, the mobile phone may send the horizontal video stream via an information channel established with the computer.
[0164] In some embodiments, the mobile phone may also send a first indication message to the computer, which may be used to indicate the position and / or size of the screen projection window for playing the horizontal video stream on the computer. In this way, the computer can quickly generate a screen projection window to play the horizontal video stream.
[0165] In one implementation, the first indication information may be a full-screen playback instruction, which may be used to instruct the computer to play a horizontal video stream in full-screen mode, i.e., to instruct the computer to generate a projection window that fully covers the computer display interface, and play a horizontal video stream in the projection window.
[0166] In another implementation, the first indication information may also be the position and / or size of the window displaying the horizontal video stream on the mobile phone. The position and / or size of the window displaying the horizontal video stream on the mobile phone can be used by the computer to determine the position and / or size of the projection window and generate a projection window to play the horizontal video stream.
[0167] S103: The computer receives the horizontal screen video stream and displays the horizontal screen video stream in the first window.
[0168] In an embodiment of the present application, when the horizontal screen video stream is encoded video data, the computer can cache and decode the received horizontal screen video stream. Specifically, the computer receives and caches the horizontal screen video stream data. After the horizontal screen video stream data is fully stored in the computer's cache area, the cached horizontal screen video stream data is decoded to obtain a decoded horizontal screen video stream, and the horizontal screen video stream is displayed in the projection window (i.e., the first window).
[0169] The position and size of the first window can be determined based on the first window information. The first window information can include the size of the entire display interface (full screen) of the computer. The first window information can also be associated with the position and / or size of the window of the first application displayed in landscape mode on the mobile phone (i.e., the window playing the landscape video stream).
[0170] In one implementation, the computer may be preset with first window information. For example, when the computer displays a horizontal video stream in full screen, that is, when the first window covers the entire display interface of the computer, the first window information preset in the computer may be the size of the entire display interface of the computer. Thus, when the mobile phone also sends the first instruction information (such as the above-mentioned full-screen play instruction) to the computer in S102, the computer may respond to the full-screen play instruction, generate a first window according to the preset first window information, and play the horizontal video stream in full screen mode.
[0171] In another implementation, the computer can also receive the position and / or size of the window for playing the horizontal screen video stream sent by the mobile phone, and determine the first window information according to the position and / or size of the window for playing the horizontal screen video stream on the mobile phone. Due to the different sizes of the display interfaces of the mobile phone and the computer, the positions of the windows for playing the horizontal screen video stream are different in the mobile phone and the computer, and the sizes may also be different. Therefore, the computer can map and transform the position and / or size of the window for playing the horizontal screen video stream received from the mobile phone (such as position offset, proportional scaling, etc.) to determine the first window information. Furthermore, the computer can generate a first window based on the first window information to play the horizontal screen video stream in the first window.
[0172] In this implementation, the computer can simultaneously receive the position and / or size of the window on the mobile phone playing the horizontal video stream. That is, in S102, the mobile phone can simultaneously send the position and / or size of the window on the mobile phone playing the horizontal video stream to the computer. Alternatively, the computer can obtain the position and / or size of the window on the mobile phone playing the horizontal video stream before receiving the horizontal video stream. This allows for the timely generation of the first window for playing the horizontal video stream, preventing playback interruptions in the horizontal video stream.
[0173] S104. The mobile phone sends the vertical screen video stream and the first control information to the computer in response to the switching instruction.
[0174] In the implementation of this application, the switching instruction can be used to indicate that the state of the window in which the mobile phone plays the video stream has changed, that is, the mobile phone changes its screen orientation from landscape to portrait, and the corresponding video stream also changes. Specifically, the switching instruction can be used to instruct the mobile phone to switch from landscape to portrait mode, that is, to switch from playing a landscape video stream to playing a portrait video stream.
[0175] In one example, the switching instruction can be generated by a user initiating a switching operation on a mobile phone. For example, the user can click a switch control in the mobile phone interface to initiate a switching operation on the mobile phone, thereby generating a switching instruction. When the mobile phone is in landscape mode and displays the landscape interface, the user can also rotate the mobile phone to a certain angle from landscape to portrait mode to initiate a switching operation on the mobile phone, thereby generating a switching instruction. In this case, the mobile phone can also send a switching instruction to the computer in response to the switching instruction, triggering the computer to switch the video stream.
[0176] In another example, the switching instruction may also be generated by the user initiating a switching operation on a computer, and the computer sends the switching instruction to the mobile phone to instruct the mobile phone to switch the video stream.
[0177] In the embodiment of the present application, the mobile phone can switch from playing a horizontal video stream to a vertical video stream in response to a switching instruction. That is, in the collaborative operation scenario, the video stream sent by the mobile phone to the computer switches from a horizontal video stream to a vertical video stream. The vertical video stream is the display data when the mobile phone displays the window of the first application in a vertical state.
[0178] The vertical video stream may be encoded video data. Specifically, the vertical video stream may be binary video stream data. In one implementation, the mobile phone may send the vertical video stream via an information channel established with the computer.
[0179] At the same time, when the mobile phone sends a vertical screen video stream to the computer, it can also send first control information. The first control is a control for playing the video in the window of the first application displayed in the vertical screen state of the mobile phone (i.e., the window playing the vertical screen video stream), and the first control information is associated with the position of the first control in the window of the mobile phone playing the vertical screen video stream.
[0180] For example, FIG10 is a schematic diagram of a mobile phone display interface provided by an embodiment of the present application. As shown in FIG10 , in a window 101 of a first application displayed in portrait mode on the mobile phone, the controls for playing a video include a play control 102. The first control may be the play control 102. The first control information may specifically include position information of the play control 102. The first control information may also include size information of the play control 102. The first control information may be used by the computer to determine the position of the switching animation change.
[0181] In one implementation, when the first control is a rectangle, the first control information may be rectangle information of the first control.
[0182] In one example, the first control information can be the position information (for example, coordinate information) of one of the vertices of the first control (rectangle), and the side length (for example, width and height) of the rectangle as the first control information. Figure 11 is a schematic diagram of a first control information provided in an embodiment of the present application. As shown in Figure 11, the first control information can be the rectangle information (l, r, w, h) composed of the coordinate value (l, r) of the vertex a of the rectangle, the width (width, w) and height (height, h) of the rectangle. Among them, vertex a can also be replaced by vertex b, vertex c or vertex d, and this application does not make specific restrictions on this.
[0183] In another example, the first control information may also be the position information of any three or four vertices in the first control (rectangle). For example, the coordinate value (l a , r a ), the coordinate value of vertex b (l b , r b ) and the coordinate value of vertex c (l c , r c ) form rectangular information (l a , r a , l b , r b , l c , r c ), namely as the first control information. This application does not specifically limit the specific expression method of the first control information.
[0184] In one implementation, the first control information can be acquired by a control perception module in the mobile phone. Specifically, the control perception module can detect the playback control in the window of the mobile phone display interface, as well as the position and size information of the playback control in the window of the first application, to generate the first control information.
[0185] In this case, the control perception module can start running when the collaborative operation is triggered (that is, when the S101 mobile phone establishes a collaborative operation connection with the computer), the control perception module can also start running before the collaborative operation is triggered, or the control perception module can also start running after the collaborative operation is triggered and before the first control information is sent. This application does not make specific restrictions on this.
[0186] In one implementation, when a control channel is established between the mobile phone and the computer, the mobile phone can send the first control information to the computer through the control channel.
[0187] In another implementation, an independent logical channel can be established between the mobile phone and the computer to transmit the first control information to the computer. In this way, since the independent logical channel is isolated from the information channel and the control channel, the efficiency of transmitting the first control information can be guaranteed and the first control information can be prevented from interfering with the transmission of the vertical screen video stream.
[0188] S105: The computer receives the vertical screen video stream and the first control information, and in response to the switching instruction, generates and displays a switching animation according to the first window information, the first control information, and the second window information.
[0189] In an embodiment of the present application, when the vertical screen video stream is encoded video data, the computer can cache and decode the received vertical screen video stream. Specifically, the computer receives and caches the vertical screen video stream data. After the vertical screen video stream data is fully stored in the computer's cache area, the cached vertical screen video stream data is decoded to obtain a decoded vertical screen video stream, and the vertical screen video stream can be displayed in the second window.
[0190] At the same time, the computer can also map the received first control information, obtain and save the projection position of the first control in the computer (ie, the first mapping control information), so as to be used by the computer to determine the position information of the video stream switching effect.
[0191] For example, after receiving the first control information, the computer can map and transform the received first control information according to the projection position of the window of the first application in the computer display interface (such as: position offset, proportional scaling, etc.), obtain the first mapping control information, and save the first mapping control information.
[0192] FIG12 is a schematic diagram of mapping the first control information provided by an embodiment of the present application. As shown in FIG12 , taking the first control as the playback control 102 as an example, the first control information is rectangular information (l1, r1, w1, h1), and the first mapping control information obtained after the mapping transformation is rectangular information (l1′, r1′, w1′, h1′). Among them, if the size of the first control after mapping does not change, w1′ is the same as w1, and h1′ is the same as h1. In this way, the position information and size information of the first control in the mobile phone display can be converted into the position information and size information in the computer display, so that the computer can accurately determine the position information of the video stream switching effect in the computer.
[0193] Among them, the above-mentioned second window is associated with the second window information, that is, the position and size of the second window can be determined based on the second window information. Specifically, the second window information is associated with the position and / or size of the window of the first application displayed in a vertical screen state on the mobile phone (that is, the window for playing the vertical screen video stream). The second window information can be the same as the position and / or size of the window for playing the vertical screen video stream on the mobile phone. The second window information can also be the same position and / or size of the window for playing the vertical screen video stream on the mobile phone after mapping transformation. The expression method of the second window information is similar to that of the first control information. When the window for playing the vertical screen video stream on the mobile phone is rectangular, the second window information can be the rectangular information of the window for playing the vertical screen video stream on the mobile phone. This application does not specifically limit the specific expression method of the second window information.
[0194] In one implementation, the window in which the mobile phone plays the vertical video stream can be a display window of the entire display screen of the mobile phone. For example, as shown in FIG10 , the window in which the mobile phone plays the vertical video stream can be window 101, and the size of window 101 can be the size information of the entire display window of the mobile phone.
[0195] In another implementation, the computer can receive the position and / or size of the window of the mobile phone playing the vertical screen video stream sent by the mobile phone, and determine the second window information according to the position and / or size of the window of the mobile phone playing the vertical screen video stream. Then, the computer can also perform a mapping transformation (such as position offset, proportional scaling, etc.) on the position and / or size of the window of the mobile phone playing the vertical screen video stream received to determine the second window information. Furthermore, the computer can regenerate the second window according to the second window information to play the vertical screen video stream in the second window. Alternatively, the computer can also adjust the position and / or size of the first window according to the second window information, and use the adjusted first window as the second window, that is, the second window is obtained by changing the first window without the need to regenerate.
[0196] In this implementation, the computer can receive the position and / or size of the window in which the mobile phone plays the vertical video stream while receiving the vertical video stream. That is, in S104, the mobile phone can send the position and / or size of the window in which the mobile phone plays the vertical video stream while sending the vertical video stream to the computer. Alternatively, the computer can obtain the position and / or size of the window in which the vertical video stream is played from the mobile phone before receiving the vertical video stream. In this way, the computer can generate the switching animation in time to prevent lag during the switching of the vertical video stream.
[0197] In another implementation, the computer may store the second window information, so there is no need to obtain the position and / or size of the window for the mobile phone to play the vertical screen video stream through the mobile phone again. For example, before the mobile phone sends the horizontal screen video stream to the computer in S102, as described in S401-S410 below, if there is a process in which the mobile phone switches from playing the vertical screen video stream to playing the horizontal screen video stream, that is, the projection window of the computer switches from playing the vertical screen video stream to playing the horizontal screen video stream. Specifically, in S403, if the computer has received the position and / or size of the window for the mobile phone to play the vertical screen video stream, the position and / or size of the window for the mobile phone to play the vertical screen video stream can be saved. In this case, the computer does not need to obtain the position and / or size of the window for the mobile phone to play the vertical screen video stream again.
[0198] The computer can generate and display a switching animation in response to a switching instruction. The switching instruction can be generated by a user initiating a switching operation on a mobile phone and then sent from the mobile phone to the computer. The switching instruction can also be generated by a user initiating a switching operation on the computer. The switching instruction can be used to instruct the computer to change the display state of the window (such as the first window) playing the video stream, and generate and display a switching animation.
[0199] Specifically, the computer can generate and display a switching animation based on the first window information, the first control information and the second window information. The switching animation includes the computer displaying the window of the first application in a horizontal state to the window of the first application in a vertical state, that is, the computer changes from the first window playing the horizontal video stream to the second window playing the vertical video stream.
[0200] In some embodiments, the computer can scale the first window based on the first window information, the first control information, and the second window information, and cause the content displayed in the first window to change as the size of the first window changes, thereby forming a switching effect. Specifically, the computer-generated switching effect may include: shrinking the first window based on the first window information and the first control information, and associating the size and position of the shrunken first window with the first control information. Then, enlarging the first window based on the second window information, and associating the size and position of the enlarged first window with the second window information.
[0201] The size and position of the reduced first window may be the same as the size and position determined by the mapped first control information (i.e., the first mapped control information), or the size and position of the reduced first window may be a position and size determined by the first mapped control information according to a first preset rule (e.g., offset, scaling, etc.), or a point determined by the first mapped control information. The size and position of the enlarged first window may be the same as the size and position determined by the second window information, or the size and position of the enlarged first window may be a position and size determined by the second window information according to a second preset rule (e.g., offset, scaling, etc.).
[0202] In one implementation, in a computer-generated transition effect, the first window can be reduced to a first point based on the first control information, and then the first window can be enlarged based on the first point. The first point is determined based on the first control information, and can be a point determined based on the position and size of the first control in the first control information and a preset rule.
[0203] For example, Figure 13 is a schematic diagram of a transition effect provided by an embodiment of the present application. As shown in Figure 13, the first point can be the center point of the first control in the window of the vertical video stream played on the computer. The computer-generated transition effect can then be: on the computer display interface 200, the first window 210 is reduced to the center point 220 of the first control, and then enlarged from the center point 220 of the first control to the second window 230. This not only reduces the difficulty of computer-generated transition effects, but also visually improves the smoothness of the transition effect, enhancing the user experience.
[0204] In another implementation, in the computer-generated switching effect, the first window can be reduced to a size and position determined by the first mapping control information according to the first control information, and then the first window can be enlarged to a size and position determined according to the second window information.
[0205] For example, Figure 14 is a second schematic diagram of the switching effect provided in an embodiment of the present application. As shown in Figure 14, the computer-generated switching effect can also be that in the computer display interface 200, the first window (i.e., the starting window 201) determined by the first window information (l0, r0, w0, h0) is reduced to the window (i.e., the middle window 202) determined by the first mapping control information (l1′, r1′, w1′, h1′), and then enlarged from the middle window 202 to the second window (i.e., the ending window 203) determined by the second window information (l2, r2, w2, h2).
[0206] In some embodiments, the computer-generated switching effects may further include: reducing the first window with a first action, and then enlarging the first window to the second window with a second action. The first action and the second action may be the same or different, and the first action and the second action may be one or more of the following effects: rotation, fade-in and fade-out, or fly-in and fly-out. This application does not specifically limit the first action and the second action. In this way, the diversity of the computer-generated switching effects can be increased, the display effect of the switching effects can be enhanced, and the user experience can be improved.
[0207] In some embodiments, the computer-generated switching animation may further include: shrinking the first window at a first speed, and then enlarging the first window to the second window at a second speed.
[0208] In one implementation, taking the implementation of the switching animation shown in Figure 13 as an example, the computer-generated switching animation may include: shrinking the first window 210 to the center point 220 of the first control at a first speed, and then enlarging from the center point 220 of the first control to the second window 230 at a second speed.
[0209] In another implementation, taking the implementation of the switching animation shown in Figure 14 as an example, the computer-generated switching animation may include: shrinking the starting window 201 to the middle window 202 at a first speed, and then enlarging the middle window 202 to the ending window 203 at a second speed.
[0210] The first speed and the second speed may be the same or different, that is, the switching effect may shrink from the starting window 201 to the middle window 202 and then expand to the ending window 203 at the same speed. The switching effect may also shrink from the starting window 201 to the middle window 202 and then expand from the middle window 202 to the ending window 203 at different speeds.
[0211] In some embodiments, when the computer's decoding capability is stable, the computer can determine the first speed and the second speed based on the first window information, the first control information, the second window information, and a preset time. The preset time is the duration of the switching animation (i.e., the window movement duration) determined based on the computer's decoding capability, based on prior knowledge or experiments. Playing the switching animation at this preset time can ensure that the video stream switches without screen flickering, freezing, or other abnormalities.
[0212] Specifically, the computer may determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information.
[0213] When the first speed and the second speed are the same, the computer can calculate the sum of the first distance and the second distance and divide it by the preset time to obtain the first speed, that is, the second speed.
[0214] If the first speed and the second speed are different, the computer can divide the preset time into the first preset time and the second preset time according to actual usage requirements, and use them as the travel time for the first distance and the second distance, respectively. Then, the first speed is obtained by dividing the first distance by the first preset time, and the second speed is obtained by dividing the second distance by the second preset time.
[0215] In some embodiments, the computer can also estimate the moving speed of the switching animation based on the process of the computer caching and decoding the horizontal screen video stream, combined with the computer's caching capacity and decoding capacity, and determine the first speed and the second speed. Among them, the computer's caching capacity is used to characterize the computer's ability to cache video streams. For example, the caching capacity can be: the size of the computer's cache area and the cache speed. The cache speed can be determined based on the size of the network bandwidth of the communication connection between the mobile phone and the computer. The computer's decoding capacity is used to characterize the computer's ability to decode video streams. For example, the decoding capacity includes but is not limited to: decoding time and decoding speed for video streams with different code streams. In the following embodiments, the solution provided in the embodiments of the present application is described using the amount of data decoded by the computer per unit time, such as the amount of data processed per millisecond (Mb / ms) as the decoding capacity.
[0216] Specifically, the computer may also determine the first speed and the second speed according to the first window information, the first control information, the second window information, the cache capacity and the decoding capacity of the computer.
[0217] In one implementation, taking the case where the first speed and the second speed determined by the computer are the same as an example, specifically, the method for determining the first speed and the second speed by the computer may include S201-S206:
[0218] S201. The computer determines a first distance S1 according to the first window information and the first control information (specifically, the mapped first control information, i.e., the first mapped control information), and determines a second distance S2 according to the first mapped control information and the first window information.
[0219] In the case where both the first mapping control information and the second window information are rectangular information, taking the first mapping control information as (l2′, r2′, w2′, h2′) and the second window information as (l3′, r3′, w3′, h3′) as an example, the second distance S2 can be calculated using the following expression:
[0220] The calculation method of the first distance is the same as the calculation method of the second distance, and will not be described in detail here.
[0221] S202: The computer determines a first time t1, i.e., the time it takes to move the first distance, based on the buffer size B and the buffer speed x. Specifically, the expression for the first time t1 can be:
[0222] S203: The computer determines a second time t2, i.e., the travel time for the second distance, based on a preset decoded data volume D and a decoding capability parameter y. The preset decoded data volume D is a preset amount of data required to achieve smooth playback of the data stream, for example, the amount of data for one or more frames of a video stream.
[0223] Specifically, the expression of the second time t2 can be:
[0224] S204: The computer determines a first estimated speed v1′ based on the first distance S1 and the first time t1. Specifically, the expression of the first estimated speed v1′ can be:
[0225] S205: The computer determines a second estimated speed v2′ based on the second distance S2 and the second time t2. Specifically, the expression for the second estimated speed v2′ can be:
[0226] S206. When the first estimated speed v1′ is less than or equal to the second estimated speed v2′, the computer can determine that the first speed and the second speed are both the first estimated speed v1′. When the first estimated speed v1′ is greater than the second estimated speed v2′, the computer can determine that the first speed and the second speed are both the second estimated speed v2′. This allows the computer to cache and decode the switched vertical video stream with sufficient time, thereby ensuring that the switched vertical video stream can be played smoothly after the computer's switching animation is displayed.
[0227] In this implementation, when the first speed and the second speed are the same, the switching animation shrinks from the starting window 201 to the middle window 202 and then expands to the ending window 203 at the same speed. In this way, the movement speed of the switching animation is uniform and constant, which can improve the smoothness of the switching animation and the user experience.
[0228] In one implementation, taking the example of a first speed and a second speed determined by a computer being different, the method for determining the first speed and the second speed by a computer may include S301-S306:
[0229] S301: The computer determines a first distance S1 based on the first window information and the first control information (specifically, the mapped first control information, i.e., the first mapped control information), and determines a second distance S2 based on the first mapped control information and the first window information. The specific implementation method can refer to S201 above and is not further described here.
[0230] S302: The computer determines the first time t1, i.e., the moving time of the second distance, based on the preset decoding data volume D and the decoding capability parameter y. Specifically, the expression of the first time t1 can be:
[0231] S303: The computer determines a first estimated speed v1′ based on the second distance S2 and the first time t1, that is, the moving speed of the second distance. Specifically, the expression of the first estimated speed v1′ can be:
[0232] S304: The computer determines a second time t2, i.e., the time it takes to travel the first distance, based on the first distance S1 and the first estimated speed v1′. Specifically, the expression for the second time t2 can be:
[0233] S305: The computer determines a third time t3, i.e., the buffering time, based on the buffer size B and the buffering speed x. Specifically, the expression for the third time t3 can be:
[0234] S306 : When the second time t2 is greater than or equal to the third time t3 , the computer may determine that the first speed and the second speed are both the first estimated speed v1 ′.
[0235] When the second time t2 is less than the third time t3, the computer can determine the second speed as the first estimated speed v1′. The computer can also determine the first speed, i.e., the moving speed of the first distance, based on the first distance S1 and the third time t3. Specifically, the expression for the first speed v1 can be:
[0236] In this way, it can be ensured that the computer has enough time to cache the switched vertical screen video stream, so that after the computer's switching animation effect is displayed, the switched vertical screen video stream can be played smoothly.
[0237] In some embodiments, when the computer-generated transition effect is a process of shrinking a first window to a first point at a first speed and then zooming from the first point to a second window at a second speed, the computer can also determine the first speed and the second speed through the above steps S201-S206 and S301-S306. Specifically, when determining the first distance and the second distance (as in the above steps S201 and S301), the computer can replace the first mapping control information with the position information of the first point. This allows the computer to accurately determine the first speed and the second speed.
[0238] In one implementation, the computer can implement the above S201-S206 and S301-S306 through a motion effect control module in the computer.
[0239] In some embodiments, to ensure that the transition animation does not produce ghosting or screen flickering, the computer may further determine whether the first speed and the second speed are between a first speed threshold and a second speed threshold, i.e., greater than the first speed threshold and less than the second speed threshold. The first speed threshold is the minimum speed at which the video stream is played without ghosting, and the second speed threshold is the maximum speed at which the video stream is played without screen flickering.
[0240] Specifically, the first speed threshold and the second speed threshold can be determined based on consensus baseline data (such as prior knowledge), or can be determined based on user experience data. The first speed threshold and the second speed threshold can be constant values, or can be dynamically adjusted based on user experience, which is not specifically limited in this application.
[0241] When the first speed and the second speed are not between the first speed threshold and the second speed threshold, the computer can adjust the first speed and the second speed so that the first speed and the second speed are between the first speed threshold and the second speed threshold, so that the computer determines that there is no ghosting or screen flickering in the switching animation.
[0242] In one implementation, the computer can adjust the first speed and the second speed via a decoding capability adaptation module within the computer. Specifically, as can be seen from the above-described processes of determining the first speed and the second speed in S201-S206 and S301-S306, the first speed and the second speed are related to the computer's decoding capability parameters. Therefore, the decoding capability adaptation module can adjust the decoding capability parameters to adjust the first speed and the second speed between the first speed threshold and the second speed threshold.
[0243] In some embodiments, the computer may use the first speed and the second speed as a baseline to maintain a constant speed to generate the switching effect. For example, the switching effect may be uniformly shifted from the starting window 201 at the first speed to the middle window 202, and then uniformly shifted from the middle window 202 to the ending window 203 at the second speed.
[0244] In some embodiments, the computer can also use the first speed and the second speed as a baseline to generate a switching effect. That is, the switching effect starts from the starting window 201, first fast then slow or first slow then fast, using the first speed as a baseline, and then changes to the middle window 202. Then, the middle window 202 changes to the ending window 203, using the second speed as a baseline, first fast then slow or first slow then fast. For example, the computer can use the first speed and the second speed as a baseline and determine the specific speed of the speed change based on the principle of Bezier curve.
[0245] In some embodiments, the display content of the switching animation may be related to the display content of the first application (i.e., the horizontal video stream and the vertical video stream). Specifically, the display content of the switching animation may be one or more of: the video of the horizontal video stream, the last frame image of the horizontal video stream, the video of the vertical video stream, the first frame image of the vertical video stream, a certain frame image in the horizontal video stream, and a mask image of a certain frame image in the horizontal video stream. The display content of the switching animation may also include, but is not limited to: a preset mask image, a preset image (such as a preset logo), a preset video, etc. Among them, the mask image is an image after blurring the image.
[0246] In one implementation, in S104 or S105, after receiving the switching instruction, the computer can obtain the last frame image of the horizontal screen video stream, or the mask image, or the preset image, or the preset video, etc., to generate the display content of the switching animation, for example, the display content of the starting window 201.
[0247] In one implementation, in S104, after the mobile phone receives the switching instruction, it can also obtain the first frame image of the vertical screen video stream, or the mask image, or the preset image, or the preset video, etc., to generate the display content of the switching effect, for example, the display content of the termination window 203.
[0248] In some application scenarios, before the computer completes decoding of the received vertical video stream, if the mobile phone does not stop sending the horizontal video stream to the computer, then during the process of the computer displaying the switching effect, the display content of the first window (for example: the window from the starting window 301 to the middle window 302, and / or the window from the middle window 302 to the ending window 303) can continue to play the horizontal video stream until the last frame of the horizontal video stream is played.
[0249] In one implementation, if the horizontal screen video stream has been played before the switching animation moves to the termination window, the last frame image of the horizontal screen video stream can be used as the display content of the switching animation moving window until it moves to the termination window, that is, the switching animation is completed.
[0250] In one implementation, when the animation is switched to the termination window, if the horizontal video stream has not yet finished playing, it can continue to play in the termination window. At the same time, the computer will cache and decode the received vertical video stream. After the vertical video stream is decoded, it will continue (or replace) the horizontal video stream played in the termination window and play the vertical video stream in the termination window, so that the vertical and horizontal video streams are connected and the video streams are smoothly switched.
[0251] As shown in FIG9 , after the computer generates and displays the switching animation, the method further includes:
[0252] S106. After the computer completes switching the dynamic effect display, it displays the vertical screen video stream in the second window.
[0253] In an embodiment of the present application, after the switching effect is displayed, the computer can display the vertical screen video stream in the second window. The second window can be the window when the switching effect is displayed, for example, the above-mentioned termination window 203. That is, the second window can be obtained by changing the position and / or size of the first window. The second window can also be a display window regenerated by the computer based on the second window information after the switching effect is displayed. This application does not make specific limitations on this.
[0254] In some embodiments, during the process of the computer generating the switching animation in S105, when the computer determines the first speed and the second speed based on the decoding capability, as shown in FIG9 , before S105, the video switching method provided in the embodiment of the present application further includes:
[0255] S107: The computer obtains the computer's decoding capability parameters.
[0256] In an embodiment of the present application, the computer can also obtain the computer's decoding capability parameters, which are used to represent the computer's ability to decode video streams. The decoding capability parameters include, but are not limited to, decoding time for video streams of different bitrates, decoding speed (i.e., the amount of data decoded by the computer per unit time), etc.
[0257] In one implementation, S107 may be implemented by a decoding capability adaptation module in a computer.
[0258] In one example, the decoding capability adaptation module can obtain the computer's decoding capability parameters from local storage or a cloud server. Specifically, a preset decoding capability mapping table is stored in the computer's local storage or cloud server. This decoding capability mapping table is a decoding capability mapping table for different bitstream video streams based on different network parameters and electronic device (e.g., computer) capabilities. Network parameters include, for example, bandwidth, rate, and latency, and electronic device capabilities include, for example, the processing power of the device chip.
[0259] In another example, the decoding capability adaptation module can also estimate the decoding capability parameters of the computer. Specifically, the computer can obtain the time point (T startTimeBuf ), the time point when the vertical screen video stream decoding is completed recorded in the decoder (T endTimeBuf ) and the amount of data accumulated in the buffer (D sum ). Then, the computer can estimate the computer's decoding capability parameter y according to the following expression:
[0260] It should be noted that step S107 is an optional step and is executed when the computer needs to determine the first and second speeds of the switching effect in combination with the decoding capability parameters in step S105. S107 can be executed when the collaborative operation is triggered (i.e., when the mobile phone and the computer establish a collaborative operation connection in step S101). S107 can also be executed after step S101 and before step S105 to ensure that the first and second speeds can be determined based on the decoding capability parameters in step S105. This application does not specifically limit this.
[0261] In some embodiments, as shown in FIG9 , after S105 , the video switching method provided in the embodiment of the present application further includes:
[0262] S108. After the computer displays the switching animation, obtain the actual decoding capability parameters for decoding the vertical screen video stream, and update the original decoding capability parameters.
[0263] In some embodiments, after the computer displays the transition animation determined in S105, the computer's actual decoding capability parameters for decoding the vertical video stream can be obtained. Furthermore, the computer can use the actual decoding parameters to update the computer's decoding capability parameters in the decoding capability mapping table. In this way, the decoding capability parameters in the decoding capability mapping table can be closer to the computer's actual decoding capability.
[0264] In one implementation, S108 can be implemented by a decoding detection module in the computer. Specifically, the decoding detection module can monitor the computer's decoding capability parameters in real time. During the computer display switching animation, the decoding detection module can obtain the computer's decoding capability parameters for decoding the vertical screen video stream in real time. After the computer display switching animation is completed, the decoding detection module can determine the actual decoding capability parameters to update the original decoding capability parameters in the decoding capability mapping table.
[0265] As in the video switching method described in S101-S108 in the above embodiment, by using the method provided in the embodiment of the present application, the mobile phone can obtain the information (such as position information) of the control for playing the video in the window where the mobile phone plays the vertical screen video stream, that is, the first control information. And the first control information can be transmitted to the computer. In this way, when the window where the mobile phone plays the video stream switches from the horizontal screen state to the vertical screen state, that is, when the horizontal screen video stream is played is switched to the vertical screen video stream. The computer can determine the change position of the first window in the process of the computer switching from playing the horizontal screen video stream to playing the vertical screen video stream based on the first window information, the first control information and the second window information, and then generate and display the switching animation, so that the computer can smoothly switch between the two video streams.
[0266] Next, we continue to use the mobile phone and computer in the above embodiment as an example. In some application scenarios, before the computer generates a switching animation based on the method described in S101-S108 above to achieve a smooth switch from playing a video stream in a horizontal screen state to playing a video stream in a vertical screen state, the computer can also generate a switching animation to achieve a smooth switch from playing a video stream in a vertical screen state to playing a video stream in a horizontal screen state when the mobile phone switches from playing a video stream in a vertical screen state to playing a video stream in a horizontal screen state.
[0267] Figure 15 is a fourth schematic diagram of the principle of the video switching method provided by an embodiment of the present application. As shown in Figure 15, first, when the mobile phone plays a vertical screen video stream, it sends the vertical screen video stream and the first control information to the computer. The first control information is associated with the position of the control for playing the video in the window where the mobile phone plays the vertical screen video stream. The computer plays the vertical screen video stream in the third window. And when the first control information changes, the updated first control information is sent to the computer. After the mobile phone switches from playing the vertical screen video stream to the horizontal screen video stream, the horizontal screen video stream is sent to the computer. The computer can generate and display a switching animation based on the third window information, the second control information and the fourth window information, so that the computer can smoothly switch from the vertical screen video stream to the horizontal screen video stream.
[0268] Specifically, FIG16 is a second flow chart of the video switching method provided in an embodiment of the present application. As shown in FIG16 , the video switching method provided in an embodiment of the present application mainly includes S401-S410:
[0269] S401. The mobile phone and the computer establish a collaborative operation connection.
[0270] Specifically, the implementation method of establishing a collaborative operation connection between the mobile phone and the computer can refer to the above S101 and will not be described in detail here.
[0271] S402: The mobile phone sends a vertical screen video stream and first control information to the computer.
[0272] In some embodiments, when multiple video playback controls are present in the display interface of a mobile phone playing a vertical video stream, that is, when the window of a first application displayed on the mobile phone includes multiple first controls, as shown in Figure 10 , the window of the first application displayed on the mobile phone also includes multiple first controls, such as: playback control 103, playback control 104, and playback control 105. The mobile phone can also obtain control information of playback control 103, playback control 104, and playback control 105 to obtain multiple first control information.
[0273] In some embodiments, when at least one first control is included, the mobile phone may further obtain and send first identification information corresponding to each first control information. Specifically, the first identification information is identification information corresponding to the first control information, that is, identification information corresponding to the first control, and each first identification information corresponds to a first control. The first identification information is a unique identifier of the first control. For example, the first identification information may be an identity document (ID) of the first control, and the first identification information may be used to distinguish the first control so as to quickly determine the first control information corresponding to the first control.
[0274] In one implementation, the mobile phone may send the first control information and the corresponding first identification information to the computer via a control channel. In another implementation, the mobile phone may also send the first control information and the corresponding first identification information to the computer via an independent logical channel.
[0275] In some embodiments, the mobile phone may also send a second instruction message to the computer, which may be used to instruct the computer on the position and / or size of the projection window for playing the vertical video stream. This allows the computer to quickly generate a projection window for playing the vertical video stream.
[0276] In one implementation, the second indication information may be the position and / or size of the window on the mobile phone displaying the vertical video stream. The position and / or size of the window on the mobile phone displaying the vertical video stream can be used by the computer to determine the position and / or size of the projection window and generate a projection window to play the vertical video stream.
[0277] S403: The computer receives the vertical screen video stream and the first control information, displays the vertical screen video stream in a third window, and saves the first control information.
[0278] In an embodiment of the present application, after the computer caches and decodes the received vertical screen video stream, it obtains the decoded vertical screen video stream and displays the vertical screen video stream in the projection window (i.e., the third window). The position and size of the third window can be determined based on the third window information. The third window information can be associated with the size of the window in which the mobile phone displays the vertical screen video stream.
[0279] In one implementation, at S402, the mobile phone sends the second instruction information to the computer, and the second instruction information may be the position and / or size of the window in which the mobile phone displays the vertical video stream. The computer may determine and obtain third window information based on the second instruction information. Further, the computer may generate a third window based on the third window information to play the vertical video stream in the third window.
[0280] In addition, the computer can also perform position mapping on the received first control information, obtain and save the projection position of the first control in the computer (ie, the first mapping control information), and save the first mapping control information.
[0281] In some embodiments, when the mobile phone sends multiple first control information and corresponding first identification information, the computer can also map and transform each first control information in the multiple first control information to obtain the first mapping control information corresponding to the multiple first control information, and save each first mapping control information and the first identification information corresponding thereto.
[0282] S404: The mobile phone sends a horizontal screen video stream to the computer in response to the switching instruction.
[0283] Specifically, the switching instruction can be used to instruct the mobile phone to switch from portrait to landscape mode, that is, to switch from playing a portrait video stream to playing a landscape video stream. The switching instruction can be generated by the user initiating a switching operation on the mobile phone. The switching instruction can also be generated by the user initiating a switching operation on a computer, which then sends the switching instruction to the mobile phone.
[0284] In an embodiment of the present application, the mobile phone can switch from playing a vertical screen video stream to a horizontal screen video stream in response to a switching instruction, that is, the video stream sent by the mobile phone to the computer is switched from a vertical screen video stream to a horizontal screen video stream.
[0285] In some embodiments, when the mobile phone sends the first identification information to the computer in S402, the mobile phone may also send target identification information to the computer. The target identification information is identification information of the target control, and the target identification information is one of the first identification information, that is, the target control is one of the first controls. Specifically, the target control is the first control determined by the user for switching to horizontal screen playback, that is, the target control is the first control selected by the user in the mobile phone display interface to switch to playing the horizontal screen video stream.
[0286] In some embodiments, similar to the manner in which the mobile phone sends the first control information, the mobile phone can send the identification information of the target control to the computer via the control channel. An independent logical channel can also be established between the mobile phone and the computer to send the identification information of the target control to the computer, although this application does not specifically limit this.
[0287] S405: The mobile phone receives the horizontal screen video stream, and in response to the switching instruction, generates and displays a switching animation according to the third window information, the first control information, and the fourth window information.
[0288] In an embodiment of the present application, the computer can cache and decode the received horizontal screen video stream to obtain the decoded horizontal screen video stream, and can display the vertical screen video stream in a fourth window. Among them, the position and size of the fourth window can be determined based on the fourth window information. The fourth window information may include the size of the entire display interface (full screen) of the computer, and the fourth window information may also be associated with the position and / or size of the window of the first application displayed in the horizontal screen state of the mobile phone (i.e., the window playing the horizontal screen video stream).
[0289] In one implementation, the computer may have preset fourth window information. For example, the preset fourth window information may be the size of the entire display interface of the computer. Thus, in S404, the mobile phone may send a full-screen playback instruction to the computer. The computer may respond to the full-screen playback instruction by generating a fourth window based on the preset fourth window information and playing the horizontal video stream in full screen mode.
[0290] In another implementation, the computer may also receive the position and / or size of the window of the mobile phone playing the horizontal screen video stream, and determine the fourth window information based on the position and / or size of the window of the mobile phone playing the horizontal screen video stream. For example, the computer may perform a mapping transformation (such as position offset, proportional scaling, etc.) on the position and / or size of the window of the mobile phone playing the horizontal screen video stream received to determine the fourth window information. Furthermore, the computer may generate a fourth window based on the fourth window information to play the horizontal screen video stream in the fourth window.
[0291] In response to the switching instruction, the computer can generate and display a switching animation based on the third window information, the first control information and the fourth window information. The switching animation includes the computer displaying the window of the first application in a vertical state to the window of the first application in a horizontal state, that is, the computer changes from the third window playing the vertical video stream to the fourth window playing the horizontal video stream.
[0292] In some embodiments, the computer can scale the first window based on the third window information, the first control information, and the fourth window information, and cause the content displayed in the third window to change as the third window size changes, thereby forming a switching effect. Specifically, the computer-generated switching effect may include: reducing the third window based on the third window information and the first control information, and associating the size and position of the reduced third window with the first control information. Then, based on the fourth window information, enlarging the third window, and associating the size and position of the enlarged third window with the fourth window information.
[0293] In one implementation, in a computer-generated transition effect, the third window can be reduced to a second point based on the first control information, and then enlarged based on the second point. The second point is determined based on the first control information, and can be a point determined based on the position and size of the first control in the first control information and a preset rule.
[0294] For example, FIG17 is a third schematic diagram of a switching effect provided by an embodiment of the present application. As shown in FIG17 , taking the second point as the center point of the first control in a window playing a vertical video stream on a computer, and the fourth window as a full-screen window on the computer as an example, the switching effect generated by the computer may include: on the computer display interface 200 , shrinking the third window 310 to the center point 320 of the first control using a third action and a third speed, and then enlarging from the center point 320 of the first control to the fourth window 330 using a fourth action and a fourth speed.
[0295] In another implementation, in the computer-generated switching animation, the third window can be reduced to the size and position determined by the first mapping control information with a third action and a third speed according to the first control information, and then the third window can be enlarged to the size and position determined according to the fourth window information with a fourth action and a fourth speed.
[0296] For example, FIG18 is a fourth schematic diagram of a switching effect provided in an embodiment of the present application. As shown in FIG18 , the fourth window is a full-screen window of a computer. The computer-generated switching effect can be a third window (i.e., a starting window 301) determined by the third window information (l2, r2, w2, h2) in the display interface of the computer, which is reduced to a window (i.e., an intermediate window 302) determined by the first mapping control information (l1′, r1′, w1′, h1′) with a third action and a third speed, and then enlarged from the intermediate window 302 to a fourth window (i.e., an ending window 303) determined by the fourth window information (l3, r3, w3, h3).
[0297] The third action and the fourth action may be the same or different, and may be one or more of the following motion effects: rotation, fade-in and fade-out, or fly-in and fly-out. This application does not specifically limit the third action and the fourth action.
[0298] In some embodiments, when the decoding capability of the computer is stable, the computer can determine the third speed and the fourth speed according to the third window information, the first control information, the fourth window information and the preset time.
[0299] In some embodiments, the computer can also estimate the moving speed of the switching animation and determine the third speed and the fourth speed based on the computer's caching and decoding process of the horizontal screen video stream, combined with the computer's caching capacity and decoding capacity.
[0300] Specifically, the computer can determine the third speed and the fourth speed based on the third window information, the first control information, the fourth window information, and the computer's cache capacity and decoding capacity. The method for determining the third speed, the fourth speed, and the display content of the switching animation can refer to the method for determining the first speed, the second speed, and the display content of the switching animation in S105 above, and will not be repeated here.
[0301] S406. After the switching of the dynamic effect display is completed, the computer displays the horizontal screen video stream in the fourth window.
[0302] The fourth window may be the window displayed when the switching animation is complete, for example, the termination window 303 described above. That is, the second window may be obtained by changing the position and / or size of the third window. The fourth window may also be a display window regenerated by the computer based on the fourth window information after the switching animation is complete. This application does not impose any specific limitations on this.
[0303] In some embodiments, during the process of the computer generating the switching animation in S405, when the computer determines the third speed and the fourth speed based on the decoding capability, as shown in FIG16 , before S405, the video switching method provided in the embodiment of the present application further includes:
[0304] S407: The computer obtains the computer's decoding capability parameters.
[0305] S408. After the computer displays the switching animation, obtain the actual decoding capability parameters for decoding the horizontal screen video stream, and update the original decoding capability parameters.
[0306] Specifically, the implementation of S407-S408 may refer to the above-mentioned S107-S108, which will not be described in detail here.
[0307] In some embodiments, in order to enable the computer to accurately determine the change position of the switching effect and improve the smoothness of the computer-generated switching effect, the mobile phone can also monitor the first control information in real time, and when the first control information changes, obtain and send the updated first control information to the computer so that the first control information can be updated in time. As shown in Figure 16, before S405, the video switching method provided in the embodiment of the present application also includes:
[0308] S409: The mobile phone detects the first control information in real time, and when the first control information changes, obtains and sends the updated first control information to the computer.
[0309] In some application scenarios, when the first control information changes. For example, Figure 19 is a schematic diagram of the mobile phone display interface provided in an embodiment of the present application. As shown in Figure 19, the user can move the display interface of the mobile phone up and down by sliding the display screen of the mobile phone up and down, thereby changing the position of the play controls (such as play controls 102, play controls 103, play controls 104 and play controls 105) in the window of the first application, resulting in changes in the first control information. The mobile phone detects the first control information in real time and sends the updated first control information to the computer. In this way, it can be ensured that the computer can quickly and accurately obtain the first control information when determining the motion effect.
[0310] In one implementation, S409 can be implemented by a control perception module in the mobile phone. Specifically, the control perception module can detect in real time whether the information and size of the first control in the window of the first application displayed on the mobile phone have changed. If the first control information has changed, the module obtains the latest first control information to update the first control information and sends the updated first control information to the computer. In this way, the computer can accurately determine the switching effect based on the first control information.
[0311] In some embodiments, when the mobile phone sends the first identification information to the computer in S402, the mobile phone may also send the updated first control information and the corresponding first identification information to the computer, so that the computer can quickly update the first control information according to the first identification information.
[0312] In this embodiment of the present application, whether the first control information has changed includes, but is not limited to: a change in the size information of the first control, a change in the position information of the first control, deletion of the first control information (i.e., the original first control is moved out of the window of the mobile phone displaying the first application), and addition of the first control information (i.e., a new first control is moved into the window of the mobile phone displaying the first application). As shown in Figure 19, the playback control 106, the playback control 107, and the playback control 108 are newly added playback controls after the content of the window displaying the first application on the mobile phone changes. The control information corresponding to the playback control 106, the playback control 107, and the playback control 108 is the newly added first control information.
[0313] S410: The computer receives updated first control information and saves the updated first control information.
[0314] In an embodiment of the present application, after receiving the updated first control information, the computer can perform a mapping transformation on the received updated first control information to obtain updated first mapping control information, and replace the original first mapping control information with the updated first mapping control information to achieve the update of the first mapping control information.
[0315] For example, when the mobile phone sends the updated first control information and the corresponding first identification information to the computer, the computer can determine the first control information saved in S403 based on the first identification information and replace the original first control information with the updated first control information corresponding to the first identification information. If the computer cannot find the original saved first control information based on the first identification information, it means that the updated first control information corresponding to the first identification information is newly added first control information, and the first control information is directly saved.
[0316] In one implementation, if the computer does not receive the first identification information saved in S403, it means that the first control corresponding to the first identification information has been moved out of the window of the mobile phone displaying the first application, and the computer can delete the first control information corresponding to the first identification information. In this way, the computer's storage resources can be saved.
[0317] In the embodiment of the present application, the above steps S409 and S410 are optional. If the first control information changes, S409 and S410 are performed after S402. If the first control information does not change, S409 and S410 are not performed.
[0318] As in the video switching method described in S401-S410 of the above embodiment, by using the method provided in the embodiment of the present application, the mobile phone can obtain the information (such as position information) of the control for playing the video in the window where the mobile phone plays the vertical screen video stream, that is, the first control information, and can transmit the first control information to the computer. In this way, when the window where the mobile phone plays the video stream switches from the vertical screen state to the horizontal screen state, that is, when the vertical screen video stream is played is switched to the horizontal screen video stream. The computer can determine the change position of the third window in the process of the computer switching from playing the vertical screen video stream to playing the horizontal screen video stream based on the third window information, the first control information and the fourth window information, and then generate and display the switching animation, so that the computer can smoothly switch between the two video streams.
[0319] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0320] In the embodiment of the present application, the functional modules of the electronic device can be grouped according to the above method example. For example, each functional module can be grouped according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the grouping of modules in the embodiment of the present application is schematic and is only a logical functional grouping. In actual implementation, there may be other grouping methods.
[0321] An embodiment of the present application also provides a video switching device, which can be the above-mentioned second electronic device (such as the computer in the above-mentioned embodiment), or a chip in the second electronic device, or a system on a chip. The video switching device can be used to perform the functions related to the computer in the above-mentioned embodiment.
[0322] As an implementable manner, as shown in FIG20 , the video switching device 200 includes: a receiving module 201, a display module 202, a control perception module 203 and a motion effect control module 204. Among them, the receiving module 201 is used to receive a first video stream, which is display data when the first electronic device displays the window of the first application in a first state. The display module 202 is used to display the first video stream in the first window. The receiving module 201 is also used to receive a second video stream, which is display data when the first electronic device displays the window of the first application in a second state. The control perception module is used to receive first control information, which is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing video in the window of the first application. The animation control module 203 is used to generate a switching animation based on the first window information, the first control information, and the second window information, wherein the first window information is associated with the first window, and the second window information is associated with the position of the window of the first application displayed in the second state on the first electronic device. The switching animation includes displaying the window of the first application in the first state to the window of the first application in the second state, wherein the display content of the switching animation is related to the first application. The display module 202 is also used to display the first video stream in the second window after the switching animation is displayed, and the second window is associated with the second window information.
[0323] In some embodiments, the video switching device 200 further includes a collaboration module 205, a decoding capability adaptation module 206, and a decoding monitoring module 207. The collaboration module 205 is configured to establish a collaborative operation connection to implement collaborative operation functionality. The decoding capability adaptation module 206 is configured to obtain decoding capability parameters to determine the speed of the switching effect. The decoding monitoring module 207 is configured to monitor the actual decoding capability parameters of the video stream for updating the decoding capability parameters.
[0324] An embodiment of the present application also provides a video switching device, which can be the above-mentioned first electronic device (such as the mobile phone in the above-mentioned embodiment), or a chip in the first electronic device, or a system on a chip. The video switching device can be used to perform the functions of the mobile phone involved in the above-mentioned embodiment.
[0325] As an implementable method, as shown in FIG21 , the video switching device 300 includes: a sending module 301 and a control perception module 302. The sending module 301 is used to send a first video stream, which is display data when the first electronic device displays the window of the first application in the first state. The control perception module 302 is used to obtain and send first control information, the first control information is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing video in the window of the first application; the first control information is used for the second electronic device to generate a switching animation, and the switching animation includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state. The sending module 301 is also used to send a second video stream, which is display data when the window of the first application is displayed in the second state.
[0326] An embodiment of the present application also provides an electronic device, which may include: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the mobile phone in the above method embodiment, or the electronic device can execute the various functions or steps executed by the computer in the above method embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors. For example, the structure of the electronic device can refer to the structure of the electronic device shown in Figure 5.
[0327] The embodiment of the present application also provides a chip system, which can be applied to the electronic devices in the aforementioned embodiments. As shown in Figure 22, the chip system includes at least one processor 401 and at least one interface circuit 402. The processor 401 can be the processor in the above-mentioned electronic device. The processor 401 and the interface circuit 402 can be interconnected through a line. The processor 401 can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit 402. When the computer instructions are executed by the processor 401, the electronic device can execute the various steps executed by the mobile phone in the above-mentioned embodiment, or the electronic device can execute the various steps executed by the computer in the above-mentioned embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in the embodiment of the present application.
[0328] An embodiment of the present application also provides a computer-readable storage medium for storing computer instructions executed by the above-mentioned electronic device.
[0329] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above electronic device.
[0330] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0331] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0332] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0333] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0334] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0335] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A video switching method, characterized in that: Applied to a second electronic device, the method includes: receiving a first video stream sent by a first electronic device, where the first video stream is display data when the first electronic device displays a window of a first application in a first state; Displaying the first video stream in a first window of the second electronic device; receiving a second video stream and first control information sent by the first electronic device, wherein the second video stream is display data when the first electronic device displays the window of the first application in a second state, the first control information is associated with a position of a first control in the window of the first application displayed in the second state, and the first control is a control in the window of the first application for playing a video; Generate a switching animation according to the first window information, the first control information, and the second window information, wherein the first window information is associated with the first window, the second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state, the switching animation includes the second electronic device changing from displaying the window of the first application in the first state to displaying the window of the first application in the second state, wherein the display content of the switching animation is related to the first application; After the switching animation is displayed, the first video stream is displayed in a second window of the second electronic device, and the second window is associated with the second window information.
2. The method according to claim 1, characterized in that The first control information is also associated with the size of the first control in the window of the first application displayed in the second state.
3. The method according to claim 1 or 2, characterized in that: The first window information is associated with at least one of a position or a size of a window of the first application displayed by the first electronic device in the first state; Before displaying the first video stream in the first window of the second electronic device, the method further includes: At least one of a position or a size of a window of the first application displayed by the first electronic device in the first state is received, which is sent by the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that: Before generating the switching animation according to the first window information, the first control information and the second window information, the method further includes: A position of a window of the first application displayed by the first electronic device in the second state is received, which is sent by the first electronic device.
5. The method according to any one of claims 1 to 4, characterized in that: The second window information is also associated with a size of a window of the first application displayed by the first electronic device in the second state; Before generating the switching animation according to the first window information, the first control information and the second window information, the method further includes: Receive the size of the window of the first application displayed by the first electronic device in the second state, which is sent by the first electronic device.
6. The method according to any one of claims 1 to 5, characterized in that: Before receiving the second video stream and the first control information sent by the first electronic device, the method further includes: A switching instruction is received, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
7. The method according to claim 6, characterized in that The first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
8. The method according to any one of claims 1 to 7, characterized in that: The generating a switching animation according to the first window information, the first control information and the second window information includes: According to the first window information and the first control information, shrinking the first window, wherein the size and position of the shrunken first window are associated with the first control information; Then, the first window is enlarged according to the second window information, and the size and position of the enlarged first window are associated with the second window information.
9. The method according to claim 8, characterized in that The reducing the first window according to the first window information and the first control information includes: The first window is reduced to a first point, where the first point is determined according to the first control information.
10. The method according to claim 9, characterized in that The first point is a center point of the first control in the window of the first application displayed by the second electronic device in the second state.
11. The method according to any one of claims 8 to 10, characterized in that: While reducing the first window, one or more of the following animations are displayed: rotation, fade in and fade out, and fly in and fly out; while enlarging the first window, one or more of the following animations are displayed: rotation, fade in and fade out, and fly in and fly out.
12. The method according to any one of claims 1 to 11, characterized in that: The display content of the switching animation is: one or more of the last frame image of the first video stream, the first frame image of the second video stream, a mask image, a preset image, and a preset video.
13. The method according to any one of claims 8 to 12, characterized in that: The method further comprises: reducing the first window at a first speed, and then enlarging the first window at a second speed; The first speed and the second speed are determined according to the cache capacity and decoding capacity of the second electronic device, the cache capacity of the second electronic device is used to characterize the ability of the second electronic device to cache the video stream, and the decoding capacity of the second electronic device is used to characterize the ability of the second electronic device to decode the video stream.
14. The method according to claim 13, characterized in that The generating of the switching animation according to the first window information, the first control information and the second window information further includes: Determine a moving distance according to the first window information, the first control information and the second window information; Determining the moving time according to the buffering capacity and decoding capacity of the second electronic device; The first speed and the second speed are determined according to the moving distance and the moving time.
15. The method according to claim 14, characterized in that The moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time; Then determining the first speed and the second speed according to the moving distance and the moving time includes: Determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information; determining the first time according to a cache capability of the second electronic device; determining the second time according to a decoding capability of the second electronic device; Determine a first estimated speed according to the first distance and the first time, and determine a second estimated speed according to the second distance and the second time; When the first estimated speed is less than or equal to the second estimated speed, determining that the first speed and the second speed are both the first estimated speed; When the first estimated speed is greater than the second estimated speed, it is determined that the first speed and the second speed are both the second estimated speed.
16. The method according to claim 14, characterized in that The moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time; Then determining the first speed and the second speed according to the moving distance and the moving time includes: Determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information; determining the first time according to a decoding capability of the second electronic device; determining the second speed according to the second distance and the first time; determining a second time according to the first distance and the second speed; Determining the third time according to the cache capability of the second electronic device; When the second time is greater than or equal to the third time, determining that the first speed is the same as the second speed; When the second time is less than the third time, the first speed is determined according to the first distance and the third time.
17. A video switching method, characterized in that: Applied to a first electronic device, the method includes: Sending a first video stream, where the first video stream is display data when the first electronic device displays a window of a first application in a first state; Acquire first control information, where the first control information is associated with a position of a first control in the window of the first application displayed in the second state, and the first control is a control in the window of the first application for playing a video; A second video stream and the first control information are sent, wherein the second video stream is display data when the first electronic device displays the window of the first application in a second state, and the first control information is used for the second electronic device to generate a switching effect, wherein the switching effect includes the second electronic device displaying the window of the first application in the first state to displaying the window of the first application in the second state.
18. The method according to claim 17, characterized in that The first control information is also associated with the size of the first control in the window of the first application displayed in the second state.
19. The method according to claim 17 or 18, characterized in that Before sending the second video stream and the first control information, the method further includes: Acquire at least one of a position or a size of a window of the first application displayed by the first electronic device in the first state; At least one of the position or size of the window of the first application displayed by the first electronic device in the first state is sent, and at least one of the position or size of the window of the first application displayed by the first electronic device in the first state is used to determine first window information, and the first window information is used by the second electronic device to generate the switching animation.
20. The method according to any one of claims 17 to 19, characterized in that: Before sending the second video stream and the first control information, the method further includes: Acquire at least one of a position or a size of a window of the first application displayed by the first electronic device in the second state; At least one of the position or size of the window of the first application displayed by the first electronic device in the second state is sent, and at least one of the position or size of the window of the first application displayed by the first electronic device in the second state is used to determine second window information, and the second window information is used by the second electronic device to generate the switching animation.
21. The method according to any one of claims 17 to 20, characterized in that: Before sending the second video stream and the first control information, the method further includes: A switching instruction is sent, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
22. The method according to any one of claims 17 to 21, characterized in that: The first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
23. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 16, or the electronic device executes the method as described in any one of claims 17 to 22.
24. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 16, or cause the electronic device to execute the method according to any one of claims 17 to 22.
Citation Information
Patent Citations
Video switching method and electronic equipment
CN118741195A
Screen projection data display processing method and device, terminal equipment and storage medium
CN113206964A
Display device and display picture rotation adaptation method
CN113395558A
Application interface display method in multi-window screen projection scene and electronic equipment
CN113553014A
Double-path screen projection method and electronic equipment
CN114691064A
