Image Data Processing Method, Apparatus, Electronic Device, and Storage Medium

By adding custom extensions to the video player, the problems of high development costs and long cycles in the existing technology are solved, and the lightweight video player is realized to support diversified image playback and processing functions.

CN114723871BActive Publication Date: 2025-08-01NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210351143.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-02
Publication Date
2025-08-01
Estimated Expiration
2042-04-02

AI Technical Summary

Technical Problem

In the prior art, developing players that can play videos and pictures is costly and have a long cycle.

Method used

By adding custom extensions to the video player, including custom image rendering classes, custom image material classes and custom image reading classes, we realize the processing flow of image data, and use custom classes to add simple custom code to the base class source code to improve extensibility.

Benefits of technology

Under lightweight development, it realizes a video player with comprehensive functions, compatibility and stability, supports diverse picture playback and processing functions, and reduces development costs and cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723871B_ABST
    Figure CN114723871B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device, electronic device, and storage medium for processing picture data; applied to an electronic device, the electronic device uses an extension program to execute the picture data processing process; the method includes: using a custom picture reading class to obtain the file path of the picture to be played and the duration logic of the picture to be played from a custom picture material class; using the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to a custom picture rendering class; using the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class; using the custom picture rendering class to implement the playback of the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path. Thus, it is possible to improve the problems of high development cost and long development cycle existing in re-developing a player through a lightweight extension program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and specifically to methods, devices, electronic devices, and storage media for processing picture data. Background Art

[0002] With the increasing demands of users for viewing and using videos and pictures, existing video players usually have relatively complete functions, such as playing pictures in the form of videos, freely editing and beautifying the pictures during playback, and so on.

[0003] However, in the prior art, if a video player is required to have both the function of playing videos and the function of playing pictures, it is usually necessary to re-develop a player that can play both videos and pictures, and the development cost of re-developing the above player is relatively high and the development cycle is relatively long. Summary of the Invention

[0004] Embodiments of this application provide methods, devices, electronic devices, and storage media for processing picture data, which can improve the problems of relatively high development cost and relatively long development cycle existing in re-developing a player in the prior art.

[0005] An embodiment of this application provides a method for processing image data, which is applied to an electronic device. The electronic device uses an extension program to execute a picture data processing process. The extension program includes a custom picture rendering class, a custom picture material class, and a custom picture reading class. The method includes: using the custom picture reading class to obtain the file path of the picture to be played and the duration logic of the picture to be played from the custom picture material class; using the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmitting the picture data to the custom picture rendering class; using the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class; using the custom picture rendering class to implement the playback of the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

[0006] An embodiment of this application also provides an image data processing device, including:

[0007] A first acquisition unit, configured to use a custom image reading class to obtain the file path of the image to be played and the duration logic of the image to be played from a custom image material class; a second acquisition unit, configured to use the custom image reading class to obtain the image data of the image to be played according to the file path of the image to be played, and transmit the image data to a custom image rendering class; a third acquisition unit, configured to use the custom image rendering class to obtain an image reading logic and the duration logic from the custom image reading class; an image playing unit, configured to use the custom image rendering class to implement the playing of the image to be played according to the duration logic, the image reading logic, and the image data obtained from the file path.

[0008] In some embodiments, the extension program further includes a custom single-frame timeline class; the image playing unit is specifically configured to:

[0009] Obtain the playing logic of the image data by using the custom single-frame timeline class;

[0010] Use the custom image rendering class to implement the playing of the image to be played according to the duration logic, the image reading logic, the image data obtained from the file path, and the playing logic.

[0011] In some embodiments, the device further includes:

[0012] A first creation unit, in response to a first creation operation on the custom image material class, configured to create the custom image material class on the basis of a media material class; wherein, the custom image material class is used to define the file path of the image to be played and the duration logic of the image to be played.

[0013] In some embodiments, the device further includes:

[0014] A custom image frame class creation unit, configured to create a custom image frame class based on the custom image material class, wherein the custom image frame class is used to create the custom image reading class, and the custom image reading class is used to define the image reading logic.

[0015] In some embodiments, the device further includes:

[0016] A second creation unit, in response to a second creation operation on the custom image reading class, configured to create the custom image reading class on the basis of the custom image frame class and on the basis of a material sampling class.

[0017] In some embodiments, the device further includes:

[0018] A custom single-frame timeline class creation unit, configured to create the custom single-frame timeline class based on the custom picture material class, wherein the custom single-frame timeline class is used to define the playback logic.

[0019] In some embodiments, the apparatus further includes:

[0020] A third creation unit, in response to a third creation operation on the custom picture rendering class, configured to create the custom picture rendering class based on the rendering class; wherein the custom picture rendering class is used to define the drawing logic of the picture data, and the drawing logic is used to present the picture corresponding to the picture data on the display interface.

[0021] In some embodiments, the apparatus further includes:

[0022] A custom player class creation unit, in response to a fourth creation operation on the custom player class, configured to create the custom player class based on the player class; wherein the custom player class is used to add each of the extension programs to the corresponding base program.

[0023] In some embodiments, the apparatus further includes:

[0024] A rendering call unit, in response to a call operation on the Open Graphics Library, configured to utilize the Open Graphics Library to call a custom rendering component;

[0025] A frame buffer object acquisition unit, configured to acquire the frame buffer object of the picture to be played;

[0026] A frame texture result acquisition unit, configured to process the frame buffer object based on the custom rendering component to obtain a frame texture result;

[0027] A binding unit, configured to bind the frame texture result to the target frame of the target video output by the electronic device, where the target video is a video generated by playing the picture to be played.

[0028] In some embodiments, the frame texture result acquisition unit further includes:

[0029] A first texture result subunit, configured to render the first texture of the frame buffer object according to a preset screen ratio, rotation direction, and curtain algorithm to obtain a first texture result, where the first texture result is a frame buffer object with the first texture;

