[go: up one dir, main page]

CN114723871A - Image data processing method, device, electronic device and storage medium - Google Patents

Image data processing method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114723871A
CN114723871A CN202210351143.1A CN202210351143A CN114723871A CN 114723871 A CN114723871 A CN 114723871A CN 202210351143 A CN202210351143 A CN 202210351143A CN 114723871 A CN114723871 A CN 114723871A
Authority
CN
China
Prior art keywords
picture
class
custom
played
logic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210351143.1A
Other languages
Chinese (zh)
Other versions
CN114723871B (en
Inventor
梅立琴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210351143.1A priority Critical patent/CN114723871B/en
Publication of CN114723871A publication Critical patent/CN114723871A/en
Application granted granted Critical
Publication of CN114723871B publication Critical patent/CN114723871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Geometry (AREA)
  • Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本申请实施例公开了图片数据处理方法、装置、电子设备和存储介质;应用于电子设备,电子设备利用扩展程序执行图片数据处理流程;该方法包括:利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及待播放图片的时长逻辑;利用自定义图片读取类,根据待播放图片的文件路径,获取待播放图片的图片数据,并将图片数据传输给自定义图片渲染类;利用自定义图片渲染类,从自定义图片读取类获取图片读取逻辑和所述时长逻辑;利用自定义图片渲染类,根据时长逻辑、图片读取逻辑、以及从文件路径获取到的图片数据,实现待播放图片的播放。从而能够通过轻量级的扩展程序,改善重新开发播放器存在的开发成本较高、开发周期较长的问题。

Figure 202210351143

The embodiment of the present application discloses a picture data processing method, device, electronic device, and storage medium; when applied to electronic equipment, the electronic device uses an extension program to execute a picture data processing process; the method includes: using a custom picture reading class, from a custom picture The picture material class obtains the file path of the picture to be played and the duration logic of the picture to be played; uses 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 transmits the picture data to the self-defined picture material class. Define the 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, according to the duration logic, picture reading logic, and from the file path The obtained picture data realizes the playback of the picture to be played. Therefore, the problems of high development cost and long development cycle existing in the re-development of the player can be improved through a lightweight extension program.

Figure 202210351143

Description

图片数据处理方法、装置、电子设备和存储介质Image data processing method, device, electronic device and storage medium

技术领域technical field

本申请涉及计算机领域,具体涉及图片数据处理方法、装置、电子设备和存储介质。The present application relates to the field of computers, and in particular, to a picture data processing method, apparatus, electronic device, and storage medium.

背景技术Background technique

随着用户对视频和图片的观看和使用需求日益增加,现有的视频播放器通常都具有较为完善的功能,例如将图片以视频形式播放、对播放中的图片进行自由剪辑和美化等功能。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 as videos, and freely editing and beautifying the pictures being played.

然而,现有技术中若要令视频播放器既具备播放视频的功能,又具备播放图片的功能,通常需要重新开发一个既能够播放视频又能够播放图片的播放器,而重新开发上述播放器的开发成本较高、开发周期较长。However, in the prior art, if a video player is to have both the function of playing video and the function of playing pictures, it is usually necessary to re-develop a player that can play both videos and pictures, and re-develop the above-mentioned player The development cost is high and the development cycle is long.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供图片数据处理方法、装置、电子设备和存储介质,可以改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。The embodiments of the present application provide a picture data processing method, apparatus, electronic device, and storage medium, which can improve the problems of high development cost and long development cycle in the prior art of re-developed players.

本申请实施例提供一种图像数据处理方法,应用于电子设备,所述电子设备利用扩展程序执行图片数据处理流程,所述扩展程序包括自定义图片渲染类、自定义图片素材类和自定义图片读取类,该方法包括:利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。An embodiment of the present application provides an image data processing method, which is applied to an electronic device. The electronic device uses an extension program to perform a picture data processing process, and the extension program includes a custom picture rendering class, a custom picture material class, and a custom picture A reading class, 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 to-be-played picture from the custom picture material class; using the custom picture reading class, according to the Describe 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 a custom picture rendering class; use the custom picture rendering class to read the class from the custom picture Obtain the picture reading logic and the duration logic; use the custom picture rendering class to implement the to-be-played logic according to the duration logic, the picture reading logic, and the picture data obtained from the file path playback of pictures.

本申请实施例还提供一种图像数据处理装置,包括:The embodiment of the present application also provides an image data processing device, including:

第一获取单元,用于利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;第二获取单元,用于利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;第三获取单元,用于利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;图片播放单元,用于利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。The first obtaining unit is used to 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; the second obtaining unit is used to use the custom picture The reading class, according to the file path of the picture to be played, obtains the picture data of the picture to be played, and transmits the picture data to a custom picture rendering class; the third obtaining unit is used for using the custom picture The picture rendering class obtains the picture reading logic and the duration logic from the custom picture reading class; the picture playing unit is used for using the custom picture rendering class to read the picture according to the duration logic and the picture The logic and the picture data obtained from the file path realize the playback of the picture to be played.

在一些实施例中,所述扩展程序还包括自定义单帧时间线类;所述图片播放单元,具体用于:In some embodiments, the extension program further includes a custom single-frame timeline class; the picture playback unit is specifically used for:

利用所述自定义单帧时间线类得到所述图片数据的播放逻辑;Use the custom single-frame timeline class to obtain the playback logic of the picture data;

利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。Using the custom picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, the to-be-played picture is played.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第一创建单元,响应于对所述自定义图片素材类的第一创建操作,用于在媒体素材类的基础上创建所述自定义图片素材类;其中,所述自定义图片素材类用于定义所述待播放图片的文件路径,以及所述待播放图片的时长逻辑。A first creation unit, in response to a first creation operation on the custom picture material class, configured to create the custom picture material class on the basis of the media material class; wherein the custom picture material class is used for Define the file path of the to-be-played picture and the duration logic of the to-be-played picture.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义图片帧类创建单元,用于基于所述自定义图片素材类创建自定义图片帧类,其中,所述自定义图片帧类用于创建所述自定义图片读取类,所述自定义图片读取类用于定义所述图片读取逻辑。A custom picture frame class creation unit is used to create a custom picture frame class based on the custom picture material class, wherein the custom picture frame class is used to create the custom picture reading class, and the custom picture frame class is used to create the custom picture frame class. The picture reading class is used to define the picture reading logic.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第二创建单元,响应于对所述自定义图片读取类的第二创建操作,用于基于所述自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。The second creation unit, in response to the second creation operation on the custom picture reading class, is configured to create the custom picture reading class on the basis of the material sampling class based on the custom picture frame class.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义单帧时间线类创建单元,用于基于所述自定义图片素材类创建所述自定义单帧时间线类,其中,所述自定义单帧时间线类用于定义所述播放逻辑。A custom single-frame timeline class creation unit, configured to create the 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.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第三创建单元,响应于对所述自定义图片渲染类的第三创建操作,用于在所述渲染类的基础上创建所述自定义图片渲染类;其中,所述自定义图片渲染类用于定义所述图片数据的绘制逻辑,所述绘制逻辑用于将所述图片数据对应的图片呈现于显示界面。A third creation unit, in response to a third creation operation on the custom picture rendering class, is configured to create the custom picture rendering class on the basis of the rendering class; wherein, the custom picture rendering class uses The drawing logic 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.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义播放器类创建单元,响应于对自定义播放器类的第四创建操作,在播放器类的基础上创建所述自定义播放器类;其中,所述自定义播放器类用于将每个所述扩展程序添加至对应的基础程序中。The custom player class creation unit, in response to the 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 for adding Each of the extension programs is added to the corresponding basic program.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

渲染调用单元,响应于对开放图形库的调用操作,用于利用所述开放图形库,调用自定义渲染组件;A rendering calling unit, in response to the calling operation to the open graphics library, for using the open graphics library to call a custom rendering component;

帧缓冲对象获取单元,用于获取所述待播放图片的帧缓冲对象;a frame buffer object acquisition unit, used for acquiring the frame buffer object of the picture to be played;

帧纹理结果获取单元,用于基于所述自定义渲染组件,对所述帧缓冲对象进行处理,得到帧纹理结果;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;

绑定单元,用于将所述帧纹理结果与所述电子设备输出的目标视频的目标帧绑定,所述目标视频为对所述待播放图片进行播放而生成的视频。A binding unit, configured to bind the frame texture result with a target frame of a target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture.

在一些实施例中,所述帧纹理结果获取单元,还包括:In some embodiments, the frame texture result acquisition unit further includes:

第一纹理结果子单元,用于预设的画面比例、旋转方向和幕布算法,渲染所述帧缓冲对象的第一纹理,得到第一纹理结果,所述第一纹理结果为带有所述第一纹理的帧缓冲对象;The first texture result sub-unit is used to render the first texture of the frame buffer object with the preset aspect ratio, rotation direction and curtain algorithm, and obtain the first texture result, and the first texture result is with the first texture result. A textured framebuffer object;

第二纹理结果子单元,用于根据预设的美颜算法和滤镜算法,渲染所述第一纹理结果,得到第二纹理结果,所述第二纹理结果为带有第二纹理效果的帧缓冲对象;The second texture result subunit is used to render the first texture result according to the preset beauty algorithm and filter algorithm to obtain a second texture result, and the second texture result is a frame with the second texture effect buffer object;

第三纹理结果子单元,用于根据预设的贴纸添加算法和文字添加算法,渲染所述第二纹理结果,得到第三纹理结果,所述第三纹理结果为带有第三纹理效果的帧缓冲对象;The third texture result subunit is used to render the second texture result according to the preset sticker adding algorithm and text adding algorithm to obtain a third texture result, where the third texture result is a frame with a third texture effect buffer object;

第四纹理结果子单元,用于根据预设的转场算法,渲染所述第三纹理结果,得到第四纹理结果,所述第四纹理结果为带有第四纹理效果的帧缓冲对象,所述第四纹理结果为所述帧纹理结果。The fourth texture result subunit is used to render the third texture result according to the preset transition algorithm to obtain a fourth texture result, where the fourth texture result is a frame buffer object with a fourth texture effect, so The fourth texture result is the frame texture result.

本申请实施例还提供一种电子设备,包括存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行本申请实施例所提供的任一种图像数据处理方法中的步骤。The embodiments of the present application further provide an electronic device, including a memory storing a plurality of instructions; the processor loads the instructions from the memory to execute steps in any image data processing method provided by the embodiments of the present application .

本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行本申请实施例所提供的任一种图像数据处理方法中的步骤。Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute any image provided by the embodiments of the present application Steps in a data processing method.

在本申请中,本申请实施例的扩展程序包括多个自定义类,每个自定义类均是通过在基类的源代码中添加自定义代码实现的,涉及到的自定义代码较为简单、体量较轻。并且由于本申请实施例的电子设备中的基础程序具有较高的可扩展性,从而能够在开发出轻量级扩展程序的基础上,使得电子设备能够获取功能全面、兼容性和稳定性较好的视频播放器或软件,进而通过该视频播放器或软件执行多样化的图片播放和处理功能,改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。In the present application, the extension program of the embodiment of the present application includes a plurality of custom classes, each custom class is realized by adding custom code to the source code of the base class, and the involved custom code is relatively simple, Lightweight. And because the basic program in the electronic device of the embodiment of the present application has high scalability, the electronic device can obtain comprehensive functions, better compatibility and stability on the basis of developing a lightweight extension program. The video player or software can be used to perform various picture playback and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle in the prior art of re-development of the player.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.

图1a是本申请实施例提供的图片数据处理方法的场景示意图;1a is a schematic diagram of a scene of a picture data processing method provided by an embodiment of the present application;

图1b是本申请实施例提供的图片数据处理方法的流程示意图;FIG. 1b is a schematic flowchart of a picture data processing method provided by an embodiment of the present application;

图1c是本申请实施例提供的将待播放图片进行播放的示意图;1c is a schematic diagram of playing a picture to be played provided by an embodiment of the present application;

图1d是本申请实施例提供的对帧缓冲对象进行处理的示意图;1d is a schematic diagram of processing a frame buffer object provided by an embodiment of the present application;

图2是本申请另一实施例提供的图片数据处理方法的流程示意图;2 is a schematic flowchart of a picture data processing method provided by another embodiment of the present application;

图3是本申请实施例提供的图片数据处理装置的结构示意图;3 is a schematic structural diagram of a picture data processing apparatus provided by an embodiment of the present application;

图4是本申请实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

本申请实施例提供一种图片数据处理方法、装置、电子设备和存储介质。Embodiments of the present application provide a picture data processing method, apparatus, electronic device, and storage medium.

其中,该图片数据处理装置具体可以集成在电子设备中,该电子设备可以为终端、服务器等设备。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、或者个人电脑(Personal Computer,PC)等设备;服务器可以是单一服务器,也可以是由多个服务器组成的服务器集群。Wherein, the picture data processing apparatus may be integrated in an electronic device, and the electronic device may be a terminal, a server, or the like. The terminal may be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, or a personal computer (Personal Computer, PC) and other devices; the server may be a single server, or a server cluster composed of multiple servers.

在一些实施例中,该图片数据处理装置还可以集成在多个电子设备中,比如,图片数据处理装置可以集成在多个服务器中,由多个服务器来实现本申请的图片数据处理方法。In some embodiments, the image data processing apparatus may also be integrated into multiple electronic devices, for example, the image data processing apparatus may be integrated into multiple servers, and the image data processing method of the present application may be implemented by multiple servers.

在一些实施例中,服务器也可以以终端的形式来实现。In some embodiments, the server may also be implemented in the form of a terminal.

例如,参考图1a,上述电子设备可以利用扩展程序执行图片数据处理流程,所述扩展程序包括自定义图片渲染类、自定义图片素材类和自定义图片读取类上述的电子设备可以执行如下方法:利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。For example, referring to FIG. 1a, the above-mentioned electronic device can use an extension program to execute a picture data processing flow, and 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 : 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; use the custom picture reading class to obtain the file path of the picture to be played according to the custom picture reading class , obtain the picture data 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 all parameters from the custom picture reading class The duration logic; using the custom picture rendering class, the playback of the to-be-played picture is implemented according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

以下分别进行详细说明。需说明的是,以下实施例的序号不作为对实施例优选顺序的限定。Each of them will be described in detail below. It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

本公开实施例首先旨在提供了一种图片数据处理方法,通过在电子设备中添加扩展程序执行图片数据处理流程,而扩展程序包括多个轻量级自定义类。故本方案可以在轻量级开发的基础上,实现多样化的图片播放功能。The embodiments of the present disclosure firstly aim to provide a picture data processing method. The picture data processing flow is performed by adding an extension program in an electronic device, and the extension program includes a plurality of lightweight custom classes. Therefore, this solution can realize diversified picture playback functions on the basis of lightweight development.

在本申请实施例中,该电子设备可以是具有一些基础功能的视频播放器,例如基础功能可以包括视频裁剪和素材拼接等,以满足用户对视频、图片的基础观看和处理需求。In this embodiment of the present application, the electronic device may be a video player with some basic functions, for example, the basic functions may include video cropping and material splicing, etc., to meet the user's basic viewing and processing requirements for videos and pictures.

由于该电子设备是添加扩展程序后实现图片数据处理流程的,因此该电子设备可以具备较高的可扩展性,例如该电子设备可以是原生的仅支持视频播放而不支持图片播放的视频播放器,例如,exoplayer。其中,exoplayer可实现视频裁剪、素材拼接和视频变速的功能。可以理解,在exoplayer中开源数据的基础上,添加自定义扩展程序,相当于在安卓的原生数据库中进行自定义扩展,从而能够在轻量级的开发环境下对该电子设备进行高效率、低成本扩展,得到稳定性和兼容性较高的电子设备。需要说明的是,电子设备还可以是其他可扩展性较高的视频播放器或同类软/硬件,电子设备的类型或具体型号不应该理解为是对本申请的限制。Since the electronic device realizes the picture data processing process after adding an 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 but not picture playback. , for example, exoplayer. Among them, exoplayer can realize the functions of video cropping, material splicing and video speed change. It can be understood that adding a custom extension program on the basis of the open source data in exoplayer is equivalent to customizing the extension in the native database of Android, so that the electronic device can be implemented in a lightweight development environment with high efficiency and low cost. Cost expansion to obtain electronic equipment with higher stability and compatibility. It should be noted that the electronic device may also be other highly scalable video players or similar software/hardware, and the type or specific model of the electronic device should not be construed as a limitation on the present application.

如图1b所示,该图片数据处理方法的具体流程可以如下:As shown in Figure 1b, the specific flow of the image data processing method may be as follows:

110、利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑。110. 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.

其中,自定义图片素材类(ImageMediaSource)可以是在exoplayer的媒体素材类(MediaSource)的基础上扩展出的自定义类,也即,exoplayer的媒体素材类可以作为一个可继承的基类,可以在该基类上扩展出一个自定义的可实现类。自定义图片读取类(ImageSampleStreamImpl)可以是在素材取样类(SampleStream)的基础上扩展出的自定义类。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, the media material class of exoplayer can be used as an inheritable base class, which can be used in This base class extends a custom implementable class. The custom image reading class (ImageSampleStreamImpl) can be a custom class extended on the basis of the material sampling class (SampleStream).

待播放图片是指将图片以视频形式进行播放的目标图片,待播放图片的文件路径是指待播放图片的存储路径,待播放图片的时长逻辑是指定义一个编程逻辑,使得可以对每张待播放图片被播放的时长进行调节。The picture to be played refers to the target picture to play the picture in the form of a video, the file path of the picture to be played refers to the storage path of the picture to be played, and the duration logic of the picture to be played refers to defining a programming logic so that each Adjust the length of time that the playback picture is played.

可选地,在一种具体实施方式中,自定义图片素材类可以用于定义待播放图片的文件路径。可以理解,由于exoplayer不具有图片播放功能,使其无法读取和解码图片数据,exoplayer的媒体素材类也就不存在获取图片数据文件路径的逻辑。因此可以通过自定义图片素材类对媒体素材类进行扩展,定义出能够获取图片待播放图片的文件路径的逻辑,使得exoplayer在运行时可以对自定义图片素材类进行解析,调用自定义图片素材类,识别出待播放图片的文件路径。其中,对于有多个文件路径的待播放图片,即存储于多个位置的待播放图片,可以获取该待播放图片的全部文件路径,以实现文件路径获取的全面性。Optionally, in a specific implementation manner, the custom picture material class may be used to define the file path of the picture to be played. It can be understood that because exoplayer does not have the function of playing pictures, it cannot read and decode picture data, and there is no logic to obtain the file path of picture data in the media material class of exoplayer. Therefore, the media material class can be extended through the custom picture material class, and the logic that can obtain the file path of the picture to be played can be defined, so that exoplayer can parse the custom picture material class at runtime and call the custom picture material class. to identify the file path of the picture to be played. Wherein, for a to-be-played picture with multiple file paths, that is, a to-be-played picture stored in multiple locations, all file paths of the to-be-played picture can be acquired, so as to achieve comprehensive file path acquisition.

可选地,自定义图片素材类还可以用于定义待播放图片的时长逻辑。可以理解,图片与视频最大的不同在于图片是静态的,而视频是动态的,因此需要在媒体素材类的基础上,扩展出对图片的解码和播放的相关逻辑。可以通过自定义图片素材类对媒体素材类进行扩展,定义出待播放图片的时长逻辑,使得exoplayer在运行时可以对自定义图片素材类进行解析,调用自定义图片素材类,对每张待播放图片被播放的时长进行调节。例如用户可以通过exoplayer预设每张待播放图片被播放的时长,例如1秒、2秒、10秒等。其中,时长逻辑中可以将待播放图片被播放的时长精确到毫秒级别,使得添加时长逻辑后,待播放图片的具体时长可以根据需求设定。Optionally, the custom picture material class can also be used to define the duration logic of the picture to be played. It can be understood that the biggest difference between pictures and videos is that pictures are static, while videos are dynamic. Therefore, it is necessary to extend the relevant logic for decoding and playing pictures based on the media material class. The media material class can be extended through the custom picture material class to define the duration logic of the picture to be played, so that exoplayer can parse the custom picture material class at runtime, call the custom picture material class, and perform each picture to be played. Adjust the length of time the picture is played. For example, the user can preset the playing time of each picture to be played through exoplayer, such as 1 second, 2 seconds, 10 seconds, etc. Among them, in the duration logic, the duration of the to-be-played picture to be played can be accurate to the millisecond level, so that after adding the duration logic, the specific duration of the to-be-played picture can be set as required.

又例如,用户可以通过exoplayer预设每张待播放图片在视频中占用的帧数,例如12帧、24帧等。由于视频数据可以通过显示端的刷新率计算出每秒播放的帧数,例如每秒12帧、每秒24帧等,使得待播放的图片可以结合显示端的刷新率计算出被播放的时长。需要说明是是,待播放图片的具体播放时长不应该理解为是对本申请的限制。For another example, the user can preset the number of frames occupied by each picture to be played in the video through exoplayer, such as 12 frames, 24 frames, and so on. Since the video data can calculate the number of frames played per second through the refresh rate of the display terminal, such as 12 frames per second, 24 frames per second, etc., the playing time of the picture to be played can be calculated based on the refresh rate of the display terminal. It should be noted that, the specific playback duration of the picture to be played should not be construed as a limitation on this application.

详情请参见图1c,图1c示出了播放图片的播放界面。可以看出,在第一时刻下,播放界面中在第一秒显示待播放图片。在第二时刻下,播放界面中仍显示同样的待播放图片,因此该待播放图片的播放时长至少为5秒。可选地,在图1c的播放界面中,该时长为10秒的视频中,可以只播放一张待播放图片,也可以播放多张待播放图片,播放待播放图片的具体数量不应该理解为是对本申请的限制。For details, please refer to FIG. 1c, which shows a playback interface for playing pictures. It can be seen that, at the first moment, the picture to be played is displayed in the playback interface for the first second. At the second moment, the same picture to be played is still displayed in the playback interface, so the playback duration of the picture to be played is at least 5 seconds. Optionally, in the playback interface of Figure 1c, in the video with a duration of 10 seconds, only one picture to be played can be played, or multiple pictures to be played can be played, and the specific number of pictures to be played should not be interpreted as is a limitation of this application.

可选地,在步骤110之前还包括:响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类。Optionally, before step 110, the method further includes: in response to the first creation operation on the custom picture material class, creating the custom picture material class on the basis of the media material class.

其中,自定义图片素材类可以用于定义所述待播放图片的文件路径,以及所述待播放图片的时长逻辑。The custom picture material class may be used to define the file path of the picture to be played and the duration logic of the picture to be played.

可以理解,媒体素材类可以作为一个可继承的基类,自定义媒体素材类可以在该基类上扩展出一个自定义的可实现类。需要说明的是,上述对基类扩展出自定义类,是通过在基类的源代码中添加自定义代码实现的。例如可以在exoplayer的播放类中扩展出自定义播放类,使得exoplayer可以实现其他播放功能,例如可以将以下自定义代码添加到exoplayer的播放类中,使得exoplayer可以实现手势播放功能,例如该自定义代码可以为: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 the base class. It should be noted that the above-mentioned extension of the custom class to the base class is realized by adding custom code to the source code of the base class. For example, a custom playback class can be extended in 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, so that exoplayer can realize the gesture playback function, such as this custom code Can be:

ManualPlayerexoPlayerManager=new ManualPlayer(this,R.id.exo_play_context_id,newDataSource(this))。ManualPlayer exoPlayerManager=new ManualPlayer(this, R.id.exo_play_context_id, newDataSource(this)).

应当理解,在本申请实施例中,可以将与定义待播放图片的文件路径,以及待播放图片的时长逻辑相关的代码添加至对应的基类,例如添加至exoplayer的媒体素材类中,以实现在媒体素材类的基础上创建自定义图片素材类。It should be understood that, in this embodiment of the present application, the code related to the definition of the file path of the picture to be played and the logic related to the duration of the picture to be played can be added to the corresponding base class, for example, to the media material class of exoplayer, so as to realize Create a custom picture material class based on the media material class.

可选地,在响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类之后,还包括: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, the method further includes:

基于所述自定义图片素材类创建自定义图片帧类,其中,所述自定义图片帧类用于创建所述自定义图片读取类,所述自定义图片读取类用于定义所述图片读取逻辑。Create a custom picture frame class based on the custom picture material class, wherein 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 read logic.

其中,自定义图片帧类(ImageMediaPeriod)可以基于对exoplayer的媒体帧类(MediaPeriod)扩展得到,也即,自定义图片帧类对应的代码是继承自媒体帧类。The custom picture frame class (ImageMediaPeriod) can be obtained by extending 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.

可选地,在一具体实施方式中,可以基于自定义图片素材类创建自定义图片帧类。可以理解,在程序执行阶段,exoplayer可以通过解析自定义图片素材类,调用自定义图片素材类,来创建预先写入的自定义图片帧类。也即,可以预先定义好自定义图片帧类的创建逻辑,是伴随对自定义图片素材类进行解析而实现的。Optionally, in a specific implementation, a custom picture frame class may be created based on a custom picture material class. It can be understood that in the program execution stage, exoplayer can create a 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 pre-defined, which is realized by parsing the custom picture material class.

自定义图片帧类可以用于创建自定义图片读取类,应当理解,在程序执行阶段,exoplayer可以通过解析自定义图片帧类,来创建预先写入的自定义图片读取类。也即,可以预先定义好自定义图片读取类的创建逻辑,是伴随对自定义图片帧类进行解析而实现的。The custom picture frame class can be used to create a custom picture reading class. It should be understood that in 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 pre-defined, which is realized by parsing the custom picture frame class.

其中,自定义图片读取类可以用于定义图片读取逻辑。由于exoplayer不具备读取图片数据的功能,使得exoplayer即使可以通过解析自定义媒体素材类获取图片的文件路径,也无法对图片进行读取,即无法实质性地获取到待播放图片。可以理解,图片读取逻辑可以定义出电子设备能够从图片的文件路径中读取到对应的图片,以实现对图片的实质性获取。例如,可以对自定义图片读取类进行解析,调用自定义图片读取类,使得exoplayer可以从待播放图片的文件路径中读取到待播放图片,将读取到的待播放图片进行播放或后续其它处理。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, so as to realize the substantial acquisition of the picture. For example, the custom picture reading class can be parsed, and the custom picture reading class can be 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 Follow-up other processing.

可选地,在所述基于所述自定义图片素材类创建自定义图片帧类之后,还包括:Optionally, after creating a custom picture frame class based on the custom picture material class, the method further includes:

响应于对所述自定义图片读取类的第二创建操作,基于所述自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。In response to the second creation operation on the custom picture reading class, the custom picture reading class is created on the basis of the material sampling class based on the custom picture frame class.

由于自定义图片读取类是在素材取样类的基础上扩展出的自定义类,因此素材取样类可以作为自定义图片读取类的基类,自定义图片读取类可以为素材取样类的子类。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 the material sampling class. Subclass.

可选地,可以基于自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。可以理解,在程序执行阶段,exoplayer可以通过解析自定义图片帧类,在素材取样类上创建出素材取样类的子类,以在素材取样类的基础上写入自定义图片读取类。也即,可以预先定义好自定义图片读取类的创建逻辑,是伴随对自定义图片帧类进行解析后扩展素材取样流而实现的。Optionally, the custom picture reading class may be created on the basis of a material sampling class based on a custom picture frame class. It can be understood that in the program execution stage, 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 pre-defined, which is realized by expanding the material sampling stream after parsing the custom picture frame class.

可选地,在所述响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类之后,还包括:Optionally, after the custom picture material class is created on the basis of the media material class in response to the first creation operation on the custom picture material class, the method further includes:

基于所述自定义图片素材类创建自定义单帧时间线类,其中,所述自定义单帧时间线类用于定义所述播放逻辑。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.

其中,自定义单帧时间线类(SinglePeriodTimeline)扩展自exoplayer的时间线类(Timeline)。可以理解,由于自定义单帧时间线类是基于自定义图片素材类创建的,因此在程序执行阶段,exoplayer可以通过解析自定义图片素材类,调用自定义图片素材类,来创建自定义单帧时间线类。也即,可以预先定义好自定义单帧时间线类的创建逻辑,是伴随对自定义图片素材类进行解析而实现的。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 picture material class, exoplayer can create a custom single frame by parsing the custom picture material class and calling the custom picture material class during the program execution stage. Timeline class. That is, the creation logic of the custom single-frame timeline class can be pre-defined, which is realized by parsing the custom picture material class.

其中,时间线类还用于定义存放视频解码帧的逻辑,例如可以将多个视频解码帧存放在一个队列中。由于自定义单帧时间线类扩展自时间线类,因此自定义单帧时间线类可以从存放视频解码帧的逻辑中,扩展出存放图片解码帧的逻辑,用于生成可存放图片解码帧的队列。其中,图片解码帧可以是将图片数据作为视频播放中的一帧,以使视频解码出对应的帧数据。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 decoded picture frames from the logic for storing decoded video frames, and is used to generate a frame that can store decoded picture frames. queue. The picture decoding frame may be that the picture data is used as a frame in the video playback, so that the video decodes the corresponding frame data.

其中,本申请实施例的播放逻辑是指播放图片时用到的相关逻辑。可选地,播放逻辑可以包括定义待播放图片的播放模式,例如,可以将待播放图片在某时间段下进行顺序播放、循环播放或倒序播放等。The play logic in the embodiment of the present application refers to related logic used when playing pictures. Optionally, the playback logic may include defining a playback mode of the pictures to be played, for example, the pictures to be played may be played sequentially, in a loop, or in reverse order within a certain period of time.

可选地,播放逻辑还可以包括定义待播放图片的起始和终止时间,例如将待播放图片设置在第3秒开始播放,在第5秒结束播放。Optionally, the playback logic may further include defining the start and end times of the picture to be played, for example, setting the picture to be played to start playing at the 3rd second and end the playback at the 5th second.

需要说明的是,与待播放图片的时长逻辑相比,区别于时长概念,播放逻辑重点在于突出待播放图片与时刻之间的逻辑,更着重于体现出某个时刻下如何播放该待播放图片。It should be noted that, compared with the duration logic of the picture to be played, it is different from the concept of duration. The focus of the playback logic is to highlight the logic between the picture to be played and the moment, and it is more focused on how to play the picture to be played at a certain moment. .

120、利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类。120. Use a custom picture reading class to acquire the picture data of the to-be-played picture according to the file path of the to-be-played picture, and transmit the picture data to the custom picture rendering class.

其中,自定义图片渲染类(ImageRenderer)可以扩展自exoplayer的渲染类(Renderer),渲染类可以用于对视频数据进行解码,绘制出视频画面的每一帧,也即,将视频画面的每一帧解码输出到显示界面上。Among them, the custom image rendering class (ImageRenderer) can be extended from the rendering class (Renderer) of exoplayer, and the rendering class can be used to decode the video data and draw each frame of the video picture, that is, to convert each frame of the video picture The frame decoding is output to the display interface.

可以理解,在程序执行阶段,电子设备可以通过解析自定义图片素材类,调用自定义图片素材类,先获取待播放图片的文件路径。再通过解析自定义图片读取类,调用自定义图片读取类,来读取文件路径中的图片数据,并将图片数据传输给自定义图片渲染类。It can be understood that in the program execution stage, the electronic device can first obtain the file path of the picture to be played by parsing the custom picture material class and calling the custom picture material class. Then, by parsing the custom image reading class, call the custom image reading class to read the image data in the file path, and transfer the image data to the custom image rendering class.

130、利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑。130. Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class.

可以理解,由于自定义图片渲染类可以通过自定义图片读取类的传输得到图片数据,因此可以通过解析自定义图片读取类,调用自定义图片读取类,使得自定义图片渲染类可以获取图片读取逻辑和时长逻辑。It can be understood that since the custom image rendering class can obtain image data through the transmission of the custom image reading class, the custom image reading class can be called by parsing the custom image reading class, so that the custom image rendering class can be obtained. Image reading logic and duration logic.

140、利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。140. Use the custom picture rendering class to implement the playback of the to-be-played picture according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

可选地,在一具体实施方式中,电子设备可以通过解析自定义图片素材类和自定义图片读取类,来调用自定义图片素材类和自定义图片读取类,获取图片数据的文件路径、时长逻辑和读取逻辑。在执行时,电子设备可以基于以上逻辑,从该文件路径中读取待播放图片的图片数据,调整每个待播放图片的时长,并调用自定义图片渲染类绘制图片数据,在该时长下播放对应的待播放图片。Optionally, in a specific implementation manner, the electronic device can call the custom picture material class and the custom picture reading class by parsing the custom picture material class and the custom picture reading class, and obtain the file path of the picture data. , duration logic and read logic. During execution, the electronic device can, based on the above logic, read the picture data of the picture to be played from the file path, adjust the duration of each picture to be played, and call the custom picture rendering class to draw the picture data, and play it under the duration The corresponding picture to be played.

所述扩展程序还包括自定义单帧时间线类,可选地,步骤140还可以包括如下步骤141和142:The extension program also includes a custom single-frame timeline class. Optionally, step 140 may further include the following steps 141 and 142:

141、利用所述自定义单帧时间线类得到所述图片数据的播放逻辑。141. Obtain the playback logic of the picture data by using the custom single-frame timeline class.

142、利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。142. Using the custom picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, to implement the playback of the picture to be played.

可选地,在一具体实施方式中,为实现电子设备播放图片的流畅性和功能多样性,可以解析自定义单帧时间线类,调用自定义单帧时间线类来获取待播放图片的播放逻辑,通过播放逻辑结合步骤140中提到的多个逻辑,实现待播放图片的播放。例如可以通过播放逻辑设置待播放图片的起始播放时刻、终止播放时刻、播放模式等。Optionally, in a specific implementation manner, in order to realize the fluency and functional diversity of the electronic device playing pictures, the custom single-frame timeline class can be parsed, and the custom single-frame timeline class can be called to obtain the playback of the to-be-played picture. Logic, by combining the multiple logics mentioned in step 140 with the playback logic, the playback of the picture to be played is realized. For example, the start playback time, end playback time, playback mode, etc. of the picture to be played can be set through playback logic.

可选地,在步骤142之前,还可以包括:Optionally, before step 142, it can also include:

响应于对所述自定义图片渲染类的第三创建操作,在所述渲染类的基础上创建所述自定义图片渲染类。其中,所述自定义图片渲染类用于定义所述图片数据的绘制逻辑,所述绘制逻辑用于将所述图片数据对应的图片呈现于显示界面。In response to the third creation operation on the custom picture rendering class, the custom picture rendering class is created on the basis of the rendering class. 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.

可以理解,由于渲染类可以用于对视频数据进行解码,绘制出视频画面的每一帧,也即,将视频画面的每一帧解码输出到显示界面上。相应地,自定义图片渲染类可以继承渲染类的解码能力,将图片数据作为解码输出的帧数据,也即,将图片数据解码为视频画面的每一帧,使得视频画面可以解码出待播放图片的整体图片数据,最终实现将图片数据绘制到显示界面。It can be understood that, since the rendering class can be used to decode the video data, draw each frame of the video picture, that is, decode and output each frame of the video picture to the display interface. Accordingly, the custom picture rendering class can inherit the decoding ability of the rendering class, and use the picture data as the frame data of the decoding output, that is, decode the picture data into each frame of the video picture, so that the video picture can decode the picture to be played. The overall picture data is finally realized to draw the picture data to the display interface.

可选地,本申请实施例的方法还包括:Optionally, the method of the embodiment of the present application further includes:

响应于对自定义播放器类的第四创建操作,可以在播放器类的基础上创建所述自定义播放器类;其中,所述自定义播放器类可以用于将每个所述扩展程序添加至对应的基础程序中。In response to the fourth creation operation on the custom player class, the custom player class can be created on the basis of the player class; wherein, the custom player class can be used to convert each of the extension programs. added to the corresponding basic program.

可以理解,对于以上多个自定义类,需要将自定义类添加到对应的基类中才可以实现其包含的逻辑和方法。以自定义图片素材类为例,需要将自定义图片素材类的代码添加到exoplayer的媒体素材类代码的列表下,才可以实现对媒体素材类进行扩展,创建出完整的自定义图片素材类。It can be understood that for the above multiple custom classes, it is necessary to add the custom class to the corresponding base class to implement the logic and methods contained therein. Taking the custom picture material class as an example, the code of the custom picture material class needs to be added to the list of media material class codes of exoplayer, and then the media material class can be extended to create a complete custom picture material class.

由于扩展程序可以包括以上多个自定义类,相应地,基础程序可以包括以上多个自定义类对应的基类。因此可以在播放器类的基础上创建自定义播放器类,对自定义播放器类进行解析,以调用自定义播放器类将本申请实施例的各自定义类添加至对应的基类中,创建出完整的自定义类。Since the extension program can include the above multiple custom classes, correspondingly, the base program can include the base classes corresponding to the above multiple custom classes. Therefore, a custom player class can be created on the basis of the player class, and the custom player class can be parsed to call the custom player class to add each custom class in the embodiments of the present application to the corresponding base class, and create out a complete custom class.

由上可知,本申请实施例的扩展程序包括多个自定义类,每个自定义类均是通过在基类的源代码中添加自定义代码实现的,涉及到的自定义代码较为简单、体量较轻。并且由于本申请实施例的电子设备中的基础程序具有较高的可扩展性,从而能够在开发出轻量级扩展程序的基础上,使得电子设备能够获取功能全面、兼容性和稳定性较好的视频播放器或软件,进而通过该视频播放器或软件执行多样化的图片播放和处理功能,改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。It can be seen from the above that the extension program of the embodiment of the present application includes a plurality of custom classes, and each custom class is realized by adding custom codes to the source code of the base class, and the involved custom codes are relatively simple and specific. Light weight. And because the basic program in the electronic device of the embodiment of the present application has high scalability, the electronic device can obtain comprehensive functions, better compatibility and stability on the basis of developing a lightweight extension program. The video player or software can be used to perform various picture playback and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle in the prior art of re-development of the player.

为实现电子设备能够在播放图片的过程中,对播放图片进行实时编辑,如图1d所示,可选地,本申请实施例的方法还包括:In order to realize that the electronic device can edit the playing picture in real time during the process of playing the picture, as shown in FIG. 1d , optionally, the method of the embodiment of the present application further includes:

响应于对开放图形库的调用操作,利用所述开放图形库,调用自定义渲染组件;In response to the calling operation to the open graphics library, using the open graphics library, the custom rendering component is called;

获取所述待播放图片的帧缓冲对象;obtaining the frame buffer object of the picture to be played;

基于所述自定义渲染组件,对所述帧缓冲对象进行处理,得到帧纹理结果;processing the frame buffer object based on the custom rendering component to obtain a frame texture result;

将所述帧纹理结果与所述电子设备输出的目标视频的目标帧绑定,所述目标视频为对所述待播放图片进行播放而生成的视频。Binding the frame texture result with a target frame of a target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture.

其中,开放图形库(Open Graphics Library,OpenGL)是用于渲染2D、3D矢量图形的跨语言、跨平台的应用程序编程接口(API),其可以用于提供一组统一的图形处理接口。The Open Graphics Library (OpenGL) is a cross-language and cross-platform application programming interface (API) for rendering 2D and 3D vector graphics, which can be used to provide a set of unified graphics processing interfaces.

可选地,在一具体实施方式中,可以通过解析电子设备的绘制类setVideoSurface,调用开放图形库,再通过开放图形库调用开放图形库的自定义渲染组件,使得电子设备后续可以通过该自定义渲染组件对图片数据进行渲染。其中,自定义渲染组件可以为自定义视频帧渲染组件GLSurfaceView。Optionally, in a specific implementation manner, 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 follow the custom rendering component of the open graphics library. The rendering component renders the image data. Among them, the custom rendering component can be the custom video frame rendering component GLSurfaceView.

其中,自定义视频帧渲染组件可以用于对视频帧进行渲染,并在显示界面中提供预览。在本申请实施例中,由于视频播放对象为待播放图片,因此可以通过自定义视频帧渲染组件对每一帧的图片数据进行渲染。The custom video frame rendering component can be used to render the video frame and provide a preview in the display interface. In the embodiment of the present application, since the video playback object is the picture to be played, the picture data of each frame can be rendered by using a custom video frame rendering component.

其中,帧缓冲对象(Framebuffer Object,FBO)是一个图像容器,是颜色缓存、深度缓存、模板缓存的集合。帧缓冲对象可以存储纹理(texture),纹理可以作为渲染的目标。The framebuffer object (Framebuffer Object, FBO) is an image container, which is a collection of color buffers, depth buffers, and template buffers. Framebuffer objects can store textures, and textures can be rendered targets.

可选地,在一具体实施方式中,可以通过创建的方式获取待播放图片的帧缓冲对象,在帧缓冲对象创建完成后,帧缓冲对象可以生成一个与目标视频帧对应的RGBA图像纹理,RGBA图像纹理可以与帧缓冲对象绑定。Optionally, in a specific implementation manner, the frame buffer object of the picture to be played can be obtained by creating, and after the frame buffer object is created, the frame buffer object can generate an RGBA image texture corresponding to the target video frame, RGBA Image textures can be bound to framebuffer objects.

可选地,在一具体实施方式中,可以基于自定义渲染组件,对帧缓冲对象进行处理,得到帧纹理结果。可以理解,由于帧缓冲对象与RGBA图像纹理绑定,也即,待播放图片的帧缓冲对象是存储有该RGBA图像纹理的,使得可以通过自定义渲染组件对该RGBA图像纹理进行渲染,得到帧纹理结果。Optionally, in a specific implementation manner, a frame buffer object may be processed based on a custom rendering component to obtain a frame texture result. It can be understood that because the frame buffer object is bound to the RGBA image texture, that is, the frame buffer 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, and the frame is obtained. Texture result.

可选地,对所述帧缓冲对象进行处理,还包括:Optionally, processing the frame buffer object further includes:

根据预设的画面比例、旋转方向和幕布算法,渲染所述帧缓冲对象的第一纹理,得到第一纹理结果,所述第一纹理结果为带有所述第一纹理的帧缓冲对象;Render the first texture of the frame buffer object according to the preset aspect ratio, rotation direction and curtain algorithm, and obtain a first texture result, where the first texture result is the frame buffer object with the first texture;

根据预设的美颜算法和滤镜算法,渲染所述第一纹理结果,得到第二纹理结果,所述第二纹理结果为带有第二纹理效果的帧缓冲对象;According to the preset beauty algorithm and filter algorithm, the first texture result is rendered, and the second texture result is obtained, and the second texture result is a frame buffer object with the second texture effect;

根据预设的贴纸添加算法和文字添加算法,渲染所述第二纹理结果,得到第三纹理结果,所述第三纹理结果为带有第三纹理效果的帧缓冲对象;According to the preset sticker adding algorithm and text adding algorithm, the second texture result is rendered to obtain a third texture result, and the third texture result is a frame buffer object with a third texture effect;

根据预设的转场算法,渲染所述第三纹理结果,得到第四纹理结果,所述第四纹理结果为带有第四纹理效果的帧缓冲对象,所述第四纹理结果为所述帧纹理结果。According to the preset transition algorithm, the third texture result is rendered 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.

可选地,在一具体实施方式中,可以通过预设的画面比例和旋转方向计算出视频界面的MVP矩阵。其中,MVP矩阵是开放图形库中的固有变量,通过MVP矩阵变换可以将视频界面的几何数据转变成二维坐标系,以便于后续通过自定义渲染组件对纹理中的各个点进行处理。Optionally, in a specific implementation manner, the MVP matrix of the video interface can be calculated by using a preset picture ratio and rotation direction. Among them, the MVP matrix is an inherent variable in the open graphics library. Through the MVP matrix transformation, the geometric data of the video interface can be converted into a two-dimensional coordinate system, so as to facilitate the subsequent processing of each point in the texture through the custom rendering component.

然后,可以通过幕布算法结合经MVP矩阵变换后的二位坐标系,在第一纹理上绘制幕布。其中,幕布算法可以用于绘制纯色幕布和模糊幕布,两者对应的幕布算法是不同的。对于纯色幕布,可以通过自定义渲染组件对RGBA图像纹理的四个颜色通道R、G、B、A进行赋值,得到对应的目标纯色幕布。对于模糊幕布,可以结合高斯算法计算纹理中每个像素的权重后,结合上述每个像素的权重,对所有像素中包含的颜色按加权求和的方式进行合成,从而得到一个模糊视觉效果的幕布。进一步地,再通过创建模糊幕布的半径逻辑,使得可以通过修改模糊幕布的半径值来调整模糊范围。最终,通过自定义渲染组件对第一纹理进行以上处理操作,得到第一纹理结果。Then, the curtain can be drawn on the first texture by combining the two-bit coordinate system transformed by the MVP matrix through the curtain algorithm. Among them, the curtain algorithm can be used to draw a solid color curtain and a blurred curtain, and the curtain algorithms corresponding to the two are different. For a solid color curtain, you can assign values to the four color channels R, G, B, and A of the RGBA image texture through a custom rendering component to obtain the corresponding target solid color curtain. For blurred curtains, the Gaussian algorithm can be used to calculate the weight of each pixel in the texture, and then combined with the weight of each pixel above, the colors contained in all pixels can be synthesized by weighted summation, so as to obtain a curtain with a blurry visual effect. . Further, by creating the radius logic of the blur screen, the blur range can be adjusted by modifying the radius value of the blur screen. Finally, the above processing operations are performed on the first texture through the custom rendering component to obtain the first texture result.

可选地,在一具体实施方式中,可以根据预设的美颜算法和滤镜算法,渲染所述第一纹理结果。可以理解,第一纹理结果携带有经画面比例调整、旋转方向调整和幕布算法处理后的参数,自定义渲染组件可以在此基础上继续对第一纹理结果进行渲染。可选地,自定义渲染组件可以通过在第一纹理结果对应的像素中添加美颜和滤镜的相关参数,实现对第一纹理结果执行美颜算法和滤镜算法。例如,可以添加屏幕方向、摄像头方向和渲染尺寸等参数。其中,屏幕方向是指横屏或竖屏,摄像头方向是指前置或后置。最终,可以根据渲染后的第一纹理结果,得到第二纹理结果。Optionally, in a specific implementation manner, the first texture result may be rendered according to a preset beauty algorithm and filter algorithm. It can be understood that the first texture result carries the parameters processed by the screen scale adjustment, the rotation direction adjustment and the curtain algorithm, and the custom rendering component can continue to render the first texture result on this basis. Optionally, the custom rendering component can implement the beautification algorithm and the filter algorithm on the first texture result by adding the relevant parameters of the beautification and filter to the pixels corresponding to the first texture result. For example, parameters such as screen orientation, camera orientation, and render size can be added. Among them, the screen orientation refers to the horizontal screen or the vertical screen, and the camera orientation refers to the front or rear. Finally, a second texture result can be obtained according to the rendered first texture result.

可选地,在一具体实施方式中,可以根据预设的贴纸添加算法和文字添加算法,渲染所述第二纹理结果。可选地,可以创建贴纸添加算法和文字添加算法的逻辑,例如可以将代码“stickerItem.getBitmap”添加至电子设备原程序的相关字段中,以获得对贴纸和文字设置坐标和起止时间的逻辑。可选地,自定义渲染组件可以调用水印滤镜渲染方法,在第二纹理结果上结合上述逻辑,将待添加的贴纸或文字以水印或滤镜的形式渲染到第二纹理结果上,得到第三纹理结果。Optionally, in a specific implementation manner, the second texture result may be rendered according to a preset sticker adding algorithm and text adding algorithm. Optionally, the logic of the sticker adding algorithm and the text adding algorithm can be created. For example, the code "stickerItem.getBitmap" can be added to the relevant field of the original program of the electronic device to obtain the logic of setting coordinates and start and end times for the sticker and text. Optionally, the custom rendering component can call the watermark filter rendering method, combine the above logic on the second texture result, render the sticker or text to be added on the second texture result in the form of a watermark or filter, and obtain the first texture result. Three texture results.

可选地,在一具体实施方式中,可以根据预设的转场算法,渲染所述第三纹理结果。可以理解,图片转场可以是指在图片播放的过程中,从播放前一个图片转为播放下一个图片。可选地,自定义渲染组件可以调用转场算法的相关逻辑,例如转场算法执行时间的逻辑可以为:在上一个图片数据播放的最后500ms与下一个图片数据播放中的前500ms,执行转场算法的效果。其中,转场算法的效果逻辑可以包括:转场移动、转场缩放和转场旋转,也即,在图片数据转场期间,可以对图片数据进行移动、缩放和旋转。在自定义渲染组件对第三纹理结果进行渲染,得到第四纹理结果后,可以将第四纹理结果作为帧纹理结果。Optionally, in a specific implementation manner, the third texture result may be rendered according to a preset transition algorithm. It can be understood that the picture transition may refer to switching from playing the previous picture to playing the next picture during the picture playing process. Optionally, the custom rendering component can call the related logic of the transition algorithm. For example, the logic of the execution time of the transition algorithm can be: in the last 500ms of the playback of the previous picture data and the first 500ms of the playback of the next picture data, execute the transition. The effect of the field algorithm. The effect logic of the transition algorithm may include: transition movement, transition scaling and transition rotation, that is, during the transition of the picture data, the picture data may be moved, scaled and rotated. After the custom rendering component renders the third texture result and obtains the fourth texture result, the fourth texture result may be used as the frame texture result.

可选地,在一具体实施方式中,可以将帧纹理结果与电子设备输出的目标视频的目标帧绑定,目标视频为对待播放图片进行播放而生成的视频。Optionally, in a specific implementation manner, the frame texture result can 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.

其中,电子设备可以通过调用自带的视频帧组件SurfaceView来绘制目标帧,通过将视频帧组件SurfaceView绘制的目标帧,与自定义视频帧组件GLSurfaceView渲染后的帧纹理结果相绑定,即可实现如图1c中的在播放图片的过程中对图片数据进行实时渲染的效果。Among them, the electronic device can 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 with the frame texture result rendered by the custom video frame component GLSurfaceView, this can be achieved. As shown in Figure 1c, the effect of real-time rendering of the picture data during the playback of the picture.

由上可知,在获取帧纹理结果的过程中,对每个纹理结果的处理都包含了对前一个纹理结果的处理参数,使得最终通过渲染得到的帧纹理结果包含了之前全部用到的渲染方法和逻辑,从而通过自定义渲染组件能够对待播放图片的帧缓冲数据进行全面的、多样化的渲染。并且,通过上述由难到易、逐层添加的方式,将自定义渲染组件与所需算法相结合,也减轻了对扩展程序的开发难度、提升了开发效率。It can be seen from the above that in 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 final frame texture result obtained by rendering contains all the rendering methods used before. and logic, so that the frame buffer data of the picture to be played can be comprehensively and diversifiedly rendered through the custom rendering component. In addition, by combining the custom rendering components with the required algorithms through the above-mentioned method of increasing from difficulty to easy and adding layer by layer, the development difficulty of the extension program is also reduced and the development efficiency is improved.

根据上述实施例所描述的方法,以下将作进一步详细说明。According to the methods described in the above embodiments, further detailed description will be given below.

在本实施例中,将以电子设备利用扩展程序执行图片数据处理流程为例,对本申请实施例的方法进行详细说明。In this embodiment, the method of the embodiment of the present application will be described in detail by taking the electronic device using an extension program to perform a picture data processing flow as an example.

如图2所示,一种图片数据处理方法具体流程如下:As shown in Figure 2, the specific flow of a picture data processing method is as follows:

201、响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类。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.

202、基于所述自定义图片素材类创建所述自定义单帧时间线类。202. Create the custom single-frame timeline class based on the custom picture material class.

203、利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑。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.

204、基于所述自定义图片素材类创建自定义图片帧类。204. Create a custom picture frame class based on the custom picture material class.

205、响应于对所述自定义图片读取类的第二创建操作,基于所述自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。205. In response to the 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.

206、利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类。206. Use a custom picture reading class to acquire picture data of the to-be-played picture according to the file path of the to-be-played picture, and transmit the picture data to the custom picture rendering class.

207、响应于对所述自定义图片渲染类的第三创建操作,在所述渲染类的基础上创建所述自定义图片渲染类。207. In response to the third creation operation on the custom picture rendering class, create the custom picture rendering class on the basis of the rendering class.

208、响应于对自定义播放器类的第四创建操作,在播放器类的基础上创建所述自定义播放器类。208. In response to the fourth creation operation on the custom player class, create the custom player class on the basis of the player class.

209、利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑。209. Use the custom picture rendering class to acquire the picture reading logic and the duration logic from the custom picture reading class.

210、利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。210. Using the custom picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, realize the playing of the picture to be played.

211、利用所述自定义单帧时间线类得到所述图片数据的播放逻辑。211. Obtain the playback logic of the picture data by using the custom single-frame timeline class.

212、利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。212. Using the self-defined picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, realize the playing of the picture to be played.

由上可知,本申请实施例的扩展程序包括多个自定义类,每个自定义类均是通过在基类的源代码中添加自定义代码实现的,涉及到的自定义代码较为简单、体量较轻。并且由于本申请实施例的电子设备中的基础程序具有较高的可扩展性,从而能够在开发出轻量级扩展程序的基础上,使得电子设备能够获取功能全面、兼容性和稳定性较好的视频播放器或软件,进而通过该视频播放器或软件执行多样化的图片播放和处理功能,改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。It can be seen from the above that the extension program of the embodiment of the present application includes a plurality of custom classes, and each custom class is realized by adding custom codes to the source code of the base class, and the involved custom codes are relatively simple and specific. Light weight. And because the basic program in the electronic device of the embodiment of the present application has high scalability, the electronic device can obtain comprehensive functions, better compatibility and stability on the basis of developing a lightweight extension program. The video player or software can be used to perform various picture playback and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle in the prior art of re-development of the player.

为了更好地实施以上方法,本申请实施例还提供一种图片数据处理装置,该图片数据处理装置具体可以集成在电子设备中,该电子设备可以为终端。其中,终端可以为手机、平板电脑、智能蓝牙设备、笔记本电脑、个人电脑等设备。In order to better implement the above method, an embodiment of the present application further provides a picture data processing apparatus, and the picture data processing apparatus may specifically be integrated in an electronic device, and the electronic device may be a terminal. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, a personal computer, or other devices.

比如,在本实施例中,将以图片数据处理装置具体集成在终端为例,对本申请实施例的方法进行详细说明。For example, in this embodiment, the method of this embodiment of the present application will be described in detail by taking the image data processing apparatus being specifically integrated in a terminal as an example.

例如,如图3所示,该图片数据处理装置可以包括:For example, as shown in FIG. 3, the picture data processing apparatus may include:

第一获取单元301,用于利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;The first obtaining unit 301 is configured to use 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 the custom picture material class;

第二获取单元302,用于利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;The second obtaining unit 302 is configured to use a custom picture reading class, obtain 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;

第三获取单元303,用于利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;The third obtaining unit 303 is configured to use the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class;

图片播放单元304,用于利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。The picture playing unit 304 is configured to use the custom picture rendering class to play the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

在一些实施例中,所述扩展程序还包括自定义单帧时间线类;所述图片播放单元304,具体用于:In some embodiments, the extension program further includes a custom single-frame timeline class; the picture playing unit 304 is specifically used for:

利用所述自定义单帧时间线类得到所述图片数据的播放逻辑;Use the custom single-frame timeline class to obtain the playback logic of the picture data;

利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。Using the custom picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, the to-be-played picture is played.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第一创建单元,响应于对所述自定义图片素材类的第一创建操作,用于在媒体素材类的基础上创建所述自定义图片素材类;其中,所述自定义图片素材类用于定义所述待播放图片的文件路径,以及所述待播放图片的时长逻辑。A first creation unit, in response to a first creation operation on the custom picture material class, configured to create the custom picture material class on the basis of the media material class; wherein the custom picture material class is used for Define the file path of the to-be-played picture and the duration logic of the to-be-played picture.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义图片帧类创建单元,用于基于所述自定义图片素材类创建自定义图片帧类,其中,所述自定义图片帧类用于创建所述自定义图片读取类,所述自定义图片读取类用于定义所述图片读取逻辑。A custom picture frame class creation unit is used to create a custom picture frame class based on the custom picture material class, wherein the custom picture frame class is used to create the custom picture reading class, and the custom picture frame class is used to create the custom picture frame class. The picture reading class is used to define the picture reading logic.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第二创建单元,响应于对所述自定义图片读取类的第二创建操作,用于基于所述自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。The second creation unit, in response to the second creation operation on the custom picture reading class, is configured to create the custom picture reading class on the basis of the material sampling class based on the custom picture frame class.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义单帧时间线类创建单元,用于基于所述自定义图片素材类创建所述自定义单帧时间线类,其中,所述自定义单帧时间线类用于定义所述播放逻辑。A custom single-frame timeline class creation unit, configured to create the 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.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

第三创建单元,响应于对所述自定义图片渲染类的第三创建操作,用于在所述渲染类的基础上创建所述自定义图片渲染类;其中,所述自定义图片渲染类用于定义所述图片数据的绘制逻辑,所述绘制逻辑用于将所述图片数据对应的图片呈现于显示界面。A third creation unit, in response to a third creation operation on the custom picture rendering class, is configured to create the custom picture rendering class on the basis of the rendering class; wherein, the custom picture rendering class uses The drawing logic 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.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

自定义播放器类创建单元,响应于对自定义播放器类的第四创建操作,在播放器类的基础上创建所述自定义播放器类;其中,所述自定义播放器类用于将每个所述扩展程序添加至对应的基础程序中。The custom player class creation unit, in response to the 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 for adding Each of the extension programs is added to the corresponding basic program.

在一些实施例中,所述装置还包括:In some embodiments, the apparatus further includes:

渲染调用单元,响应于对开放图形库的调用操作,用于利用所述开放图形库,调用渲染组件;A rendering calling unit, in response to the calling operation to the open graphics library, for using the open graphics library to call the rendering component;

帧缓冲对象获取单元,用于获取所述待播放图片的帧缓冲对象;a frame buffer object acquisition unit, used for acquiring the frame buffer object of the picture to be played;

帧纹理结果获取单元,用于基于所述渲染组件,对所述帧缓冲对象进行处理,得到帧纹理结果;a frame texture result acquisition unit, configured to process the frame buffer object based on the rendering component to obtain a frame texture result;

绑定单元,用于将所述帧纹理结果与所述电子设备输出的目标视频的目标帧绑定,所述目标视频为对所述待播放图片进行播放而生成的视频。A binding unit, configured to bind the frame texture result with a target frame of a target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture.

在一些实施例中,所述帧纹理结果获取单元,还包括:In some embodiments, the frame texture result acquisition unit further includes:

第一纹理结果子单元,用于预设的画面比例、旋转方向和幕布算法,渲染所述帧缓冲对象的第一纹理,得到第一纹理结果,所述第一纹理结果为带有所述第一纹理的帧缓冲对象;The first texture result sub-unit is used to render the first texture of the frame buffer object with the preset aspect ratio, rotation direction and curtain algorithm, and obtain the first texture result, and the first texture result is with the first texture result. A textured framebuffer object;

第二纹理结果子单元,用于根据预设的美颜算法和滤镜算法,渲染所述第一纹理结果,得到第二纹理结果,所述第二纹理结果为带有第二纹理效果的帧缓冲对象;The second texture result subunit is used to render the first texture result according to the preset beauty algorithm and filter algorithm to obtain a second texture result, and the second texture result is a frame with the second texture effect buffer object;

第三纹理结果子单元,用于根据预设的贴纸添加算法和文字添加算法,渲染所述第二纹理结果,得到第三纹理结果,所述第三纹理结果为带有第三纹理效果的帧缓冲对象;The third texture result subunit is used to render the second texture result according to the preset sticker adding algorithm and text adding algorithm to obtain a third texture result, where the third texture result is a frame with a third texture effect buffer object;

第四纹理结果子单元,用于根据预设的转场算法,渲染所述第三纹理结果,得到第四纹理结果,所述第四纹理结果为带有第四纹理效果的帧缓冲对象,所述第四纹理结果为所述帧纹理结果。The fourth texture result subunit is used to render the third texture result according to the preset transition algorithm to obtain a fourth texture result, where the fourth texture result is a frame buffer object with a fourth texture effect, so The fourth texture result is the frame texture result.

本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行本申请实施例所提供的任一种图片数据处理方法中的步骤。Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute any picture provided by the embodiments of the present application Steps in a data processing method.

本申请实施例提供的图片数据处理方法中,可以利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。In the picture data processing method provided by the embodiment 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 the custom picture material class; Take the 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; use the custom picture rendering class, from the self-defined picture rendering class Define a picture reading class to obtain the picture reading logic and the duration logic; use the custom picture rendering class, according to the duration logic, the picture reading logic, and the picture data obtained from the file path, Realize the playback of the picture to be played.

在本申请中,本申请实施例的扩展程序包括多个自定义类,每个自定义类均是通过在基类的源代码中添加自定义代码实现的,涉及到的自定义代码较为简单、体量较轻。并且由于本申请实施例的电子设备中的基础程序具有较高的可扩展性,从而能够在开发出轻量级扩展程序的基础上,使得电子设备能够获取功能全面、兼容性和稳定性较好的视频播放器或软件,进而通过该视频播放器或软件执行多样化的图片播放和处理功能,改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。In the present application, the extension program of the embodiment of the present application includes a plurality of custom classes, each custom class is realized by adding custom code to the source code of the base class, and the involved custom code is relatively simple, Lightweight. And because the basic program in the electronic device of the embodiment of the present application has high scalability, the electronic device can obtain comprehensive functions, better compatibility and stability on the basis of developing a lightweight extension program. The video player or software can be used to perform various picture playback and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle in the prior art of re-development of the player.

相应的,本申请实施例还提供一种计算机设备,该计算机设备可以为终端或服务器,该终端可以为智能手机、平板电脑、笔记本电脑、触控屏幕、游戏机、个人计算机、个人数字助理(Personal Digital Assistant,PDA)等终端设备。Correspondingly, an embodiment of the present application also provides a computer device, the computer device may be a terminal or a server, and the terminal may be 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) and other terminal equipment.

