Video switching method and electronic device
By transmitting video playback control information between the first and second electronic devices and generating switching animations, the problems of screen flickering and stuttering during video stream switching are solved, achieving smooth video stream switching and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2023-03-28
- Publication Date
- 2026-07-03
AI Technical Summary
When switching video streams between the first and second electronic devices, the second electronic device cannot smoothly switch the display state of the projection window, which can easily lead to screen flickering, black screen, or stuttering.
The first electronic device transmits the control information of the video playback control corresponding to the video stream to the second electronic device, and the second electronic device generates switching animations based on this information to smoothly switch the video stream.
It improves the smoothness of video stream switching and user experience, avoids screen flickering or stuttering, and ensures a smooth switching process.
Smart Images

Figure CN118741195B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic devices, and more particularly to a video switching method and an electronic device. Background Technology
[0002] With the development of electronic devices, the interaction between them is becoming increasingly frequent. Multi-screen collaboration technology is a distributed technology that enables cross-system and cross-device collaboration, facilitating resource sharing and collaborative operation among electronic devices. As one of the main ways for electronic devices to interact, multi-screen collaboration can compensate for the shortcomings of electronic devices themselves, fully leverage the advantages of different electronic devices, and thus improve the user experience.
[0003] 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 cast the video played on the first electronic device to the second electronic device for display and playback.
[0004] However, when the display state of the window playing the video stream in the first electronic device changes—for example, when the first electronic device switches from landscape to portrait mode—the content displayed in the projection window of the second electronic device may flicker, go black, or stutter during the switching process, making it impossible to smoothly switch the video stream. Summary of the Invention
[0005] This application provides a video switching method and an electronic device, which can be applied in collaborative operation scenarios where a first electronic device projects its screen to a second electronic device. Specifically, the first electronic device can transmit control information (such as position information) 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 (i.e., when switching video streams), the second electronic device can determine the position information of the projection window based on the control information, and then generate and display switching animation effects so that the second electronic device can smoothly switch video streams.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0007] Firstly, a video switching method is provided, which can be applied to a second electronic device. Specifically, the method includes: the second electronic device receiving 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 in its display interface. Next, the second electronic device can 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, and the first control information is associated with the position of a first control within the window of the first application displayed in the second state; the first control is a control used for playing video within 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 a window of the first application in the first state to displaying a 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 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 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.
[0008] In this method, the second electronic device can receive first control information sent by the first electronic device. Thus, when the state of the window displaying the first application on the first electronic device changes—that is, when the video stream sent by the first electronic device to the first electronic device switches from a first video stream to a second video stream—the second electronic device can determine the changing position of the first window based on the first control information, the first window information, and the second window information. This allows the second electronic device to smoothly transition from displaying the first application window in a first state (i.e., the first window) to displaying the first application window in a second state (i.e., the second window), thereby improving the smoothness of the video stream switching by the second electronic device.
[0009] In conjunction with the first aspect, in one alternative implementation, the aforementioned 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.
[0010] In this implementation, the second electronic device can more accurately determine the changing position and size of the first window based on the first control information, namely 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 the second electronic device switching video streams.
[0011] In conjunction with the first aspect, in one alternative implementation, the aforementioned first window information is associated with at least one of the position or size of the window of the first application displayed in the first state on the first electronic device. Then, before displaying the first video stream in the first window of the second electronic device, the method further includes: the second electronic device receiving at least one of the position or size of the window of the first application displayed in the first state on the first electronic device, sent by the first electronic device.
[0012] 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 by the first electronic device in a first state. This allows the second electronic device to accurately determine the position and size of the first window based on the first window information, thereby displaying the first video stream within the first window and realizing the function of projecting the first video stream onto the second electronic device, improving the user experience. Furthermore, the second electronic device can also more accurately determine the starting position and size of the switching animation based on the first window information, further improving the smoothness of video stream switching on the second electronic device.
[0013] In conjunction with the first aspect, in an alternative implementation, before the second electronic device generates the switching 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 the position of the window of the first application displayed by the first electronic device in a second state, sent by the first electronic device.
[0014] This allows the second electronic device to 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 switching animations, the second electronic device can determine the termination position of the window displaying the switching animation based on the second window information, thereby further improving the smoothness of the video stream switching by the second electronic device.
[0015] In conjunction with the first aspect, in one alternative implementation, the aforementioned second window information is also associated with the size of the window of the first application displayed by the first electronic device in the second state. Therefore, before the second electronic device generates the switching 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 the size of the window of the first application displayed by the first electronic device in the second state, sent by the first electronic device.
[0016] This allows the second electronic device to accurately determine the second window information based on the size of the window of the first application displayed by the first electronic device in the second state. Furthermore, when generating the 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 video stream switching by the second electronic device.
[0017] In conjunction with the first aspect, in an alternative 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 receiving a switching instruction.
[0018] In this implementation, the switching command can be sent by the first electronic device or initiated by the user through a switching operation. The switching command can be used to instruct the first electronic device to change its screen orientation, 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 command, and to receive the first control information to generate a switching animation, thereby enabling the second electronic device to smoothly switch video streams.
[0019] In conjunction with the first aspect, in one alternative implementation, the first state is a landscape state and the second state is a portrait state, then the switching instruction is used to instruct the first electronic device to switch from the landscape state to the portrait state.
[0020] In conjunction with the first aspect, in one alternative 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, wherein 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, wherein the size and position of the enlarged first window are associated with the second window information.
[0021] In this implementation, the switching animation generated by the second electronic device can determine the size and position of the first window change based on the first window information, the first control information, and the second window information. This allows the first window to first shrink to the position and size associated with the first control information, and then enlarge to the position and size associated with the second control information. In this way, the switching animation can dynamically change, allowing the second electronic device to smoothly transition from the first window to the second window, further improving the smoothness of the switching animation display.
[0022] In conjunction with the first aspect, in one alternative implementation, the second electronic device shrinks the first window based on the first window information and the first control information, including: the second electronic device shrinks the first window to a first point, the first point being determined based on the first control information.
[0023] In conjunction with the first aspect, in one alternative implementation, the aforementioned first point is the center point of the first control in the window of the first application displayed on the second electronic device in the second state. This not only reduces the difficulty of generating switching animations on the second electronic device but also visually improves the smoothness of the switching animations, enhancing the user experience.
[0024] In conjunction with the first aspect, in one alternative implementation, the second electronic device displays one or more of the following animation effects while shrinking the first window: rotation, fade-in / fade-out, and fly-in / fly-out. The second electronic device also displays one or more of the following animation effects while enlarging the first window: rotation, fade-in / fade-out, and fly-in / fly-out.
[0025] In this implementation, the second electronic device can simultaneously shrink and enlarge the projection window, accompanied by various animation effects such as display rotation, fade-in / fade-out, and fly-in / fly-out. This increases the diversity of switching animation effects generated by the second electronic device, enhances the display effect of the switching animations, and improves the user experience.
[0026] In conjunction with the first aspect, in one alternative implementation, the displayed content of the aforementioned switching animation is one or more of the following: 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 displayed content of the switching animation and further improves the smoothness of the second electronic device switching video streams.
[0027] In conjunction with the first aspect, in one alternative implementation, the method further includes: the second electronic device shrinking 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 buffering capacity and decoding capacity of the second electronic device. Specifically, the buffering capacity of the second electronic device characterizes its ability to buffer video streams, and the decoding capacity characterizes its ability to decode video streams.
[0028] In this implementation, the second electronic device can determine the speed of shrinking and enlarging the projection window based on its decoding and caching capabilities, which can further improve the smoothness of the switching animation changes.
[0029] In conjunction with the first aspect, in one alternative implementation, the second electronic device generates a switching animation based on the first window information, the first control information, and the second window information. Specifically, this may include: the second electronic device determining the movement distance based on the first window information, the first control information, and the second window information; the second electronic device also determining the movement time based on its buffering and decoding capabilities; and finally, the second electronic device determining a first speed and a second speed based on the movement distance and the movement time.
[0030] In this implementation, the second electronic device can estimate the movement speed of the switching animation based on its movement distance and time. This allows the second electronic device to determine the speed at which the projection window shrinks and the speed at which it enlarges, thus improving the smoothness of the switching animation.
[0031] In conjunction with the first aspect, in one alternative implementation, the aforementioned movement distance includes a first distance and a second distance, and the aforementioned 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 movement time can include: First, the second electronic device determines the first distance based on first window information and first control information, and determines the second distance based on first control information and second window information. Then, the second electronic device determines the first time based on its buffering capability, and determines the second time based on its decoding capability. 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 can 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 estimated speed, the second electronic device can 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 buffering and decoding the switched second video stream, thereby ensuring that the switched second video stream can play smoothly after the switching animation is displayed.
[0032] In conjunction with the first aspect, in one alternative implementation, the aforementioned movement distance includes a first distance and a second distance, and the aforementioned 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 movement time can 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 its decoding capability, determines the second speed based on the second distance and the first time, and then determines the second time again based on the first distance and the second speed. Next, the second electronic device determines the third time based on its buffering capability. 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 buffer the switched second video stream, so that the switched second video stream can play smoothly after the switching animation display is completed.
[0033] Secondly, a video switching method is provided, which can be applied to a first electronic device. Specifically, the method includes: the first electronic device sending a first video stream, wherein the first video stream is display data when the first electronic device displays a window of a first application in a first state; the first electronic device acquiring first control information, the first control information being associated with the position of the first control in the window of the first application displayed in a second state, the first control being a control in the window of the first application used for playing video; and then, the first electronic device sending a second video stream and the first control information. The second video stream is display data when the first electronic device displays a window of the first application in a second state, and the first control information is used by the second electronic device to generate a switching animation effect, the switching animation effect including 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.
[0034] In this method, the first electronic device can acquire first control information and send the first control information to the second electronic device. Thus, when the state of the window displaying the first application changes on the first electronic device—that is, when the video stream sent by the first electronic device switches from the first video stream to the second video stream—the second electronic device can determine the changing position of the first window in its display interface based on the first control information, thereby generating and displaying a switching animation. This allows the second electronic device to smoothly transition from displaying the first application window in the first state (i.e., the first window) to displaying the first application window in the second state (i.e., the second window), thereby improving the smoothness of the video stream switching on the second electronic device.
[0035] In conjunction with the second aspect, in one alternative implementation, the aforementioned first control information is also 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 changing position and size of the first window based on the first control information—that is, 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 video stream switching by the second electronic device.
[0036] In conjunction with the second aspect, in one alternative implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device acquiring at least one of the position or size of the window of the first application displayed on the first electronic device in a first state. Then, the first electronic device sends at least one of the position or size of the window of the first application displayed on the first electronic device in the first state. Wherein at least one of the position or size of the window of the first application displayed on the first electronic device in the first state can be used to determine first window information, which can be used by the second electronic device to generate switching animations.
[0037] In conjunction with the second aspect, in an alternative implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device acquiring at least one of the position or size of the window of the first application displayed on 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 on the first electronic device in the second state, wherein the at least one of the position or size of the window of the first application displayed on 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 a switching animation.
[0038] This allows the second electronic device to accurately determine the second window information based on 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. Furthermore, the second electronic device can determine the termination position of the window displaying the switching animation based on the second window information, thereby improving the smoothness of the video stream switching by the second electronic device.
[0039] In conjunction with the second aspect, in an alternative implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device sending a switching instruction, which is used to instruct the first electronic device to change between portrait and landscape modes.
[0040] In conjunction with the second aspect, in one alternative implementation, where the first state is landscape mode and the second state is portrait mode, the switching instruction is used to instruct the first electronic device to switch from landscape mode to portrait mode.
[0041] Thirdly, a video switching device is provided, comprising: a receiving module, a display module, a control sensing module, and a motion effect control module. The receiving module receives a first video stream sent 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 displays the first video stream in a first window of a second electronic device. The receiving module also receives a second video stream sent 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 sensing module receives first control information sent 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 used for playing video in the window of the first application. The motion effect control module generates a switching motion effect 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 by the first electronic device in the second state. Specifically, the switching motion effect includes the second electronic device switching from displaying a window of the first application in the first state to displaying a window of the first application in the second state, wherein the display content of the switching motion effect is related to the first application. The display module is also used to display the first video stream in a second window of the second electronic device after the switching animation display is completed, wherein the second window is associated with the second window information.
[0042] Fourthly, a video switching device is provided, comprising: a sending module and a control sensing module. The sending module is used to send a first video stream, which is display data of a first electronic device displaying a window of a first application in a first state. The control sensing module is used to acquire and send first control information, which is associated with the position of a first control in the window of the first application displayed in a second state. The first control is a control used for playing video in the window of the first application. The first control information is used by the second electronic device to generate a switching animation effect, which 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. The sending module is also used to send a second video stream, which is display data of the first electronic device displaying the window of the first application in the second state.
[0043] Fifthly, an electronic device is provided, comprising: a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method described in the first aspect above and any alternative method thereof, or cause the electronic device to perform the method described in the second aspect above and any alternative method thereof.
[0044] A sixth aspect provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect above and any alternative method thereof, or cause the electronic device to perform the method described in the second aspect above and any alternative method thereof.
[0045] In a seventh aspect, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to perform the method described in the first aspect above and any alternative method thereof, or causes the computer to perform the method described in the second aspect above and any alternative method thereof.
[0046] Understandably, the beneficial effects 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, which will not be repeated here. Attached Figure Description
[0047] Figure 1 A schematic diagram illustrating a screen projection scenario provided in an embodiment of this application;
[0048] Figure 2 A schematic diagram illustrating the principle of transmitting video data for related technologies;
[0049] Figure 3 A schematic diagram illustrating the principle of the video stream switching method provided for related technologies;
[0050] Figure 4 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 1 ;
[0051] Figure 5 A schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;
[0052] Figure 6 A schematic diagram of the software structure of the electronic device provided in the embodiments of this application;
[0053] Figure 7 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 2 ;
[0054] Figure 8 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 3 ;
[0055] Figure 9 Flowchart of the video switching method provided in the embodiments of this application Figure 1 ;
[0056] Figure 10 A schematic diagram of a mobile phone display interface provided in an embodiment of this application;
[0057] Figure 11 This is a schematic diagram of a first control information provided in an embodiment of this application;
[0058] Figure 12 This is a schematic diagram illustrating the mapping of first control information according to an embodiment of this application;
[0059] Figure 13 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 1 ;
[0060] Figure 14 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 2 ;
[0061] Figure 15 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 4 ;
[0062] Figure 16 Flowchart of the video switching method provided in the embodiments of this application Figure 2 ;
[0063] Figure 17 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 3 ;
[0064] Figure 18 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 4 ;
[0065] Figure 19 This is a schematic diagram of a mobile phone display interface provided in an embodiment of this application;
[0066] Figure 20 Schematic diagram of the video switching device provided in the embodiments of this application Figure 1 ;
[0067] Figure 21 Schematic diagram of the video switching device provided in the embodiments of this application Figure 2 ;
[0068] Figure 22 This is a schematic diagram of the composition of a chip system provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer 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, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different. Meanwhile, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0070] With the development of electronic devices, the intelligence level of smartphones, laptops, tablets, smart screens, and other electronic devices is rapidly increasing, and the interaction between these devices is becoming more and more frequent. Multi-screen collaboration technology is a distributed technology that enables cross-system and cross-device collaboration, facilitating resource sharing and collaborative operation among electronic devices. As one of the main ways for electronic devices to interact, multi-screen collaboration can compensate for the shortcomings of electronic devices themselves, fully leverage the advantages of different electronic devices, and thus improve the user experience. For example, smartphones are convenient to carry and are mainly used for users' daily communication and social networking. However, smartphone screens are relatively small, making it difficult for users to obtain a high level of experience in application scenarios such as watching videos or playing games. On the other hand, large-screen devices such as computers, smart screens, and TVs have advantages such as large screens and high display resolution. Therefore, users can use window casting to project the screen of their smartphones onto other devices (such as computers or smart screens) for a better user experience.
[0071] Please see Figure 1In the screen mirroring scenario shown, users can mirror video 'a' played on the main control electronic device (hereinafter referred to as the first electronic device) to a large-screen device such as the collaborative electronic device (hereinafter referred to as the second electronic device) for display and playback. On the second electronic device, the playback interface of video 'a' is larger, thus providing users with a better video viewing experience.
[0072] In one implementation, after a cooperative operation connection is established between the first electronic device and the second electronic device, the first electronic device can transmit video data to the second electronic device by transmitting a video stream. For example, technologies such as Miracast, AirPlay, and HiSight can be used to transmit video data from the first electronic device to the second electronic device as a video stream.
[0073] Specifically, Figure 2 A schematic diagram illustrating the principle of transmitting video data for related technologies, such as Figure 2 As shown, a collaborative connection can be established between the first electronic device and the second electronic device through a collaborative module. For example, a socket channel can be established between the first and second electronic devices through the collaborative module. This socket channel can be based on, for example, a multicast source discovery protocol (MSDP) or the Hisight protocol. This socket channel can serve 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 and second electronic devices as a control channel. This control channel can be used by the second electronic device to send control commands to the first electronic device to achieve control (or reverse control) of the first electronic device.
[0074] Specifically, when the first electronic device sends video stream data to the second electronic device, the first electronic device first compresses each frame of video a to obtain video stream data composed of multiple video frames (i.e., encoding video a to obtain video stream data). Then, the first electronic device sends the video stream data to the second electronic device through a socket channel (information channel). The second electronic device receives and buffers the video stream data, decodes it, and plays video a.
[0075] However, in multi-screen collaboration technologies, the first electronic device does not transmit the control information (e.g., size, position) of the video playback controls in its display interface to the second electronic device during the transmission of video stream data. In other words, the second electronic device cannot obtain the control information of the video playback controls in the first electronic device. Consequently, when the display state of the window playing the video stream in the first electronic device changes—for example, when the window switches from landscape to portrait mode—the content displayed in the projection window of the second electronic device may experience flickering, blackouts, or stuttering during the switching of the projection window's display state, resulting in an inability to smoothly switch video streams.
[0076] In this scenario, when the second electronic device has not finished decoding the video stream after the display state change, it can typically use a preset image (e.g., a mask image) as a transition between the two video streams before and after the change. The video stream is then played only after the changed video stream has been decoded. As a result, during the switching process, the second electronic device is prone to screen flickering, image stretching, or stuttering, further hindering the smooth switching between the two video streams.
[0077] In one application scenario, taking a collaborative operation where a first electronic device projects its screen to a second electronic device, the first electronic device switches between landscape and portrait video streams. Specifically, the first electronic device switches from playing a landscape video stream to a portrait video stream; that is, the video stream sent by the first electronic device to the second electronic device changes from a landscape video stream to a portrait video stream. Here, the landscape video stream is the video stream played by the first electronic device in landscape mode, and the portrait video stream is the video stream played by the first electronic device in portrait mode.
[0078] Specifically, the screen of the first electronic device typically has two screen modes: landscape and portrait. When the first electronic device is in portrait mode, it displays a portrait interface; when it is in landscape mode, it displays a landscape interface. This allows the first electronic device to present the application interface to the user in both portrait and landscape modes, enabling the user to browse the application interface normally.
[0079] It should be noted that the screen of the first electronic device is usually rectangular. Therefore, in the screen states of the first electronic device, the landscape state is usually when the bottom of the screen (the side facing the direction of gravitational acceleration, i.e., the side of the screen closest to the ground) is the long side. The portrait state is usually when the bottom of the screen is the short side. Alternatively, the first electronic device is in landscape state when the side of the screen corresponding to the chin or forehead of the user using the screen is the long side; the first electronic device is in portrait state when the side of the screen corresponding to the chin or forehead of the user using the screen is the short side.
[0080] When the first electronic device is in landscape mode and displays a landscape interface, the user can rotate the device to switch from landscape to portrait mode by a certain angle. Similarly, when the first electronic device is in portrait mode and displays a portrait interface, the user can also rotate the device to switch from portrait to landscape mode by a certain angle.
[0081] Please see Figure 3 The diagram illustrating the video stream switching principle in the related technology uses a mobile phone as the first electronic device and a computer as the second. First, the mobile phone plays a landscape video stream (i.e., the phone plays the video stream in landscape mode) and sends it to the computer. The computer receives the landscape video stream, buffers and decodes it, and then plays a portrait video stream. Then, after a time T milliseconds (ms), the mobile phone executes a switching animation and plays a portrait video stream (i.e., the phone plays the video stream in portrait mode), and sends it to the computer. The computer receives the portrait video stream, buffers and decodes it, and then plays it. However, because the mobile phone does not transmit the control information of the video playback controls in the window where the portrait video stream is played to the computer, the computer cannot determine the position of the switching animation between the portrait and landscape video streams, resulting in an inability to determine the switching animation. In this situation, the computer usually directly recreates the session to receive the portrait video stream and switches to playing it. Furthermore, due to the limitations of the computer's decoding capabilities, screen flickering or stuttering may occur during the video stream switching process.
[0082] Please continue reading Figure 3For computers with strong decoding capabilities, the decoding speed for portrait video streams is faster, with a shorter decoding time T1. Therefore, the computer can quickly switch from playing a portrait video stream to another portrait video stream, which can cause screen flickering during the transition. Conversely, for computers with weaker decoding capabilities, the decoding speed for portrait video streams is slower, with a longer decoding time T2. Therefore, the computer switches from playing a portrait video stream to another portrait video stream more slowly, which can cause stuttering during the transition. Both of these factors contribute to the inability of the computer to smoothly switch video streams.
[0083] To address the issue of collaborative electronic devices (such as the aforementioned computer) being unable to smoothly switch between two video streams in multi-screen collaboration scenarios, this application provides a video switching method. In a collaborative operation scenario where a master-side electronic device projects its screen to a collaborative electronic device, when the master-side electronic device switches video streams (i.e., the display state of the window playing the video stream changes), the collaborative electronic device can receive control information of the video playback controls corresponding to the switched video stream sent by the master-side electronic device. Based on this control information, the collaborative electronic device determines the changing position of the projection window during the switching process between the two video streams, and then generates and displays a switching animation effect, enabling the collaborative electronic device to smoothly switch between the two video streams.
[0084] For details, please see Figure 4 , Figure 4 This is a schematic diagram illustrating the principle of the video switching method provided in an embodiment of this application. Figure 4 As shown, taking a mobile phone as the main control electronic device and a computer as the collaborating electronic device, and the mobile phone switching from a first video stream to a second video stream as an example. When the mobile phone is playing the first video stream, it sends the first video stream to the computer. The first video stream is the display data of the mobile phone when displaying the window of the first application in the first state. The computer receives the first video stream, buffers 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 first control information to the computer. The second video stream is the display data of the mobile phone when displaying 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 for playing video in the window of the first application. In this way, the computer can determine the changing position of the first window based on the first window information, the first control information, and the second window information, 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.
[0085] In some embodiments, the computer can also obtain the computer's decoding capability parameters and determine the switching speed (or movement speed) of the animation 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 stuttering when the computer switches the second video stream, and further improve the smoothness of the computer switching between the two video streams.
[0086] The video switching method provided in this application can be applied to the application scenario of screen projection from the first electronic device to the second electronic device. For example, in this application embodiment, the first electronic device and the second electronic device may include, but are not limited to, smartphones, netbooks, tablets, smartwatches, smart bracelets, phone watches, smart cameras, handheld computers, personal computers (PCs), personal digital assistants (PDAs), portable multimedia players (PMPs), augmented reality (AR) / virtual reality (VR) devices, televisions, projection devices, or motion-sensing game consoles in human-computer interaction scenarios. Alternatively, the first electronic device and the second electronic device may also be other types or structures of electronic devices, which are not limited in this application.
[0087] Typically, to maximize the advantages of multi-screen collaboration technology, it is often 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 smartphone, and the large-screen device is a laptop. Another example is a tablet computer, and the large-screen device is a television. Of course, this application does not limit the specific devices in the multi-window projection scenario. As mentioned above, the first and second electronic devices can be any electronic device that supports multi-screen collaboration technology, such as smartphones, netbooks, tablet computers, smartwatches, smart bracelets, smartwatches, smart cameras, handheld computers, PDAs, PMPs, AR / VR devices, or televisions.
[0088] In this embodiment, the first electronic device and the second electronic device can establish a wireless communication connection through methods such as "tap-to-connect," "scan" (e.g., scanning a QR code or barcode), or "proximity discovery" (e.g., using Bluetooth or Wi-Fi). The first and second electronic devices can follow a wireless transmission protocol to transmit information via a wireless transceiver. This wireless transmission protocol can include, but is not limited to, Bluetooth (BT) or Wi-Fi protocols. For example, the Wi-Fi transmission protocol could be the Wi-Fi P2P protocol. The wireless transceiver includes, but is not limited to, Bluetooth and Wi-Fi transceivers. Information transmission between the first and second electronic devices is achieved through wireless pairing. The information transmitted between the first and second electronic devices includes, but is not limited to, content data to be displayed (e.g., standard video streams) and control commands.
[0089] Alternatively, a wired communication connection can be established between the first electronic device and the second electronic device. For example, the first electronic device and the second electronic device can establish a wired communication connection via a video graphics array (VGA), digital visual interface (DVI), high-definition multimedia interface (HDMI), or data transmission cable. Information transmission is achieved between the first electronic device and the second electronic device through this established wired communication connection. This application does not limit the specific connection method between the first electronic device and the second electronic device.
[0090] Figure 5 A schematic diagram of the hardware structure of electronic device 100 is shown. For example, Figure 5 The electronic device 100 shown can be either a first electronic device or a second electronic device.
[0091] like Figure 5As shown, 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0092] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0093] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0094] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0095] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0096] In some embodiments, the processor 110 may include one or more interfaces. 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, etc.
[0097] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0098] 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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0099] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0100] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-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 transmitted to the application processor.
[0101] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0102] For example, when the electronic device 100 is the first electronic device in the aforementioned embodiments, the first electronic device can send video streams, control information and control commands to the second electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0103] For example, when the electronic device 100 is the second electronic device in the aforementioned embodiments, the second electronic device can receive video streams, control information and control commands sent by the first electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0104] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0105] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0106] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0107] For example, when the electronic device 100 is the first electronic device in the foregoing embodiments, the display screen 194 of the first electronic device can display the video stream selected by the user to play on the first electronic device. Furthermore, when the user clicks or touches the screen, some functional controls, such as switching controls and collaborative controls, are further displayed.
[0108] For example, when electronic device 100 is the second electronic device in the aforementioned embodiments, the display screen 194 of the second electronic device can display the video stream selected by the user to play on the first electronic device. Furthermore, switching animations can be displayed when the video stream is switched. And when the user clicks or touches the screen, some functional controls, such as switching controls and collaborative controls, are further displayed.
[0109] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0110] The external storage 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 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0111] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0112] For example, when the electronic device 100 is the second electronic device in the foregoing embodiments, the processor 110 can determine the changing position of the projection window during the process of switching the first video stream to the second video stream by running the instructions stored in the internal memory 121, 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 between the two video streams.
[0113] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0114] When the electronic device 100 displays video content, the audio module 170 can synchronously play the audio content corresponding to the video content.
[0115] For example, when the electronic device 100 is the first electronic device in the aforementioned embodiments, if the first electronic device displays content, then 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 onto the second electronic device, then the audio module 170 of the first electronic device may not play the audio content corresponding to the video content.
[0116] For example, when the electronic device 100 is the second electronic device in the aforementioned embodiments, if the second electronic device displays video content, then 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 a screen mirroring scenario, then the audio module 170 of the second electronic device can synchronously play the audio content corresponding to the projected video content.
[0117] In some embodiments, based on Figure 5 When the electronic device 100 shown implements the video switching method in this application embodiment, if the electronic device 100 is the first electronic device and the second electronic device in the aforementioned embodiments, taking the first electronic device casting its screen to the second electronic device, and the first electronic device switching 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 instructions stored in the internal memory 121. It then sends the second video stream and the first control information to the second electronic device through 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 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 animation 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 instructions stored in the internal memory 121. Furthermore, the second electronic device can have the processor 110 execute the switching animation and display the switching animation on the display screen 194.
[0118] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0119] Figure 6 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0120] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0121] The application layer can include a series of application packages.
[0122] like Figure 6 As shown, the application package can include SMS applications, video applications, office applications, game applications, lifestyle applications, shopping applications, or functional applications. Specifically, examples include applications for camera, gallery, calendar, calling, maps, navigation, WLAN, Bluetooth, music, video, and SMS.
[0123] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0124] like Figure 6 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, collaboration module, control awareness module, motion control module, etc.
[0125] The collaboration module is used to establish collaborative operation connections with other electronic devices, enabling the electronic devices to perform collaborative operation functions.
[0126] The control awareness module is used to acquire control information (such as the position and size of the control) corresponding to the video stream being played in the electronic device; that is, information about the playback controls used to play the video stream. It is also used to transmit control information to the electronic device so that the device can determine the changing position of the transition animation based on the control information.
[0127] 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, so as to generate the switching motion effect.
[0128] In some embodiments, the application framework layer may further include a decoding capability adaptation module and a decoding monitoring module.
[0129] The decoding capability adaptation module is used to obtain the decoding capability parameters of the electronic device, so as to determine the switching speed of the switching animation based on the decoding capability parameters, and generate the switching animation.
[0130] 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 switching animations, so as to update the decoding capability parameters of the electronic device.
[0131] The motion control module can also be used to determine the switching speed of the 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.
[0132] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0133] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0134] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0135] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0136] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0137] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0138] The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.
[0139] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0140] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0141] The system library can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), screen projection modules, etc.
[0142] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0143] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0144] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0145] A 2D graphics engine is a graphics engine for 2D drawing.
[0146] The screen mirroring module is used by electronic device 100 to mirror its screen to other devices, or to receive screen mirroring data from other devices. The module can select the mirroring application, send mirroring data, receive mirroring data, and display the mirroring data.
[0147] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, etc., but this application embodiment does not impose any limitations on this.
[0148] In some embodiments, based on Figure 6 When the electronic device 100 shown implements the video switching method in the embodiments of this application, if the electronic device 100 is the first electronic device and the second electronic device in the foregoing embodiments, taking the first electronic device casting its screen to the second electronic device, and the first electronic device switching from the first video stream to the second video stream as an example, combined with... Figure 7 The schematic diagram shows that the first electronic device and the second electronic device can establish a collaborative operation connection through a collaboration module. The first electronic device, through a control sensing module, can obtain first control information within itself and send it to the control sensing module of the second electronic device. The control sensing 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.
[0149] 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 acquire the decoding capability parameters of the second electronic device and send them to the motion effect control module. The decoding monitoring module of the second electronic device can acquire the actual decoding capability parameters of the second electronic device for the video stream. Based on the decoding capability parameters, the motion effect control module can determine and adjust the transition speed of the switching motion effect to achieve a smooth switching between the first video stream and the second video stream.
[0150] The following description uses a mobile phone as the first electronic device and a computer as the second electronic device to illustrate the video switching method provided in this application.
[0151] Both the mobile phone and the computer have collaborative operation capabilities, allowing the mobile phone to cast video streams to the computer for playback. Taking the example of the mobile phone switching from playing a landscape video stream (i.e., the first video stream) to playing a portrait video stream (i.e., the second video stream), that is, the video stream sent from the mobile phone to the computer changing from a landscape to a portrait format, the landscape video stream refers to the video stream played on the mobile phone in landscape mode (i.e., the second state), and the portrait video stream refers to the video stream played on the mobile phone in portrait mode (i.e., the second state).
[0152] Figure 8 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 3 ,like Figure 8 As shown, firstly, when the mobile phone is playing a landscape video stream, it sends the landscape video stream to the computer. The computer displays the landscape video stream in a first window. After the mobile phone switches from playing a landscape video stream to a portrait video stream, it sends the portrait video stream and first control information to the computer. This first control information is associated with the position of the control playing the video in the window where the mobile phone is playing the portrait video stream. Based on the first window information, the first control information, and the second window information, the computer can generate and display a switching animation effect, enabling the computer to smoothly switch from a landscape video stream to a portrait video stream.
[0153] Specifically, Figure 9 Flowchart of the video switching method provided in the embodiments of this application Figure 1 ,like Figure 9 As shown, the video switching method provided in this application embodiment mainly includes S101-S108:
[0154] S101. Establish a collaborative operation connection between the mobile phone and the computer.
[0155] In this embodiment, the mobile phone can establish a collaborative operation connection with the computer. In this way, the mobile phone can send information such as video streams to the computer, and the computer can receive and play the video streams, allowing the mobile phone to project the video onto the computer for playback. This achieves collaborative operation between the mobile phone and the computer.
[0156] For example, the mobile phone can establish a collaborative operation connection with the computer based on wireless connection methods such as Bluetooth or Wi-Fi transmission protocols, or it can also establish a collaborative operation connection based on wired connection methods such as HDMI or data transmission cables. This application does not specifically limit this.
[0157] In some embodiments, the mobile phone can establish an information channel with the computer to transmit video streams. The mobile phone can also establish a control channel with the computer to transmit control information for projecting the video stream.
[0158] S102. The mobile phone sends a landscape video stream to the computer.
[0159] In this embodiment, when a landscape video stream is playing on a mobile phone, the landscape video stream is sent to a computer. The landscape 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 screen, within which the landscape video stream is played. In other words, the landscape video stream is also the display data when the mobile phone displays the window of the first application in landscape mode.
[0160] It should be noted that, in this embodiment, playing a landscape video stream on a mobile phone means playing the video stream in landscape mode (or landscape interface, landscape window). Playing a portrait video stream on a mobile phone means playing the video stream in portrait mode (or portrait interface, portrait window). Playing a landscape video stream on a mobile phone means playing the video stream in landscape mode (or landscape interface, landscape window).
[0161] Specifically, the landscape video stream can be encoded video data; for example, it can be encoded binary video stream data. In one implementation, the mobile phone can send the landscape video stream through an information channel established between it and the computer.
[0162] In some embodiments, the mobile phone can also send a first instruction to the computer, which can be used to indicate the position and / or size of the projection window for playing a landscape video stream on the computer. This allows the computer to quickly generate a projection window to play the landscape video stream.
[0163] In one implementation, the first instruction information mentioned above can be a full-screen playback instruction, which can be used to instruct the computer to play a landscape video stream in full-screen mode, that is, to instruct the computer to generate a projection window that can fully cover the computer display interface, and to play the landscape video stream in the projection window.
[0164] In another implementation, the aforementioned first instruction information may also be the position and / or size of the window on the mobile phone displaying the landscape video stream. The position and / or size of the window on the mobile phone displaying the landscape video stream can be used by the computer to determine the position and / or size of the projection window and generate the projection window to play the landscape video stream.
[0165] S103. The computer receives the landscape video stream and displays it in the first window.
[0166] In this embodiment of the application, when the landscape video stream is encoded video data, the computer can cache and decode the received landscape video stream. Specifically, the computer receives and caches the landscape video stream data. After the computer's cache is full, the cached landscape video stream data is decoded to obtain the decoded landscape video stream, which is then displayed in the projection window (i.e., the first window).
[0167] The position and size of the first window can be determined based on the first window information. The first window information may include the size of the entire display interface of the computer (full screen), and may also be associated with the position and / or size of the window of the first application displayed on the mobile phone in landscape mode (i.e., the window playing a landscape video stream).
[0168] In one implementation, the computer may have pre-defined first window information. For example, when the computer is displaying a landscape video stream in full screen, meaning the first window covers the entire display interface of the computer, the pre-defined first window information in the computer can be the size of the entire display interface of the computer. Thus, when the mobile phone sends a first instruction (such as the full-screen playback command mentioned above) to the computer in S102, the computer can respond to the full-screen playback command, generate a first window according to the pre-defined first window information, and play the landscape video stream in full screen mode.
[0169] In another implementation, the computer can also receive the position and / or size of the window displaying the landscape video stream from the mobile phone, and determine the first window information based on the position and / or size of the window. Since the display screen sizes of mobile phones and computers are different, the position and size of the window displaying the landscape video stream will differ between the two. Therefore, the computer can perform mapping transformations (e.g., position offset, proportional scaling, etc.) on the received position and / or size of the window displaying the landscape video stream to determine the first window information. Furthermore, the computer can generate a first window based on the first window information to play the landscape video stream within the first window.
[0170] In this implementation, the computer can receive the position and / or size of the window on the mobile phone playing the landscape video stream simultaneously with receiving the landscape video stream. That is, in S102, the mobile phone can send the position and / or size of its playback window at the same time as sending the landscape video stream to the computer. Alternatively, the computer can obtain the position and / or size of the playback window from the mobile phone before receiving the landscape video stream. This ensures timely generation of the first window for playing the landscape video stream and prevents stuttering during playback.
[0171] S104. The mobile phone responds to the switching command and sends the vertical video stream and first control information to the computer.
[0172] In this application, the switching command can be used to indicate a change in the state of the window playing the video stream on the mobile phone, that is, a change in screen orientation (landscape or portrait), and the corresponding video stream also changes. Specifically, the switching command can be used to instruct the mobile phone to switch from landscape mode to portrait mode, that is, to switch from playing a landscape video stream to playing a portrait video stream.
[0173] In one example, the switching command can be generated by the user initiating a switching operation on the phone. For instance, the user can initiate a switching operation by clicking a switching control on the phone's interface, generating a switching command. When the phone is in landscape mode and displaying a landscape interface, the user can also initiate a switching operation by rotating the phone, changing it from landscape to portrait mode, thus generating a switching command. In this case, the phone, in response to the switching command, can also send a switching command to the computer to trigger the computer to switch the video stream.
[0174] In another example, the switching command can also be generated by the user initiating the switching operation on the computer, and the computer sends the switching command to the mobile phone to instruct the mobile phone to switch the video stream.
[0175] In this embodiment, the mobile phone can switch from playing a landscape video stream to a portrait video stream in response to a switching command. That is, in a collaborative operation scenario, the video stream sent by the mobile phone to the computer is switched from a landscape video stream to a portrait video stream, and the portrait video stream is the display data when the mobile phone displays the window of the first application in portrait mode.
[0176] The vertical video stream can be encoded video data. Specifically, it can be binary video stream data. In one implementation, the mobile phone can send the vertical video stream through an information channel established between it and the computer.
[0177] Simultaneously, when a mobile phone sends a portrait-oriented video stream to a computer, it can also send information about a first control. This first control refers to the control used for playing the video within the window of the first application displayed on the mobile phone in portrait mode (i.e., the window playing the portrait-oriented video stream). The information about the first control is associated with its position within the window where the portrait-oriented video stream is played.
[0178] For example, Figure 10 This is a schematic diagram of a mobile phone display interface provided in an embodiment of this application, such as... Figure 10 As shown, in the window 101 of the first application displayed on the mobile phone in portrait mode, the controls for playing video include a playback control 102. Therefore, the first control can be the playback control 102. Specifically, the information of the first control can include the position information of the playback control 102, and it can also include the size information of the playback control 102. This first control information can be used by the computer to determine the position of the switching animation change.
[0179] In one implementation, when the first control is a rectangle, the information of the first control can be the rectangle information of the first control.
[0180] In one example, the first control information can be the position information (e.g., coordinate information) of one vertex of the first control (rectangle), and the side length (e.g., width and height) of the rectangle as the first control information. Figure 11 This is a schematic diagram of a first control information provided in an embodiment of this application, such as... Figure 11 As shown, the first control information can be the rectangle information (l, r, w, h) composed of the coordinates (l, r) of vertex a, the width (width, w), and the height (height, h) of the rectangle. Vertex a can also be replaced by vertex b, vertex c, or vertex d; this application does not specifically limit this.
[0181] In another example, the first control information can also be the position information of any three or four vertices within the first control (rectangle). For example, the coordinates of vertex a of the rectangle (l... a r a ), the coordinates of vertex b (l b r b ) and the coordinates of vertex c (l c r c ) constitute rectangular information (l a r a , l b r b , l c r c This refers to the first control information. This application does not specifically limit the way the first control information is expressed.
[0182] In one implementation, the first control information can be obtained by a control sensing module in the mobile phone. Specifically, the control sensing 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 first application window, and generate the first control information.
[0183] In this case, the control perception module can start running when the collaborative operation is triggered (i.e., when the S101 mobile phone and the computer establish a collaborative operation connection), or it can start running before the collaborative operation is triggered, or it can start running after the collaborative operation is triggered but before sending the first control information. This application does not make any specific limitations on this.
[0184] In one implementation, when a control channel is established between the mobile phone and the computer, the mobile phone can send first control information to the computer through the control channel.
[0185] In another implementation, a separate logical channel can be established between the mobile phone and the computer to send the first control information to the computer. Because this separate logical channel is isolated from the information and control channels, the efficiency of transmitting the first control information can be guaranteed, and interference with the transmission of the vertical video stream can be prevented.
[0186] S105. The computer receives the vertical video stream and the first control information, responds to the switching command, and generates and displays the switching animation based on the first window information, the first control information and the second window information.
[0187] In this embodiment, when the portrait video stream is encoded video data, the computer can cache and decode the received portrait video stream. Specifically, the computer receives and caches the portrait video stream data. After the computer's cache is full, the cached portrait video stream data is decoded to obtain the decoded portrait video stream, which can then be displayed in a second window.
[0188] At the same time, the computer can also map the received first control information to obtain and save the projection position of the first control on the computer (i.e., the first mapped control information) so that the computer can determine the position information of the video stream switching animation.
[0189] 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 first application window on the computer display interface (such as position offset, proportional scaling, etc.) to obtain the first mapped control information and save the first mapped control information.
[0190] Figure 12 This is a schematic diagram illustrating the mapping of first control information provided in an embodiment of this application, such as... Figure 12 As shown, taking the playback control 102 as the first control as an example, the information of the first control is rectangular information (l1, r1, w1, h1). Then, the first mapped control information obtained after mapping transformation is rectangular information (l1′, r1′, w1′, h1′). Wherein, if the size of the first control does not change after mapping, then w1′ is the same as w1, and h1′ is the same as h1. In this way, the position and size information of the first control on the mobile phone screen can be converted into position and size information on the computer screen, enabling the computer to accurately determine the position information of the video stream switching animation on the computer.
[0191] The second window is associated with second window information, meaning its position and size can be determined based on this information. Specifically, the second window information is associated with the position and / or size of the window of the first application displayed on the phone in portrait mode (i.e., the window playing a portrait video stream). The second window information can be the same as the position and / or size of the window playing the portrait video stream on the phone, or it can be the same as the position and / or size of the window playing the portrait video stream on the phone after mapping transformation. The expression of the second window information is similar to that of the first control information. If the window playing the portrait video stream on the phone is rectangular, the second window information can be the rectangular information of that window. This application does not specifically limit the specific expression of the second window information.
[0192] In one implementation, the window for playing a portrait-oriented video stream on the mobile phone can be a display window of the entire mobile phone screen. For example, such as... Figure 10 As shown, the window for playing a vertical video stream on the mobile phone can be window 101, and the size of window 101 can be the size information of the entire display window of the mobile phone.
[0193] In another implementation, the computer can receive the position and / or size of the window from the mobile phone playing a portrait video stream, and determine the second window information based on this position and / or size. Then, the computer can perform mapping transformations (e.g., position offset, proportional scaling) on the received position and / or size of the mobile phone's portrait video stream window to determine the second window information. Further, the computer can regenerate the second window based on the second window information to play the portrait video stream within it. Alternatively, the computer can adjust the position and / or size of the first window based on the second window information, using the adjusted first window as the second window; that is, the second window is obtained by modifying the first window without needing to be regenerated.
[0194] In this implementation, the computer can receive the position and / or size of the window on the mobile phone playing the portrait video stream simultaneously with receiving the portrait video stream. That is, in S104, the mobile phone can send the position and / or size of its playback window at the same time as sending the portrait video stream to the computer. Alternatively, the computer can obtain the position and / or size of the playback window from the mobile phone before receiving the portrait video stream. This allows the computer to generate switching animations in a timely manner, preventing stuttering during the switching of the portrait video stream.
[0195] In another implementation, the computer can store the second window information, eliminating the need to retrieve the position and / or size of the phone's portrait video stream window again. For example, before the phone sends the landscape video stream to the computer in S102, as described in S401-S410 below, if there is a process where the phone switches from playing a portrait video stream to playing a landscape video stream, i.e., the computer's projection window switches from playing a portrait video stream to playing a landscape video stream. Specifically, in S403, if the computer has already received the position and / or size of the phone's portrait video stream window, it can save the position and / or size of the phone's portrait video stream window. In this case, the computer does not need to retrieve the position and / or size of the phone's portrait video stream window again.
[0196] The computer can generate and display a switching animation in response to a switching command. This switching command can be generated by the user initiating the switching operation on their mobile phone, and then sent from the phone to the computer. Alternatively, the switching command can be generated by the user initiating the switching operation on the computer. The switching command can be used to instruct the display state of the window playing the video stream on the computer (such as the first window) to change, generating and displaying the switching animation.
[0197] Specifically, the computer can generate and display switching animations based on the information of the first window, the first control, and the second window. These switching animations include the computer changing from displaying the window of the first application in landscape mode to displaying the window of the first application in portrait mode, that is, the computer changing from the first window playing a landscape video stream to the second window playing a portrait video stream.
[0198] In some embodiments, the computer can scale the first window based on first window information, first control information, and second window information, causing the content displayed in the first window to change as the size of the first window changes, thus creating a switching animation effect. Specifically, the switching animation effect generated by the computer may include: shrinking the first window based on the first window information and the first control information, with the size and position of the shrunken first window associated with the first control information; and then enlarging the first window based on the second window information, with the size and position of the enlarged first window associated with the second window information.
[0199] The size and position of the scaled-down first window can 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 scaled-down first window can also be a position and size, or a point, determined by the first mapped control information according to a first preset rule (e.g., offset, scaling, etc.). The size and position of the scaled-up first window can be the same as the size and position determined by the second window information, or the size and position of the scaled-up first window can also be a position and size determined by the second window information according to a second preset rule (e.g., offset, scaling, etc.).
[0200] In one implementation, in the computer-generated switching animation, the first window can be shrunk to a first point based on the first control information, and then the first window can be enlarged from that first point. The first point is determined based on the first control information, which can be a point determined according to the position and size of the first control in the first control information and preset rules.
[0201] For example, Figure 13 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 1 ,like Figure 13 As shown, the first point mentioned above can be the center point of the first control in the window where a vertical video stream is played on the computer. Therefore, the computer-generated switching animation can be: in the computer's display interface 200, the first window 210 is shrunk to the center point 220 of the first control, and then enlarged from the center point 220 to the second window 230. This not only reduces the difficulty of generating the switching animation on the computer, but also visually improves the smoothness of the switching animation, enhancing the user experience.
[0202] In another implementation, the computer-generated switching animation can be used to shrink the first window to the size and position determined by the first mapped control information, and then enlarge the first window to the size and position determined by the second window information.
[0203] For example, Figure 14 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 2 ,like Figure 14 As shown, the computer-generated switching animation can also be that in the computer's display interface 200, the first window (i.e., the starting window 201) determined by the first window information (l0, r0, w0, h0) shrinks to the window (i.e., the middle window 202) determined by the first mapping control information (l1′, r1′, w1′, h1′), and then the middle window 202 expands to the second window (i.e., the ending window 203) determined by the second window information (l2, r2, w2, h2).
[0204] In some embodiments, the computer-generated transition animation may further include: shrinking the first window with a first action, and then enlarging the first window to the second window with a second action. The first and second actions may be the same or different, and may be one or more of the following animation effects: rotation, fade-in / fade-out, or fly-in / fly-out, etc. This application does not specifically limit the first and second actions. This increases the diversity of computer-generated transition animation changes, enhances the display effect of the transition animation, and improves the user experience.
[0205] 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.
[0206] In one implementation, as follows Figure 13 Taking the implementation of the switching animation shown as an example, the switching animation generated by the computer can include: shrinking the first window 210 to the center point 220 of the first control at a first speed, and then enlarging it to the second window 230 at a second speed from the center point 220 of the first control.
[0207] In another implementation, as shown Figure 14 Taking the implementation of the switching animation shown as an example, the switching animation generated by the computer can 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.
[0208] The first speed and the second speed can be the same or different. That is, the switching animation can 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 animation can 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.
[0209] 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 playback time of the switching animation (i.e., the window movement time) determined based on the computer's decoding capability, prior knowledge, or experiments. Playing the switching animation at this preset time ensures that there will be no screen flickering, stuttering, or other abnormalities during video stream switching.
[0210] Specifically, the computer can determine the first distance based on the information from the first window and the first control, and determine the second distance based on the information from the first control and the second window.
[0211] When the first speed and the second speed are the same, the computer can obtain the first speed, which is also the second speed, by calculating the sum of the first distance and the second distance and dividing it by a preset time.
[0212] When the first speed and the second speed are different, the computer can divide the preset time into a first preset time and a second preset time according to actual usage needs, and use them as the travel time for the second distance of the first 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.
[0213] In some embodiments, the computer can also estimate the movement speed of the switching animation based on the process of caching and decoding the landscape video stream, combining the computer's caching and decoding capabilities, and determine a first speed and a second speed. The computer's caching capability characterizes its ability to cache video streams; for example, caching capability can be the size of the computer's buffer and its caching speed. The caching speed can be determined based on the network bandwidth of the communication connection between the mobile phone and the computer. The computer's decoding capability characterizes its ability to decode video streams; for example, decoding capability includes, but is not limited to, decoding time and decoding speed for video streams with different bitrates. In the following embodiments, the amount of data decoded by the computer per unit time, such as the amount of data processed per millisecond (Mb / ms), is used as the decoding capability to illustrate the scheme provided in this application.
[0214] Specifically, the computer can also determine the first speed and the second speed based on the information of the first window, the first control, the second window, the computer's caching ability, and the decoding ability.
[0215] In one implementation, taking the example that the first speed and the second speed determined by the computer are the same, the specific method for the computer to determine the first speed and the second speed may include S201-S206:
[0216] S201. The computer determines the 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 the second distance S2 based on the first mapped control information and the first window information.
[0217] When both the first mapped control information and the second window information are rectangular, taking the first mapped 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:
[0218]
[0219] The calculation method for the first distance is the same as that for the second distance, and will not be repeated here.
[0220] S202. The computer determines the first time t1, i.e., the movement time for the first distance, based on the buffer size B and the buffer speed x. Specifically, the expression for the first time t1 can be:
[0221]
[0222] S203. The computer determines the second time t2, i.e., the movement time for the second distance, based on the preset decoding data volume D and the decoding capability parameter y. Here, the preset decoding data volume D is the preset amount of data required for smooth playback of the data stream; for example, it could be the data volume of one or more frames in the video stream.
[0223] Specifically, the expression for the second time t2 can be:
[0224]
[0225] S204. The computer determines the first estimated velocity v1′ based on the first distance S1 and the first time t1. Specifically, the expression for the first estimated velocity v1′ can be:
[0226]
[0227] S205. The computer determines the second estimated velocity v2′ based on the second distance S2 and the second time t2. Specifically, the expression for the second estimated velocity v2′ can be:
[0228]
[0229] S206. If the first estimated speed v1′ is less than or equal to the second estimated speed v2′, the computer can determine that both the first speed and the second speed are the first estimated speed v1′. If the first estimated speed v1′ is greater than the second estimated speed v2′, the computer can determine that both the first speed and the second speed are the second estimated speed v2′. This allows the computer sufficient time to cache and decode the switched vertical video stream, ensuring smooth playback of the switched vertical video stream after the computer's switching animation is complete.
[0230] 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.
[0231] In one implementation, an example is given where the first speed and the second speed determined by the computer are different. Specifically, the method by which the computer determines the first speed and the second speed may include S301-S306:
[0232] 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 be referred to S201 above, and will not be elaborated here.
[0233] S302. The computer determines the first time t1, i.e., the movement time for the second distance, based on the preset decoding data volume D and decoding capability parameter y. Specifically, the expression for the first time t1 can be:
[0234]
[0235] S303. The computer determines the first estimated velocity v1′, i.e., the movement speed over the second distance, based on the second distance S2 and the first time t1. Specifically, the expression for the first estimated velocity v1′ can be:
[0236]
[0237] S304. The computer determines the second time t2, i.e., the travel time for the first distance, based on the first distance S1 and the first estimated velocity v1′. Specifically, the expression for the second time t2 can be:
[0238]
[0239] S305. The computer determines the third time t3, i.e., the buffering time, based on the cache size B and the buffer speed x. Specifically, the expression for the third time t3 can be:
[0240]
[0241] S306. When the second time t2 is greater than or equal to the third time t3, the computer can determine that both the first speed and the second speed are the first estimated speed v1′.
[0242] When the second time t2 is less than the third time t3, the computer can determine the second velocity as the first estimated velocity v1′. It can also determine the first velocity, i.e., the speed of movement over the first distance, based on the first distance S1 and the third time t3. Specifically, the expression for the first velocity v1 can be:
[0243]
[0244] This ensures that the computer has enough time to cache the vertical video stream after the switch, so that the vertical video stream can play smoothly after the computer's switching animation is complete.
[0245] In some embodiments, when the computer-generated switching animation involves shrinking the first window to a first point at a first speed and then expanding it back to the second window at a second speed, the computer can still determine the first speed and the second speed through the aforementioned steps S201-S206 and S301-S306. Specifically, when determining the first distance and the second distance (as described in 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.
[0246] In one implementation, the computer can implement the above S201-S206 and S301-S306 through the motion control module in the computer.
[0247] In some embodiments, to ensure that the transition animation is free of ghosting or 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 playback is free of ghosting, and the second speed threshold is the maximum speed at which the video stream playback is free of flickering.
[0248] Specifically, the first speed threshold and the second speed threshold can be determined based on consensus-based baseline data (such as prior knowledge), or they can be determined based on user experience data. The first speed threshold and the second speed threshold can be constant values, or they can be dynamically adjusted based on user experience; this application does not specifically limit this.
[0249] If 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 to make them between the first speed threshold and the second speed threshold, so that the computer can determine that there is no ghosting or screen flickering when switching animation effects.
[0250] In one implementation, the computer can adjust the first speed and the second speed through a decoding capability adaptation module. Specifically, as can be seen from the process of determining the first speed and the second speed in S201-S206 and S301-S306 above, 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 a first speed threshold and a second speed threshold.
[0251] In some embodiments, the computer can use a first speed and a second speed as a baseline to generate the transition animation at a constant speed. For example, the transition animation can change from the starting window 201 at a constant speed to the middle window 202, and then from the middle window 202 at a constant speed to the ending window 203.
[0252] In some embodiments, the computer can also use a first speed and a second speed as a baseline to generate a switching animation effect. That is, the switching animation effect changes from the starting window 201, with the first speed as the baseline, first fast and then slow or first slow and then fast, to the intermediate window 202, and then from the intermediate window 202, with the second speed as the baseline, first fast and then slow or first slow and then fast, to the ending window 203. 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 curves.
[0253] In some embodiments, the content displayed for the switching animation may be related to the display content of the first application (i.e., landscape video stream and portrait video stream). Specifically, the content displayed for the switching animation may be one or more of the following: video from the landscape video stream, the last frame image of the landscape video stream, video from the portrait video stream, the first frame image of the portrait video stream, a frame image from the landscape video stream, and a mask image of a frame image from the landscape video stream. The content displayed for the switching animation may also include, but is not limited to: a preset mask image, a preset image (e.g., a preset logo), a preset video, etc. The mask image is an image after blurring the image.
[0254] In one implementation, in S104 or S105, after the computer receives the switching instruction, it can obtain the last frame image of the landscape video stream, or a mask image, or a preset image, or a preset video, etc., to generate the display content of the switching animation, such as the display content of the starting window 201.
[0255] In one implementation, after receiving the switching instruction in S104, the mobile phone can also obtain the first frame image of the vertical screen video stream, or a mask image, or a preset image, or a preset video, etc., to generate the display content of the switching animation, such as the display content of the termination window 203.
[0256] In some application scenarios, if the mobile phone does not stop sending the landscape video stream to the computer before the computer has finished decoding the received portrait video stream, the display content of the first window (e.g., the window from the start window 301 to the middle window 302, and / or the window from the middle window 302 to the end window 303) can continue to play the landscape video stream during the display of the switching animation effect, until the last frame of the landscape video stream is played.
[0257] In one implementation, if the landscape video stream has finished playing before the switching animation moves to the termination window, the last frame of the landscape video stream can be used as the display content of the switching animation moving window until it moves to the termination window, at which point the switching animation has finished playing.
[0258] In one implementation, when switching animation playback to the termination window, if the landscape video stream has not finished playing, it can continue playing in the termination window. Simultaneously, the computer buffers and decodes the received portrait video stream. After the portrait video stream is decoded, it resumes (or replaces) the landscape video stream playing in the termination window, thus playing the portrait video stream in the termination window to ensure a smooth transition between the two video streams.
[0259] like Figure 9 As shown, after the computer generates and displays the transition animation, the method also includes:
[0260] S106. After the computer finishes switching the animation display, it displays the vertical video stream in the second window.
[0261] In this embodiment, after the switching animation display is complete, the computer can display a portrait video stream in a second window. The second window can be the window that appears when the switching animation display is complete, such as the aforementioned termination window 203. That is, the second window can be obtained from the first window through changes in position and / or size. Alternatively, the second window can be a display window regenerated by the computer based on the information from the second window after the switching animation display is complete. This application does not specifically limit this aspect.
[0262] 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, such as Figure 9 As shown, prior to S105, the video switching method provided in this application embodiment further includes:
[0263] S107. The computer obtains the computer's decoding capability parameters.
[0264] In this embodiment, the computer can also obtain its decoding capability parameters, which characterize the computer's ability to decode video streams. These decoding capability parameters include, but are not limited to, decoding time for different bitrate video streams and decoding speed (i.e., the amount of data the computer decodes per unit time).
[0265] In one implementation, S107 can be implemented by a decoding capability adaptation module in the computer.
[0266] 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 the cloud server. This decoding capability mapping table establishes decoding capability mappings for different bitrate video streams based on different network parameters and the capabilities of electronic devices (such as computers). Network parameters include, for example, bandwidth, rate, and latency, while electronic device capabilities include, for example, the processing power of the device's chip.
[0267] In another example, the decoding capability adaptation module can also estimate the computer's decoding capability parameters. Specifically, the computer can obtain the time point (Ti) recorded in the decoder when the vertical video stream enters the buffer. startTimeBuf The time point (T) recorded in the decoder when the vertical screen video stream decoding is completed. endTimeBuf ) and the amount of data accumulated in the cache (D sum Then, the computer can estimate its decoding capability parameter y based on the following expression:
[0268]
[0269] It should be noted that S107 is an optional step. S107 is executed when the computer needs to determine the first and second speeds of the switching animation based on the decoding capability parameters in S105. S107 can be executed when the cooperative operation is triggered (i.e., when the mobile phone and the computer establish a cooperative operation connection in S101), or S107 can be executed after S101 and before S105, to ensure that the first and second speeds can be determined based on the decoding capability parameters in S105. This application does not make specific limitations on this.
[0270] In some embodiments, such as Figure 9 As shown, after S105, the video switching method provided in this application embodiment further includes:
[0271] S108. After the computer displays the switching animation, obtain the actual decoding capability parameters of the decoded vertical screen video stream and update the original decoding capability parameters.
[0272] In some embodiments, after the computer displays the switching animation determined in S105, the actual decoding capability parameters of the computer's vertical video stream can be obtained. Furthermore, the computer can use these actual decoding parameters to update the decoding capability parameters in the decoding capability mapping table. This allows the decoding capability parameters in the decoding capability mapping table to approximate the computer's actual decoding capability.
[0273] 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's display of the switching animation, the decoding detection module can obtain the decoding capability parameters of the vertical screen video stream in real time. After the computer displays the switching animation, the decoding detection module can determine the actual decoding capability parameters to update the original decoding capability parameters in the decoding capability mapping table.
[0274] As described in S101-S108 of the above embodiments, the video switching method provided in this application allows the mobile phone to obtain information (such as position information) of the controls used for playing video in the window where the mobile phone is playing a portrait video stream, i.e., the first control information. This first control information can also be transmitted to the computer. Thus, when the window where the mobile phone is playing the video stream switches from landscape to portrait mode, i.e., from playing a landscape video stream to playing a portrait video stream, the computer can determine the changing position of the first window during the switch from playing a landscape video stream to playing a portrait video stream based on the first window information, the first control information, and the second window information. This allows for the generation and display of switching animations, enabling the computer to smoothly switch between the two video streams.
[0275] Below, we will continue to use the mobile phone and computer in the above embodiments as examples. In some application scenarios, before the computer generates switching animations based on the methods described in S101-S108 above to smoothly switch from playing a video stream in landscape mode to playing a video stream in portrait mode, the computer can also generate switching animations when the mobile phone switches from playing a video stream in portrait mode to playing a video stream in landscape mode to smoothly switch from playing a video stream in portrait mode to playing a video stream in landscape mode.
[0276] Figure 15 A schematic diagram of the principle of the video switching method provided in the embodiments of this application. Figure 4 ,like Figure 15 As shown, firstly, when the mobile phone is playing a portrait video stream, it sends the portrait video stream and first control information to the computer. This first control information is associated with the position of the control playing the video in the window where the mobile phone is playing the portrait video stream. The computer plays the portrait video stream in a third window. If the first control information changes, the phone sends updated first control information to the computer. After the mobile phone switches from playing a portrait video stream to a landscape video stream, it sends a landscape video stream to the computer. Based on the information from the third window, the second control information, and the fourth window, the computer can generate and display a switching animation to smoothly switch from a portrait video stream to a landscape video stream.
[0277] Specifically, Figure 16 Flowchart of the video switching method provided in the embodiments of this application Figure 2 ,like Figure 16As shown, the video switching method provided in this application mainly includes S401-S410:
[0278] S401. Establish a collaborative operation connection between the mobile phone and the computer.
[0279] Specifically, the implementation method for establishing a collaborative operation connection between the mobile phone and the computer can be referred to in S101 above, and will not be elaborated here.
[0280] S402, The mobile phone sends a vertical video stream and the first control information to the computer.
[0281] In some embodiments, there are multiple video playback controls in the display interface of the mobile phone playing a portrait video stream, that is, when the window of the first application displayed on the mobile phone includes multiple first controls. For example... Figure 10 As shown, 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 from playback control 103, playback control 104, and playback control 105 to obtain information about multiple first controls.
[0282] In some embodiments, where at least one first control is included, the mobile phone can also acquire and send first identification information corresponding to each first control information. Specifically, the first identification information is the identification information corresponding to the first control information, that is, the identification information corresponding to the first control, and each first identification information corresponds to one first control. The first identification information is a unique identifier for the first control. For example, the first identification information can be the identity document (ID) of the first control. The first identification information can be used to distinguish the first controls, so as to quickly determine the first control information corresponding to the first control.
[0283] In one implementation, the mobile phone can send the first control information and the corresponding first identification information to the computer via a control channel. In another implementation, the mobile phone can also send the first control information and the corresponding first identification information to the computer via a separate logical channel.
[0284] In some embodiments, the mobile phone can also send a second instruction to the computer, which can be used to indicate the position and / or size of the projection window for playing the portrait video stream on the computer. This allows the computer to quickly generate a projection window to play the portrait video stream.
[0285] In one implementation, the second instruction information mentioned above can be the position and / or size of the window on the mobile phone displaying the portrait video stream. The position and / or size of the window on the mobile phone displaying the portrait video stream can be used by the computer to determine the position and / or size of the projection window and generate the projection window to play the portrait video stream.
[0286] S403. The computer receives the vertical video stream and the first control information, displays the vertical video stream in the third window, and saves the first control information.
[0287] In this embodiment, the computer buffers and decodes the received portrait video stream to obtain the decoded portrait video stream, and displays the portrait 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. This third window information can be associated with the size of the window on the mobile phone displaying the portrait video stream.
[0288] In one implementation, when the S402 mobile phone sends second instruction information to the computer, and the second instruction information can be the position and / or size of the window on which the mobile phone displays the portrait video stream, the computer can determine the third window information based on the second instruction information. Furthermore, the computer can generate a third window based on the third window information to play the portrait video stream within the third window.
[0289] Furthermore, the computer can also perform position mapping on the received first control information, obtain and save the projection position of the first control on the computer (i.e., the first mapped control information), and save the first mapped control information.
[0290] In some embodiments, when the mobile phone sends multiple first control information and corresponding first identification information, the computer can also perform mapping transformation on each of the multiple first control information to obtain the first mapped control information corresponding to each of the multiple first control information, and save each first mapped control information and its corresponding first identification information.
[0291] S404: The mobile phone responds to the switching command and sends a landscape video stream to the computer.
[0292] Specifically, the switching command can be used to instruct the phone to switch from portrait to landscape mode, that is, to switch from playing a portrait video stream to a landscape video stream. The switching command can be generated by the user initiating the switching operation on the phone. Alternatively, the switching command can be generated by the user initiating the switching operation on a computer, and then sent from the computer to the phone.
[0293] In this embodiment of the application, the mobile phone can switch from playing a portrait video stream to a landscape video stream in response to a switching command, that is, the video stream sent by the mobile phone to the computer is switched from a portrait video stream to a landscape video stream.
[0294] In some embodiments, when the mobile phone sends first identification information to the computer in S402, the mobile phone can also send target identification information to the computer. The target identification information is the identification information of a target control, and the target identification information is one of the first identification information, meaning the target control is one of the first controls. Specifically, the target control is the first control determined by the user for switching to landscape playback; that is, the target control is the first control selected by the user on the mobile phone display interface to switch to playing a landscape video stream.
[0295] In some embodiments, similar to how a mobile phone sends first control information, the mobile phone can send the identification information of the target control to the computer via a control channel. An independent logical channel can also be established between the mobile phone and the computer for sending the identification information of the target control to the computer; this application does not specifically limit this.
[0296] S405: The mobile phone receives a landscape video stream, responds to the switching command, and generates and displays the switching animation based on the information from the third window, the first control, and the fourth window.
[0297] In this embodiment, the computer can cache and decode the received landscape video stream to obtain a decoded landscape video stream, and can display the portrait video stream in a fourth window. The position and size of the fourth window can be determined based on fourth window information. The fourth window information may include the size of the computer's entire display interface (full screen), and may also be associated with the position and / or size of the window of the first application displayed on the mobile phone in landscape mode (i.e., the window playing the landscape video stream).
[0298] In one implementation, the computer may have pre-defined fourth window information. For example, the pre-defined fourth window information could be the size of the entire display screen of the computer. Thus, in S404, the mobile phone can also send a full-screen playback command to the computer, and the computer can respond to this command by generating a fourth window based on the pre-defined fourth window information to play the landscape video stream in full-screen mode.
[0299] In another implementation, the computer can also receive the position and / or size of the window displaying the landscape video stream from the mobile phone, and determine the fourth window information based on the position and / or size of the mobile phone's landscape video stream window. For example, the computer can perform mapping transformations (e.g., position offset, proportional scaling, etc.) on the received position and / or size of the mobile phone's landscape video stream window to determine the fourth window information. Furthermore, the computer can generate a fourth window based on the fourth window information to play the landscape video stream within the fourth window.
[0300] In response to the switching command, the computer can generate and display a switching animation based on the information of the third window, the first control, and the fourth window. The switching animation includes the computer changing from displaying the window of the first application in portrait mode to displaying the window of the first application in landscape mode, that is, the computer changing from the third window playing a portrait video stream to the fourth window playing a landscape video stream.
[0301] In some embodiments, the computer can scale the first window based on third window information, first control information, and fourth window information, causing the content displayed in the third window to change as the size of the third window changes, thus creating a switching animation effect. Specifically, the computer-generated switching animation effect may include: shrinking the third window based on the third window information and the first control information, with the size and position of the shrunken third window associated with the first control information; and then enlarging the third window based on the fourth window information, with the size and position of the enlarged third window associated with the fourth window information.
[0302] In one implementation, in the computer-generated switching animation, the third window can be shrunk to a second point based on the first control information, and then the third window can be enlarged from that second point. The second point is determined based on the first control information, and can be a point determined according to the position and size of the first control in the first control information and preset rules.
[0303] For example, Figure 17 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 3 ,like Figure 17 As shown, taking the second point mentioned above as the center point of the first control in the window playing a vertical video stream on the computer, and the fourth window as the full-screen window of the computer, the switching animation generated by the computer can include: in the computer's display interface 200, shrinking the third window 310 to the center point 320 of the first control with a third action and a third speed, and then enlarging it from the center point 320 of the first control to the fourth window 330 with a fourth action and a fourth speed.
[0304] In another implementation, the computer-generated switching animation can be further modified to shrink the third window to the size and position determined by the first mapping control information using a third action and a third speed, and then enlarge the third window to the size and position determined by the fourth window information using a fourth action and a fourth speed.
[0305] For example, Figure 18 A schematic diagram of the switching animation provided in the embodiments of this application. Figure 4 ,like Figure 18As shown, taking the fourth window as the computer's full-screen window as an example, the computer-generated switching animation can be as follows: the third window (i.e., the starting window 301) determined by the third window information (l2, r2, w2, h2) in the computer's display interface shrinks to the window (i.e., the middle window 302) determined by the first mapping control information (l1′, r1′, w1′, h1′) with the third action and the third speed, and then the middle window 302 enlarges to the fourth window (i.e., the ending window 303) determined by the fourth window information (l3, r3, w3, h3).
[0306] The third and fourth actions mentioned above may be the same or different, and may be one or more of the following motion effects: rotation, fade-in / fade-out, or fly-in / fly-out. This application does not specifically limit the third and fourth actions.
[0307] In some embodiments, when the computer's decoding capability is stable, 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 a preset time.
[0308] In some embodiments, the computer can also estimate the movement speed of the switching motion effect based on the computer's caching and decoding process of the landscape video stream, combined with the computer's caching and decoding capabilities, and determine the third and fourth speeds.
[0309] Specifically, the computer can determine the third speed and the fourth speed based on the information from the third window, the first control, and the fourth window, as well as the computer's caching and decoding capabilities. The methods for determining the third speed, the fourth speed, and the display content of the switching animation can refer to the methods for determining the first speed, the second speed, and the display content of the animation switching described in S105 above, and will not be repeated here.
[0310] S406. After the computer finishes switching the animation display, it displays a landscape video stream in the fourth window.
[0311] The fourth window can be the window displayed when the switching animation effect is completed, such as the termination window 303 mentioned above. That is, the second window can be obtained from the third window by changing its position and / or size. The fourth window can also be a display window regenerated by the computer based on the information from the fourth window after the switching animation effect is completed. This application does not specifically limit this.
[0312] 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 its decoding capabilities, such as Figure 16 As shown, prior to S405, the video switching method provided in this application embodiment further includes:
[0313] S407. The computer obtains the decoding capability parameters of the computer.
[0314] S408. After the computer displays the switching animation, obtain the actual decoding capability parameters of the decoded landscape video stream and update the original decoding capability parameters.
[0315] Specifically, the implementation methods of S407-S408 can be referred to S107-S108 above, and will not be repeated here.
[0316] In some embodiments, to enable the computer to accurately determine the transition position of the switching animation and improve the smoothness of the computer-generated switching animation, the mobile phone can also monitor the first control information in real time. If the first control information changes, the mobile phone can obtain and send the updated first control information to the computer, so that the first control information can be updated promptly. For example... Figure 16 As shown, prior to S405, the video switching method provided in this application embodiment further includes:
[0317] S409: The mobile phone detects the first control information in real time, and when the first control information changes, it obtains and sends the updated first control information to the computer.
[0318] In some application scenarios, when the information of the first control changes. For example, Figure 19 This is a schematic diagram of a mobile phone display interface provided in an embodiment of this application, such as... Figure 19 As shown, users can move the phone's display interface up and down by swiping the screen, which changes the position of the playback controls (such as playback controls 102, 103, 104, and 105) in the first application window, causing changes to the first control information. The phone detects the first control information in real time and sends the updated first control information to the computer. This ensures that the computer can quickly and accurately obtain the first control information when determining the animation effect.
[0319] In one implementation, S409 can be implemented by a control sensing module in the mobile phone. Specifically, the control sensing 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 information of the first control has changed, it obtains the latest information of the first control, updates the information of the first control, and sends the updated information of the first control to the computer. In this way, the computer can accurately determine the switching animation based on the information of the first control.
[0320] In some embodiments, when the mobile phone sends the first identification information to the computer in S402, the mobile phone can also send the updated first control information and the corresponding first identification information to the computer. This allows the computer to quickly update the first control information based on the first identification information.
[0321] In this embodiment of the application, changes in the information of the first control include, but are not limited to: changes in the size information of the first control, changes in the position information of the first control, deletion of the first control information (i.e., the original first control being moved out of the window of the first application displayed on the mobile phone), and addition of the first control information (i.e., a new first control being moved into the window of the first application displayed on the mobile phone), etc. Figure 19 As shown, playback controls 106, 107, and 108 are newly added playback controls after the content of the first application window displayed on the mobile phone changes. The control information corresponding to playback controls 106, 107, and 108 is the information of the newly added first control.
[0322] S410. The computer receives the updated first control information and saves the updated first control information.
[0323] In this embodiment of the application, after receiving the updated first control information, the computer can perform mapping transformation on the received updated first control information to obtain updated first mapped control information, and replace the original first mapped control information with the updated first mapped control information to realize the update of the first mapped control information.
[0324] For example, when the mobile phone sends updated first control information and corresponding first identifier information to the computer, the computer can determine the first control information saved in S403 based on the first identifier information, and replace the original first control information with the updated first control information corresponding to the first identifier information. If the computer does not find the saved original first control information based on the first identifier information, it means that the updated first control information corresponding to the first identifier information is newly added first control information, and the first control information is saved directly.
[0325] In one implementation, if the computer does not receive the first identifier information saved in S403, it means that the first control corresponding to the first identifier information has been moved out of the window displaying the first application on the mobile phone, and the computer can delete the first control information corresponding to the first identifier information. This saves computer storage resources.
[0326] In this embodiment, steps S409 and S410 are optional. If the first control information changes, steps S409 and S410 are executed after step S402. If the first control information does not change, steps S409 and S410 are not executed.
[0327] As described in S401-S410 of the above embodiments, the video switching method provided in this application allows the mobile phone to obtain information (such as position information) of the controls used for playing video in the window where the mobile phone is playing a portrait video stream, i.e., the first control information, and to transmit the first control information to the computer. Thus, when the window where the mobile phone is playing the video stream switches from portrait to landscape mode, i.e., from playing a portrait video stream to playing a landscape video stream, the computer can determine the changing position of the third window during the switch from playing a portrait video stream to playing a landscape video stream based on the third window information, the first control information, and the fourth window information. This allows for the generation and display of switching animations, enabling the computer to smoothly switch between the two video streams.
[0328] It is understood that, in order to achieve the aforementioned functions, the electronic device includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that, based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0329] This application embodiment can group functional modules of an electronic device according to the above method example. For example, each functional group can be assigned to a separate functional module, or two or more functions can be integrated into a single processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the grouping of modules in this application embodiment is illustrative and represents only one logical functional grouping; other grouping methods may be used in actual implementation.
[0330] This application also provides a video switching device, which can be the second electronic device (such as the computer in the above embodiments), a chip in the second electronic device, or a system on a chip. The video switching device can be used to perform the functions of the computer involved in the above embodiments.
[0331] As one possible approach, such as Figure 20As shown, the video switching device 200 includes: a receiving module 201, a display module 202, a control sensing module 203, and a motion effect control module 204. The receiving module 201 receives a first video stream, which is display data when the first electronic device displays a window of a first application in a first state. The display module 202 displays the first video stream in a first window. The receiving module 201 also receives a second video stream, which is display data when the first electronic device displays a window of the first application in a second state. The control sensing module receives first control information, which is associated with the position of a first control within the window of the first application displayed in the second state. The first control is a control used for playing video within the window of the first application. The motion effect control module 203 generates 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. The switching motion effect includes a transition from the window of the first application displayed in the first state to the window of the first application displayed in the second state, and the content of the switching motion effect 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 display is completed, and the second window is associated with the second window information.
[0332] In some embodiments, the video switching device 200 further includes a coordination module 205, a decoding capability adaptation module 206, and a decoding monitoring module 207. The coordination module 205 establishes a cooperative operation connection to implement cooperative operation functions. The decoding capability adaptation module 206 acquires decoding capability parameters to determine the transition speed of the switching animation. The decoding monitoring module 207 monitors the actual decoding capability parameters of the video stream for updating the decoding capability parameters.
[0333] This application also provides a video switching device, which can be the first electronic device (such as the mobile phone in the above embodiments), 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 embodiments.
[0334] As one possible approach, such as Figure 21As shown, the video switching device 300 includes a sending module 301 and a control sensing module 302. The sending module 301 sends 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 control sensing module 302 acquires and sends first control information, which is associated with the position of the first control in the window of the first application displayed in a second state. The first control is a control used for playing video in the window of the first application. The first control information is used by the second electronic device to generate a switching animation effect, which 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. The sending module 301 also sends a second video stream, which is display data when the window of the first application is displayed in the second state.
[0335] This application also provides an electronic device, which may include a memory and one or more processors. The memory and processors are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the mobile phone in the above method embodiments, or the electronic device can perform various functions or steps performed by the computer in the above method embodiments. Of course, the electronic device includes, but is not limited to, the memory and one or more processors described above. For example, the structure of the electronic device can be referred to... Figure 5 The structure of the electronic device shown.
[0336] This application also provides a chip system that can be applied to the electronic devices described in the foregoing embodiments. For example... Figure 22 As shown, the chip system includes at least one processor 401 and at least one interface circuit 402. The processor 401 may be a processor found in the aforementioned electronic device. The processor 401 and the interface circuit 402 are interconnected via a circuit. The processor 401 can receive and execute computer instructions from the memory of the aforementioned electronic device through the interface circuit 402. When the computer instructions are executed by the processor 401, the electronic device may perform the steps executed by the mobile phone in the aforementioned embodiments, or it may perform the steps executed by the computer in the aforementioned embodiments. Of course, the chip system may also include other discrete components, which are not specifically limited in this application embodiment.
[0337] This application also provides a computer-readable storage medium for storing computer instructions for operating the aforementioned electronic device.
[0338] This application also provides a computer program product, including computer instructions for running the above-mentioned electronic device.
[0339] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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.
[0340] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0341] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0342] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0343] If the integrated unit is implemented as 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 solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0344] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A video switching method, characterized in that, Applied to a second electronic device, the method includes: Receive a first video stream sent by a first electronic device, wherein the first video stream is display data when the first electronic device displays the window of the first application in a first state; The first video stream is displayed in the first window of the second electronic device; The device receives 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 the window of the first application in a 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 a control in the window of the first application used to play video. A switching animation effect is generated 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 on the first electronic device in the second state. The switching animation effect 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. The display content of the switching animation effect is related to the first application. Generating the switching animation effect based on the first window information, the first control information, and the second window information includes: shrinking the first window based on the first window information and the first control information, wherein the size and position of the shrunken first window are associated with the first control information; and then enlarging the first window based on the second window information, wherein the size and position of the enlarged first window are associated with the second window information. After the switching animation display is completed, the first video stream is displayed in the 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 the position or size of the 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: Receive 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.
4. The method according to claim 1 or 2, characterized in that, Before generating the switching animation based on the first window information, the first control information, and the second window information, the method further includes: The position of the window of the first application displayed in the second state by the first electronic device is received from the first electronic device.
5. The method according to claim 1 or 2, characterized in that, The second window information is also associated with the size of the window of the first application displayed by the first electronic device in the second state; Before generating the switching animation based on the first window information, the first control information, and the second window information, the method further includes: The size of the window of the first application displayed by the first electronic device in the second state, as sent by the first electronic device.
6. The method according to claim 1 or 2, characterized in that, Before receiving the second video stream and first control information sent by the first electronic device, the method further includes: The device receives a switching command, which is used to instruct the first electronic device to change its screen orientation from portrait to landscape.
7. The method according to claim 6, characterized in that, If the first state is landscape mode and the second state is portrait mode, then the switching command is used to instruct the first electronic device to switch from the landscape mode to the portrait mode.
8. The method according to claim 1, characterized in that, The step of shrinking the first window based on the first window information and the first control information includes: The first window is minimized to a first point, which is determined based on the first control information.
9. The method according to claim 8, characterized in that, The first point is the center point of the first control in the window of the first application displayed by the second electronic device in the second state.
10. The method according to any one of claims 1, 8-9, characterized in that, While shrinking the first window, one or more of the following animation effects are displayed: rotation, fade in / out, fly in / fly out; while enlarging the first window, one or more of the following animation effects are displayed: rotation, fade in / out, fly in / fly out.
11. The method according to claim 1 or 2, characterized in that, The display content of the switching animation is one or more of the following: the last frame image of the first video stream, the first frame image of the second video stream, the mask image, the preset image, and the preset video.
12. The method according to any one of claims 1, 8-9, characterized in that, The method further includes: The first window is reduced at a first speed, and then enlarged at a second speed; The first speed and the second speed are determined based on the buffering capability and decoding capability of the second electronic device. The buffering capability of the second electronic device is used to characterize the ability of the second electronic device to buffer video streams, and the decoding capability of the second electronic device is used to characterize the ability of the second electronic device to decode video streams.
13. The method according to claim 12, characterized in that, The step of generating the switching animation based on the first window information, the first control information, and the second window information further includes: The movement distance is determined based on the information from the first window, the information from the first control, and the information from the second window. The movement time is determined based on the buffering and decoding capabilities of the second electronic device; The first speed and the second speed are determined based on the distance traveled and the time traveled.
14. The method according to claim 13, characterized in that, The movement distance includes: a first distance and a second distance; the movement time includes: a first time and a second time. The step of determining the first speed and the second speed based on the travel distance and the travel time includes: The first distance is determined based on the first window information and the first control information, and the second distance is determined based on the first control information and the second window information. The first time is determined based on the caching capability of the second electronic device; The second time is determined based on the decoding capability of the second electronic device; A first estimated speed is determined based on the first distance and the first time, and a second estimated speed is determined based on the second distance and the second time; If the first estimated speed is less than or equal to the second estimated speed, both the first speed and the second speed are determined to be the first estimated speed. If the first estimated speed is greater than the second estimated speed, then both the first speed and the second speed are determined to be the second estimated speed.
15. The method according to claim 13, characterized in that, The movement distance includes: a first distance and a second distance; the movement time includes: a first time and a second time. The step of determining the first speed and the second speed based on the travel distance and the travel time includes: The first distance is determined based on the first window information and the first control information, and the second distance is determined based on the first control information and the second window information. The first time is determined based on the decoding capability of the second electronic device; The second speed is determined based on the second distance and the first time; The second time is determined based on the first distance and the second speed; The third time is determined based on the caching capability of the second electronic device; If the second time is greater than or equal to the third time, it is determined that the first speed is the same as the second speed; If the second time is less than the third time, the first speed is determined based on the first distance and the third time.
16. A video switching method, characterized in that, Applied to a first electronic device, the method includes: Send 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 a first state; Obtain 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. The first control is a control used to play video in the window of the first application. The second video stream and the first control information are sent. The second video stream is the display data when the first electronic device displays the window of the first application in the second state. The first control information is used by the second electronic device to generate a switching animation effect. The switching animation 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. In the switching animation effect, the first control information is associated with the size and position of the first window after it is reduced, and the size and position of the first window after it is enlarged are associated with the second window information.
17. The method according to claim 16, 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.
18. The method according to claim 16 or 17, characterized in that, Before sending the second video stream and the first control information, the method further includes: Obtain 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; Send 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, wherein 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.
19. The method according to claim 16 or 17, characterized in that, Before sending the second video stream and the first control information, the method further includes: Obtain 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; Send 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 second window information, and the second window information is used by the second electronic device to generate the switching animation.
20. The method according to claim 16 or 17, characterized in that, Before sending the second video stream and the first control information, the method further includes: Send a switching command, which is used to instruct the first electronic device to change its screen orientation from portrait to landscape.
21. The method according to claim 20, characterized in that, If the first state is landscape mode and the second state is portrait mode, then the switching command is used to instruct the first electronic device to switch from the landscape mode to the portrait mode.
22. An electronic device, characterized in that, include: A memory, one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the method as claimed in any one of claims 1-15, or cause the electronic device to perform the method as claimed in any one of claims 16-21.
23. A computer-readable storage medium, characterized in that, The method includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-15, or cause the electronic device to perform the method as described in any one of claims 16-21.