[0030] A second texture result subunit, configured to render the first texture result according to a preset beauty algorithm and filter algorithm to obtain a second texture result, where the second texture result is a frame buffer object with a second texture effect;

[0031] A third texture result subunit, configured to render the second texture result according to a preset sticker adding algorithm and a text adding algorithm, so as to obtain a third texture result, where the third texture result is a frame buffer object with a third texture effect;

[0032] A fourth texture result subunit, configured to render the third texture result according to a preset transition algorithm, so as to obtain a fourth texture result, where the fourth texture result is a frame buffer object with a fourth texture effect, and the fourth texture result is the frame texture result.

[0033] An embodiment of the present application further provides an electronic device, including a memory storing multiple instructions; the processor loads the instructions from the memory to execute the steps in any one of the image data processing methods provided by the embodiments of the present application.

[0034] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the image data processing methods provided by the embodiments of the present application.

[0035] In the present application, the extended program of the embodiment of the present application includes multiple custom classes, and each custom class is implemented by adding custom code to the source code of the base class. The custom code involved is relatively simple and has a small size. And because the basic program in the electronic device of the embodiment of the present application has high scalability, on the basis of developing a lightweight extended program, the electronic device can obtain a video player or software with comprehensive functions, good compatibility and stability, and then execute diversified picture playing and processing functions through the video player or software, improving the problems of high development cost and long development cycle existing in redeveloping the player in the prior art. Description of the Drawings

[0036] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0037] Figure 1a It is a schematic diagram of the scenario of the picture data processing method provided by the embodiment of the present application;

[0038] Figure 1b It is a schematic flowchart of the picture data processing method provided by the embodiment of the present application;

[0039] Figure 1c It is a schematic diagram of playing a picture to be played provided by the embodiment of the present application;

[0040] Figure 1d It is a schematic diagram for processing a frame buffer object provided by an embodiment of the present application;

[0041] Figure 2 It is a schematic flowchart of a method for processing picture data provided by another embodiment of the present application;

[0042] Figure 3 It is a schematic structural diagram of a picture data processing device provided by an embodiment of the present application;

[0043] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0044] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0045] The embodiments of the present application provide a method, a device, an electronic device, and a storage medium for processing picture data.

[0046] Among them, the picture data processing device can be specifically integrated in an electronic device, and the electronic device can be a device such as a terminal or a server. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, or a personal computer (PC); the server can be a single server or a server cluster composed of multiple servers.

[0047] In some embodiments, the picture data processing device can also be integrated in multiple electronic devices. For example, the picture data processing device can be integrated in multiple servers, and multiple servers are used to implement the picture data processing method of the present application.

[0048] In some embodiments, the server can also be implemented in the form of a terminal.

[0049] For example, refer to Figure 1a, the above-mentioned electronic device can utilize an extension program to execute the picture data processing flow. The extension program includes a custom picture rendering class, a custom picture material class, and a custom picture reading class. The above-mentioned electronic device can execute the following method: utilize the custom picture reading class to obtain the file path of the picture to be played and the duration logic of the picture to be played from the custom picture material class; utilize the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to the custom picture rendering class; utilize the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class; utilize the custom picture rendering class to implement the playback of the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

[0050] The following will be described in detail respectively. It should be noted that the serial numbers of the following embodiments do not limit the preferred order of the embodiments.

[0051] The embodiment of the present disclosure first aims to provide a picture data processing method. By adding an extension program to the electronic device to execute the picture data processing flow, and the extension program includes multiple lightweight custom classes. Therefore, this solution can realize diverse picture playback functions on the basis of lightweight development.

[0052] In the embodiment of the present application, the electronic device can be a video player with some basic functions. For example, the basic functions can include video cropping and material splicing, etc., to meet the basic viewing and processing needs of users for videos and pictures.

[0053] Since the electronic device realizes the picture data processing flow after adding the extension program, the electronic device can have high scalability. For example, the electronic device can be a native video player that only supports video playback and does not support picture playback, such as, exoplayer. Among them, exoplayer can realize the functions of video cropping, material splicing, and video speed change. It can be understood that on the basis of the open-source data in exoplayer, adding a custom extension program is equivalent to performing custom extension in the native database of Android, so as to be able to expand the electronic device efficiently and at low cost in a lightweight development environment, and obtain an electronic device with high stability and compatibility. It should be noted that the electronic device can also be other video players or similar software / hardware with high scalability. The type or specific model of the electronic device should not be understood as a limitation to the present application.

[0054] As Figure 1b shown, the specific process of this picture data processing method can be as follows:

[0055] 110. Use a custom image reading class to obtain the file path of the image to be played and the duration logic of the image to be played from the custom image material class.

[0056] Among them, the custom image material class (ImageMediaSource) can be a custom class extended on the basis of the media material class (MediaSource) of exoplayer. That is to say, the media material class of exoplayer can be used as an inheritable base class, and a custom implementable class can be extended on this base class. The custom image reading class (ImageSampleStreamImpl) can be a custom class extended on the basis of the sample stream class (SampleStream).

[0057] The image to be played refers to the target image that plays the image in the form of a video. The file path of the image to be played refers to the storage path of the image to be played. The duration logic of the image to be played refers to defining a programming logic so that the duration of each image to be played can be adjusted.

[0058] Optionally, in a specific implementation, the custom image material class can be used to define the file path of the image to be played. It can be understood that since exoplayer does not have the function of playing images and cannot read and decode image data, there is no logic for the media material class of exoplayer to obtain the file path of the image data. Therefore, the media material class can be extended through the custom image material class to define the logic for obtaining the file path of the image to be played, so that exoplayer can parse the custom image material class during operation, call the custom image material class, and identify the file path of the image to be played. Among them, for the image to be played with multiple file paths, that is, the image to be played stored in multiple locations, all file paths of the image to be played can be obtained to achieve the comprehensiveness of file path acquisition.