如图4所示,图4为本申请实施例提供的计算机设备的结构示意图,该计算机设备400包括有一个或者一个以上处理核心的处理器401、有一个或一个以上计算机可读存储介质的存储器402及存储在存储器402上并可在处理器上运行的计算机程序。其中,处理器401与存储器402电性连接。本领域技术人员可以理解,图中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。As shown in FIG. 4 , which is a schematic structural diagram of a computer device provided by an embodiment of the application, the computer device 400 includes a processor 401 having one or more processing cores, and a memory having one or more computer-readable storage media 402 and a computer program stored on memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402 . Those skilled in the art can understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or less components than the one shown, or combine some components, or arrange different components.

处理器401是计算机设备400的控制中心,利用各种接口和线路连接整个计算机设备400的各个部分,通过运行或加载存储在存储器402内的软件程序和/或模块,以及调用存储在存储器402内的数据,执行计算机设备400的各种功能和处理数据,从而对计算机设备400进行整体监控。The processor 401 is the control center of the computer device 400, and uses various interfaces and lines to connect various parts of the entire computer device 400, by running or loading the software programs and/or modules stored in the memory 402, and calling the software programs stored in the memory 402. to perform various functions of the computer device 400 and process data, so as to monitor the computer device 400 as a whole.

在本申请实施例中,计算机设备400中的处理器401会按照如下的步骤,将一个或一个以上的应用程序的进程对应的指令加载到存储器402中,并由处理器401来运行存储在存储器402中的应用程序,从而实现各种功能:In this embodiment of the present application, the processor 401 in the computer device 400 loads 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 executes the instructions stored in the memory. 402 application in order to achieve various functions:

利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;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;

利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;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 the custom picture rendering class;

利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class;

利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。Using the custom picture rendering class, the to-be-played picture is played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of the above operations, reference may be made to the foregoing embodiments, and details are not described herein again.

可选的,如图4所示,计算机设备400还包括:触控显示屏403、射频电路404、音频电路405、输入单元406以及电源407。其中,处理器401分别与触控显示屏403、射频电路404、音频电路405、输入单元406以及电源407电性连接。本领域技术人员可以理解,图4中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Optionally, as shown in FIG. 4 , 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 . 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 the computer device structure shown in FIG. 4 does not constitute a limitation on the computer device, and may include more or less components than the one shown, or combine some components, or arrange different components.

触控显示屏403可用于显示图形用户界面以及接收用户作用于图形用户界面产生的操作指令。触控显示屏403可以包括显示面板和触控面板。其中,显示面板可用于显示由用户输入的信息或提供给用户的信息以及计算机设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-EmittingDiode)等形式来配置显示面板。触控面板可用于收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并生成相应的操作指令,且操作指令执行对应程序。可选的,触控面板可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器401,并能接收处理器401发来的命令并加以执行。触控面板可覆盖显示面板,当触控面板检测到在其上或附近的触摸操作后,传送给处理器401以确定触摸事件的类型,随后处理器401根据触摸事件的类型在显示面板上提供相应的视觉输出。在本申请实施例中,可以将触控面板与显示面板集成到触控显示屏403而实现输入和输出功能。但是在某些实施例中,触控面板与触控面板可以作为两个独立的部件来实现输入和输出功能。即触控显示屏403也可以作为输入单元406的一部分实现输入功能。The touch screen 403 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display 403 may include a display panel and a touch panel. Among them, the display panel can be used to display the information input by the user or the information provided to the user and various graphical user interfaces of the computer equipment. These graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode), and the like. The touch panel can be used to collect the user's touch operations on or near it (such as the user's operations on or near the touch panel using a finger, stylus, etc., any suitable object or accessory), and generate corresponding operations instruction, and the operation instruction executes the corresponding program. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, 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 touch controller. To the processor 401, and can receive the command sent by the processor 401 and execute it. The touch panel can cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of the touch event, and then the processor 401 provides the display panel according to the type of the touch event. Corresponding visual output. In this embodiment of the present application, the touch panel and the display panel may 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 used as two independent components to implement input and output functions. That is, the touch display screen 403 can also be used as a part of the input unit 406 to realize the input function.

