Dynamic wallpaper playing method, foldable screen device and storage medium
By capturing the folding angle in real time on foldable screen devices and using a frame skipping step strategy and preset values to control video frame playback, the trailing and unresponsiveness issues caused by flexible animation schemes are resolved, improving the playback effect and user experience of dynamic wallpapers.
Patent Information
- Application Number
- CN202310727886.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-06-16
AI Technical Summary
In existing technologies, when using flexible animation solutions on foldable screen devices, the user's hand movements have stopped, but the live wallpaper still needs to play for a relatively long time, resulting in trailing and unresponsiveness.
By capturing the folding angle and determining the number of video frames in real time within foldable screen devices, and employing a frame skipping step strategy and preset values to control video frame playback, the dynamic wallpaper is ensured to finish playing in a short time. This is combined with uniform frame-by-frame playback to improve responsiveness and visual experience.
It effectively reduces the trailing effect during live wallpaper playback, improves the user experience, and ensures smooth animation and visual effects.
Smart Images

Figure CN119155379B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for playing dynamic wallpapers, a foldable screen device, and a storage medium. Background Technology
[0002] With the popularization of terminal devices, people's demand for devices that are both portable and have large screens is becoming stronger, leading to the emergence of foldable screen devices.
[0003] Currently, foldable screen devices include at least one foldable display. When the display is on, if the user changes the folding angle, the foldable device can use a flexible animation scheme to render a dynamic wallpaper corresponding to the changed folding angle, in order to enrich the wallpaper effect. Typically, the flexible animation scheme relies on the timestamps returned from the underlying system to determine the time interval between two adjacent frames rendered on the screen. The mechanism of the flexible animation scheme means that the closer to the end of the dynamic wallpaper, the larger the interval between the returned timestamps, and the larger the time interval between two adjacent frames rendered on the screen. This results in a longer dynamic wallpaper playback time, causing users to perceive a trailing or unresponsive feel. Summary of the Invention
[0004] This application provides a method for playing live wallpapers, a foldable screen device, and a storage medium, which solves the technical problems of trailing and unresponsiveness that occur when playing live wallpapers using an elastic animation scheme when the folding angle of the foldable screen device is changed.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] Firstly, embodiments of this application provide a method for playing dynamic wallpapers. This method should be applicable to foldable screen devices, which include at least one foldable display screen. As an example, the foldable screen device includes two displays screens, the foldable display screen being referred to as the large screen and the non-foldable display screen being referred to as the small screen.
[0007] Taking a foldable display screen as an example (referred to as a large screen), the method may include: displaying a wallpaper of a first theme on the large screen, wherein the video resource of the first theme comprises multiple video frames; receiving a first operation from a user to adjust the large screen from a first folding angle to a second folding angle; in response to the first operation, determining a first video frame in the video resource of the first theme corresponding to the first folding angle, and a second video frame in the video resource of the first theme corresponding to the second folding angle; if the number of video frames in the first video resource is less than or equal to a first value, playing each video frame of the first video resource frame by frame on the large screen according to the frame rate of the first theme; or, if the number of video frames in the first video resource is greater than the first value, extracting frames from the first video resource according to a first frame extraction step size, and playing the extracted video frames on the large screen according to the frame rate of the first theme. The first video resource refers to the video frames in the video resource of the first theme between the first video frame and the second video frame. That is, the first video resource consists of a first video frame, a second video frame, and video frames located between the first and second video frames, which are extracted from the video resource of the first theme.
[0008] It should be understood that when displaying wallpaper on a large screen, if the user changes the angle between the two display areas of the large screen, the system can determine whether the number of video frames corresponding to that angle is less than or equal to a first value. If the number of video frames is high, frame skipping (i.e., playing only a portion of the video resources for the first theme) can be implemented; if the number of video frames is low, frame-by-frame playback can proceed at a constant speed. In this way, regardless of the folding angle, these video frames can be played within a short time, making the wallpaper animation more responsive and reducing the likelihood of ghosting, thus improving the user experience when using foldable screen devices.
[0009] In one possible implementation, the configuration options for the first theme include a preset value. This preset value indicates the maximum number of video frames allowed to play at the end of a video resource. For example, the preset value might be 5, 10, or 15 frames. It should be understood that a larger preset value results in more video frames playing at a constant speed at the end of the live wallpaper, producing a more detailed picture; a smaller preset value results in fewer video frames playing at a constant speed at the end of the live wallpaper, providing better responsiveness.
[0010] Accordingly, when the number of video frames in the first video resource is greater than a first value, the first video resource is frame-sampling according to a first frame-sampling step size, and the extracted video frames are played on the large screen according to the frame rate of the first theme. This includes: when the number of video frames in the first video resource is greater than the first value, starting from the first video frame, the first video resource is frame-sampling according to the first frame-sampling step size, and the extracted video frames are played on the large screen; after each frame-sampling of the first video resource according to the first frame-sampling step size, it is determined whether the number of remaining video frames is less than or equal to a preset value, where the remaining video frames refer to the video frames from the next frame of the currently extracted video frame to the second video frame; if the number of remaining video frames is greater than the preset value, the frame-sampling of the first video resource continues according to the first frame-sampling step size, and the extracted video frames are played on the large screen; if the number of remaining video frames is less than or equal to the preset value, the frame-sampling stops, and the remaining video frames are played frame by frame on the large screen.
[0011] It should be understood that because preset values are set in the theme package configuration, when a user adjusts the folding angle of their foldable phone, the video frames are first played in a frame-by-frame manner according to the frame-by-frame increment, and then the frame-by-frame playback stops at the end of the video resource and resumes at a constant speed. On one hand, the total number of video frames played is less than the first value, ensuring that the dynamic wallpaper finishes playing in a shorter time (e.g., 700 milliseconds), making the wallpaper animation responsive and reducing the possibility of ghosting. On the other hand, using a constant-speed frame-by-frame playback strategy at the end of the video resource results in a more delicate, smooth, and gentle image, thereby improving the user's visual experience when watching the wallpaper animation.
[0012] In one possible implementation, before performing frame extraction on the first video resource according to the first extraction step size, the method may further include determining the first extraction step size using the following relationship:
[0013]
[0014] Where S represents the first frame extraction step size, ΔF represents the number of video frames in the first video resource, and k2 represents the second value, which is the number of video frames played at the frame rate of the first theme within the first preset duration. For example, the first preset duration is 400 milliseconds. Research shows that if the live wallpaper can finish playing within 400 milliseconds after the user stops the folding operation, the large-screen wallpaper animation will be more responsive.
[0015] In one possible implementation, before displaying the wallpaper of the first theme on the large screen, the method may further include: receiving a second operation from the user setting the wallpaper of the first theme as the desktop wallpaper of the large screen; in response to the second operation, obtaining the configuration items of the first theme, and parsing the configuration items of the first theme to obtain a first value and a second value.
[0016] It should be understood that the parameters in the configuration options of the first theme are fixed. When a user sets the wallpaper of the first theme as the desktop wallpaper on the large screen, the foldable screen device can parse the configuration options of the first theme and calculate the first and second values based on them. Thus, each time the user changes the folding angle of the large screen, a dynamic wallpaper playback scheme can be formulated according to the pre-calculated first and second values, thereby improving the response speed of the foldable screen device when playing wallpaper animations.
[0017] In one possible implementation, parsing the configuration items of the first topic to obtain the second value includes: parsing the configuration items of the first topic to obtain the frame rate of the first topic; and determining the second value based on the frame rate of the first topic and a first preset duration using the following formula:
[0018] k2 = t2 * f;
[0019] Where t2 represents the first preset duration, and f represents the frame rate of the first theme. For example, the first preset duration is 400 milliseconds.
[0020] It should be understood that the first preset duration can be a fixed value pre-stored in the foldable screen device. After obtaining the frame rate of the first theme, the first preset duration can be multiplied by the frame rate of the first theme to obtain the maximum number of frames that can be played within the first preset duration, i.e., the second value.
[0021] In one possible implementation, parsing the configuration items of the first topic to obtain the first value includes: parsing the configuration items of the first topic to obtain the frame rate of the first topic; and determining the first value based on the frame rate of the first topic and a second preset duration using the following formula:
[0022] k1 = t1 * f;
[0023] Where k1 represents the first value, t1 represents the second preset duration, and f represents the frame rate of the first theme. The second preset duration is longer than the first preset duration. Research shows that although a live wallpaper completing its playback within 400 milliseconds provides better responsiveness, when the playback duration of the wallpaper animation is controlled within 400 milliseconds, playing from the video frame corresponding to the start folding operation to the video frame corresponding to the end folding operation may skip too many video frames, resulting in a stiff and less smooth animation effect. To balance responsiveness and smoothness, the playback duration can be increased by approximately 200 to 300 milliseconds from 400 milliseconds, so that the total duration of the wallpaper animation (i.e., the second preset duration) is controlled within 600 to 700 milliseconds. In other words, the second preset duration is any value between 600 and 700 milliseconds.
[0024] It should be understood that the second preset duration can be a fixed value pre-stored in the foldable screen device. After obtaining the frame rate of the first theme, the second preset duration can be multiplied by the frame rate of the first theme to obtain the maximum number of frames that can be played within the second preset duration, i.e., the first value.
[0025] In one possible implementation, determining the first video frame corresponding to the first folding angle in the video resource of the first theme, and the second video frame corresponding to the second folding angle in the video resource of the first theme, includes:
[0026] The first video frame corresponding to the first folding angle is determined using the first relational expression; the first relational expression is:
[0027]
[0028] The second relationship is used to determine the second video frame corresponding to the second folding angle; the second relationship is:
[0029]
[0030] Where F1 represents the frame index of the first video frame, D1 represents the folding angle corresponding to the frame index of the first video frame, F2 represents the frame index of the second video frame, D2 represents the folding angle corresponding to the frame index of the second video frame, x represents the minimum value of the preset angle range, y represents the maximum value of the preset angle range, and m represents the total number of video frames of the first theme.
[0031] It should be understood that foldable screen devices can pre-store a formula for calculating folding angles and frame indices. In this formula, the minimum value x and the maximum value y of the preset angle range are fixed values, and the total number of video frames for the first theme can be obtained from the configuration items of the first theme. Therefore, whenever a folding angle is captured, the corresponding video frame can be calculated using this formula.
[0032] In one possible implementation, the first folding angle and the second folding angle are within a preset angle range.
[0033] It should be understood that when the angle between the two display areas of a large screen is too large or too small, the user may not need to view the live wallpaper, or the foldable screen device may not need to display the live wallpaper. Therefore, the angle before and after folding can be limited to a preset angle range.
[0034] In one possible implementation, the wallpaper of the first theme is the desktop wallpaper of the large screen. Accordingly, before displaying the wallpaper of the first theme on the large screen, the method may further include: receiving a third operation triggered by the user to turn on the large screen when the large screen is in a screen-off state; in response to the third operation, extracting frames from the video resource of the second theme according to a second frame extraction step size, and playing the extracted video frames on the large screen starting from the first frame of the video resource of the second theme, according to the frame rate of the second theme, until the last frame of the video resource of the second theme. The second frame extraction step size is configured in the configuration items of the second theme.
[0035] It should be understood that, on the one hand, unlike triggering the display of a live wallpaper by changing the folding angle when the large screen is on, when the large screen is off, upon receiving a user's command to turn on the large screen, since no wallpaper has been displayed before, the foldable screen device can play the second theme from the first frame to the last frame as usual. On the other hand, if the video resource of the second theme contains many frames, frame skipping can be performed on the video resource of the second theme to shorten the playback time of the animated wallpaper. As another possible implementation, after receiving a user's command to turn on the large screen, the foldable screen device may also not perform frame skipping, but instead play each video frame of the second theme one by one.
[0036] In one possible implementation, the method may further include: during the playback of the extracted video frames on the large screen, if a user's folding operation on the large screen is received, the method does not respond to the folding operation and continues to play the extracted video frames on the large screen until the last frame of the video resource of the second theme.
[0037] It should be understood that during the process of playing the extracted video frames at a constant speed on the large screen, since the video frames of the second theme have not yet finished playing, it is not necessary to respond to the user's folding operation to trigger the display of the live wallpaper, thereby avoiding the conflict caused by playing two themes at the same time.
[0038] In one possible implementation, when the number of video frames in the first video resource is less than or equal to a first value, each video frame of the first video resource is played on the large screen frame by frame according to the frame rate of the first theme, including: when the number of video frames in the first video resource is less than or equal to the first value, each video frame of the first video resource is played on the large screen starting from the video frame corresponding to the first folding angle, up to the video frame corresponding to the second folding angle, according to the frame rate of the first theme.
[0039] Wherein, the first folding angle is greater than the second folding angle, or the first folding angle is less than the second folding angle.
[0040] It should be understood that the first folding angle is the starting angle, and the second folding angle is the ending angle. Whether switching from a large folding angle to a small folding angle, or vice versa, the foldable screen device starts playing video frames corresponding to the starting angle and continues until the video frames corresponding to the ending angle. This ensures the continuity of the live wallpaper displayed before and after the folding operation, which is more in line with the user's viewing habits.
[0041] Secondly, this application provides an apparatus comprising units for performing the method described in the first aspect above. This apparatus corresponds to performing the live wallpaper playback method described in the first aspect above. For a detailed description of the units within this apparatus, please refer to the description in the first aspect above; for brevity, it will not be repeated here.
[0042] The method described in the first aspect above can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a processing module or unit, a display module or unit, etc.
[0043] Thirdly, this application provides a foldable screen device, which includes a memory and one or more processors. The memory stores computer program code, including computer instructions. When the computer instructions are executed by the processor, the foldable screen device performs the dynamic wallpaper playback method provided in any of the first aspects.
[0044] Fourthly, this application provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are executed on a foldable screen device, the foldable screen device causes the foldable screen device to perform the dynamic wallpaper playback method provided in the first aspect and any possible implementation thereof.
[0045] Fifthly, this application provides a computer program product. When the computer program product is run on a computer, it causes the computer to execute the dynamic wallpaper playback method provided in the first aspect and any possible implementation thereof.
[0046] Sixthly, this application provides a chip system. The chip system includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via lines. The chip system can be applied to a foldable screen device including a communication module and a memory. The interface circuits are used to receive signals from the memory of the foldable screen device and send the received signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the foldable screen device can perform the dynamic wallpaper playback method provided by the first aspect and any possible implementation thereof.
[0047] It is understood that the beneficial effects achieved by the apparatus of the second aspect, the foldable screen device of the third aspect, the computer-readable storage medium of the fourth aspect, the computer program product of the fifth aspect, and the chip system of the sixth aspect can be referred to the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description
[0048] Figure 1 A schematic diagram of the hardware structure of a foldable screen phone provided in an embodiment of this application;
[0049] Figure 2 A schematic diagram of a foldable screen phone in a fully folded state, as provided in an embodiment of this application.
[0050] Figure 3 This is a schematic diagram of a foldable screen phone in a semi-folded state, as provided in an embodiment of this application.
[0051] Figure 4 A schematic diagram of a foldable screen phone provided in an embodiment of this application in its fully unfolded state;
[0052] Figure 5 A schematic diagram of a dynamic wallpaper display scenario provided in an embodiment of this application;
[0053] Figure 6 A schematic diagram illustrating a second dynamic wallpaper display scenario provided in an embodiment of this application;
[0054] Figure 7 A schematic diagram of a dynamic wallpaper display scenario three provided in an embodiment of this application;
[0055] Figure 8 A schematic diagram of the fourth dynamic wallpaper display scenario provided in this application embodiment;
[0056] Figure 9 A schematic diagram of a dynamic wallpaper display scenario five provided in an embodiment of this application;
[0057] Figure 10 This is a schematic diagram of a dynamic wallpaper display scenario six provided in an embodiment of this application;
[0058] Figure 11 A schematic diagram of the dynamic wallpaper display scenario seven provided in the embodiments of this application;
[0059] Figure 12 A schematic diagram of dynamic wallpaper display scene eight provided in this application embodiment;
[0060] Figure 13 A schematic diagram of dynamic wallpaper display scene nine provided in an embodiment of this application;
[0061] Figure 14A schematic diagram of a dynamic wallpaper display scenario ten provided in an embodiment of this application;
[0062] Figure 15 This is a schematic diagram of the system architecture of a foldable screen phone provided in an embodiment of this application;
[0063] Figure 16 This is a schematic diagram illustrating the interaction between various modules in a foldable screen phone provided in an embodiment of this application.
[0064] Figure 17 A flowchart illustrating a theme setting method provided in an embodiment of this application;
[0065] Figure 18 A flowchart illustrating a dynamic wallpaper playback method provided in an embodiment of this application;
[0066] Figure 19 A schematic diagram illustrating the process of playing video frames using MediaCodec, as provided in an embodiment of this application;
[0067] Figure 20 A schematic diagram illustrating the playback of the second theme according to the frame skipping step size provided in this application embodiment;
[0068] Figure 21 A schematic diagram of a dynamic wallpaper uniform motion frame extraction scheme provided in an embodiment of this application;
[0069] Figure 22 A schematic diagram of another dynamic wallpaper uniform animation frame extraction scheme provided in the embodiments of this application;
[0070] Figure 23 A schematic diagram of another dynamic wallpaper uniform animation frame extraction scheme provided in the embodiments of this application;
[0071] Figure 24 A flowchart illustrating a method for playing video frames at a constant speed at the end of a live wallpaper, as provided in an embodiment of this application.
[0072] Figure 25 A schematic diagram illustrating a scheme for playing video frames at a constant speed at the end of a live wallpaper, as provided in an embodiment of this application;
[0073] Figure 26 This is a schematic diagram illustrating another scheme for playing video frames at a constant speed at the end of a live wallpaper, provided as an embodiment of this application. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0075] In the description of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. In the description of this application, "and / or" is merely a way of describing the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone.
[0076] In the specification and claims of this application, the terms "first" and "second," etc., are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of the objects. For example, "first folding angle" and "second folding angle," etc., are used to distinguish different folding angles, rather than to describe a specific order of folding angles. In the embodiments of this application, "multiple" refers to two or more.
[0077] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0078] To facilitate understanding of the embodiments of this application, some terms used in the embodiments of this application will be explained below.
[0079] 1. Frame: A frame is the smallest unit of visual information displayed on a screen. A frame can be understood as a still image. Displaying multiple consecutive frames quickly can create the illusion of motion, thus producing a video playback.
[0080] 2. Frame Rate: This refers to the number of frames generated per second by an application client during runtime. Terminal devices typically involve processes such as drawing, rendering, and compositing to generate frames for display. The unit of frame rate is frames per second (FPS). Frame drawing refers to the rendering of images for the display interface. Frame rendering involves coloring the drawn view or adding 3D effects. Frame compositing is the process of combining at least one rendered view into a single display interface.
[0081] 3. Live Wallpaper: Also known as dynamic wallpaper, it refers to a wallpaper composed of multiple frames. The image content of each frame in a live wallpaper changes dynamically. When the terminal device enters the lock screen from the always-on display (AOD) interface, enters the desktop interface from the lock screen, or continuously displays the desktop, the terminal device can play the live wallpaper frame by frame, thus creating a continuous wallpaper animation effect. Typically, one wallpaper corresponds to one theme package, which can be a compressed file in hwt format. The theme package includes a file named livepaper.xml in Extensible Markup Language (XML) format. This livepaper.xml file indicates the wallpaper service bound to the wallpaper in the Android application package (APK). In addition, the wallpaper application also includes display resources used to implement the wallpaper display, such as frame sequences.
[0082] This application primarily relates to live wallpapers applied to foldable screen devices. For example, when the foldable screen device is fully folded, it displays a live wallpaper on the smaller screen (also known as the outer screen). Alternatively, when a user holds the foldable screen device with both hands and changes its folding angle, the device can play a live wallpaper on the larger screen (also known as the inner screen, foldable display, or foldable screen) according to the change in folding angle, and the image content of the live wallpaper changes with the change in folding angle.
[0083] 4. Unresponsiveness: In this embodiment of the application, unresponsiveness refers to the phenomenon that when a user holds the foldable screen device with both hands and changes the folding angle of the foldable screen, for example, when the foldable screen changes from folding angle A to folding angle B, the user's hand movements have stopped, but the live wallpaper continues to play for a relatively long time.
[0084] 5. Trailing: This refers to the phenomenon where, during the process of changing the foldable screen of a foldable device from folding angle A to folding angle B, the time interval between two adjacent frames of the live wallpaper being rendered onto the foldable screen continuously increases, causing some frames of wallpaper animation displayed on the foldable screen to remain stagnant for a long time.
[0085] Currently, when a foldable phone is dynamically folded, it can use an elastic animation scheme (also known as a spring animation algorithm) to render a wallpaper animation corresponding to the folding angle. Typically, the elastic animation scheme relies on timestamps returned from the underlying layer to determine the time interval between two adjacent frames rendered on the screen. However, the mechanism of the elastic animation scheme dictates that the closer to the end of the wallpaper animation, the larger the interval between the timestamps returned from the underlying layer, and the larger the time interval between two adjacent frames rendered on the screen.
[0086] For example, Table 1 shows the time it takes for frames captured from a log data segment to be rendered to the screen when rendering a wallpaper animation using the Elastic Animation scheme. The frame index indicates the playback order of the frames. It should be understood that a larger frame index indicates a later frame in the playback order.
[0087] Table 1
[0088]
[0089]
[0090] As shown in Table 1, when using the elastic animation scheme, the time interval between two adjacent frames rendered to the screen increases as the frame index value gradually increases. Taking frame i+9 as the last frame of the dynamic wallpaper as an example, near the end of the wallpaper animation, the time interval between two adjacent frames rendered to the screen has increased to 195ms. This means that frame i+8 may need to be displayed on the screen for about 195ms before it can be updated to frame i+9, resulting in a noticeable trailing effect for the user. Furthermore, as the time interval between two adjacent frames rendered to the screen gradually increases, the elastic animation may continue playing for a long time after the user stops the folding operation, such as thousands of milliseconds, leading to a lack of responsiveness. Trailing and responsiveness degrade the user's interactive experience when using foldable screen devices.
[0091] To address the aforementioned issues, this application provides a frame-skipping scheme for dynamic wallpaper animation on foldable screen devices. The folding angle is collected in real-time by sensors on the foldable screen device. When a change from a first folding angle D(A) to a second folding angle D(B) is detected, the number of video frames F(A) corresponding to the first folding angle D(A) to F(B) corresponding to the second folding angle D(B) is determined. If this number is less than or equal to a first value k1, then the animation is played frame by frame at a uniform speed. If the number is greater than the first value k1, then the animation is played frame by frame according to a skipping step size. This ensures that the dynamic wallpaper completes playback in a shorter time, making the wallpaper animation on the foldable screen device more responsive and reducing the possibility of trailing.
[0092] In this embodiment, the foldable screen device is a terminal device equipped with a foldable screen. For example, the foldable screen device can be a foldable mobile phone, a tablet computer (Pad) equipped with a foldable screen, a wearable device equipped with a foldable screen, a virtual reality (VR) device or an augmented reality (AR) device equipped with a foldable screen, or other devices or apparatuses with screen folding functionality. This embodiment does not limit the specific type of foldable screen device.
[0093] The following section uses a foldable screen phone as an example to introduce the frame extraction scheme for the uniform speed animation of dynamic wallpapers.
[0094] Figure 1 This is a schematic diagram of the hardware structure of a foldable screen phone 100 provided in an embodiment of this application.
[0095] like Figure 1 As shown, the foldable screen phone 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 SIM card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, and a bone conduction sensor 180M, etc.
[0096] The processor 110 may include one or more processing units, such as a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an image signal processor (ISP), a neural network processing unit (NPU), a video codec, a modem, and / or a baseband processor.
[0097] The CPU is the final execution unit for information processing and program execution. Its main tasks include processing instructions, executing operations, controlling time, and processing data. The CPU may include a controller, an arithmetic logic unit (ALU), a cache memory, and a bus for connecting these components. For example, when the CPU detects that a user has applied a live wallpaper to a foldable phone 100, it can calculate a first value k1 and a second value k2 corresponding to the live wallpaper. Then, when a change in the folding angle is detected, it determines the frame extraction scheme for the live wallpaper based on the change in the folding angle, the first value k1, and the second value k2 corresponding to the live wallpaper, and then plays video frames according to this frame extraction scheme. The first value k1 is used to determine whether frame extraction of the live wallpaper's video resources is necessary; the second value k2 is the number of video frames that can be played within a first preset duration. The frame extraction step size of the video resources can be calculated using the second value k2 and the number of frames in the video resources. The method for determining the first value k1 and the second value k2 can be referred to the description in the following embodiments, and will not be repeated here.
[0098] The internal memory 121 can be used to store computer executable program code, including instructions. The processor 110 executes various functional applications and data processing of the foldable screen phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application (APP) required for a function, such as a theme setting application. The data storage area may store configuration files for each APP, such as theme packages corresponding to each wallpaper. The data storage area may also store data created during the use of the foldable screen phone 100. For example, when a user applies a wallpaper to the foldable screen phone 100, the internal memory 121 may store a first value k1 and a second value k2 corresponding to that wallpaper.
[0099] Button 190 can be a mechanical button (such as a physical keyboard) or a touch button. For example, when the foldable phone 100 is fully folded and the smaller screen is off, the user can turn on the screen by pressing the power button. When the foldable phone 100 is fully unfolded and the larger screen is on, the user can turn off the screen by pressing the power button.
[0100] The display screen 194 is used to display images, videos, etc. The display screen 194 may include a signal processing module and a display panel. In this embodiment, the display screen 194 includes a non-foldable small screen and a foldable large screen.
[0101] It is understood that the hardware structure illustrated in the embodiments of this application does not constitute a specific limitation on the foldable screen phone 100. In other embodiments, the foldable screen phone 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.
[0102] Figures 2 to 4 The illustration shows a foldable screen phone provided in this application under different physical forms.
[0103] like Figures 2 to 4 As shown, the foldable phone 200 may include a folding body 201 and a folding body 202. The folding bodies 201 and 202 are movably connected by a hinge. When a user holds the folding bodies 201 and 202 with both hands respectively, applying pressure to the folding bodies 201 and 202 allows the screen to fold along the hinge. The outer surface of the folding body 201 has a small screen and a camera. The outer surface of the folding body 202 is a shell, and a camera is also located at a through-hole in the shell. A large screen is located on the inner surface of the folding bodies 201 and 202. The large screen can be bent along the connection point of the two folding bodies. Additionally, a power button is located on the second side frame of the folding body 202.
[0104] like Figure 2 As shown, when the foldable phone 200 is fully folded, the inner surfaces of the folding bodies 201 and 202 face each other, and the large screen is hidden and invisible to the user. The user can turn on the small screen located on the outer surface of the folding body 201.
[0105] like Figure 3 As shown, when the foldable phone 200 is in a semi-folded state, the folding angle between the inner surfaces of the folding bodies 201 and 202 is greater than 0° and less than 180°. Typically, when the folding angle between the inner surfaces of the folding bodies 201 and 202 reaches a preset angle, such as 42°, the screen will switch from a small screen to a large screen. Users can place the folding body 202 on a horizontal table and play videos using the large screen portion of the folding body 201; this is also referred to as the foldable phone 200 being in a hovered state.
[0106] like Figure 4 As shown, when the folding angle between the inner surfaces of folding body 201 and folding body 202 is 180°, the large screen is in a fully unfolded state.
[0107] According to the description of the above embodiments, the physical states of a foldable phone can be divided into three categories: fully folded, half-folded (also known as half-unfolded), and fully unfolded. Specifically, when in the fully folded state, the folding angle is less than or equal to α; when in the fully unfolded state, the folding angle is greater than or equal to β; and when in the half-folded state, the folding angle is greater than α and less than β. α is equal to or close to the minimum folding angle of 0°, and β is equal to or close to the maximum folding angle of 180°. When the foldable phone is in different physical states, or when switching between different states, the large and small screens will display different dynamic wallpaper interfaces.
[0108] The following examples illustrate the display scenarios of live wallpapers under different physical conditions.
[0109] Live Wallpaper Display Scene 1
[0110] like Figure 5 As shown, assuming the foldable phone is initially fully folded, and both the small and large screens are off, if the user presses the power button located on the side bezel, or the camera on the small screen captures the user's image, or the user taps the small screen, or the user wakes the screen via voice assistant, the foldable phone will light up the small screen and retrieve the video resource of the corresponding live wallpaper 1. Then, starting from the first frame of this video resource, live wallpaper 1 will play on the small screen until the last frame. Afterward, the desktop will be overlaid on top of the wallpaper.
[0111] As an example, after playing Live Wallpaper 1 on a small screen ends, Live Wallpaper 2 can continue playing, or a static wallpaper can be displayed. Live Wallpaper 1 and Live Wallpaper 2 can have the same theme or different themes. Additionally, Live Wallpaper 2 has a lower frame rate than Live Wallpaper 1. The wallpaper animation updates more slowly after the desktop is displayed, better aligning with user habits.
[0112] In this embodiment, for small screens, the foldable screen device can render a dynamic wallpaper on a first layer and a desktop or lock screen interface on a second layer. The backgrounds of both the desktop and lock screen interfaces are transparent, and the second layer is located above the first layer. The desktop includes desktop elements such as application icons, cards, and notification messages. The lock screen includes lock screen elements such as unlock prompt text, unlock prompt images, date prompt text, flashlight controls, and camera controls. When the desktop / lock screen interface is overlaid on top of the wallpaper, the user can see not only the desktop / lock screen elements but also the portion of the wallpaper not obscured by them.
[0113] It should be noted that, Figure 5This explanation uses the example of displaying desktop elements overlaid on the wallpaper after the last frame of a video resource has finished playing on the small screen, and does not limit the scope of this application. It should be understood that foldable screen devices can display desktop elements overlaid on the wallpaper when any frame (such as the first frame) of a video resource is playing on the small screen.
[0114] In addition, foldable screen devices can not only overlay desktop elements on top of wallpapers, but also overlay lock screen elements on top of wallpapers. For example, after the small screen is turned on, a live wallpaper and lock screen elements are first displayed on the small screen. When the user successfully unlocks the foldable screen phone through facial recognition, fingerprint recognition, or password verification, the foldable screen device updates the lock screen elements on top of the wallpaper to desktop elements.
[0115] Live Wallpaper Display Scene 2
[0116] like Figure 6 As shown, assuming the foldable phone is initially fully folded, the smaller screen is on and the larger screen is off. The user can hold the two folding sections of the phone with both hands and fold them outwards, gradually increasing the folding angle. When the folding angle exceeds a preset angle, the smaller screen switches from on to off, while the larger screen switches from off to on.
[0117] Taking a preset angle of 45° as an example. During the folding angle change from 0° to 45°, the large screen remains off. When the folding angle reaches 45°, the foldable phone lights up the large screen and retrieves the video resource of the corresponding live wallpaper 3. Then, starting from the first frame of this video resource, live wallpaper 3 is played on the large screen until the last frame. Afterward, the desktop is overlaid on top of the wallpaper.
[0118] As an example, after Live Wallpaper 3 finishes playing on a large screen, Live Wallpaper 4 can continue playing, or a static wallpaper can be displayed. Live Wallpaper 3 and Live Wallpaper 4 can have the same theme or different themes. Additionally, Live Wallpaper 4 has a lower frame rate than Live Wallpaper 3, meaning the wallpaper animation updates more slowly after the desktop is displayed, better suited to user habits.
[0119] As an example, the large screen can play all frames of the video resource of Live Wallpaper 3, or it can play a portion of the video resource of Live Wallpaper 3 according to a frame extraction scheme. For the implementation scheme of playing a portion of the video resource of Live Wallpaper 3 according to the frame extraction scheme, please refer to the specific description of the following embodiments, which will not be repeated here.
[0120] It should be noted that Live Wallpaper 1 for small screens and Live Wallpaper 3 for large screens can be the same theme or different themes. It should be understood that because small and large screens have different dimensions, Live Wallpaper 1 for small screens and Live Wallpaper 3 for large screens will also have different sizes.
[0121] Referring to the description of live wallpaper display scenario 1 above, for large screens, foldable screen devices can render the live wallpaper on the third layer and the desktop or lock screen interface on the fourth layer. The backgrounds of the desktop and lock screen interfaces are transparent, and the fourth layer is located above the third layer. The desktop includes desktop elements, such as application icons, cards, and notification messages. The lock screen includes lock screen elements, such as unlock prompt text, unlock prompt images, date prompt text, flashlight controls, and camera controls. When the desktop / lock screen interface is overlaid on top of the wallpaper, the user can see not only the desktop / lock screen elements but also the portion of the wallpaper not obscured by them.
[0122] It should be noted that, Figure 6 This explanation uses the example of displaying desktop elements overlaid on the wallpaper after the last frame of a video resource has finished playing on the large screen, and does not limit the scope of this application. It should be understood that foldable screen devices can display desktop elements overlaid on the wallpaper at any frame (such as the first frame) while a video resource is playing on the large screen.
[0123] In addition, foldable screen devices can not only overlay desktop elements on top of wallpapers, but also overlay lock screen elements on top of wallpapers. For example, after the large screen is turned on, a live wallpaper and lock screen elements are first displayed on the large screen. When the user successfully unlocks the foldable screen phone through facial recognition, fingerprint recognition, or password verification, the foldable screen device updates the lock screen elements on top of the wallpaper to desktop elements.
[0124] Live Wallpaper Display Scene 3
[0125] like Figure 7 As shown, assuming the foldable phone is initially fully folded, with both the small and large screens off, the user can hold the two folding sections of the phone with both hands and fold them outwards, gradually increasing the folding angle between them. When the folding angle exceeds a preset angle, the small screen remains off, while the large screen switches from off to on.
[0126] Taking a preset angle of 45° as an example. During the folding angle change from 0° to 45°, the large screen remains off. When the folding angle reaches 45°, the foldable phone lights up the large screen and retrieves the video resource of the corresponding live wallpaper 3. Then, starting from the first frame of this video resource, the live wallpaper is played on the large screen until the last frame. Afterward, the desktop is overlaid on top of the wallpaper.
[0127] The implementation method of dynamic wallpaper display scene 3 is similar to that of dynamic wallpaper display scene 2, and will not be described in detail here.
[0128] Live Wallpaper Display Scene 4
[0129] like Figure 8 As shown, assume that the foldable phone is initially in a semi-folded state, and both the small and large screens are off. When the power button is on, the user can hold the two folding sections of the foldable phone with both hands and fold them outwards, gradually increasing the folding angle between the two sections, for example, from 100° at the beginning to 180°.
[0130] Assuming the foldable phone is bent to 101°, the sensor detects the change in folding angle. The foldable phone immediately lights up the large screen and retrieves the video resource of the corresponding live wallpaper 3. Then, it plays live wallpaper 3 on the large screen starting from the first frame of the video resource until the last frame. Finally, the desktop is overlaid on top of the wallpaper.
[0131] The implementation method of dynamic wallpaper display scene 4 is similar to that of dynamic wallpaper display scene 2, and will not be described in detail here.
[0132] Live Wallpaper Display Scene 5
[0133] like Figure 9 As shown, assuming the foldable phone is initially fully unfolded, and both the small and large screens are off, when the power button is on, the user can hold the two folding sections of the phone with both hands and fold them inwards, gradually reducing the folding angle between the two sections, for example, from 180° initially to 100°.
[0134] Assuming the foldable phone is bent to 179°, the sensor detects the change in folding angle. The foldable phone immediately lights up the large screen and retrieves the video resource of the corresponding live wallpaper. Then, it plays the live wallpaper on the large screen starting from the first frame of the video resource until the last frame. Finally, the desktop is overlaid on top of the wallpaper.
[0135] The implementation method of dynamic wallpaper display scene 5 is similar to that of dynamic wallpaper display scene 2, and will not be described in detail here.
[0136] Live Wallpaper Display Scene 6
[0137] like Figure 10 As shown, assuming the foldable phone is initially in a semi-folded state (e.g., folding angle of 150°) and the large screen is on, when the user folds the phone outwards with both hands, if the foldable phone detects the folding angle changing from 150° to 180°, it will execute the dynamic wallpaper uniform animation frame-skipping scheme provided in this application embodiment: first, determine the video frame corresponding to 150° and the video frame corresponding to 180°; then calculate the number of video frames from the 150° video frame to the 180° video frame; then determine whether the number is less than or equal to a first value k1. Taking the number being less than the first value k1 as an example, the foldable phone plays each video frame at a uniform speed on the large screen, starting from the video frame corresponding to 150°, until it reaches the video frame corresponding to 180°. Additionally, while playing the dynamic wallpaper on the large screen, the upper-layer elements can also be displayed on the large screen.
[0138] Live Wallpaper Display Scene 7
[0139] like Figure 11 As shown, assuming the foldable phone is initially in a semi-folded state (e.g., folding angle of 90°) and the large screen is on, when the user folds the phone outwards with both hands, if the foldable phone detects the folding angle changing from 90° to 180°, it will execute the dynamic wallpaper uniform animation frame-skipping scheme provided in this embodiment: first, determine the video frame corresponding to 90° and the video frame corresponding to 180°; then calculate the number of video frames from the 90° video frame to the 180° video frame; then determine whether the number is less than or equal to a first value k1. Taking a number greater than the first value k1 as an example, the foldable phone starts playing a video frame every few frames on the large screen, starting from the video frame corresponding to 90°, according to the frame-skipping step size, until it plays the video frame corresponding to 180°. In addition, during the playback of the dynamic wallpaper on the large screen, the upper-layer elements can also be displayed on the large screen.
[0140] Live Wallpaper Display Scene 8
[0141] like Figure 12As shown, assuming the foldable phone is initially fully unfolded (e.g., folded at 180°) and the large screen is on, when the user folds the phone inwards with both hands, if the foldable phone detects the folding angle changing from 180° to 150°, it will execute the dynamic wallpaper uniform animation frame-skipping scheme provided in this embodiment: first, determine the video frame corresponding to 180° and the video frame corresponding to 150°; then calculate the number of video frames from the 180° video frame to the 150° video frame; then determine whether the number is less than or equal to a first value k1. Taking the example that the number is less than the first value k1, the foldable phone plays each video frame at a uniform speed on the large screen, starting from the video frame corresponding to 180°, until it reaches the video frame corresponding to 150°. Additionally, while playing the dynamic wallpaper on the large screen, the upper-layer elements can also be displayed on the large screen.
[0142] Live Wallpaper Display Scene 9
[0143] The above-described live wallpaper display scenarios 6 to 8 are examples of implementing a live wallpaper uniform animation frame-skipping scheme when the large screen is in portrait mode. This embodiment can also implement the live wallpaper uniform animation frame-skipping scheme when the large screen is in landscape mode. Live wallpaper display scenario 9 will be used as an example for further explanation.
[0144] like Figure 13 As shown, assuming the folding body 202 of the foldable phone is initially placed horizontally, the folding angle between the folding body 201 and folding body 202 is 100°. At this time, the large screen is in landscape display mode. When the user folds the phone outward with both hands, if the foldable phone detects that the folding angle changes from 100° to 180°, it will execute the dynamic wallpaper uniform animation frame extraction scheme provided in this application embodiment: first, determine the video frame corresponding to 100° and the video frame corresponding to 180°; then calculate the number of video frames from the video frame corresponding to 100° to the video frame corresponding to 180°; then determine whether the number is less than or equal to a first value k1. Taking the number being greater than the first value k1 as an example, the foldable phone starts from the video frame corresponding to 100° on the large screen, and plays one video frame every few frames according to the frame extraction step size, until it plays the video frame corresponding to 180°. In addition, during the playback of the dynamic wallpaper on the large screen, the upper-layer elements can also be displayed on the large screen.
[0145] Live Wallpaper Display Scene 10
[0146] The above-described live wallpaper display scenarios 6 to 9 are examples of implementing a live wallpaper uniform animation frame-skipping scheme when displaying the desktop on a large screen. This application embodiment can also implement the live wallpaper uniform animation frame-skipping scheme when displaying the lock screen interface on a large screen. Figure 14 Let's take an example to illustrate.
[0147] like Figure 14 As shown, assuming the foldable phone is initially fully unfolded (e.g., folded at 180°) and the large screen is off, the user can trigger the foldable phone to light up the large screen and display the unlock interface by tapping the large screen, pressing the power button, or waking up the large screen via voice assistant. When the user folds the phone inward with both hands, if the foldable phone detects the folding angle changing from 180° to 150°, it will execute the dynamic wallpaper uniform animation frame-skipping scheme provided in this application embodiment: first, determine the video frame corresponding to 180° and the video frame corresponding to 150°; then calculate the number of video frames from the video frame corresponding to 180° to the video frame corresponding to 150°; then determine whether the number is less than or equal to a first value k1. Taking the example that the number is less than the first value k1, the foldable phone plays each video frame at a uniform speed on the large screen, starting from the video frame corresponding to 180°, until it plays the video frame corresponding to 150°. After bending the screen to a suitable angle, users can also trigger facial recognition unlock by swiping up on the large screen, fingerprint recognition unlock by fingerprint input, or password verification unlock by entering a password. Once the large screen is successfully unlocked, the desktop will be displayed on it.
[0148] It should be noted that, Figure 14 This example illustrates how the wallpapers displayed before and after the desktop are from different themes. However, in actual use, the wallpapers displayed before and after the desktop can also belong to the same theme.
[0149] Based on the description of the live wallpaper display scenarios in the above embodiments, there are two schemes for displaying the live wallpaper interface when the foldable phone changes its physical state. Referring to live wallpaper display scenarios 1 to 5, the first live wallpaper playback scheme is as follows: when a screen switching event or a large screen lighting event occurs, the foldable phone lights up its screen and plays the live wallpaper starting from the first frame of the video resource corresponding to the large screen, until the last frame of the video resource corresponding to the large screen. Referring to live wallpaper display scenarios 6 to 10, the second live wallpaper playback scheme is as follows: when the large screen is lit, if the user changes the folding angle of the large screen, the foldable phone will execute a live wallpaper uniform animation frame-skipping scheme corresponding to the folding angle.
[0150] It should be noted that the above embodiments are illustrative examples of a foldable screen device including a foldable inner screen (large screen) and a non-foldable outer screen (small screen), and do not limit the scope of this application. It should be understood that foldable screen devices can also adopt other structures. For example, a foldable screen device may include only a foldable large screen, which can serve as the outer screen. When the user changes the folding angle of this large screen, the foldable screen device can also execute a dynamic wallpaper uniform animation frame-skipping scheme corresponding to the folding angle.
[0151] To better understand the above dynamic wallpaper playback scheme, we will first provide an example of the system architecture of a foldable screen phone, and then provide an example of the dynamic wallpaper playback scheme in conjunction with the system architecture.
[0152] The software system of the aforementioned foldable phone can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture of the Android system as an example to exemplify the system structure of the foldable phone.
[0153] Figure 15 This is a schematic diagram of the system architecture of a foldable screen phone according to an embodiment of this application.
[0154] like Figure 15 As shown, foldable phones can adopt a layered architecture, dividing the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software layers of the software structure are divided from top to bottom as follows: application layer, application framework (FWK) layer, native layer, hardware abstraction layer (HAL) layer, and kernel layer. This software architecture runs on top of the hardware layer, which may include a GPU, a large screen, a small screen, and angle sensors, etc. The angle sensor is used to collect the angle between the two display areas of the large screen; for example, the angle sensor can be a gyroscope sensor, a gravity sensor, and / or a magnetic sensor, etc.
[0155] The application layer, or application layer for short, can include a series of applications and APKs, such as the theme settings module, system services, wallpaper applications, and codec modules (MediaCodec.java). When these applications and APKs are run, they can access various service modules provided by the application framework layer through the application programming interface (API) and execute corresponding intelligent business logic. The theme settings module provides users with various theme wallpapers and sets theme wallpapers for large and small screens based on user actions. The system service sends a large screen lighting event to the wallpaper application when switching from a small screen to a large screen or when the large screen is turned on. The wallpaper application registers and deregisters sensors according to the system service's instructions and determines the playback method of video frames (e.g., frame-by-frame playback or frame-by-frame playback) based on the angle uploaded by the sensor management service. The codec module is a class in the android.media framework that provides a Java API to the application side for developers to use, such as loading video resources, configuring animation attributes, and playing wallpaper animations. It should be noted that the screen lighting event in this embodiment is also called a unfreezing event, which triggers the screen to switch from a screen-off state to a screen-on state.
[0156] The application framework layer, also known as the framework layer, supports the operation of various applications within the application layer. For example, the framework layer may include a sensor management service (SystemSensorManager), a wallpaper management service, a video codec service (JMediaCodec.c++), a screen management service, and a window management service. The sensor management service acquires the folding angle and reports it to the system service and the wallpaper management service. The wallpaper management service manages the operation and switching of wallpapers and provides an interface for manipulating wallpapers through the WallpaperManager class. When switching wallpapers through the WallpaperManager interface, the wallpaper management service determines whether to cancel the currently bound wallpaper service and start the new wallpaper service. The video codec service (JMediaCodec.C++) acts as a bridge for message passing between the application layer's codec module (MediaCodec-java) and the native codec modules (MediaCodec.C++, ACodec.C++, OMXCllent.C++) in the native layer. The screen management service manages the current display state of the screen and sends notifications to the system and other applications when the state is updated, such as when the screen switches to a live or off state. Window management services are used to assign and manage window attributes (such as hierarchy, size, display order, etc.) for applications, as well as manage the display and switching of lock screen windows and wallpaper windows, and manage the display of elements above the wallpaper (such as icons).
[0157] The local layer includes the local codec modules (MediaCodec.C++, ACodec.C++, OMXCllent.C++), the sensor service (SensorService), and SurfaceFlinger. SurfaceFlinger runs as a system process and is primarily responsible for allocating graphics buffers, compositing graphics buffers, and managing the vertical synchronization (Vsync) signal. The Vsync signal is a periodic signal used to control the drawing, rendering, and compositing of layers.
[0158] It should be noted that the combination of the application-layer codec module (MediaCodec.java), the application framework-layer video codec service (JMediaCodec.C++), and the local layer codec modules (MediaCodec.C++, ACodec.C++, OMXCllent.C++) is called MediaCodec. MediaCodec is an audio and video codec tool provided by the Android system. It mainly encapsulates the upper-layer interfaces for developers to use, while the actual codec functionality is performed in the local layer service.
[0159] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry. Its purpose is to abstract the hardware, hiding the hardware interface details of a specific platform. For example, the HAL may include a hardware graphics composer (HWC) and a display HAL. The HWC is the module responsible for window compositing and display, providing hardware support for the system's rendering core.
[0160] The kernel layer is the layer between hardware and software. It includes display drivers and sensor drivers, among others.
[0161] It should be noted that, Figure 15 The illustrations show the layers in the architecture and the components contained in each layer, but do not constitute a specific limitation on the foldable screen phone. In other embodiments, the foldable screen phone may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0162] It is understood that, in order to implement the dynamic wallpaper playback method in the embodiments of this application, a foldable screen phone includes hardware and / or software modules that perform various functions. Based on the algorithm steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by 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 in conjunction with the embodiments.
[0163] In such Figure 15 Based on the system architecture shown, Figure 16 The diagram illustrates the interaction between various modules in a foldable phone.
[0164] like Figure 16 As shown, the wallpaper application specifically includes a wallpaper service module and an angle acquisition module. MediaCodec specifically includes an application-layer encoding / decoding module (MediaCodec.java), an application framework-layer video encoding / decoding service (JMediaCodec.C++), and a local layer local encoding / decoding module (MediaCodec.C++, ACodec.C++, OMXCllent.C++).
[0165] The data interaction between various modules in a foldable phone can be divided into the following processes.
[0166] (a) Theme setting process
[0167] The theme settings module displays various themes to the user and, in response to the user's theme selection, launches the wallpaper application through the wallpaper service framework. The wallpaper application's wallpaper service module applies the user-selected wallpaper theme to the large and / or small screen. Additionally, the wallpaper application's wallpaper service module can parse the theme's configuration items to obtain the parameters of the video resources corresponding to that wallpaper theme (e.g., total number of video frames, frame rate, and video bitrate). Then, based on the parameters of the video resources corresponding to the wallpaper theme, it calculates and stores the first and second values k1 and k2 corresponding to that wallpaper theme. It should be understood that when the user selects different wallpaper themes, each wallpaper theme corresponds to different video resource parameters, therefore different first and second values k1 and k2 may be calculated.
[0168] It should be noted that the wallpaper themes used on large screens and small screens can be the same or different.
[0169] (b) Small screen lighting process
[0170] When a foldable phone switches from a fully unfolded / half-folded state to a fully folded state, the sensor management service reports the angle change to the system service. The system service then generates a screen-on event for the smaller screen based on the angle change. Alternatively, when the camera on the smaller screen captures the user's face, the system service generates a screen-on event for the smaller screen. Or, when the user presses the power button while the phone is fully folded, the system service generates a screen-on event for the smaller screen. The system service sends a command to the wallpaper service module and angle acquisition module of the wallpaper application, indicating that a screen-on event for the smaller screen has occurred. Then, the wallpaper service module of the wallpaper application sends a live wallpaper playback command to the application layer's codec module (MediaCodec.java). Responding to this command, the codec module (MediaCodec.java) calls the application framework layer's video codec service (JMediaCodec.C++) and the local layer's local codec modules (MediaCodec.C++, ACodec.C++, OMXCllent.C++) to play the live wallpaper from the first frame of the video resource corresponding to the smaller screen until the last frame.
[0171] (c) Large screen lighting process
[0172] When the foldable phone switches from a fully folded state to a half-folded / fully unfolded state, the sensor management service reports the angle change to the system service. Based on the angle change, the system service generates a screen-on event for the large screen. Alternatively, when the camera on the large screen captures the user's face, the system service generates a screen-on event for the large screen. Or, when the large screen is in a half-folded / fully unfolded state and the user presses the power button, the system service generates a screen-on event for the large screen. The system service sends a command to the wallpaper service module and angle acquisition module of the wallpaper application, indicating that a screen-on event for the large screen has occurred. Then, the wallpaper service module of the wallpaper application sends a live wallpaper playback command to the application layer's codec module (MediaCodec.java). In response to this instruction, the codec module (MediaCodec.java) calls the video codec service at the application framework layer (JMediaCodec.C++) and the local codec modules at the local layer (MediaCodec.C++, ACodec.C++, OMXCllent.C++) to play the live wallpaper starting from the first frame of the video resource corresponding to the large screen and continuing until the last frame. Additionally, during the large screen's operation, the wallpaper application's angle acquisition module also responds to the above instruction and registers an angle sensor.
[0173] (d) Folding angle change process
[0174] Once the large screen is on, the wallpaper application's angle acquisition module receives the folding angle reported by the sensor management service in real time. After verifying the validity of the folding angle, the wallpaper application's angle acquisition module sends the changed folding angle (e.g., from the first folding angle D(A) to the second folding angle D(B)) to the wallpaper application's wallpaper service module. The wallpaper application's wallpaper service module calculates the number of video frames F(A) corresponding to the first folding angle D(A) to F(B) corresponding to the second folding angle D(B), and determines whether to use a frame-by-frame playback strategy or a frame-skipping playback strategy by comparing this number with a first value k1. This first value k1 is obtained during the theme setting process described in (a) above. Then, the APK's wallpaper service module sends frame-by-frame / frame-skipping playback instructions to the application layer's codec module (MediaCodec.java). In response to this instruction, the codec module (MediaCodec.java) calls the video codec service (JMediaCodec.C++) in the application framework layer and the local codec module (MediaCodec.C++, ACodec.C++, OMXCllent.C++) in the local layer to play the video frames corresponding to the first folding angle D(A) and the second folding angle D(B).
[0175] (e) Screen off process on small screen
[0176] When a foldable phone is fully folded, if the system receives a press of the power button or a screen-off command input by the user via voice assistant, the system service generates a screen-off event for the smaller screen. As another example, when the screen is powered on, if the foldable phone switches from a fully folded state to a half-folded / fully unfolded state, the system service will generate a screen-off event for the smaller screen.
[0177] (f) Screen off process
[0178] When the foldable phone is in its fully unfolded / half-folded state, if the system receives a user press of the power button, a user's voice command to turn off the screen, or detects the phone switching from fully unfolded / half-folded to fully folded, the system service generates a screen-off event for the large screen. Additionally, during the large screen's screen-off process, the wallpaper application's angle acquisition module deactivates the angle sensor.
[0179] Figure 17 This is a flowchart illustrating a theme setting method provided in an embodiment of this application. The execution subject of this method is as follows: Figure 15 and Figure 16 The various modules are shown below. Figure 17 As shown, the method may include the following steps S701 to S707.
[0180] S701, the theme settings module receives the user's theme settings operations.
[0181] The theme setting operation allows users to select a specific theme from a range of themes provided by the theme setting module. This theme setting operation instructs the user to choose the theme to be displayed when the large screen is on, i.e., the primary theme.
[0182] It should be noted that the live wallpaper that plays when the large screen switches from off state to on state is called the second theme.
[0183] S702, the theme settings module retrieves the video resources for the first theme.
[0184] If the foldable phone has the video resources for the first theme stored locally, the theme settings module can retrieve these resources from the local storage. If the foldable phone does not have the video resources for the first theme stored locally, the theme settings module can download them from the server. The video resources for the first theme include the theme's configuration file.
[0185] S703, the theme settings module sends a command to the wallpaper application to set the first theme for the large-screen application.
[0186] S704, the wallpaper application parses the configuration file of the first theme.
[0187] S705, the wallpaper application sends a command to MediaCodec to decode the wallpaper interface of the first theme.
[0188] Accordingly, MediaCodec decodes the wallpaper interface of the first theme so that SurfaceFlinger can play the wallpaper interface.
[0189] It should be noted that S701 to S705 above describe the implementation method for setting the first theme. It should be understood that the implementation method for setting the second theme is similar to that for setting the first theme, and will not be repeated here.
[0190] S706, the wallpaper application calculates the first value k1 and the second value k2 corresponding to the video resources of the first theme.
[0191] S707, the wallpaper application saves the first value k1 and the second value k2.
[0192] Studies show that if the live wallpaper finishes playing within 400ms after the user stops the folding action, the large-screen wallpaper animation will be more responsive. However, when the playback duration of the wallpaper animation is controlled within 400ms, playing from the video frame corresponding to the start of the folding action to the video frame corresponding to the end of the folding action may skip too many video frames, resulting in a stiff and less smooth animation effect. To balance responsiveness and smoothness, the playback duration can be increased by about 200ms to 300ms from the 400ms, keeping the total duration of the wallpaper animation within 600ms to 700ms.
[0193] In some embodiments, the foldable screen phone pre-stores a first preset duration and a second preset duration. The first preset duration can be 400ms or a duration close to 400ms. The second preset duration can be approximately 200ms to 300ms longer than the first preset duration t2; for example, the second preset duration t1 can be 600ms, 650ms, or 700ms, etc.
[0194] Based on the first preset duration, the second preset duration, and the configuration file of the first theme, the wallpaper application can calculate a first value k1 and a second value k2. The first value k1 is used to measure whether the number of video frames to be played is too large. If the number of video frames to be played is greater than the first value k1, then the first video resource needs to be extracted according to a first extraction step size. The second value k2 is used to calculate the first extraction step size.
[0195] For example, the second value k2 can be calculated using the following relation (1).
[0196]
[0197] Where f represents the frame rate of the video resource of the first theme, and t2 represents the first preset duration.
[0198] For example, the first value k1 can be calculated using the following relation (2).
[0199]
[0200] Where f represents the frame rate of the video resource for the first theme, and t1 represents the second preset duration.
[0201] It should be understood that since the total number of video frames and the frame rate of a theme's video resources are fixed, the first value k1 and the second value k2 corresponding to that theme are also unique. Each time a user sets the first theme for the large screen, the first value k1 and the second value k2 can be obtained through a single calculation. Thus, during the display of the first theme, whenever the user changes the folding angle, the pre-calculated first value k1 and the second value k2 can be directly invoked to determine whether to use a frame-by-frame playback strategy or a frame-skipping strategy for the live wallpaper.
[0202] To facilitate understanding of the first value k1 and the second value k2 in the dynamic wallpaper uniform animation frame extraction scheme, the following two examples will be used to explain these two values.
[0203] Example 1
[0204] Assuming the first preset duration is 400ms and the second preset duration is 700ms, the parameters of the video resource corresponding to the first theme are as follows: the total number of video frames is 150, the frame rate is 60FPS, and the video bit rate is 240bps (bits per second).
[0205] Table 2
[0206] Video length Number of frames that can be played within the video duration frame skipping step Theoretical playback frame rate 300ms 18 1 18 400ms 24 1 24 500ms 30 1 30 600ms 36 1 36 700ms 42 1 42 800ms 48 2 24 900ms 54 2 27 1200ms 72 3 24 …… …… …… …… 1600ms 96 4 24
[0207] When the second preset duration is 700ms, the number of video frames that can be played within 700ms is:
[0208]
[0209] Since the second preset duration of 700ms is the maximum allowed duration while balancing responsiveness and smoothness of the animation, and the corresponding number of playable frames is 42, the first value k1 can be set to 42 frames. It should be understood that when a video resource to be played has 42 frames or less, and the playback duration is less than or equal to 700ms, frame-by-frame playback can balance responsiveness and smoothness. However, when a video resource to be played has more than 42 frames, and the playback duration is greater than 700ms, frame-by-frame playback will not meet the responsiveness requirement. In this case, it is necessary to extract frames from the video resource according to the extraction step size.
[0210] Continuing with Table 2 above, we will introduce the calculation method for the frame extraction step size under different video durations.
[0211] When the duration of a video resource to be played is 800ms, the number of video frames that can be played within 800ms is:
[0212]
[0213] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 800ms is calculated as follows:
[0214]
[0215] That is, when the duration of a video resource to be played is 800ms, one frame can be extracted and played every two frames. Accordingly, the theoretical number of frames for this video resource to be played is:
[0216]
[0217] When the duration of a video resource to be played is 900ms, the number of video frames that can be played within 900ms is:
[0218]
[0219] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 900ms is calculated as follows:
[0220]
[0221] That is, when the duration of a video resource to be played is 900ms, one frame can be extracted and played every two frames. Accordingly, the theoretical number of frames for this video resource to be played is:
[0222]
[0223] When the duration of a video resource to be played is 1200ms, the number of video frames that can be played within 1200ms is:
[0224]
[0225] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 1200ms is calculated as follows:
[0226]
[0227] That is, when the duration of a video resource to be played is 1200ms, one frame can be extracted and played every three frames. Accordingly, the theoretical number of frames for this video resource to be played is:
[0228]
[0229] When the duration of a video resource to be played is 1600ms, the number of video frames that can be played within 1600ms is:
[0230]
[0231] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 1600ms is calculated as follows:
[0232]
[0233] That is, when the duration of a video resource to be played is 1600ms, one frame can be extracted and played every four frames. Accordingly, the theoretical number of frames for this video resource to be played is:
[0234]
[0235] Analysis of the theoretical playback frame rates calculated for video durations of 800ms, 900ms, 1200ms, and 1600ms reveals that when the video resource's frame rate is 60FPS, regardless of the video resource's duration, the second value k2 remains around 24 frames per second. The second value k2 of the video resource is:
[0236]
[0237] Where k2 represents the second value, T represents the duration of the video resource, f represents the frame rate of the video resource, and t2 represents the first preset duration. The first preset duration t2 can be 400ms or a duration close to 400ms.
[0238] The following conclusion can be drawn: when the frame rate of the video resource is 60 FPS, the second value k2 is 24 frames.
[0239] Example 2
[0240] Assuming the first preset duration is 400ms and the second preset duration is 700ms, the parameters of the video resource corresponding to the first theme are as follows: the total number of video frames is 210, the frame rate is 120FPS, and the video bitrate is 240bps.
[0241] Table 3
[0242] Video length Number of frames that can be played within the video duration frame skipping step Theoretical playback frame rate 300ms 36 1 36 400ms 48 1 48 500ms 60 1 60 600ms 72 1 72 700ms 84 1 84 800ms 96 2 48 900ms 108 2 54 1200ms 144 3 48 …… …… …… …… 1600ms 192 4 48
[0243] When the second preset duration is 700ms, the number of video frames that can be played within 700ms is:
[0244]
[0245] Since the second preset duration of 700ms is the maximum allowed duration while balancing responsiveness and smoothness of the animation, and the corresponding number of playable frames is 84, the first value k1 can be set to 84 frames. It should be understood that when a video resource to be played has 84 frames or less, and the playback duration is less than or equal to 700ms, frame-by-frame playback can balance responsiveness and smoothness. However, when a video resource to be played has more than 84 frames, and the playback duration is greater than 700ms, frame-by-frame playback will not meet the responsiveness requirement. In this case, it is necessary to extract frames from the video resource according to the extraction step size.
[0246] Continuing with Table 3 above, we will introduce the calculation method for the frame extraction step size under different video durations.
[0247] When the duration of a video resource to be played is 800ms, the number of video frames that can be played within 800ms is:
[0248]
[0249] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 800ms is calculated as follows:
[0250]
[0251] That is, when the duration of a video resource to be played is 800ms, one frame can be extracted and played every two frames. Correspondingly, the second value k2 of this video resource to be played is:
[0252]
[0253] When the duration of a video resource to be played is 900ms, the number of video frames that can be played within 900ms is:
[0254]
[0255] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 900ms is calculated as follows:
[0256]
[0257] That is, when the duration of a video resource to be played is 900ms, one frame can be extracted and played every two frames. Correspondingly, the second value k2 of this video resource to be played is:
[0258]
[0259] When the duration of a video resource to be played is 1200ms, the number of video frames that can be played within 1200ms is:
[0260]
[0261] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 1200ms is calculated as follows:
[0262]
[0263] That is, when the duration of a video resource to be played is 1200ms, one frame can be extracted and played every three frames. Correspondingly, the second value k2 of this video resource to be played is:
[0264]
[0265] When the duration of a video resource to be played is 1600ms, the number of video frames that can be played within 1600ms is:
[0266]
[0267] Based on the first preset duration of 400ms, the frame extraction step size corresponding to a video duration of 1600ms is calculated as follows:
[0268]
[0269] That is, when the duration of a video resource to be played is 1600ms, one frame can be extracted and played every four frames. Correspondingly, the second value k2 of this video resource to be played is:
[0270]
[0271] Analysis of the theoretical playback frame rates calculated for video durations of 800ms, 900ms, 1200ms, and 1600ms reveals that when the video resource's frame rate is 120FPS, regardless of the video resource's duration, the second value k2 remains around 24 frames per second. The second value k2 of the video resource is:
[0272]
[0273] Where k2 represents the second value, T represents the duration of the video resource, f represents the frame rate of the video resource, and t2 represents the first preset duration. In this embodiment, the first preset duration t2 can be 400ms or a duration close to 400ms.
[0274] The following conclusion can be drawn: when the frame rate of the video resource is 120 FPS, the second value k2 is 48 frames.
[0275] Examples 1 and 2 above illustrate how the first value k1 and the second value k2 are calculated. In practice, users typically set a theme as the primary theme for the large screen. Since the total number of video frames and the frame rate of a theme's video resources are fixed, the first value k1 and the second value k2 corresponding to that primary theme are also unique.
[0276] Figure 18 This is a flowchart illustrating a dynamic wallpaper playback method provided in an embodiment of this application. The execution subject of this method is as follows: Figure 15 and Figure 16 The various modules are shown below. Figure 18 As shown, the method may include the following S1 to S19.
[0277] S1, when the large screen is off, and the user changes the folding angle by folding the foldable phone, the sensor management service collects the changed folding angle through the angle sensor. The angle sensor is used to collect the folding angle in real time.
[0278] Referring to the descriptions of live wallpaper display scenarios 2 to 5 in the above embodiments, the sensor management service can collect the changing folding angle in any of the following situations: Situation 1: The small screen is on, the large screen is off, and the physical state of the foldable phone is fully folded; Situation 2: The small screen is off and the large screen is off, and the physical state of the foldable phone is fully folded; Situation 3: The small screen is off and the large screen is off, and the physical state of the foldable phone is half-folded; Situation 4: The small screen is off and the large screen is off, and the physical state of the foldable phone is fully unfolded.
[0279] S2, the sensor management service reports the changed folding angle to the system service.
[0280] S3, the system service determines that a screen-on event has occurred for the large screen based on the changed angle, and sends a command to the wallpaper application to indicate the screen-on event.
[0281] Specifically, the system service can send a command to the wallpaper application's animation service thread (LinerAnimationService) to indicate the screen-on event, and then the animation service thread (LinerAnimationService) will execute the dynamic wallpaper's uniform animation frame-skipping scheme.
[0282] It should be noted that S1 to S3 are examples of determining the occurrence of a screen-on event for a large screen based on the change in the folding angle, and do not limit the embodiments of this application.
[0283] For example, screen-on events for large screens can be divided into two categories:
[0284] The first type is the small screen to large screen (screen turn on) event.
[0285] For example, such as Figure 6 As shown, when the foldable phone is fully folded, with the large screen off and the small screen on, the user folds the phone outwards with both hands, switching the phone from a fully folded state to a half-folded / fully unfolded state. The sensor management service reports the change in folding angle to the system service. Based on the change in folding angle, the system service generates a command to indicate the event of the small screen switching to the large screen.
[0286] The second category is the "waking up" event.
[0287] For example, such as Figure 7 As shown, when the foldable phone is fully folded and both the large and small screens are off, the user folds the phone outwards with both hands, causing it to switch from a fully folded state to a half-folded / fully unfolded state. The sensor management service reports the change in folding angle to the system service. Based on the change in folding angle, the system service generates a command to indicate that the large screen should light up.
[0288] For example, such as Figure 8 As shown, when the foldable phone is in a semi-folded state and both the large and small screens are off, the user folds the phone outwards with both hands, switching the foldable phone from a semi-folded state to a fully unfolded state. The sensor management service reports the change in folding angle to the system service. Based on the change in folding angle, the system service generates a command to indicate that the large screen will light up.
[0289] For example, such as Figure 9 As shown, when the foldable phone is fully unfolded and both the large and small screens are off, the user folds the phone inward with both hands, switching the phone from a fully unfolded state to a half-folded state. The sensor management service reports the change in folding angle to the system service. Based on the change in folding angle, the system service generates a command to indicate that the large screen should light up.
[0290] In addition, when the foldable phone is in a semi-folded or fully unfolded state, and both the large and small screens are off, if the camera on the large screen uses the user's face image, or the user presses the power button, or the user presses any touch area on the large screen, or the user inputs a command to turn on the large screen through the voice assistant, then the system service will also generate a command to turn on the large screen.
[0291] S4, the wallpaper application sends a command to MediaCodec to play a second-themed live wallpaper on the big screen.
[0292] In S5, MediaCodec responds to the instruction to play the live wallpaper by loading the video resource corresponding to the second theme, so that SurfaceFlinger can play the video resource from the first frame to the last frame.
[0293] Data transfer during MediaCodec execution involves two buffer queues: an input buffer queue (InputBufferQueue) and an output buffer queue (OutputBufferQueue). For example... Figure 19 As shown, after receiving the instruction to play the live wallpaper, MediaCodec first configures itself, then loads the video resources corresponding to the second theme, and then begins decoding the data. Specifically, the raw data of the video resources is first placed into an empty buffer in the InputBufferQueue; the codec retrieves data from the empty buffer in the InputBufferQueue, performs decoding, and places the decoding result into an empty buffer in the OutputBufferQueue, then releases the buffer in the InputBufferQueue; after rendering the data in the OutputBufferQueue buffer onto the screen, the outputBufferQueue buffer is released. This process is repeated continuously, sending each frame from the buffer to SurfaceFlinger in sequence. After SurfaceFlinger completes the rendering of the video frames, the frames are displayed on the large screen, thus enabling the playback of the live wallpaper.
[0294] In the first possible implementation, MediaCodec responds to the live wallpaper playback command by playing frame by frame, rendering one frame after another onto the big screen starting from the first frame of the video resource corresponding to the second theme, until the last frame of the video resource, that is, playing all the frames of the video resource.
[0295] In the second possible implementation, MediaCodec responds to the live wallpaper playback command by using a frame-skipping playback method. Starting from the first frame of the video resource corresponding to the second theme, it extracts one frame every few frames and renders it onto the large screen until the last frame of the video resource, which is the part of the video resource being played.
[0296] For example, such as Figure 20 As shown, assume the original video resource's indices from the first frame to the last frame are 1, 2, 3, 4, ..., 300. If MediaCodec uses frame-by-frame playback (i.e., the frame extraction step size is set to 1), it plays in the order of frame 1, frame 2, frame 3, frame 4, ..., frame 300. If MediaCodec uses frame-skipping playback (with a step size of 2), it extracts one frame every two frames and plays in the order of frame 1, frame 3, frame 5, frame 7, ..., frame 299. If MediaCodec uses frame-skipping playback (with a step size of 3), it extracts one frame every three frames and plays in the order of frame 1, frame 4, frame 7, frame 10, ..., frame 300. If MediaCodec uses frame-skipping playback (with a step size of 4), it extracts one frame every four frames and plays in the order of frame 1, frame 5, frame 9, frame 13, ..., frame 300.
[0297] It should be noted that the frame extraction step size mentioned above depends on the theme package configuration item of the second theme. As an example, the frame extraction step size indicated by the theme package configuration item of the second theme is a fixed value, such as a frame extraction step size of 2. As another example, the frame extraction step size indicated by the theme package configuration item of the second theme is related to the end angle of the folding operation; the larger the end angle of the folding operation, the larger the frame extraction step size. For example, the frame extraction step size is 1 when the end angle of the folding operation is in the range [45°, 90°), 2 when the end angle is in the range [90°, 120°), 3 when the end angle is in the range [120°, 150°), and 4 when the end angle is in the range [150°, 180°]. Of course, other methods may be used to configure the frame extraction step size in the theme package configuration item.
[0298] Additionally, if the sensor service detects a change in the folding angle while the foldable phone is playing the video resource corresponding to the second theme on the large screen, the wallpaper app will continue to play the video resource corresponding to the second theme on the large screen according to the original scheme, without changing the playback method of the second theme in response to the change in the folding angle.
[0299] In response to the screen-on event, the wallpaper application calls the registerSensor() function to register the angle sensor.
[0300] It should be understood that wallpaper applications can obtain changes in the folding angle in real time by registering an angle sensor, which makes it easier to flexibly adjust the playback strategy of the live wallpaper according to the changing folding angle during subsequent use.
[0301] When the S7 is in the large screen on state, if the user changes the folding angle by folding the folding screen phone, the sensor management service can collect the change in folding angle through the angle sensor.
[0302] The above folding operation is divided into two types:
[0303] like Figure 10 , Figure 11 and Figure 13 As shown, one type of folding operation involves a user holding the two folding sections of a foldable phone with both hands and folding them outwards, increasing the angle from a first folding angle D(A) to a second folding angle D(B). The second folding angle D(B) is greater than the first folding angle D(A).
[0304] like Figure 12 and Figure 14 As shown, another folding operation involves the user holding the two folding sections of the foldable phone with both hands and folding them inwards with force, reducing the two folding sections from a first folding angle D(A) to a second folding angle D(B). The second folding angle D(B) is smaller than the first folding angle D(A).
[0305] It should be noted that the first folding angle D(A) is also called the starting angle of the folding operation, and the second folding angle D(B) is also called the ending angle of the folding operation.
[0306] S8, the sensor management service uploads the collected folding angles to the wallpaper application according to the preset sampling rate.
[0307] S9, the wallpaper application receives the folding angle reported by the sensor management service in real time.
[0308] S10, the wallpaper application verifies whether the error of the received folding angle is within the preset range.
[0309] If the error of the folding angle is within the preset range, the folding angle is valid, and the wallpaper application executes the following S11.
[0310] If the error of the folding angle is not within the preset range, the folding angle is invalid, the wallpaper application cannot execute the following S11, and can continue to receive the folding angle reported by the sensor management service in real time.
[0311] For example, the error in the folding angle mentioned above can refer to the degree of integration of the folding angle. When the degree of integration of the folding angle is less than or equal to 0.04, it is confirmed to be within the preset range; when the degree of integration of the folding angle is greater than 0.04, it is confirmed to be outside the preset range.
[0312] For example, the error in the folding angle mentioned above can also refer to the reliability of the folding angle. When the reliability of the folding angle is greater than or equal to a preset value, it is determined to be within the preset range; when the reliability of the folding angle is less than the preset value, it is determined to be outside the preset range.
[0313] In addition to verifying whether the error of the received folding angle is within a preset range, the wallpaper application can also verify whether the received folding angle is within a preset angle range to determine whether the folding angle is valid. For example, when both the first folding angle D(A) and the second folding angle D(B) are within the preset angle range, the first folding angle D(A) and the second folding angle D(B) can be determined to be valid. For instance, the preset angle range is from 45° to 175°.
[0314] In some embodiments, before the wallpaper application executes S11 below, the wallpaper application may first determine whether the interface currently displayed on the large screen contains a wallpaper. If the interface currently displayed on the large screen contains a wallpaper, such as the current interface being the desktop interface, then S11 below is executed. If the interface currently displayed on the large screen does not contain a wallpaper, such as the current interface being the application interface, then S11 below is not executed. It should be understood that when the interface currently displayed on the large screen does not contain a wallpaper, even if the user changes the folding angle, there is no need to display the wallpaper, therefore S11 below does not need to be executed.
[0315] S11, the wallpaper application determines the number of video frames ΔF corresponding to the change in folding angle ΔD.
[0316] With the large screen already lit, the first theme is displayed on the screen's desktop. If the user changes the screen's folding angle, the live wallpaper of the first theme can be played based on the change in folding angle ΔD. The first and second themes can be the same theme or different themes.
[0317] In some embodiments, the foldable screen phone may pre-store the following relation (3):
[0318]
[0319] Where F represents the frame index, D represents the folding angle, x represents the minimum value of the preset angle range, y represents the maximum value of the preset angle range, and m represents the total number of video frames in the first theme. The value of F is any integer from 0 to (m-1). One frame index corresponds to one video frame in the video resource of the first theme. For example, F = 0 corresponds to the minimum value of the preset angle range. Or, for example, F = m-1 corresponds to the maximum value of the preset angle range.
[0320] In the above relation (3), the minimum value x of the preset angle range, the maximum value y of the preset angle range, and the total number of video frames m of the first theme are known quantities. After any folding angle D is collected by the angle sensor, the wallpaper application can use the above relation (3) to determine the frame index F corresponding to the folding angle D, that is, to determine a video frame corresponding to the folding angle D.
[0321] Taking the preset angle range of 45° to 175° as an example. Table 4 shows the frame index F corresponding to the folding angle D, calculated using the above relationship (3), when the total number of video frames m of the first theme is 131 frames, 151 frames and 301 frames respectively.
[0322] Table 4
[0323]
[0324] It should be noted that in some cases, after inputting the folding angle reported by the sensor management service into the above formula (3), the calculated frame index F may be a non-integer. In this case, the wallpaper application can use either rounding down or rounding up to determine the final frame index F.
[0325] The aforementioned "change in folding angle ΔD" refers to the change in angle from the first folding angle D(A) to the second folding angle D(B). Specifically, ΔD = |D(A) - D(B)|.
[0326] As an example, the "number of video frames ΔF corresponding to the change in folding angle ΔD" mentioned above refers to the number of video frames between the video frame F(A) corresponding to the first folding angle D(A) and the video frame F(B) corresponding to the second folding angle D(B). In this case, the number ΔF does not include F(A). Specifically, ΔF = |F(A) - F(B)|.
[0327] For example, referring to Table 4 above, assuming that the total number of video frames for the first theme is 131, the first folding angle D(A) = 48°, the second folding angle D(B) = 174°, the frame index F(A) corresponding to D(A) = 48° = 3, and the frame index F(B) corresponding to D(B) = 174° = 129, then the change in folding angle ΔD = |D(A) - D(B)| = 126°, and the number of video frames corresponding to ΔD ΔF = |F(A) - F(B)| = 126 frames.
[0328] For example, referring to Table 4 above, assuming the total number of video frames for the first theme is 151, the first folding angle D(A) = 175.00°, the second folding angle D(B) = 47.60°, the frame index F(A) corresponding to D(A) = 175.00° = 150, and the frame index F(B) corresponding to D(B) = 47.60° = 3, then the change in folding angle ΔD = |D(A) - D(B)| = 127.4°, and the number of video frames corresponding to ΔD ΔF = |F(A) - F(B)| = 147 frames.
[0329] As another example, the "number of video frames ΔF corresponding to the change in folding angle ΔD" mentioned above refers to the number of video frames from the next frame of video frame F(A) corresponding to the first folding angle D(A) to the video frame F(B) corresponding to the second folding angle D(B). In this case, the number ΔF is a count of F(A). Specifically, ΔD = |D(A) - D(B)| + 1.
[0330] S12, the wallpaper application determines whether the number of video frames ΔF corresponding to the change in folding angle ΔD is less than or equal to the first value k1.
[0331] The first value k1 mentioned above is the first value k1 corresponding to the first theme currently set on the large screen. The first value k1 can be calculated using the above relationship (2).
[0332] It should be understood that when the large screen uses different themes as the first theme, the corresponding first value k1 will also be different because the parameters of the video resources of each theme are different.
[0333] If the number of video frames ΔF corresponding to the change in folding angle ΔD is less than or equal to the first value k1, it means that the number of video frames to be rendered is small and can be played out in a short time. The possibility of producing trailing and unresponsiveness is low. At this time, a uniform frame-by-frame playback scheme is adopted, that is, the following S13 is executed.
[0334] If the number of video frames ΔF corresponding to the change in folding angle ΔD is greater than the first value k1, it indicates that there are too many video frames to be rendered, and they cannot be played out in a short time. In this case, if a uniform frame-by-frame playback scheme is used, trailing and unresponsiveness may occur. To solve this problem, a frame-by-frame playback scheme can be used, i.e., executing S14 and S15 below.
[0335] S13, the wallpaper application sends frame-by-frame playback instructions to MediaCodec.
[0336] Accordingly, MediaCodec responds to the frame-by-frame playback instruction by loading the first video resource, causing SurfaceFlinger to play the live wallpaper at a constant speed from video frame F(A) corresponding to the first folding angle D(A) to video frame F(B) corresponding to the second folding angle D(B), according to the frame rate of the first theme. The first video resource consists of all video frames from video frame F(A) corresponding to the first folding angle D(A) to video frame F(B) corresponding to the second folding angle D(B). As an example, if the first folding angle D(A) and the second folding angle D(B) are the minimum value x and the maximum value y of a preset angle range, respectively, then video frames F(A) to F(B) represent all video frames of the first theme. As another example, if the first folding angle D(A) and the second folding angle D(B) are between the minimum value x and the maximum value y of a preset angle range, then video frames F(A) to F(B) represent a portion of the video frames of the first theme.
[0337] It should be understood that since video frame F(A) has already been displayed on the large screen, the first video resource may not contain video frame F(A). That is, MediaCodec starts playing the live wallpaper at a constant speed from the video frames after video frame F(A) until the video frame F(B) corresponding to the second folding angle D(B).
[0338] For example, Figure 21 A schematic diagram of a dynamic wallpaper uniform animation frame extraction scheme is shown. Referring to Table 4 above, assuming the preset angle range is 45° to 175° and the total number of video frames m is 131 frames, then each 1° corresponds to one frame index. If the starting angle D(A) of the folding operation is 66° and the ending angle D(B) of the folding operation is 45°, then the change in folding angle ΔD = 21°, and the number of video frames corresponding to the change in folding angle ΔD = 21° ΔF = 22 frames. Further, assuming the first value k1 is 42 frames, since ΔF < 42 frames, a frame-by-frame playback strategy can be adopted, sequentially playing video frames F(21), F(20), F(19), ..., F(0).
[0339] S14, the wallpaper application calculates the frame extraction step size based on the second value k2 and the number ΔF of video frames (i.e., video frames contained in the first video resource) corresponding to the change in folding angle ΔD. Then, it extracts frames according to the frame extraction step size to obtain the video frames to be played.
[0340] The second value k2 mentioned above is the maximum number of frames played within the first preset duration according to the frame rate of the first theme. The second value k2 can be calculated using the above relationship (1).
[0341] For example, a wallpaper application can use the following relationship (4) to calculate the frame extraction step size:
[0342]
[0343] Where S represents the frame extraction step size, k2 represents the second value, and ΔF represents the number of video frames corresponding to the change in folding angle ΔD.
[0344] S15, the wallpaper application sends a frame-skipping playback instruction to the MediaCodec, which includes the frame number of the extracted video frame. Correspondingly, the MediaCodec, in response to the frame-skipping playback instruction, decodes the video resource corresponding to the extracted video frame based on the frame number of the extracted video frame, obtaining the extracted video frame. This allows SurfaceFlinger to play each of the extracted video frames according to the frame rate of the first theme, starting from the video frame F(A) corresponding to the first folding angle D(A), until the video frame F(B) corresponding to the second folding angle D(B).
[0345] It should be understood that since video frame F(A) has already been displayed on the large screen, the first video resource may not contain video frame F(A). That is, the video frames after the frame skipping will be played starting from the video frame after video frame F(A) until the video frame F(B) corresponding to the second folding angle D(B).
[0346] As an example, Figure 22A schematic diagram of another dynamic wallpaper uniform animation frame-skipping scheme is shown. Referring to Table 4 above, assuming the preset angle range is 45° to 175° and the total number of video frames m is 131 frames, then each 1° corresponds to one frame index. If the starting angle D(A) of the folding operation is 45° and the ending angle D(B) of the folding operation is 93°, then the change in folding angle ΔD = 48°, and the number of video frames corresponding to the change in folding angle ΔD = 48° ΔF = 49 frames. Further, assuming the first value k1 is 42 frames, since ΔF > 42 frames, a frame-skipping playback strategy can be adopted. Taking the frame extraction step size of 2 calculated based on ΔF = 49 frames and the frame rate of the live wallpaper as an example, one frame can be extracted from every two frames in the first video resource F(0), F(1), F(2), ..., F(48) to obtain the extracted F(0), F(2), F(4), ..., F(48), and then F(0), F(2), F(4), ..., F(48) can be played in sequence.
[0347] As an example, Figure 23 This diagram illustrates another dynamic wallpaper uniform animation frame-skipping scheme. Referring to Table 4 above, assuming the preset angle range is 45° to 175° and the total number of video frames m is 131 frames, then each 1° corresponds to one frame index. If the starting angle D(A) of the folding operation is 45° and the ending angle D(B) of the folding operation is 117°, then the change in folding angle ΔD = 72°, and the number of video frames corresponding to the change in folding angle ΔD = 72° ΔF = 73 frames. Further, assuming the first value k1 is 42 frames, since ΔF > 42 frames, a frame-skipping playback strategy can be adopted. Taking the frame extraction step size of 3 calculated based on ΔF = 73 frames and the frame rate of the live wallpaper as an example, one frame can be extracted from every three frames in the first video resource F(0), F(1), F(2), ..., F(72) to obtain the extracted F(0), F(3), F(6), ..., F(72), and then F(0), F(3), F(6), ..., F(72) can be played in sequence.
[0348] For example, taking a frame extraction step size S=2 as an example. Table 5 shows the time it takes for frames captured from a log data segment to be rendered onto the screen when rendering wallpaper animation using the dynamic wallpaper uniform animation frame extraction scheme. The frame index is used to indicate the playback order of the frames.
[0349] Table 5
[0350] Frame Index Time to render a frame to the screen Time interval from the previous frame i 2023-05-08 11:21:49.255 - i+2 2023-05-08 11:21:49.271 16ms i+4 2023-05-08 11:21:49.290 19ms i+6 2023-05-08 11:21:49.306 16ms i+8 2023-05-08 11:21:49.321 15ms i+10 2023-05-08 11:21:49.338 17ms i+12 2023-05-08 11:21:49.355 17ms i+14 2023-05-08 11:21:49.369 14ms i+16 2023-05-08 11:21:49.387 18ms i+18 2023-05-08 11:21:49.403 16ms i+20 2023-05-08 11:21:49.417 14ms
[0351] As shown in Table 5 above, when using the dynamic wallpaper uniform animation frame extraction scheme, as the frame index value gradually increases, the time interval between two adjacent frames rendered to the screen remains approximately 16ms. Therefore, the uniform animation scheme ensures that the time interval between two adjacent frames rendered to the screen is basically equal at any given time, solving the trailing and unresponsiveness issues present in the elastic animation scheme, and improving the user's interactive experience when using foldable screen devices.
[0352] S16: When the large screen is on, if the user changes the folding angle again by folding the foldable phone, the sensor management service will collect the changed folding angle through the angle sensor.
[0353] S17, the sensor management service reports the changed folding angle to the system service.
[0354] S18, the system service determines that a screen-off event has occurred for the large screen based on the changed angle, and sends a command to the wallpaper application to indicate the screen-off event.
[0355] S19, the wallpaper application calls the unregisterSensor() function to unregister the angle sensor.
[0356] It should be noted that S16 to S19 are examples of determining the occurrence of a screen-off event for a large screen based on the change in the folding angle, and do not limit the embodiments of this application.
[0357] For example, screen-off events for large screens can be divided into two categories:
[0358] The first type is the large screen to small screen (screen turn on) event.
[0359] For example, when a foldable phone is in a half-folded / fully unfolded state, and the large screen is on while the small screen is off, the user folds the phone inwards with both hands. The foldable phone switches from a half-folded / fully unfolded state to a fully folded state. The sensor management service reports the change in folding angle to the system service, for example, a change to 0°. Based on this change in folding angle, the system service generates an instruction to switch the large screen to the small screen, thus turning off the large screen. Since there's no need to continue displaying the live wallpaper on the large screen after it turns off, the wallpaper application no longer needs to obtain the folding angle. Therefore, the wallpaper application can call the `unregisterSensor()` function to unregister the angle sensor.
[0360] The second category is the event of the large screen turning off (going to sleep).
[0361] For example, when a foldable phone is in a semi-folded / fully unfolded state, with the large screen on and the small screen off, if the user presses the power button, or if the foldable phone does not receive any user interaction with the large screen within a preset time, or if the camera on the large screen does not detect the user's face within a preset time, the system service will generate a command to turn off the large screen. Since there is no need to continue displaying the live wallpaper on the large screen after it turns off, the wallpaper application no longer needs to obtain the folding angle. Therefore, the wallpaper application can call the `unregisterSensor()` function to unregister the angle sensor.
[0362] The above embodiments provide two schemes for displaying dynamic wallpaper interfaces.
[0363] I. Dynamic Wallpaper Playback Scheme for the Second Theme. As shown in S1 to S5, when a screen switching event or a large screen lighting event occurs, the wallpaper animation of the second theme begins to play at a constant speed at the moment the large screen lights up. The dynamic wallpaper starts playing from the first frame of the video resource corresponding to the second theme and continues until the last frame of the video resource corresponding to the second theme. It should be understood that the requirement for responsiveness is not high during the large screen lighting stage, so all video resources of the second theme can be played, or a portion of the video resources of the second theme can be extracted for playback.
[0364] II. The dynamic wallpaper playback scheme for the first theme, namely, the dynamic wallpaper uniform-speed animation frame-skipping scheme. As shown in S7 to S15, when the large screen is on, if the user changes the folding angle, for example, from the first folding angle D(A) to the second folding angle D(B), then the number of video frames F(A) corresponding to the first folding angle D(A) to the second folding angle D(B) is determined. The video frame segment from F(A) to F(B) represents the first theme's video resource. If this number is less than or equal to a first value k1, a uniform-speed frame-by-frame playback strategy is used to play this video resource; if the number is greater than the first value k1, a frame-skipping playback strategy is used to skip frames from this video resource before playback. In this way, regardless of the folding angle change, the video resource can be played out in a relatively short time, making the wallpaper animation more responsive and reducing the possibility of trailing.
[0365] Thus, the introduction of the uniform speed animation frame extraction scheme for dynamic wallpapers has been completed. Based on the description of the above embodiments, after adjusting the foldable phone from the first folding angle D(A) to the second folding angle D(B), the number of video frames ΔF corresponding to the change in folding angle ΔD can be calculated. Then, the frame extraction step size S is calculated using the above relationship (4), and the video frames are extracted and played according to the frame extraction step size S. However, using the frame extraction strategy to play dynamic wallpapers may skip too many frames, resulting in a less detailed and more abrupt image. To solve this problem, this application also proposes a technical solution to set the uniform speed playback frame value in the theme package configuration item.
[0366] Figure 24 This diagram illustrates a method for playing video frames at a constant speed at the end of a live wallpaper. The subject of this method can be the wallpaper application. Figure 24 As shown, the method may include the following steps S401 to S404.
[0367] S401, start extracting video frames from the video frame F(A) corresponding to the first folding angle D(A).
[0368] S402 extracts one video frame from every S frames and plays the extracted video frame.
[0369] Where S is the frame extraction step size. S can be calculated using the above relationship (4).
[0370] S403: After extracting one video frame from every S frames, determine whether the number of remaining video frames is less than or equal to a preset value. If the number of remaining video frames is greater than the preset value, it means that the live wallpaper has not yet been played to the end, and S402 can continue to be executed. If the number of remaining video frames is less than or equal to the preset value, it means that the live wallpaper has been played to the end, and S404 can be executed. Here, the remaining video frames refer to the video frames from the next frame after the currently extracted video frame to the video frame F(B) corresponding to the second folding angle D(B).
[0371] The preset values mentioned above are set in the theme package configuration and indicate the maximum number of video frames allowed to play at the end of a video resource. For example, the preset values are 5, 10, or 15 frames. It should be understood that a larger preset value results in more video frames playing at a constant speed at the end of the live wallpaper, resulting in a more detailed image; a smaller preset value results in fewer video frames playing at a constant speed at the end of the live wallpaper, resulting in better responsiveness. In actual implementation, the preset values can be adjusted according to the desired level of detail and responsiveness.
[0372] S404, play the remaining video frames one by one at a constant speed until the video frame F(B) corresponding to the second folding angle D(B) is played.
[0373] It should be noted that S401 to S404 described above are examples of extracting and playing video frames simultaneously, and do not limit the scope of this application. In actual implementation, video frames can also be extracted before playback begins.
[0374] Based on the data provided in Table 3, Table 6 shows the correspondence between the theoretical number of frames played, the number of frames played at a constant speed, and the actual number of frames played when the preset value is 10 frames. As shown in Table 6, when the video length is 800ms, the actual number of frames played is 29; when the video length is 900ms, the actual number of frames played is 32; when the video length is 1200ms, the actual number of frames played is 30; and when the video length is 1600ms, the actual number of frames played is 30. On the one hand, the actual number of frames played for each video length is greater than the theoretical number of frames played, resulting in a more detailed picture; on the other hand, the actual number of frames played for each video length is less than the first value of 42 frames, which can meet the needs of responsiveness.
[0375] Table 6
[0376]
[0377] Based on the data provided in Table 3, Table 7 shows the correspondence between the theoretical number of frames played, the number of frames played at a constant speed, and the actual number of frames played when the preset value is 10 frames. As shown in Table 7, when the video length is 800ms, the actual number of frames played is 53; when the video length is 900ms, the actual number of frames played is 59; when the video length is 1200ms, the actual number of frames played is 54; and when the video length is 1600ms, the actual number of frames played is 54. On the one hand, the actual number of frames played for each video length is greater than the theoretical number of frames played, resulting in a more detailed picture; on the other hand, the actual number of frames played for each video length is less than the first value of 84 frames, which can meet the needs of responsiveness.
[0378] Table 7
[0379]
[0380] For example, Figure 25 This diagram illustrates a scheme for playing video frames at a constant speed at the end of a live wallpaper. Figure 25As shown, assuming the preset angle range is 45° to 175° and the total number of video frames m is 131 frames, then each 1° corresponds to one frame index. If the starting angle D(A) of the folding operation is 45° and the ending angle D(B) of the folding operation is 93°, then the change in folding angle ΔD = 48°, and the number of video frames corresponding to the change in folding angle ΔD = 48° ΔF = 49 frames. Since ΔF is greater than the first value of 42 frames, the first video resource can be extracted in pairs according to the extraction step size of 2, for example, extracting video frames F(0), F(2), F(4), ... When video frame F(38) is extracted, the number of remaining video frames to be played is 10, and the extraction stops. The foldable screen phone plays the remaining video frames F(39), F(40), ..., F(47), F(48) frame by frame according to the frame rate of the first theme.
[0381] For example, Figure 26 This diagram illustrates a scheme for playing video frames at a constant speed at the end of a live wallpaper. Figure 26 As shown, assuming the preset angle range is 45° to 175° and the total number of video frames m is 131 frames, then each 1° corresponds to one frame index. If the starting angle D(A) of the folding operation is 45° and the ending angle D(B) of the folding operation is 117°, then the change in folding angle ΔD = 72°, and the number of video frames corresponding to the change in folding angle ΔD = 72° ΔF = 73 frames. ΔF is greater than the first value, so frames can be extracted from the first video resource according to a frame extraction step size of 3, for example, extracting video frames F(0), F(3), F(6), ... When video frame F(63) is extracted, the number of remaining video frames to be played is 9, and frame extraction stops. The foldable screen phone plays the remaining video frames F(64), F(65), ..., F(71), F(72) sequentially according to the frame rate of the first theme.
[0382] In the above solution, because a uniform playback frame rate is set in the theme package configuration, when the user adjusts the folding angle of the foldable phone, the video frames can be played in a frame-by-frame manner according to the frame-skipping step size, and then played back frame by frame at a uniform speed at the end of the video resource. On the one hand, the total number of video frames played is less than the first value k1, which ensures that the dynamic wallpaper finishes playing in a short time (e.g., 700ms), making the wallpaper animation responsive and reducing the possibility of trailing. On the other hand, using a uniform frame-by-frame playback strategy at the end of the video resource makes the picture more delicate, smooth, and soft, improving the user's visual experience when watching the wallpaper animation.
[0383] This application also provides a foldable screen device, including a processor coupled to a memory. The processor calls a computer program or instruction stored in the memory, so that the foldable screen device implements the methods in the above embodiments.
[0384] This application also provides a computer-readable storage medium storing computer instructions. When the computer-readable storage medium is operated on a foldable screen device, it causes the foldable screen device to perform the method described above. The computer instructions can be stored in the computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or can contain one or more data storage devices such as servers or data centers that can be integrated with the medium. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, or magnetic tape), an optical medium, or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0385] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a foldable screen device, it causes the foldable screen device to perform the methods described in the above embodiments.
[0386] This application also provides a chip coupled to a memory. This chip is used to read and execute computer programs or instructions stored in the memory to perform the methods described in the above embodiments. The chip can be a general-purpose processor or a special-purpose processor. It should be noted that the chip can be implemented using one or more field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits capable of performing the various functions described throughout this application.
[0387] The foldable screen device, computer-readable storage medium, computer program product, and chip provided in the above embodiments of this application are all used to execute the methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects corresponding to the methods provided above, and will not be repeated here.
[0388] 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.
[0389] 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 apparatus, 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 apparatuses or units may be electrical, mechanical, or other forms.
[0390] 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.
[0391] 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.
[0392] 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, in essence, or 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 of 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.
[0393] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes 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 dynamic wallpaper playing method, characterized in that, The method is applied to a foldable screen device including at least one foldable display screen, and the method includes: displaying a wallpaper of a first theme on the display screen, the video resource of the first theme including a plurality of video frames; receiving a first operation of adjusting the display screen from a first folding angle to a second folding angle by a user; in response to the first operation, determining a first video frame in the video resource of the first theme corresponding to the first folding angle and a second video frame in the video resource of the first theme corresponding to the second folding angle; in a case where the number of video frames in the first video resource is less than or equal to a first value, playing each video frame of the first video resource on the display screen at a frame rate of the first theme, the first video resource being the video frames between the first video frame and the second video frame in the video resource of the first theme; or in a case where the number of video frames in the first video resource is greater than the first value, extracting the video frames of the first video resource at a first frame extraction step, and playing the extracted video frames on the display screen at the frame rate of the first theme.
2. The method of claim 1, wherein, The configuration item of the first theme includes a preset value; in the case where the number of video frames in the first video resource is greater than the first value, the method further includes: in the case where the number of video frames in the first video resource is greater than the first value, extracting the video frames of the first video resource at the first frame extraction step, and playing the extracted video frames on the display screen at the frame rate of the first theme. after extracting the video frames of the first video resource at the first frame extraction step each time, determining whether the number of remaining video frames is less than or equal to the preset value, wherein the remaining video frames refer to the video frames from a next frame of the extracted video frame to the second video frame. if the number of remaining video frames is less than or equal to the preset value, stopping the frame extraction and playing the remaining video frames on the display screen frame by frame.
3. The method of claim 2, wherein, after determining whether the number of remaining video frames is less than or equal to the preset value, the method further includes: if the number of remaining video frames is greater than the preset value, continuing to extract the video frames of the first video resource at the first frame extraction step, and playing the extracted video frames on the display screen.
4. The method according to any one of claims 1 to 3, characterized in that, before extracting the video frames of the first video resource at the first frame extraction step, the method further includes: determining the first frame extraction step by using the following relationship: wherein S represents the first frame extraction step, ΔF represents the number of video frames in the first video resource, and k2 represents a second value, the second value being the number of video frames played at the frame rate of the first theme within a first preset time length.
5. The method of claim 4, wherein, before displaying the wallpaper of the first theme on the display screen, the method further includes: receiving a second operation of setting the wallpaper of the first theme as the desktop wallpaper of the display screen by a user; In response to the second operation, a configuration item of the first theme is acquired, and the configuration item of the first theme is parsed to obtain the first value and the second value.
6. The method of claim 5, wherein, parsing the configuration item of the first theme to obtain the second value comprises: parsing the configuration item of the first theme to obtain a frame rate of the first theme; determining the second value according to the frame rate of the first theme and a first preset time length using the following relationship: k2 = t2 * f; wherein t2 represents the first preset time length, and f represents the frame rate of the first theme.
7. The method of claim 5, wherein, parsing the configuration item of the first theme to obtain the first value comprises: parsing the configuration item of the first theme to obtain a frame rate of the first theme; determining the first value according to the frame rate of the first theme and a second preset time length using the following relationship: k1 = t1 * f; wherein k1 represents the first value, t1 represents the second preset time length, and f represents the frame rate of the first theme; and the second preset time length is greater than the first preset time length.
8. The method of claim 7, wherein, The first preset time length is 400 milliseconds, and the second preset time length is any value between 600 milliseconds and 700 milliseconds.
9. The method of any one of claims 1 to 8, wherein, the determining of the first video frame corresponding to the first folding angle in the video resource of the first theme and the second video frame corresponding to the second folding angle in the video resource of the first theme comprises: determining the first video frame corresponding to the first folding angle using a first relationship: determining the second video frame corresponding to the second folding angle using a second relationship: wherein F1 represents a frame index of the first video frame, D1 represents a folding angle corresponding to the frame index of the first video frame, F2 represents a frame index of the second video frame, D2 represents a folding angle corresponding to the frame index of the second video frame, x represents a minimum value of a preset angle range, y represents a maximum value of the preset angle range, and m represents a total number of video frames of the first theme.
10. The method of claim 9, wherein, Before the determining of the first video frame and the second video frame, the method further comprises: parsing the configuration item of the first theme to obtain the total number of video frames of the first theme.
11. The method of claim 9, wherein, The first folding angle and the second folding angle are located in the preset angle range.
12. The method according to any one of claims 1 to 11, characterized in that, The wallpaper of the first theme is a desktop wallpaper of the display screen. Before the displaying of the wallpaper of the first theme on the display screen, the method further comprises: receiving a third operation triggered by a user to turn on the display screen in a case that the display screen is in an off-screen state; in response to the third operation, frame extracting a video resource of a second theme according to a second frame extracting step, and playing the extracted video frames starting from a first frame of the video resource of the second theme on the display screen according to a frame rate of the second theme until a last frame of the video resource of the second theme; The second frame extraction step length is configured in a configuration item of the second theme.
13. The method according to any one of claims 1 to 12, characterized in that, In a case where the number of video frames in the first video resource is less than or equal to the first value, each video frame of the first video resource is played on the display screen frame by frame at the frame rate of the first theme, including: In a case where the number of video frames in the first video resource is less than or equal to the first value, each video frame of the first video resource is played on the display screen starting from the first video frame at the frame rate of the first theme until the second video frame.
14. The method according to any one of claims 1 to 13, characterized in that, The first folding angle is greater than the second folding angle, or the first folding angle is less than the second folding angle.
15. A foldable screen device, characterized in that, The folding screen device includes a processor and a memory coupled to the processor; wherein the memory stores instructions, and the processor invokes the instructions to enable the folding screen device to perform the dynamic wallpaper playing method according to any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program runs on the folding screen device, the folding screen device performs the dynamic wallpaper playing method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Theme display method, terminal equipment and storage medium
CN113377483A
Display method and electronic equipment
CN115344177A