[0059] Optionally, the custom image material class can also be used to define the duration logic of the images to be played. It can be understood that the biggest difference between images and videos is that images are static while videos are dynamic. Therefore, based on the media material class, relevant logic for decoding and playing images needs to be extended. The media material class can be extended through the custom image material class to define the duration logic of the images to be played, so that ExoPlayer can parse the custom image material class during operation, call the custom image material class, and adjust the duration for which each image to be played is played. For example, the user can preset through ExoPlayer the duration for which each image to be played is played, such as 1 second, 2 seconds, 10 seconds, etc. Among them, in the duration logic, the duration for which the image to be played is played can be accurate to the millisecond level, so that after adding the duration logic, the specific duration of the image to be played can be set according to requirements.

[0060] For another example, the user can preset through ExoPlayer the number of frames that each image to be played occupies in the video, such as 12 frames, 24 frames, etc. Since the video data can calculate the number of frames played per second through the refresh rate of the display end, such as 12 frames per second, 24 frames per second, etc., the duration for which the image to be played is played can be calculated in combination with the refresh rate of the display end. It should be noted that the specific playing duration of the image to be played should not be construed as a limitation of this application.

[0061] For details, please refer to Figure 1c , Figure 1c which shows the playback interface for playing images. It can be seen that at the first moment, the image to be played is displayed in the playback interface in the first second. At the second moment, the same image to be played is still displayed in the playback interface. Therefore, the playback duration of this image to be played is at least 5 seconds. Optionally, in the Figure 1c playback interface, in this video with a duration of 10 seconds, only one image to be played can be played, or multiple images to be played can be played. The specific number of images to be played should not be construed as a limitation of this application.

[0062] Optionally, before step 110, it further includes: in response to a first creation operation on the custom image material class, creating the custom image material class on the basis of the media material class.

[0063] Among them, the custom image material class can be used to define the file path of the image to be played, as well as the duration logic of the image to be played.

[0064] It can be understood that the media material class can be used as an inheritable base class, and the custom media material class can extend a custom implementable class on this base class. It should be noted that the above extension of the custom class from the base class is achieved by adding custom code to the source code of the base class. For example, a custom playback class can be extended from the playback class of ExoPlayer, so that ExoPlayer can implement other playback functions. For example, the following custom code can be added to the playback class of ExoPlayer to enable ExoPlayer to implement the gesture playback function. For example, the custom code can be:

[0065] ManualPlayerexoPlayerManager = new ManualPlayer(this, R.id.exo_play_context_id, new DataSource(this)).

[0066] It should be understood that in the embodiments of the present application, the code related to defining the file path of the picture to be played and the duration logic of the picture to be played can be added to the corresponding base class, for example, added to the media material class of ExoPlayer, so as to create a custom picture material class on the basis of the media material class.

[0067] Optionally, after creating the custom picture material class on the basis of the media material class in response to the first creation operation on the custom picture material class, it further includes:

[0068] Creating a custom picture frame class based on the custom picture material class, where the custom picture frame class is used to create the custom picture reading class, and the custom picture reading class is used to define the picture reading logic.

[0069] Among them, the custom picture frame class (ImageMediaPeriod) can be extended from the media frame class (MediaPeriod) of ExoPlayer, that is, the code corresponding to the custom picture frame class is inherited from the media frame class.

[0070] Optionally, in a specific implementation manner, a custom picture frame class can be created based on the custom picture material class. It can be understood that during the program execution stage, ExoPlayer can create the pre-written custom picture frame class by parsing the custom picture material class and calling the custom picture material class. That is, the creation logic of the custom picture frame class can be predefined and realized along with the parsing of the custom picture material class.

[0071] The custom picture frame class can be used to create a custom picture reading class. It should be understood that during the program execution phase, ExoPlayer can create a pre-written custom picture reading class by parsing the custom picture frame class. That is, the creation logic of the custom picture reading class can be predefined and realized by parsing the custom picture frame class.

[0072] Among them, the custom picture reading class can be used to define the picture reading logic. Since ExoPlayer does not have the function of reading picture data, even if ExoPlayer can obtain the file path of the picture by parsing the custom media material class, it cannot read the picture, that is, it cannot substantially obtain the picture to be played. It can be understood that the picture reading logic can define that the electronic device can read the corresponding picture from the file path of the picture to achieve the substantial acquisition of the picture. For example, the custom picture reading class can be parsed and called, so that ExoPlayer can read the picture to be played from the file path of the picture to be played, and play the read picture to be played or perform other subsequent processing.

[0073] Optionally, after creating the custom picture frame class based on the custom picture material class, it further includes:

[0074] In response to the second creation operation of the custom picture reading class, based on the custom picture frame class, create the custom picture reading class on the basis of the material sampling class.

[0075] Since the custom picture reading class is a custom class extended on the basis of the material sampling class, the material sampling class can be used as the base class of the custom picture reading class, and the custom picture reading class can be a subclass of the material sampling class.

[0076] Optionally, the custom picture reading class can be created on the basis of the material sampling class based on the custom picture frame class. It can be understood that during the program execution phase, ExoPlayer can create a subclass of the material sampling class on the material sampling class by parsing the custom picture frame class, so as to write the custom picture reading class on the basis of the material sampling class. That is, the creation logic of the custom picture reading class can be predefined and realized by extending the material sampling stream after parsing the custom picture frame class.

[0077] Optionally, after creating the custom picture material class on the basis of the media material class in response to the first creation operation of the custom picture material class, it further includes:

[0078] Create a custom single-frame timeline class based on the custom picture material class, where the custom single-frame timeline class is used to define the playback logic.