在本申请实施例中,通过处理器401执行游戏应用程序在触控显示屏403上生成图形用户界面,图形用户界面上的虚拟场景中包含至少一个技能控制区域,技能控制区域中包含至少一个技能控件。该触控显示屏403用于呈现图形用户界面以及接收用户作用于图形用户界面产生的操作指令。In this embodiment of the present application, the processor 401 executes a game application program 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 controls. The touch display screen 403 is used for presenting a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface.

射频电路404可用于收发射频信号,以通过无线通信与网络设备或其他计算机设备建立无线通讯,与网络设备或其他计算机设备之间收发信号。The radio frequency circuit 404 can be used for transmitting and receiving radio frequency signals, so as to establish wireless communication with network equipment or other computer equipment through wireless communication, and send and receive signals with the network equipment or other computer equipment.

音频电路405可以用于通过扬声器、传声器提供用户与计算机设备之间的音频接口。音频电路405可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路405接收后转换为音频数据,再将音频数据输出处理器401处理后,经射频电路404以发送给比如另一计算机设备,或者将音频数据输出至存储器402以便进一步处理。音频电路405还可能包括耳塞插孔,以提供外设耳机与计算机设备的通信。Audio circuitry 405 may be used to provide an audio interface between the user and computer equipment through speakers, microphones. The audio circuit 405 can convert the received audio data into an electrical signal, and transmit it to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is converted after being received by the audio circuit 405. In the form of audio data, the audio data is output to the processor 401 for processing, and then sent to, for example, another computer device via the radio frequency circuit 404, or the audio data is output to the memory 402 for further processing. Audio circuitry 405 may also include an ear jack to provide for communication of peripheral headphones with computer equipment.

