Coding and decoding method and device, equipment and storage medium
By receiving and converting data by decoders that support multiple operating platforms, the problem that Ffmpeg decoded data cannot be directly used in the Android platform is solved, and multi-screen interaction and mirror screen projection functions are realized, providing cross-platform capabilities of the decoding end.
Patent Information
- Application Number
- CN202411272020.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-29
AI Technical Summary
When decoding the Ffmpeg codec, the decoded data cannot be directly provided to the surface of the Android platform, resulting in the failure of multi-screen interaction and mirror projection functions.
The decoder that supports multiple operating platforms receives the encoded data sent by the encoder, and converts the video decoded data into the rendering data of the appropriate rendering object in the operating platform that is incompatible with the decoder, achieving cross-platform capabilities and ensuring that the data is in Available on any operating platform.
Solve the problem of decoder incompatible with the operating platform, realize multi-screen interaction and mirror screen projection functions, provide cross-platform capabilities of the decoding end, and ensure that data can be used on any operating platform.
Smart Images

Figure CN119052498A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile intelligent cockpits, and in particular to a coding and decoding method, device, equipment and storage medium. Background Art
[0002] With the rapid development of automobile intelligence, in-car entertainment is becoming increasingly rich. The cockpit is equipped with multiple screens such as the central control screen, the co-pilot entertainment screen, and the rear tablet personal computer (PAD) to meet the needs of more people in the car to enjoy audio, video, games and other entertainment scenes at the same time. Multi-screen interaction and mirror projection have become popular features. This involves the encoding and decoding of screen data. However, when the Ffmpeg codec is decoding, the decoded data cannot be directly provided to the surface in the Android platform, resulting in the failure of multi-screen interaction. Summary of the invention
[0003] The present invention provides a coding and decoding method to realize functions such as multi-screen interaction and mirror projection; secondly, provides a coding and decoding device; thirdly, provides an electronic device; thirdly, provides a computer storage medium; finally, provides a computer program product.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] A coding and decoding method, the coding and decoding method comprising:
[0006] The first coded data sent by the encoder is received by a decoder supporting multiple operating platforms; the first coded data is data obtained after the encoder supporting the first operating platform encodes the obtained screen recording data; the decoder and the encoder are installed in different devices;
[0007] Decoding the first encoded data by the decoder to obtain decoded data;
[0008] In the case that the decoder is not compatible with the rendering object in the first operating platform, the video decoding data included in the decoded data is converted into rendering data of the rendering object of the first operating platform and displayed.
[0009] According to the above technical means, the decoder supports multiple operating platforms and solves the problem that the decoder is incompatible with the rendering objects in the first operating platform, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided, thereby realizing multi-screen interaction, mirror screen projection and other functions.
[0010] Further, the converting of the video decoded data included in the decoded data into rendering data of the rendering object of the first operating platform includes: storing the decoded data in a first structure; converting the video decoded data in the first structure into rendering data of the rendering object of the first operating platform; the encoding and decoding method also includes: playing the audio decoded data in the first structure.
[0011] According to the above technical means, the problem that the decoder is incompatible with the rendering objects in the first operating platform is solved, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided.
[0012] Further, the converting of the video decoding data in the first structure into the rendering data of the rendering object of the first operating platform includes: assigning the pointer of the first structure included in the first parameter to the second parameter through a first function; obtaining the video decoding data in the first structure based on the pointer of the first structure included in the second parameter through a second function, and passing it to a third parameter; and passing the rendering data of the third parameter to the rendering object included in a fourth parameter; the third parameter is used to convert the video decoding data in the first structure into the rendering data.
[0013] According to the above technical means, with the help of the first function and the second function, the video decoding data in the first structure included in the first parameter is associated with the rendering object included in the fourth parameter, thereby achieving the purpose of converting the video decoding data in the first structure into the rendering data of the rendering object.
[0014] Further, decoding the first encoded data by the decoder to obtain decoded data includes: converting the first encoded data of a first data type into second encoded data of a second data type; storing the second encoded data of the second data type in a second structure; and sending the second structure to the decoder for decoding to obtain the decoded data.
[0015] According to the above technical means, when decoding, the decoder will directly use the encoded data transmitted from the device installed with the encoder, thereby realizing functions such as multi-screen interaction and mirroring screen projection.
[0016] Further, sending the second structure to the decoder for decoding to obtain the decoded data includes: for the audio coding data included in the second coding data in the second structure, performing audio decoding on the audio coding data to obtain audio decoded data; for the video coding data included in the second coding data in the second structure, performing video decoding on the video coding data to obtain video decoded data; obtaining the decoded data based on the audio decoded data and the video decoded data.
[0017] According to the above technical means, a corresponding decoding method is selected for decoding according to the category of the second coded data to ensure the correctness of the decoded data.
[0018] Furthermore, the receiving of the first encoded data sent by the encoder by a decoder supporting multiple operating platforms includes: receiving the first encoded data from the encoder by a receiving unit based on a preset network communication method, and sending the first encoded data to the decoder.
[0019] According to the above technical means, the decoder obtains the first encoded data of the encoder based on a preset network communication method, which ensures the stability and efficiency of the data during transmission.
[0020] Furthermore, the decoder is Ffmpeg, and the encoder is Mediacodec.
[0021] A coding and decoding device, the coding and decoding device comprising:
[0022] A processing unit, configured to decode first coded data from an encoder through a decoder supporting multiple operating platforms to obtain decoded data; the first coded data is data obtained after the encoder supporting the first operating platform encodes the obtained screen recording data; the decoder and the encoder are installed in different devices;
[0023] An output unit is used to output the decoded data.
[0024] According to the above technical means, the decoder supports multiple operating platforms and solves the problem that the decoder is incompatible with the rendering objects in the first operating platform, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided, thereby realizing multi-screen interaction, mirror screen projection and other functions.
[0025] An electronic device comprises: a processor and a memory configured to store a computer program that can be run on the processor, wherein the processor is configured to execute the steps of the above method when running the computer program.
[0026] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0027] A computer program product comprises a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the steps of the aforementioned method are implemented.
[0028] Beneficial effects of the present invention:
[0029] (1) The decoder of the present invention supports multiple operating platforms and solves the problem that the decoder is incompatible with the rendering object in the first operating platform, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided, thereby realizing functions such as multi-screen interaction and mirror screen projection;
[0030] (2) The present invention uses the first function and the second function to associate the video decoding data in the first structure included in the first parameter with the rendering object included in the fourth parameter, thereby achieving the purpose of converting the video decoding data in the first structure into the rendering data of the rendering object. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The process diagram of the encoding and decoding method in the embodiment of the present invention is as follows Figure 1 ;
[0032] Figure 2 The process diagram of the encoding and decoding method in the embodiment of the present invention is as follows Figure 2 ;
[0033] Figure 3 The process diagram of the encoding and decoding method in the embodiment of the present invention is as follows Figure 3 ;
[0034] Figure 4 The process diagram of the encoding and decoding method in the embodiment of the present invention is as follows Figure 4 ;
[0035] Figure 5 This is a flow chart of Mediacodec screen recording encoding in an embodiment of the present invention;
[0036] Figure 6 This is a flowchart of Ffmpeg decoding from AVpack to AVframe in an embodiment of the present invention;
[0037] Figure 7 A flowchart of storing encoded byte data in AVpacket in an embodiment of the present invention;
[0038] Figure 8 A schematic diagram of the structure of a coding and decoding device according to an embodiment of the present invention;
[0039] Fig. 9 Schematic diagram of the composition structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0041] The embodiment of the present invention provides a coding and decoding method. Figure 1 The process diagram of the encoding and decoding method in the embodiment of the present invention is as follows Figure 1 ,like Figure 1 As shown, the encoding and decoding method includes the following steps:
[0042] S101: Receive first encoded data sent by an encoder through a decoder that supports multiple operating platforms; the first encoded data is data obtained by encoding the screen recording data by an encoder that supports the first operating platform; the decoder and the encoder are installed in different devices.
[0043] S102: Decode the first encoded data by a decoder to obtain decoded data.
[0044] S103: When the decoder is not compatible with the rendering object in the first operating platform, convert the video decoding data included in the decoded data into rendering data of the rendering object of the first operating platform, and display the data.
[0045] It is understandable that the encoder is installed in the first device, the decoder is installed in the second device, and the first device and the second device are different devices. The decoder supports multiple operating platforms, that is, the second device is a device running on a certain operating platform among the multiple operating platforms. The multiple operating platforms include the first operating platform. The multiple operating platforms include at least: Windows, Android, Linux and IOS. The first operating platform is an operating platform among the multiple operating platforms.
[0046] It can be understood that the first device performs screen recording to obtain screen recording data; the first device uses an encoder to encode the screen recording data to obtain first encoded data; the first device sends the first encoded data to the second device; the second device uses a decoder to decode the first encoded data to obtain decoded data; and the second device outputs the decoded data.
[0047] The first encoded data includes audio encoded data and video encoded data, and the decoded data includes audio decoded data and video decoded data.
[0048] In an embodiment of the present invention, the decoder supports multiple operating platforms and solves the problem that the decoder is incompatible with rendering objects in the first operating platform, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided, thereby realizing functions such as multi-screen interaction and mirror projection.
[0049] Exemplarily, the decoder can be Ffmpeg, and the encoder can be Mediacodec. Among them, Mediacodec's efficient hardware encoding and decoding efficiency in Android can provide a screen recording function, and is strongly bound to the surface in Android, suitable for use in the Android system, but not suitable for cross-platform use. Ffmpeg can be used across platforms, but it is not as convenient and efficient as Mediacodec in Android. In this way, encoding through Mediacodec can ensure efficient encoding efficiency. Decoding through Ffmpeg can provide cross-platform capabilities of the decoding end.
[0050] In some embodiments, S103 includes the following steps S201-S202:
[0051] S201: Store the decoded data in a first structure.
[0052] In the embodiment of the present invention, the first structure is used to receive decoded audio and video data, and therefore, the decoded data is stored in the first structure.
[0053] S202: Convert the video decoding data in the first structure into rendering data of a rendering object of the first operating platform.
[0054] In the embodiment of the present invention, the first structure is a key structure used to describe audio and video data in the decoder. The decoder is not compatible with the rendering object in the first operating platform, which can be understood as the decoder cannot directly call the rendering object of the first operating platform. Therefore, it is necessary to convert the video decoding data in the first structure into the rendering data of the rendering object of the first operating platform to ensure the use of the video decoding data on the first operating platform.
[0055] The rendering object refers to an object used to render the rendering data on the display interface. The decoding data includes video decoding data.
[0056] In some embodiments, the encoding and decoding method further includes: playing the audio decoding data in the first structure.
[0057] In some embodiments, S202 includes the following steps S301 to S302:
[0058] S301: Assign the pointer of the first structure included in the first parameter to the second parameter through the first function.
[0059] S302: obtaining the video decoding data in the first structure based on the pointer of the first structure included in the second parameter through the second function, and passing it to the third parameter; and passing the rendering data of the third parameter to the rendering object included in the fourth parameter; the third parameter is used to convert the video decoding data in the first structure into rendering data.
[0060] In an embodiment of the present invention, the first function includes a first parameter and a second parameter, and the second function includes a second parameter, a third parameter, and a fourth parameter. That is, the first parameter and the second function both include the second parameter. When the pointer of the first structure included in the first parameter is assigned to the second parameter through the first function, the second parameter in the second function also obtains the pointer of the first structure. Then, the second function obtains the video decoding data in the first structure included in the first parameter based on the pointer of the first structure included in the second parameter, and passes it to the third parameter. The third parameter is used to convert the video decoding data in the first structure into rendering data, and passes it to the rendering object included in the fourth parameter. In this way, with the help of the first function and the second function, the video decoding data in the first structure included in the first parameter is associated with the rendering object included in the fourth parameter, thereby achieving the purpose of converting the video decoding data in the first structure into the rendering data of the rendering object.
[0061] The pointer to the first structure may be understood as the address of the first structure.
[0062] In some embodiments, S102 includes the following steps S401 to S403:
[0063] S401: Convert first coded data of a first data type into second coded data of a second data type.
[0064] S402: Store second encoded data of the second data type in a second structure.
[0065] S403: Send the second structure to the decoder for decoding to obtain decoded data.
[0066] In an embodiment of the present invention, the data type of the first encoded data is the first data type, and the data type decoded by the decoder is the second data type. Therefore, the first encoded data of the first data type is first converted into the second encoded data of the second data type. The second structure is used to store the encoded data. Therefore, the second encoded data of the second data type is stored in the second structure. After that, the second structure is sent to the decoder for decoding to obtain the decoded data. In this way, when the decoder is decoding, it will directly use the encoded data transmitted from the device on which the encoder is installed. Thereby realizing functions such as multi-screen interaction and mirror projection.
[0067] Exemplarily, the first data type may be a byte type (ie, byte), and the second data type may be a character type (eg, char).
[0068] In some embodiments, sending the second structure to the decoder for decoding to obtain the decoded data includes: performing audio decoding on the audio encoding data included in the second encoding data in the second structure to obtain audio decoded data; performing video decoding on the video encoding data included in the second encoding data in the second structure to obtain video decoded data; and obtaining the decoded data based on the audio decoded data and the video decoded data.
[0069] In the embodiment of the present invention, different types of coded data correspond to different decoding methods. Therefore, when the decoder is used to decode the second coded data in the second structure, it is determined whether it is audio coded data or video coded data; the second coded data includes audio coded data, and the audio coded data is audio-decoded to obtain audio decoded data; the second coded data includes video coded data, and the video coded data is video-decoded to obtain video decoded data; the audio decoded data and the video decoded data constitute the decoded data. In this way, according to the type of the coded data, the corresponding decoding method is selected for decoding to ensure the correctness of the decoded data.
[0070] In some embodiments, the receiving of the first coded data sent by the encoder by a decoder supporting multiple operating platforms includes: receiving the first coded data of the encoder by a receiving unit based on a preset network communication method, and sending it to the decoder. In an embodiment of the present invention, a device with an encoder installed is used as a server, and a device with a decoder installed is used as a client. The server uses the encoder to perform screen recording, and then performs encoding operations on the recorded screen data. After the encoding is completed, the encoded first coded data is transmitted to the client through a preset network communication method, and the client gives the first coded data to the decoder to perform decoding operations and output operations. In this way, the decoder obtains the first coded data of the encoder based on the preset network communication method, which ensures the stability and efficiency of the data during the transmission process. Among them, the protocol used for network communication can be Transmission Control Protocol / Internet Protocol (TCP / IP).
[0071] Based on the above embodiment, the embodiment of the present invention is described by taking Ffmpeg as the decoder and Mediacodec as the encoder, wherein the decoder is installed in the second device and the encoder is installed in the first device, and the first device and the second device are different devices.
[0072] Mediacodec has efficient hardware encoding and decoding efficiency in Android, can also provide screen recording function, and is strongly bound to the surface in Android, suitable for use in the Android system, but not suitable for cross-platform use. Ffmpeg can be used across platforms, but is not as convenient and efficient as Mediacodec in Android, and the decoded data cannot be directly provided to the surface for use. Based on this, the embodiment of the present invention proposes a set of solutions that can use Mediacodec for encoding in Android and Ffmpeg for decoding, and at the same time, it is necessary to solve the problem that Ffmpeg is incompatible with the surface in Android, so that the data of the Android platform can be encoded and used on any platform (including Android).
[0073] Figure 5 This is a flow chart of Mediacodec screen recording encoding in an embodiment of the present invention, such as Figure 5 As shown, the following steps are included:
[0074] S501: Record the screen of the first device through Mediacodec to obtain screen recording data.
[0075] S502: Encode the screen recording data through Mediacodec to obtain first encoded data.
[0076] S503: The second device sends the first encoded data to the first device based on a preset network communication method.
[0077] The first device acts as a server, and the second device acts as a client.
[0078] Figure 6 FIG. 1 is a flowchart of Ffmpeg decoding from AVpack to AVframe in an embodiment of the present invention, as shown in FIG. Figure 6 As shown, the following steps are included:
[0079] S601: Receive first coded data.
[0080] S602: Convert the first byte-type coded data into the second character-type coded data.
[0081] S603: Store the second encoding data of the character type in the AVpack structure.
[0082] The byte type is byte, and the character type is char.
[0083] The AVpack structure is the second structure mentioned in the previous embodiment. The second coded data stored in the AVpack structure includes the data after the screen recording data is encoded, the video frame information, and various attribute information.
[0084] S603 specific steps are as follows Figure 7 shown.
[0085] S604: Create the corresponding Ffmpeg based on the AVpack structure.
[0086] S605: Ffmpeg determines whether the second encoded data in the AVpack structure includes audio encoded data.
[0087] If yes, execute S606; if no, execute S607.
[0088] S606: Use Ffmpeg to perform audio decoding on the audio encoding data to obtain audio decoding data.
[0089] S607: Ffmpeg determines whether the second coded data in the AVpack structure includes video coded data.
[0090] If yes, execute S608; if no, end.
[0091] S608: Use Ffmpeg to perform video encoding on the video encoding data to obtain video decoding data.
[0092] S609: The audio decoded data and the video decoded data constitute the decoded data and are stored in the AVframe structure.
[0093] The AVframe structure is the first structure mentioned in the previous embodiment.
[0094] Finish.
[0095] Since the AVframe structure does not support direct use by the Android platform (ie, the first operating platform), it is necessary to convert the video decoding data in the AVframe structure into rendering data of the surface (ie, the rendering object) of the Android platform.
[0096] Transformations are primarily related in the following ways:
[0097] First function: static int mediacodec_wrap_hw_buffer(AVCodecContext*avctx,
[0098] MediaCodecDecContext*s,
[0099] ssize_t index,
[0100] FFAMediaCodecBufferInfo*info,
[0101] AVFrame*frame)
[0102] The second function: int av_mediacodec_default_init(AVCodecContext*avctx, AVMediaCodecContext*ctx, void*surface) These two functions associate AVCondecContext (i.e. the second parameter), AVMediaCodecContext (i.e. the third parameter), and surface (i.e. the fourth parameter). This can achieve the purpose of converting AVframe to surface. Finally, in Ffmpeg, use the int av_mediacodec_release_buffer(AVMediaCodecBuffer*buffer, int render) method to render the data to Surface, and the AVframe is converted to surface and displayed.
[0103] Figure 7 FIG. 1 is a flowchart of storing the encoded byte data in AVpacket in an embodiment of the present invention. Figure 7 As shown, the following steps are included:
[0104] S701: Apply for memory space for AVpacket.
[0105] S702: Set the size of AVpacket according to the data length of the second encoded data.
[0106] S703: Store the second encoded data in the AVpacket structure.
[0107] S704: Send the AVpacket structure to Ffmpeg for decoding.
[0108] In the embodiment of the present invention, the server uses Mediacodec to encode on the Android platform, ensuring high encoding efficiency. The client uses Ffmpeg to decode, and then converts the data in the AVFrame obtained after decoding into the surface, which can be directly provided to Android for use, solving the problem that the data source decoded by Ffmpeg cannot be directly provided to the surface in the Android platform for display. Ffmpeg supports multiple operating platforms, so that the data of the Android platform can be encoded and used by any platform (including the Android platform).
[0109] Based on the above embodiments, the present invention further provides a coding and decoding device. Figure 8 Schematic diagram of the structure of the encoding and decoding device in an embodiment of the present invention. Figure 8 As shown, the encoding and decoding device 80 includes:
[0110] The decoder 801 supporting multiple operating platforms is used to receive first coded data sent by the encoder; the first coded data is data obtained after the encoder supporting the first operating platform encodes the obtained screen recording data; the decoder and the encoder are installed in different devices;
[0111] The decoder 801 is further configured to decode the first encoded data to obtain decoded data;
[0112] The processing unit 802 is configured to convert the video decoding data included in the decoded data into rendering data of the rendering object of the first operating platform and display the data when the decoder is not compatible with the rendering object in the first operating platform.
[0113] In an embodiment of the present invention, the decoder supports multiple operating platforms and solves the problem that the decoder is incompatible with rendering objects in the first operating platform, so that the screen recording data of the first operating platform can be encoded and used on any operating platform, that is, the cross-platform capability of the decoding end is provided, thereby realizing functions such as multi-screen interaction and mirror projection.
[0114] In some embodiments, the processing unit 802 is further used to store the decoded data in a first structure; convert the video decoded data in the first structure into rendering data of a rendering object of the first operating platform; and play the audio decoded data in the first structure.
[0115] In some embodiments, the processing unit 802 is also used to assign the pointer of the first structure included in the first parameter to the second parameter through the first function; obtain the video decoding data in the first structure based on the pointer of the first structure included in the second parameter through the second function, and pass it to the third parameter; and pass the rendering data of the third parameter to the rendering object included in the fourth parameter; the third parameter is used to convert the video decoding data in the first structure into the rendering data.
[0116] In some embodiments, the processing unit 802 is also used to convert the first encoded data of the first data type into second encoded data of the second data type; store the second encoded data of the second data type in a second structure; and send the second structure to the decoder for decoding to obtain the decoded data.
[0117] In some embodiments, the processing unit 802 is further used to perform audio decoding on the audio encoding data included in the second encoding data in the second structure to obtain audio decoded data; perform video decoding on the video encoding data included in the second encoding data in the second structure to obtain video decoded data; and obtain the decoded data based on the audio decoded data and the video decoded data.
[0118] In some embodiments, the processing unit 802 is further configured to receive the first encoded data from the encoder through a receiving unit based on a preset network communication method, and send the first encoded data to the decoder.
[0119] In some embodiments, the decoder is Ffmpeg and the encoder is Mediacodec.
[0120] The embodiment of the present invention further provides another electronic device, Fig. 9 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Fig. 9 As shown, the electronic device 90 includes: a processor 901 and a memory 902 configured to store a computer program that can be run on the processor;
[0121] The processor 901 is configured to execute the method steps in the aforementioned embodiment when running a computer program.
[0122] Of course, in practical applications, Fig. 9 As shown, the components in the electronic device 90 are coupled together via a bus system 903. It is understood that the bus system 903 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 903 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus system 903.
[0123] In practical applications, the processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiments of the present invention do not specifically limit this.
[0124] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor.
[0125] In an exemplary embodiment, an embodiment of the present invention further provides a computer-readable storage medium for storing a computer program.
[0126] Optionally, the computer-readable storage medium can be applied to any one of the methods in the embodiments of the present invention, and the computer program enables the computer to execute the corresponding processes implemented by the processor in each method in the embodiments of the present invention. For the sake of brevity, they are not described here.
[0127] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0128] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0129] In addition, all functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art may understand that all or part of the steps of implementing the above method embodiments may be completed by hardware related to program instructions, and the above program may be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the above storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0130] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0131] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0132] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0133] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A coding and decoding method, characterized in that: The encoding and decoding method comprises: The first coded data sent by the encoder is received by a decoder supporting multiple operating platforms; the first coded data is data obtained after the encoder supporting the first operating platform encodes the obtained screen recording data; the decoder and the encoder are installed in different devices; Decoding the first encoded data by the decoder to obtain decoded data; In the case that the decoder is not compatible with the rendering object in the first operating platform, the video decoding data included in the decoded data is converted into rendering data of the rendering object of the first operating platform and displayed.
2. The encoding and decoding method according to claim 1, characterized in that: The converting the video decoded data included in the decoded data into rendering data of the rendering object of the first operating platform comprises: Storing the decoded data in a first structure; Converting the video decoding data in the first structure into rendering data of a rendering object of the first operating platform; The encoding and decoding method further includes: playing the audio decoding data in the first structure.
3. The encoding and decoding method according to claim 2, characterized in that: The converting the video decoding data in the first structure into rendering data of the rendering object of the first operating platform includes: Assign the pointer of the first structure included in the first parameter to the second parameter through the first function; The video decoding data in the first structure is obtained through a second function based on the pointer to the first structure included in the second parameter, and is passed to a third parameter; and the rendering data of the third parameter is passed to the rendering object included in the fourth parameter; the third parameter is used to convert the video decoding data in the first structure into the rendering data.
4. The encoding and decoding method according to claim 1 or 2, characterized in that: The decoding of the first encoded data by the decoder to obtain decoded data includes: Converting the first encoded data of the first data type into second encoded data of the second data type; storing the second encoded data of the second data type in a second structure; The second structure is sent to the decoder for decoding to obtain the decoded data.
5. The encoding and decoding method according to claim 4, characterized in that: The step of sending the second structure to the decoder for decoding to obtain the decoded data includes: For the audio coded data included in the second coded data in the second structure, perform audio decoding on the audio coded data to obtain audio decoded data; For the video encoding data included in the second encoding data in the second structure, performing video decoding on the video encoding data to obtain video decoding data; The decoded data is obtained based on the audio decoded data and the video decoded data.
6. The encoding and decoding method according to claim 1 or 2, characterized in that: The receiving, by a decoder supporting multiple operating platforms, first encoded data sent by an encoder comprises: The first encoded data of the encoder is received by a receiving unit based on a preset network communication mode, and sent to the decoder.
7. The encoding and decoding method according to any one of claims 1 to 3, characterized in that: The decoder is Ffmpeg, and the encoder is Mediacodec.
8. A coding and decoding device, characterized in that: The encoding and decoding device comprises: A decoder supporting multiple operating platforms, used for receiving first coded data sent by an encoder; the first coded data is data obtained after the encoder supporting the first operating platform encodes the obtained screen recording data; the decoder and the encoder are installed in different devices; The decoder is further used to decode the first encoded data to obtain decoded data; The processing unit is used to convert the video decoding data included in the decoded data into rendering data of the rendering object of the first operating platform and display it when the decoder is not compatible with the rendering object in the first operating platform.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory configured to store a computer program capable of running on the processor, Wherein, the processor is configured to execute the steps of the encoding and decoding method according to any one of claims 1 to 7 when running the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the encoding and decoding method according to any one of claims 1 to 7 are implemented.