[0079] Among them, the custom single-frame timeline class (SinglePeriodTimeline) extends from the timeline class (Timeline) of ExoPlayer. It can be understood that since the custom single-frame timeline class is created based on the custom image material class, during the program execution phase, ExoPlayer can create the custom single-frame timeline class by parsing the custom image material class and calling the custom image material class. That is, the creation logic of the custom single-frame timeline class can be predefined and realized by parsing the custom image material class.

[0080] Among them, the timeline class is also used to define the logic for storing video decoded frames. For example, multiple video decoded frames can be stored in a queue. Since the custom single-frame timeline class extends from the timeline class, the custom single-frame timeline class can extend the logic for storing picture decoded frames from the logic for storing video decoded frames to generate a queue that can store picture decoded frames. Among them, the picture decoded frame can be the picture data as a frame in video playback, so that the corresponding frame data can be decoded from the video.

[0081] Among them, the playback logic in the embodiments of this application refers to the relevant logic used when playing pictures. Optionally, the playback logic can include defining the playback mode of the picture to be played. For example, the picture to be played can be played sequentially, looped, or played in reverse order during a certain time period.

[0082] Optionally, the playback logic can also include defining the start and end times of the picture to be played. For example, the picture to be played is set to start playing at the 3rd second and end playing at the 5th second.

[0083] It should be noted that compared with the duration logic of the picture to be played, different from the concept of duration, the playback logic focuses on highlighting the logic between the picture to be played and the moment, and more emphasizes how to play the picture to be played at a certain moment.

[0084] 120. Use the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to the custom picture rendering class.

[0085] Among them, the custom picture rendering class (ImageRenderer) can extend from the rendering class (Renderer) of ExoPlayer. The rendering class can be used to decode video data and draw each frame of the video picture. That is, each frame of the video picture is decoded and output to the display interface.

[0086] It can be understood that during the program execution stage, the electronic device can parse the custom image material class, call the custom image material class, and first obtain the file path of the image to be played. Then, by parsing the custom image reading class and calling the custom image reading class, it reads the image data in the file path and transfers the image data to the custom image rendering class.

[0087] 130. Use the custom image rendering class to obtain the image reading logic and the duration logic from the custom image reading class.

[0088] It can be understood that since the custom image rendering class can obtain the image data through the transfer of the custom image reading class, the custom image rendering class can obtain the image reading logic and the duration logic by parsing the custom image reading class and calling the custom image reading class.

[0089] 140. Use the custom image rendering class to implement the playback of the image to be played according to the duration logic, the image reading logic, and the image data obtained from the file path.

[0090] Optionally, in a specific embodiment, the electronic device can parse the custom image material class and the custom image reading class to call the custom image material class and the custom image reading class, and obtain the file path of the image data, the duration logic, and the reading logic. During execution, the electronic device can, based on the above logic, read the image data of the image to be played from the file path, adjust the duration of each image to be played, and call the custom image rendering class to draw the image data and play the corresponding image to be played at this duration.

[0091] The extended program further includes a custom single-frame timeline class. Optionally, step 140 may further include the following steps 141 and 142:

[0092] 141. Use the custom single-frame timeline class to obtain the playback logic of the image data.

[0093] 142. Use the custom image rendering class to implement the playback of the image to be played according to the duration logic, the image reading logic, the image data obtained from the file path, and the playback logic.

[0094] Optionally, in a specific embodiment, to achieve the smoothness and functional diversity of the electronic device for playing images, the custom single-frame timeline class can be parsed, and the custom single-frame timeline class can be called to obtain the playback logic of the image to be played. By combining the playback logic with the multiple logics mentioned in step 140, the playback of the image to be played is achieved. For example, the start playback time, end playback time, playback mode, etc. of the image to be played can be set through the playback logic.

[0095] Optionally, before step 142, the following steps may also be included:

[0096] In response to the third creation operation on the custom image rendering class, the custom image rendering class is created based on the rendering class, wherein the custom image rendering class is used to define the drawing logic of the image data, and the drawing logic is used to present the image corresponding to the image data on the display interface.

[0097] It can be understood that since the rendering class can be used to decode video data and draw each frame of the video screen, that is, decode each frame of the video screen and output it to the display interface, the custom image rendering class can accordingly inherit the decoding capabilities of the rendering class and use the image data as the frame data for decoding output, that is, decode the image data into each frame of the video screen, so that the video screen can be decoded into the overall image data of the image to be played, and ultimately achieve the drawing of the image data to the display interface.

[0098] Optionally, the method of the embodiment of the present application further includes:

[0099] In response to the fourth creation operation on the custom player class, the custom player class may be created based on the player class; wherein the custom player class may be used to add each of the extension programs to the corresponding basic program.

[0100] It can be understood that for the above custom classes, you need to add the custom class to the corresponding base class to implement the logic and methods it contains. Taking the custom image material class as an example, you need to add the code of the custom image material class to the list of exoplayer's media material class code to expand the media material class and create a complete custom image material class.

[0101] Since the extension program can include the above multiple custom classes, the base program can also include the base classes corresponding to the above multiple custom classes. Therefore, a custom player class can be created based on the player class, and the custom player class can be parsed to call the custom player class to add each custom class in the embodiment of the application to the corresponding base class to create a complete custom class.

[0102] As can be seen from the above, the extension program of the embodiment of the present application includes multiple custom classes, and each custom class is implemented by adding custom code to the source code of the base class. The custom code involved is relatively simple and has a small size. Moreover, since the basic program in the electronic device of the embodiment of the present application has high scalability, on the basis of developing a lightweight extension program, the electronic device can obtain a video player or software with comprehensive functions, good compatibility and stability, and then execute diverse picture playing and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle existing in re-developing the player in the prior art.

[0103] To enable the electronic device to perform real-time editing on the playing picture during the picture playing process, as Figure 1d shown, optionally, the method of the embodiment of the present application further includes:

[0104] In response to a call operation on the Open Graphics Library, using the Open Graphics Library to call a custom rendering component;

[0105] Obtain the frame buffer object of the to-be-played picture;

[0106] Based on the custom rendering component, process the frame buffer object to obtain a frame texture result;

[0107] Bind the frame texture result to the target frame of the target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture.

[0108] Among them, the Open Graphics Library (OpenGL) is a cross-language and cross-platform application programming interface (API) for rendering 2D and 3D vector graphics, and it can be used to provide a set of unified graphics processing interfaces.

[0109] Optionally, in a specific embodiment, the Open Graphics Library can be called by parsing the drawing class setVideoSurface of the electronic device, and then the custom rendering component of the Open Graphics Library can be called through the Open Graphics Library, so that the electronic device can subsequently render the picture data through the custom rendering component. Among them, the custom rendering component can be a custom video frame rendering component GLSurfaceView.

[0110] Among them, the custom video frame rendering component can be used to render video frames and provide a preview in the display interface. In the embodiment of the present application, since the video playing object is the to-be-played picture, the picture data of each frame can be rendered through the custom video frame rendering component.

[0111] Among them, a Framebuffer Object (FBO) is an image container, which is a collection of a color buffer, a depth buffer, and a stencil buffer. The framebuffer object can store a texture, and the texture can be used as the target of rendering.

[0112] Optionally, in a specific embodiment, the framebuffer object of the picture to be played can be obtained by creation. After the framebuffer object is created, the framebuffer object can generate an RGBA image texture corresponding to the target video frame, and the RGBA image texture can be bound to the framebuffer object.

[0113] Optionally, in a specific embodiment, the framebuffer object can be processed based on a custom rendering component to obtain a frame texture result. It can be understood that since the framebuffer object is bound to the RGBA image texture, that is, the framebuffer object of the picture to be played stores the RGBA image texture, so that the RGBA image texture can be rendered by the custom rendering component to obtain the frame texture result.

[0114] Optionally, processing the framebuffer object further includes:

[0115] Rendering the first texture of the framebuffer object according to a preset screen ratio, rotation direction, and curtain algorithm to obtain a first texture result, where the first texture result is the framebuffer object with the first texture;

[0116] Rendering the first texture result according to a preset beauty algorithm and filter algorithm to obtain a second texture result, where the second texture result is the framebuffer object with a second texture effect;

[0117] Rendering the second texture result according to a preset sticker adding algorithm and text adding algorithm to obtain a third texture result, where the third texture result is the framebuffer object with a third texture effect;

[0118] Rendering the third texture result according to a preset transition algorithm to obtain a fourth texture result, where the fourth texture result is the framebuffer object with a fourth texture effect, and the fourth texture result is the frame texture result.

[0119] Optionally, in a specific embodiment, the MVP matrix of the video interface can be calculated through a preset screen ratio and rotation direction. Among them, the MVP matrix is an inherent variable in the OpenGL graphics library. Through the MVP matrix transformation, the geometric data of the video interface can be transformed into a two-dimensional coordinate system, so as to facilitate subsequent processing of each point in the texture by a custom rendering component.

[0120] Then, the curtain algorithm can be combined with the two-dimensional coordinate system transformed by the MVP matrix to draw a curtain on the first texture. Among them, the curtain algorithm can be used to draw a solid-color curtain and a blurred curtain, and the corresponding curtain algorithms for the two are different. For the solid-color curtain, the four color channels R, G, B, and A of the RGBA image texture can be assigned values through a custom rendering component to obtain the corresponding target solid-color curtain. For the blurred curtain, after calculating the weight of each pixel in the texture in combination with the Gaussian algorithm, and combining the weights of each pixel above, the colors contained in all pixels are synthesized in a weighted summation manner to obtain a curtain with a blurred visual effect. Further, by creating the radius logic of the blurred curtain, the blurred range can be adjusted by modifying the radius value of the blurred curtain. Finally, the above processing operations are performed on the first texture through a custom rendering component to obtain the first texture result.

[0121] Optionally, in a specific embodiment, the first texture result can be rendered according to a preset beauty algorithm and filter algorithm. It can be understood that the first texture result carries parameters after screen ratio adjustment, rotation direction adjustment, and curtain algorithm processing, and the custom rendering component can continue to render the first texture result on this basis. Optionally, the custom rendering component can implement the beauty algorithm and filter algorithm on the first texture result by adding relevant parameters of beauty and filter to the pixels corresponding to the first texture result. For example, parameters such as screen direction, camera direction, and rendering size can be added. Among them, the screen direction refers to landscape or portrait, and the camera direction refers to front or rear. Finally, the second texture result can be obtained according to the rendered first texture result.

[0122] Optionally, in a specific embodiment, the second texture result can be rendered according to a preset sticker addition algorithm and text addition algorithm. Optionally, the logic of the sticker addition algorithm and text addition algorithm can be created. For example, the code "stickerItem.getBitmap" can be added to the relevant fields of the original program of the electronic device to obtain the logic for setting the coordinates and start and end times of the sticker and text. Optionally, the custom rendering component can call the watermark filter rendering method, and combine the above logic on the second texture result to render the sticker or text to be added onto the second texture result in the form of a watermark or filter to obtain the third texture result.

[0123] Optionally, in a specific embodiment, the third texture result may be rendered according to a preset transition algorithm. It can be understood that picture transition may refer to the process of switching from playing the previous picture to playing the next picture during picture playback. Optionally, the custom rendering component may call the relevant logic of the transition algorithm. For example, the logic of the execution time of the transition algorithm may be: during the last 500 ms of the playback of the previous picture data and the first 500 ms of the playback of the next picture data, the effect of the transition algorithm is executed. Among them, the effect logic of the transition algorithm may include: transition movement, transition scaling, and transition rotation. That is, during the picture data transition, the picture data can be moved, scaled, and rotated. After the custom rendering component renders the third texture result to obtain the fourth texture result, the fourth texture result may be used as the frame texture result.