输入单元406可用于接收输入的数字、字符信息或用户特征信息(例如指纹、虹膜、面部信息等),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。The input unit 406 can be used to receive input numbers, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control .

电源407用于给计算机设备400的各个部件供电。可选的,电源407可以通过电源管理系统与处理器401逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源407还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。Power supply 407 is used to power various components of computer device 400 . Optionally, the power supply 407 may be logically connected to the processor 401 through a power management system, so that functions such as charging, discharging, and power consumption management are implemented through the power management system. The power source 407 may also include one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and any other components.

尽管图4中未示出,计算机设备400还可以包括摄像头、传感器、无线保真模块、蓝牙模块等,在此不再赘述。Although not shown in FIG. 4 , the computer device 400 may further include a camera, a sensor, a Wi-Fi module, a Bluetooth module, and the like, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

由上可知,本实施例提供的计算机设备可以利用扩展程序执行图片数据处理流程,本申请实施例的扩展程序包括多个自定义类,每个自定义类均是通过在基类的源代码中添加自定义代码实现的,涉及到的自定义代码较为简单、体量较轻。并且由于本申请实施例的电子设备中的基础程序具有较高的可扩展性,从而能够在开发出轻量级扩展程序的基础上,使得电子设备能够获取功能全面、兼容性和稳定性较好的视频播放器或软件,进而通过该视频播放器或软件执行多样化的图片播放和处理功能,改善现有技术中重新开发播放器存在的开发成本较高、开发周期较长的问题。It can be seen from the above that the computer device provided in this embodiment can use an extension program to execute a picture data processing process. The extension program in this embodiment of the present application includes a plurality of custom classes, and each custom class is passed in the source code of the base class. Adding custom code to implement, the custom code involved is relatively simple and lightweight. And because the basic program in the electronic device of the embodiment of the present application has high scalability, the electronic device can obtain comprehensive functions, better compatibility and stability on the basis of developing a lightweight extension program. The video player or software can be used to perform various picture playback and processing functions through the video player or software, thereby improving the problems of high development cost and long development cycle in the prior art of re-development of the player.

本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructions, or by instructions that control relevant hardware, and the instructions can be stored in a computer-readable storage medium, and loaded and executed by the processor.

为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条计算机程序,该计算机程序能够被处理器进行加载,以执行本申请实施例所提供的任一种图片数据处理方法中的步骤。例如,该计算机程序可以执行如下步骤:To this end, the embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute any image data processing method provided by the embodiments of the present application. steps in . For example, the computer program may perform the following steps:

利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;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;

利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;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 the custom picture rendering class;

利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class;

利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。Using the custom picture rendering class, the to-be-played picture is played according to the duration logic, the picture reading logic, and the picture data obtained from the file path.

以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of the above operations, reference may be made to the foregoing embodiments, and details are not described herein again.

其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。Wherein, the storage medium may include: a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and the like.

由于该存储介质中所存储的计算机程序,可以执行本申请实施例所提供的任一种图片数据处理方法中的步骤,因此,可以实现本申请实施例所提供的任一种图片数据处理方法所能实现的有益效果,详见前面的实施例,在此不再赘述。Since the computer program stored in the storage medium can execute the steps in any of the picture data processing methods provided in the embodiments of the present application, it is possible to implement the steps in any of the picture data processing methods provided in the embodiments of the present application. For the beneficial effects that can be achieved, see the foregoing embodiments for details, which will not be repeated here.