[0124] Optionally, in a specific embodiment, the frame texture result may be bound to the target frame of the target video output by the electronic device, where the target video is a video generated by playing the picture to be played.

[0125] Among them, the electronic device may draw the target frame by calling the built-in video frame component SurfaceView. By binding the target frame drawn by the video frame component SurfaceView to the frame texture result rendered by the custom video frame component GLSurfaceView, the effect of real-time rendering of picture data during picture playback as described in Figure 1c can be achieved.

[0126] As can be seen from the above, during the process of obtaining the frame texture result, the processing of each texture result includes the processing parameters of the previous texture result, so that the finally rendered frame texture result includes all the previous rendering methods and logics used. Therefore, the custom rendering component can perform comprehensive and diversified rendering on the frame buffer data of the picture to be played. And by combining the custom rendering component with the required algorithms in the above-mentioned way from difficult to easy and layer by layer, the development difficulty of the extended program is also reduced and the development efficiency is improved.

[0127] The method described in the above embodiment will be further described in detail below.

[0128] In this embodiment, taking the electronic device using the extended program to execute the picture data processing flow as an example, the method of the embodiment of the present application will be described in detail.

[0129] As Figure 2 shown, the specific process of a picture data processing method is as follows:

[0130] 201. In response to a first creation operation on the custom picture material class, create the custom picture material class on the basis of the media material class.

[0131] 202. Create the custom single-frame timeline class based on the custom picture material class.

[0132] 203. Use the custom picture reading class to obtain the file path of the picture to be played and the duration logic of the picture to be played from the custom picture material class.

[0133] 204. Create a custom picture frame class based on the custom picture material class.

[0134] 205. In response to a second creation operation on the custom picture reading class, create the custom picture reading class on the basis of the material sampling class based on the custom picture frame class.

[0135] 206. Use the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to the custom picture rendering class.

[0136] 207. In response to a third creation operation on the custom picture rendering class, create the custom picture rendering class on the basis of the rendering class.

[0137] 208. In response to a fourth creation operation on the custom player class, create the custom player class on the basis of the player class.

[0138] 209. Use the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class.

[0139] 210. Use the custom picture rendering class to implement the playback of the picture to be played according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playback logic.

[0140] 211. Use the custom single-frame timeline class to obtain the playback logic of the picture data.

[0141] 212. Use the custom picture rendering class to implement the playback of the picture to be played according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playback logic.

[0142] As can be seen from the above, the extension program of the embodiment of the present application includes multiple custom classes, each of which is implemented by adding custom code to the source code of the base class. The custom code involved is relatively simple and has a small size. And because the basic program in the electronic device of the embodiment of the present application has high scalability, on the basis of developing a lightweight extension program, the electronic device can obtain a video player or software with comprehensive functions, good compatibility and stability, and then execute diversified picture playing and processing functions through the video player or software, improving the problems of high development cost and long development cycle in re-developing a player in the prior art.

[0143] To better implement the above method, the embodiment of the present application also provides an image data processing device, which can be specifically integrated in an electronic device, and the electronic device can be a terminal. Among them, the terminal can be a device such as a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer, etc.

[0144] For example, in this embodiment, taking the image data processing device being specifically integrated in the terminal as an example, the method of the embodiment of the present application will be described in detail.

[0145] For example, as Figure 3 shown, the image data processing device may include:

[0146] A first acquisition unit 301, configured to use a custom image reading class to acquire the file path of the picture to be played and the duration logic of the picture to be played from a custom picture material class;

[0147] A second acquisition unit 302, configured to use a custom image reading class to acquire the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to a custom picture rendering class;

[0148] A third acquisition unit 303, configured to use the custom picture rendering class to acquire a picture reading logic and the duration logic from the custom image reading class;

[0149] A picture playing unit 304, configured to use the custom picture rendering class to implement the playing of the picture to be played according to the duration logic, the picture reading logic, and the picture data acquired from the file path.

[0150] In some embodiments, the extension program further includes a custom single-frame timeline class; the picture playing unit 304 is specifically configured to:

[0151] Obtain the playing logic of the picture data by using the custom single-frame timeline class;

[0152] Using the custom image rendering class, implement the playback of the image to be played according to the duration logic, the image reading logic, the image data obtained from the file path, and the playback logic.

[0153] In some embodiments, the apparatus further includes:

[0154] A first creation unit, in response to a first creation operation on the custom image material class, is configured to create the custom image material class on the basis of a media material class; wherein, the custom image material class is used to define the file path of the image to be played, and the duration logic of the image to be played.

[0155] In some embodiments, the apparatus further includes:

[0156] A custom image frame class creation unit, configured to create a custom image frame class based on the custom image material class, wherein the custom image frame class is used to create the custom image reading class, and the custom image reading class is used to define the image reading logic.

[0157] In some embodiments, the apparatus further includes:

[0158] A second creation unit, in response to a second creation operation on the custom image reading class, is configured to create the custom image reading class on the basis of the custom image frame class and on the basis of a material sampling class.

[0159] In some embodiments, the apparatus further includes:

[0160] A custom single-frame timeline class creation unit, configured to create the custom single-frame timeline class based on the custom image material class, wherein the custom single-frame timeline class is used to define the playback logic.

[0161] In some embodiments, the apparatus further includes:

[0162] A third creation unit, in response to a third creation operation on the custom image rendering class, is configured to create the custom image rendering class on the basis of the rendering class; wherein, the custom image rendering class is used to define the drawing logic of the image data, and the drawing logic is used to present the image corresponding to the image data on a display interface.

[0163] In some embodiments, the apparatus further includes:

[0164] A custom player class creation unit, in response to a fourth creation operation on the custom player class, creates the custom player class on the basis of the player class; wherein, the custom player class is used to add each of the extension programs to the corresponding basic program.

[0165] In some embodiments, the apparatus further includes:

[0166] A rendering call unit, in response to a call operation on the Open Graphics Library, for using the Open Graphics Library to call a rendering component;

[0167] A frame buffer object acquisition unit, for acquiring a frame buffer object of the picture to be played;

[0168] A frame texture result acquisition unit, for processing the frame buffer object based on the rendering component to obtain a frame texture result;

[0169] A binding unit, for binding the frame texture result to a target frame of a target video output by the electronic device, where the target video is a video generated by playing the picture to be played.

[0170] In some embodiments, the frame texture result acquisition unit further includes:

[0171] A first texture result sub-unit, for rendering a first texture of the frame buffer object according to a preset screen ratio, rotation direction, and curtain algorithm to obtain a first texture result, where the first texture result is a frame buffer object with the first texture;

[0172] A second texture result sub-unit, for rendering the first texture result according to a preset beauty algorithm and filter algorithm to obtain a second texture result, where the second texture result is a frame buffer object with a second texture effect;

[0173] A third texture result sub-unit, for rendering the second texture result according to a preset sticker adding algorithm and text adding algorithm to obtain a third texture result, where the third texture result is a frame buffer object with a third texture effect;

[0174] A fourth texture result sub-unit, for rendering the third texture result according to a preset transition algorithm to obtain a fourth texture result, where the fourth texture result is a frame buffer object with a fourth texture effect, and the fourth texture result is the frame texture result.

[0175] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of the picture data processing methods provided by the embodiments of the present application.

[0176] In the picture data processing method provided by the embodiments of the present application, a custom picture reading class can be used to obtain the file path of the picture to be played and the duration logic of the picture to be played from a custom picture material class; use the custom picture reading class to obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to a custom picture rendering class; use the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class; use the custom picture rendering class to implement the playing of the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

[0177] In the present application, the extension program of the embodiments of the present application includes multiple custom classes, and each custom class is implemented by adding custom code to the source code of the base class. The custom code involved is relatively simple and has a small size. And because the basic program in the electronic device of the embodiments of the present application has high scalability, on the basis of developing a lightweight extension program, the electronic device can obtain a video player or software with comprehensive functions, good compatibility and stability, and then perform diverse picture playing and processing functions through the video player or software, improving the problems of high development cost and long development cycle existing in re-developing a player in the prior art.

[0178] Correspondingly, the embodiments of the present application further provide a computer device, which can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant (Personal Digital Assistant, PDA), etc.

[0179] As Figure 4 shown, Figure 4 is a schematic structural diagram of the computer device provided by the embodiments of the present application. The computer device 400 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory and executable on the processor. Among them, the processor 401 is electrically connected to the memory 402. Those skilled in the art can understand that the structural diagram of the computer device shown in the figure does not limit the computer device, and it may include more or fewer components than shown in the figure, or combine some components, or arrange different components.

[0180] The processor 401 is the control center of the computer device 400, connecting various parts of the entire computer device 400 through various interfaces and circuits. By running or loading software programs and / or modules stored in the memory 402, and invoking the data stored in the memory 402, it executes various functions of the computer device 400 and processes data, thereby monitoring the computer device 400 as a whole.

[0181] In the embodiment of the present application, the processor 401 in the computer device 400 will load the instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 will run the application programs stored in the memory 402 to implement various functions:

[0182] Using a custom picture reading class, obtain the file path of the picture to be played and the duration logic of the picture to be played from the custom picture material class;

[0183] Using a custom picture reading class, according to the file path of the picture to be played, obtain the picture data of the picture to be played, and transmit the picture data to the custom picture rendering class;

[0184] Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class;

[0185] Using the custom picture rendering class, according to the duration logic, the picture reading logic, and the picture data obtained from the file path, implement the playback of the picture to be played.

[0186] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.

[0187] Optionally, as Figure 4 shown, the computer device 400 further includes: a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. Among them, the processor 401 is electrically connected to the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407 respectively. Those skilled in the art can understand that Figure 4 the computer device structure shown in

[0188] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 401, and can receive and execute the commands sent by the processor 401. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event. Subsequently, the processor 401 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 406 to implement the input function.

[0189] In the embodiments of the present application, the processor 401 executes a game application to generate a graphical user interface on the touch display screen 403. The virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 403 is used to present the graphical user interface and receive operation instructions generated by a user acting on the graphical user interface.

[0190] The radio frequency circuit 404 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.

[0191] The audio circuit 405 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 405 can convert the received audio data into an electrical signal and transmit it to the speaker, which converts it into a sound signal for output. On the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405, converted into audio data, and then the audio data is output to the processor 401 for processing. After that, it is sent to another computer device, for example, through the radio frequency circuit 404, or the audio data is output to the memory 402 for further processing. The audio circuit 405 may also include an earphone jack to provide communication between the peripheral earphone and the computer device.

[0192] The input unit 406 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0193] The power supply 407 is used to supply power to each component of the computer device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 407 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0194] Although Figure 4 not shown in the figure, the computer device 400 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.

[0195] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0196] As can be seen from the above, the computer device provided in this embodiment can utilize an extension program to execute the picture data processing flow. The extension program of the embodiment of the present application includes multiple custom classes, and each custom class is implemented by adding custom code to the source code of the base class. The custom code involved is relatively simple and has a small size. And because the basic program in the electronic device of the embodiment of the present application has high scalability, on the basis of developing a lightweight extension program, the electronic device can obtain a video player or software with comprehensive functions, good compatibility and stability, and then execute diversified picture playing and processing functions through the video player or software, improving the problems of high development cost and long development cycle in redeveloping the player in the prior art.

[0197] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0198] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. These computer programs can be loaded by a processor to execute the steps in any one of the picture data processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:

[0199] Using a custom picture reading class, obtain the file path of the picture to be played and the duration logic of the picture to be played from a custom picture material class;

[0200] Using a custom picture reading class, obtain the picture data of the picture to be played according to the file path of the picture to be played, and transmit the picture data to a custom picture rendering class;

[0201] Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class;

[0202] Using the custom picture rendering class, realize the playback of the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

[0203] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.

[0204] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

[0205] Since the computer programs stored in the storage medium can execute the steps in any one of the picture data processing methods provided by the embodiments of the present application, the beneficial effects that can be achieved by any one of the picture data processing methods provided by the embodiments of the present application can be realized. For details, refer to the previous embodiments, which will not be elaborated here.

[0206] The above has introduced in detail a method, device, storage medium and computer device for processing picture data provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A method for processing picture data, characterized in that, Applied to an electronic device, the electronic device uses an extension program to execute an image data processing flow, and the extension program includes a custom image rendering class, a custom image material class, and a custom image reading class; The method includes: Using the custom image reading class, obtain the file path of the image to be played and the duration logic of the image to be played from the custom image material class; Using the custom image reading class, obtain the image data of the image to be played according to the file path of the image to be played, and transmit the image data to the custom image rendering class; Using the custom image rendering class, obtain the image reading logic and the duration logic from the custom image reading class; Using the custom image rendering class, implement the playback of the image to be played according to the duration logic, the image reading logic, and the image data obtained from the file path.

2. The method according to claim 1, wherein The extension program further includes a custom single-frame timeline class; The using the custom image rendering class to implement the playback of the image to be played according to the duration logic, the image reading logic, and the image data obtained from the file path includes: Using the custom single-frame timeline class to obtain the playback logic of the image data; Using the custom image rendering class, implement the playback of the image to be played according to the duration logic, the image reading logic, the image data obtained from the file path, and the playback logic.

3. The method according to claim 2, wherein Before using the custom image reading class to obtain the file path of the image to be played from the custom image material class, the method further includes: In response to a first creation operation on the custom image material class, create the custom image material class on the basis of the media material class; wherein, the custom image material class is used to define the file path of the image to be played and the duration logic of the image to be played.

4. The method according to claim 3, wherein After the creating the custom image material class on the basis of the media material class in response to the first creation operation on the custom image material class, the method further includes: Create a custom image frame class based on the custom image material class, wherein the custom image frame class is used to create the custom image reading class, and the custom image reading class is used to define the image reading logic.

5. The method according to claim 4, characterized in that, After the creating the custom image frame class based on the custom image material class, the method further includes: In response to a second creation operation on the custom image reading class, create the custom image reading class on the basis of the custom image frame class and on the basis of the material sampling class.

6. The method according to claim 3, wherein After the creating the custom image material class on the basis of the media material class in response to the first creation operation on the custom image material class, the method further includes: Create the custom single-frame timeline class based on the custom image material class, wherein the custom single-frame timeline class is used to define the playback logic.

7. The method according to claim 1, characterized in that Before using the custom image rendering class to obtain the image reading logic and the duration logic from the custom image reading class, the method further includes: In response to a third creation operation on the custom image rendering class, the custom image rendering class is created based on the rendering class; wherein, the custom image rendering class is used to define the drawing logic of the image data, and the drawing logic is used to present the image corresponding to the image data on the display interface.

8. The method according to any one of claims 1 to 7, characterized in that The method further includes: In response to a fourth creation operation on the custom player class, the custom player class is created based on the player class; wherein, the custom player class is used to add each of the extension programs to the corresponding basic program.

9. The method according to claim 1, wherein The method further includes: In response to a call operation on the open graphics library, the open graphics library is used to call a custom rendering component; Obtain the frame buffer object of the to-be-played picture; Based on the custom rendering component, process the frame buffer object to obtain a frame texture result; Bind the frame texture result to the target frame of the target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture.

10. The method according to claim 9, wherein The processing of the frame buffer object includes: According to a preset screen ratio, rotation direction, and curtain algorithm, render the first texture of the frame buffer object to obtain a first texture result, where the first texture result is a frame buffer object with the first texture; According to a preset beauty algorithm and filter algorithm, render the first texture result to obtain a second texture result, where the second texture result is a frame buffer object with a second texture effect; According to a preset sticker adding algorithm and text adding algorithm, render the second texture result to obtain a third texture result, where the third texture result is a frame buffer object with a third texture effect; According to a preset transition algorithm, render the third texture result to obtain a fourth texture result, where the fourth texture result is a frame buffer object with a fourth texture effect, and the fourth texture result is the frame texture result.

11. An image data processing device, characterized in that, Applied to an electronic device, the electronic device uses an extension program to execute an image data processing flow, and the extension program includes a custom image rendering class, a custom image material class, and a custom image reading class; The device includes: A first obtaining unit, configured to use the custom image reading class to obtain the file path of the to-be-played picture and the duration logic of the to-be-played picture from the custom image material class; A second obtaining unit, configured to use the custom image reading class to obtain the image data of the to-be-played picture according to the file path of the to-be-played picture, and transmit the image data to the custom image rendering class; A third obtaining unit, configured to use the custom image rendering class to obtain the image reading logic and the duration logic from the custom image reading class; An image playing unit, configured to use the custom image rendering class to implement the playing of the to-be-played picture according to the duration logic, the image reading logic, and the image data obtained from the file path.

12. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores multiple instructions; the processor loads the instructions from the memory to execute the steps in the picture data processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the picture data processing method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Integrated panorama player

    CN108289231A

  • Frame animation realization method and apparatus, electronic device and computer-readable storage medium

    WO2019214615A1