以上对本申请实施例所提供的一种图片数据处理方法、装置、存储介质及计算机设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A picture data processing method, device, storage medium, and computer equipment provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described with specific examples in this paper. The descriptions of the above embodiments It is only used to help understand the method of the present application and its core idea; 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 and application scope. The contents of the description should not be construed as limiting the application.

Claims (13)

1.一种图片数据处理方法,其特征在于,应用于电子设备,所述电子设备利用扩展程序执行图片数据处理流程,所述扩展程序包括自定义图片渲染类、自定义图片素材类和自定义图片读取类;1. a picture data processing method, is characterized in that, is applied to electronic equipment, described electronic equipment utilizes extension program to carry out picture data processing flow, and described extension program comprises custom picture rendering class, custom picture material class and custom Image reading class; 所述方法包括:The method includes: 利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;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; 利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;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 the custom picture rendering class; 利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;Using the custom picture rendering class, obtain the picture reading logic and the duration logic from the custom picture reading class; 利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。Using the custom picture rendering class, the to-be-played picture is played according to the duration logic, the picture reading logic, and the picture data obtained from the file path. 2.根据权利要求1所述的方法,其特征在于,所述扩展程序还包括自定义单帧时间线类;2. The method according to claim 1, wherein the extension program further comprises a custom single-frame timeline class; 所述利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放,包括:The use of the custom picture rendering class to realize the playback of the to-be-played picture according to the duration logic, the picture reading logic, and the picture data obtained from the file path includes: 利用所述自定义单帧时间线类得到所述图片数据的播放逻辑;Use the custom single-frame timeline class to obtain the playback logic of the picture data; 利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、从所述文件路径获取到的图片数据以及所述播放逻辑,实现所述待播放图片的播放。Using the custom picture rendering class, according to the duration logic, the picture reading logic, the picture data obtained from the file path, and the playing logic, the to-be-played picture is played. 3.根据权利要求1所述的方法,其特征在于,在所述利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径之前,所述方法还包括:3. The method according to claim 1, characterized in that, before the use of the self-defined picture reading class to obtain the file path of the to-be-played picture from the self-defined picture material class, the method further comprises: 响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类;其中,所述自定义图片素材类用于定义所述待播放图片的文件路径,以及所述待播放图片的时长逻辑。In response to the first creation operation on the custom picture material class, the custom picture material class is created on the basis of the media material class; wherein, the custom picture material class is used to define the content of the picture to be played. The file path, and the duration logic of the picture to be played. 4.根据权利要求3所述的方法,其特征在于,在所述响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类之后,所述方法还包括:4. The method according to claim 3, wherein, after the custom picture material class is created on the basis of the media material class in response to the first creation operation on the custom picture material class , the method also includes: 基于所述自定义图片素材类创建自定义图片帧类,其中,所述自定义图片帧类用于创建所述自定义图片读取类,所述自定义图片读取类用于定义所述图片读取逻辑。Create a custom picture frame class based on the custom picture material class, wherein 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 read logic. 5.根据权利要求4所述的方法,其特征在于,在所述基于所述自定义图片素材类创建自定义图片帧类之后,所述方法还包括:5 . The method according to claim 4 , wherein after creating a custom picture frame class based on the custom picture material class, the method further comprises: 5 . 响应于对所述自定义图片读取类的第二创建操作,基于所述自定义图片帧类,在素材取样类的基础上创建所述自定义图片读取类。In response to the second creation operation on the custom picture reading class, the custom picture reading class is created on the basis of the material sampling class based on the custom picture frame class. 6.根据权利要求3所述的方法,其特征在于,在所述响应于对所述自定义图片素材类的第一创建操作,在媒体素材类的基础上创建所述自定义图片素材类之后,所述方法还包括:6. The method according to claim 3, characterized in that, after the custom picture material class is created on the basis of the media material class in response to the first creation operation on the custom picture material class , the method also includes: 基于所述自定义图片素材类创建所述自定义单帧时间线类,其中,所述自定义单帧时间线类用于定义所述播放逻辑。The custom single-frame timeline class is created based on the custom picture material class, where the custom single-frame timeline class is used to define the playback logic. 7.根据权利要求1所述的方法,其特征在于,在所述利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑之前,所述方法还包括:7 . The method according to claim 1 , wherein, before the use of the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class, the Methods also include: 响应于对所述自定义图片渲染类的第三创建操作,在所述渲染类的基础上创建所述自定义图片渲染类;其中,所述自定义图片渲染类用于定义所述图片数据的绘制逻辑,所述绘制逻辑用于将所述图片数据对应的图片呈现于显示界面。In response to the third creation operation on the custom picture rendering class, the custom picture rendering class is created on the basis of the rendering class; wherein, the custom picture rendering class is used to define the picture data. Drawing logic, the drawing logic is used to present the picture corresponding to the picture data on the display interface. 8.根据权利要求1至7任一项所述的方法,其特征在于,所述方法还包括:8. The method according to any one of claims 1 to 7, wherein the method further comprises: 响应于对自定义播放器类的第四创建操作,在播放器类的基础上创建所述自定义播放器类;其中,所述自定义播放器类用于将每个所述扩展程序添加至对应的基础程序中。In response to the fourth creation operation on the custom player class, the custom player class is created on the basis of the player class; wherein the custom player class is used to add each of the extensions to in the corresponding basic program. 9.根据权利要求1所述的方法,其特征在于,所述方法还包括:9. The method of claim 1, wherein the method further comprises: 响应于对开放图形库的调用操作,利用所述开放图形库,调用自定义渲染组件;In response to the calling operation to the open graphics library, using the open graphics library, the custom rendering component is called; 获取所述待播放图片的帧缓冲对象;Obtain the frame buffer object of the picture to be played; 基于所述自定义渲染组件,对所述帧缓冲对象进行处理,得到帧纹理结果;processing the frame buffer object based on the custom rendering component to obtain a frame texture result; 将所述帧纹理结果与所述电子设备输出的目标视频的目标帧绑定,所述目标视频为对所述待播放图片进行播放而生成的视频。Binding the frame texture result with a target frame of a target video output by the electronic device, where the target video is a video generated by playing the to-be-played picture. 10.根据权利要求9所述的方法,其特征在于,所述对所述帧缓冲对象进行处理,包括:10. The method according to claim 9, wherein the processing the frame buffer object comprises: 根据预设的画面比例、旋转方向和幕布算法,渲染所述帧缓冲对象的第一纹理,得到第一纹理结果,所述第一纹理结果为带有所述第一纹理的帧缓冲对象;Render the first texture of the frame buffer object according to the preset aspect ratio, rotation direction and curtain algorithm, and obtain a first texture result, where the first texture result is the frame buffer object with the first texture; 根据预设的美颜算法和滤镜算法,渲染所述第一纹理结果,得到第二纹理结果,所述第二纹理结果为带有第二纹理效果的帧缓冲对象;According to the preset beauty algorithm and filter algorithm, the first texture result is rendered, and the second texture result is obtained, and the second texture result is a frame buffer object with the second texture effect; 根据预设的贴纸添加算法和文字添加算法,渲染所述第二纹理结果,得到第三纹理结果,所述第三纹理结果为带有第三纹理效果的帧缓冲对象;According to the preset sticker adding algorithm and text adding algorithm, the second texture result is rendered to obtain a third texture result, and the third texture result is a frame buffer object with a third texture effect; 根据预设的转场算法,渲染所述第三纹理结果,得到第四纹理结果,所述第四纹理结果为带有第四纹理效果的帧缓冲对象,所述第四纹理结果为所述帧纹理结果。According to a preset transition algorithm, the third texture result is rendered 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.一种图片数据处理装置,其特征在于,应用于电子设备,所述电子设备利用扩展程序执行图片数据处理流程,所述扩展程序包括自定义图片渲染类、自定义图片素材类和自定义图片读取类;11. A picture data processing device, characterized in that it is applied to an electronic device, and the electronic device uses an extension program to execute a picture data processing flow, and the extension program includes a custom picture rendering class, a custom picture material class, and a custom picture material class. Image reading class; 所述装置包括:The device includes: 第一获取单元,用于利用自定义图片读取类,从自定义图片素材类获取待播放图片的文件路径,以及所述待播放图片的时长逻辑;a first obtaining unit, configured to 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; 第二获取单元,用于利用自定义图片读取类,根据所述待播放图片的文件路径,获取所述待播放图片的图片数据,并将所述图片数据传输给自定义图片渲染类;a second obtaining unit, configured to use a custom picture reading class, obtain picture data of the to-be-played picture according to the file path of the to-be-played picture, and transmit the picture data to the custom picture rendering class; 第三获取单元,用于利用所述自定义图片渲染类,从所述自定义图片读取类获取图片读取逻辑和所述时长逻辑;a third obtaining unit, configured to use the custom picture rendering class to obtain the picture reading logic and the duration logic from the custom picture reading class; 图片播放单元,用于利用所述自定义图片渲染类,根据所述时长逻辑、所述图片读取逻辑、以及从所述文件路径获取到的图片数据,实现所述待播放图片的播放。The picture playing unit is configured to use the custom picture rendering class to play the picture to be played according to the duration logic, the picture reading logic, and the picture data obtained from the file path. 12.一种电子设备,其特征在于,包括处理器和存储器,所述存储器存储有多条指令;所述处理器从所述存储器中加载指令,以执行如权利要求1~10任一项所述的图片数据处理方法中的步骤。12. An electronic device, comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads the instructions from the memory to execute the instructions according to any one of claims 1 to 10. The steps in the image data processing method described above. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1~10任一项所述的图片数据处理方法中的步骤。13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor, so as to execute the method according to any one of claims 1 to 10. The steps in the image data processing method.
CN202210351143.1A 2022-04-02 2022-04-02 Picture data processing method and device, electronic equipment and storage medium Active CN114723871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210351143.1A CN114723871B (en) 2022-04-02 2022-04-02 Picture data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210351143.1A CN114723871B (en) 2022-04-02 2022-04-02 Picture data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114723871A true CN114723871A (en) 2022-07-08
CN114723871B CN114723871B (en) 2025-08-01

Family

ID=82242929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210351143.1A Active CN114723871B (en) 2022-04-02 2022-04-02 Picture data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114723871B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948735A (en) * 2017-12-06 2018-04-20 北京金山安全软件有限公司 Video playing method and device and electronic equipment
CN108228790A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 Push the methods of exhibiting and device of picture
CN108289231A (en) * 2017-06-20 2018-07-17 深圳市佳创视讯技术股份有限公司 A kind of panorama player of fusion
WO2019214615A1 (en) * 2018-05-09 2019-11-14 鸿合科技股份有限公司 Frame animation realization method and apparatus, electronic device and computer-readable storage medium
WO2021169168A1 (en) * 2020-02-28 2021-09-02 海信视像科技股份有限公司 Video file preview method and display device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108289231A (en) * 2017-06-20 2018-07-17 深圳市佳创视讯技术股份有限公司 A kind of panorama player of fusion
CN107948735A (en) * 2017-12-06 2018-04-20 北京金山安全软件有限公司 Video playing method and device and electronic equipment
CN108228790A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 Push the methods of exhibiting and device of picture
WO2019214615A1 (en) * 2018-05-09 2019-11-14 鸿合科技股份有限公司 Frame animation realization method and apparatus, electronic device and computer-readable storage medium
WO2021169168A1 (en) * 2020-02-28 2021-09-02 海信视像科技股份有限公司 Video file preview method and display device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
罗成圆: ""在达芬奇12中如何提高实时预览的效率"", 《现代电影技术》, no. 10, 11 October 2016 (2016-10-11), pages 28 - 34 *

Also Published As

Publication number Publication date
CN114723871B (en) 2025-08-01

Similar Documents

Publication Publication Date Title
KR102646977B1 (en) Display method and device based on augmented reality, and storage medium
TWI732240B (en) Video file generation method, device, and storage medium
US11587280B2 (en) Augmented reality-based display method and device, and storage medium
WO2020186988A1 (en) Information display method and device, terminal, and storage medium
CN108762881B (en) Interface drawing method and device, terminal and storage medium
CN113645476A (en) Picture processing method and device, electronic equipment and storage medium
CN118159341A (en) A method and related device for rendering an image frame
CN114663560A (en) Animation realization method and device of target model, storage medium and electronic equipment
WO2024222356A1 (en) Special-effect generation method and apparatus, and computer device and storage medium
CN113744377A (en) Animation processing system, method, device, equipment and medium
WO2024077498A1 (en) Playback interface display method and apparatus, device, and readable storage medium
CN114904279A (en) Data preprocessing method, device, medium and equipment
CN114327174A (en) Virtual reality scene display method and cursor three-dimensional display method and device
CN114570020A (en) Data processing method and system
EP4546268A1 (en) Graphical interface processing method and apparatus
CN114723871B (en) Picture data processing method and device, electronic equipment and storage medium
CN109636917B (en) Three-dimensional model generation method, device and hardware device
CN116708696B (en) Video processing method and electronic device
CN116109737A (en) Animation generation method, device, computer equipment, and computer-readable storage medium
CN114385062A (en) Switching method, device, readable storage medium and electronic device for presentation scheme
CN112433696A (en) Wallpaper display method, device, equipment and medium
CN118803339B (en) Page display method and device, electronic equipment and storage medium
CN114339247A (en) Video preview method, device, storage medium and electronic device
CN115797532A (en) Rendering method and device of virtual scene, computer equipment and storage medium
CN116328298A (en) Virtual model rendering method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant