Here explanation will be performed to exemplary embodiment in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects be described in detail in claims, the disclosure.
At present, in the structure of video playback application program, the amc plug-in units that are widely used that in GStreamer frameworks
With gst-omx plug-in units.
Wherein, amc plug-in units are the GstVideoDecoder base class for inheriting GStreamer frameworks, and Android system is connected with this
MediaCodec interfaces, and then realize the decoding and display of video data.
The advantages of amc plug-in units, can be achieved on the perfect adaptation of GStreamer frameworks and Android system, and shortcoming is to abide by
The flow of GStreamer frameworks is followed, it is necessary to which the decoding data that decoding is obtained is copied to after video data decoding
In the GstBuffer that GStreamer frameworks are specified, carried out so that decoding data is pushed into player plug-in unit by GstBuffer
Because decoding data is yuv format, generally there is huger data volume, if each frame decoding data all need
GstBuffer is returned by output cached copies, not only reduce the efficiency of Video processing, and also create the card of video playback
, the performance of influence video playback seriously.
Similarly, gst-omx plug-in units also have the shortcomings that similar, in addition, the complexity of gst-omx plug-in units is higher, exploit person
Member needs to spend longer time to go to grasp, and is also unfavorable for reducing R＆D costs.
Therefore, current video broadcasting method goes to realize video playback application journey also by customized HAL layer interfaces
Sequence structure, but this method is poor compared with the versatility of GStreamer frameworks, has had a strong impact on the expansible of video broadcasting method
Property and professional platform independence.
Based on this, the video broadcasting method in the prior art based on GStreamer frameworks still suffer from Video processing efficiency compared with
The defects of low, therefore, disclosure spy proposes a kind of video based on GStreamer frameworks that can improve Video processing efficiency
Player method, video broadcasting method of this kind based on GStreamer frameworks are applied to electronic equipment.
Referring to Fig. 2, Fig. 2 is the hardware block diagram of a kind of electronic equipment according to an exemplary embodiment.Electricity
Sub- equipment can be smart mobile phone, desktop computer, notebook computer, tablet personal computer or be available for video playback application program to run
Other electronic equipments, be not defined herein.
It should be noted that the electronic equipment 100 is an example for adapting to the disclosure, it is impossible to thinks there is provided
To any restrictions of the use range of the disclosure.The electronic equipment 100 can not be construed to need to rely on or must have
One or more component in the exemplary electronic equipment 100 shown in Fig. 2.
(only show in figure as shown in Fig. 2 electronic equipment 100 includes memory 101, storage control 103, one or more
Go out one) processor 105, Peripheral Interface 107, radio-frequency module 109, locating module 111, photographing module 113, audio-frequency module 115,
Touch Screen 117 and key-press module 119.These components are mutually communicated by one or more communication bus/signal wire 121.
Wherein, memory 101 can be used for storage software program and module, as in disclosure exemplary embodiment based on
Programmed instruction and module corresponding to the video broadcasting method and device of GStreamer frameworks, processor 105 are stored in by operation
Programmed instruction in memory 101, so as to perform various functions and data processing, that is, realize and above-mentioned be based on GStreamer frames
The video broadcasting method of frame.
The carrier that memory 101 stores as resource, can be random storage medium, such as high speed random access memory, non-
Volatile memory, such as one or more magnetic storage devices, flash memory or other solid-state memories.Storage mode can be
Of short duration storage permanently stores.
Peripheral Interface 107 can include an at least wired or wireless network interface, an at least connection in series-parallel translation interface, at least
One input/output interface and at least USB interface etc., for outside various input/output devices to be coupled into memory
101 and processor 105, to realize the communication with outside various input/output devices.
Radio-frequency module 109 is used for transceiving electromagnetic ripple, the mutual conversion of electromagnetic wave and electric signal is realized, so as to pass through communication network
Network is communicated with other equipment.Communication network includes cellular telephone networks, WLAN or Metropolitan Area Network (MAN), above-mentioned communication network
Network can use various communication standards, agreement and technology.
Locating module 111 is used for the geographical position being currently located for obtaining electronic equipment 100.The example of locating module 111
Including but not limited to GPS (GPS), the location technology based on WLAN or mobile radio communication.
Photographing module 113 is under the jurisdiction of camera, for shooting picture or video.The picture or video of shooting can be deposited
In storage to memory 101, it can also be sent by radio-frequency module 109 to host computer.
Audio-frequency module 115 provides a user COBBAIF, and it may include one or more microphone interfaces, one or more
Speaker interface and one or more earphone interfaces.Interacting for voice data is carried out with miscellaneous equipment by COBBAIF.Sound
Frequency can also be sent according to that can store to memory 101 by radio-frequency module 109.
Touch Screen 117 provides an I/O Interface between electronic equipment 100 and user.Specifically, Yong Huke
Input operation, such as the gesture operation such as click, touch, slip are carried out by Touch Screen 117, so that electronic equipment 100 is to this
Input operation is responded.Then by word, picture, either any one form of video or combination are formed electronic equipment 100
Content is exported by Touch Screen 117 to user's display output.
Key-press module 119 includes at least one button, to provide the interface that user is inputted to electronic equipment 100,
User can make electronic equipment 100 perform different functions by pressing different buttons.For example, sound regulating key is available for using
Realize the regulation of the wave volume played to electronic equipment 100 in family.
It is appreciated that structure shown in Fig. 2 is only to illustrate, electronic equipment 100 may also include than shown in Fig. 2 more or more
Few component, or there is the component different from shown in Fig. 2.
In addition, also can equally realize the disclosure by hardware circuit or hardware circuit combination software instruction, therefore, realize
The disclosure is not limited to any specific hardware circuit, software and both combinations.
Referring to Fig. 3, in one exemplary embodiment, a kind of video broadcasting method based on GStreamer frameworks is applicable
In electronic equipment, the electronic equipment is applied to hardware configuration illustrated in fig. 2.
Video broadcasting method of this kind based on GStreamer frameworks can be performed by electronic equipment, can include following step
Step 210, by specifying caching to obtain video data.
Specified caching refers to the GstBuffer specified by GStreamer frameworks, and all types of plug-in units are buffered in by specifying
Data transfer is carried out between (such as decoder plug-in unit, player plug-in unit), so as to ensure based on constructed by GStreamer frameworks
Various multimedia applications (such as video playback application program) can follow the flow of GStreamer frameworks.
The video data stored in caching is specified to derive from the front end hardware equipment set by electronic equipment, for example,
Front end hardware equipment is camera；Can also derive from electronic equipment set by local cache, for example, local cache include with
Machine memory, read-only storage, hard disk, disk, flash memory etc., are not limited herein.
Specifically, the video data that receiving front-end hardware device collects, or, video counts are extracted by local cache
According to, and video data is stored to specified caching.
Stored in video data to specified caching, just can be by specifying when needing to decode video data
Video data to be decoded is obtained in caching.
Step 230, call decoder plug-in unit to be decoded to obtain decoding data to video data, and decoding data is stored
The output caching set to decoder plug-in unit.
Specifically, for the video data by specifying caching to get, first, video data is copied to decoder plug-in unit
The input-buffer of setting, then the video data in input-buffer is decoded to obtain decoding data, and then decoding data is deposited
The output caching set to decoder plug-in unit is stored up, to wait the decoding data in subsequently being cached to output to carry out video playback.
It is noted that compared to prior art, different, decoding data is being stored to output caching
Afterwards, it can't be copied and refer to determine caching.That is, transmitted by specifying to be buffered between decoder plug-in unit and player plug-in unit
Data will no longer be decoding data.
Step 250, player plug-in unit is obtained by specifying the media decoder object of caching push, and calls media decoder object
Decoding data during the display interface of middle encapsulation caches to output carries out video playback.
In order to avoid decoding data is copied back into specified caching, decoder plug-in unit is buffered in playing as it was previously stated, specifying
The data transmitted between device plug-in unit will no longer be decoding data, that is to say, that be inserted by specifying caching to push to player
Part is no longer decoding data.
Thus, in order to follow the flow of GStreamer frameworks, in the present embodiment, by specifying caching to push to player
Plug-in unit is media decoder object.Wherein, media decoder object creates for structure video playback application program.
In the establishment of media decoder object, display interface will be packaged into media decoder object.The display interface by with
In to decoding data progress video playback.For example, the display interface can be Android system standard application program interface (such as
MediaCodec interfaces), or, the display interface is the application programming interfaces of the self-defined generation of linux system.
It should be noted that when the standard application program interface of Android system is packaged into media decoder object, it is
GStreamer frameworks are combined with Android system, and then are advantageous to build video playback application program in Android system.
Similarly, when the application programming interfaces of the self-defined generation of linux system are packaged into media decoder object, be by
GStreamer frameworks combine with linux system, and then are advantageous to build video playback application program in linux system.
Based on process as described above, by specifying caching to carry out the push of media decoder object to substitute decoding data to push away
Sending so that the structure of video playback application program still follows the flow of GStreamer frameworks, meanwhile, pass through media decoding pair
Decoding data in directly being cached as the display interface of middle encapsulation to output carries out video playback, it is entirely avoided copy solution
Code data and then improve the efficiency of Video processing, have fully ensured that the fluency of video playback to the possibility of specified caching,
Be advantageous to improve the performance of video playback.
Referring to Fig. 4, in one exemplary embodiment, before step 250, method as described above can also include following
Step 310, media decoder object is defined for structure video playback application program.
Step 330, a structure is constructed according to the pointer of the pointer of media decoder object and output caching, and by structure
By specifying caching to push to player plug-in unit.
Illustrate first, the pointer of media decoder object is used to indicate media decoder object, i.e. is decoded by media
The pointer of object is just able to access that media decoder object and its display interface.
Secondly, the pointer for exporting caching points to the decoding data being stored in output caching, i.e. by the finger for exporting caching
Pin is just able to access that the decoding data in output caching.
Because decoding data can't be by specifying caching to be pushed to player plug-in unit so that player plug-in unit can not
Video playback directly is carried out to decoding data, for this reason, it may be necessary to be changed to the processing mode of player plug-in unit, i.e., adjusted with interface
Mode is gone to show and discharges the decoding data in output caching.
Based on this, before the decoding data in being shown and discharging output caching, player plug-in unit is firstly the need of obtaining
Know how calling interface and how to access output caching in decoding data.
Specifically, a media decoder object is defined for structure video playback application program first, and then is decoded by media
The pointer of object and the pointer of output caching carry out structure construction, then are inserted by specifying caching that structure is pushed into player
Part, sealed in order to which follow-up play device plug-in unit can be realized in media decoder object by the pointer of media decoder object in structure
The calling of the display interface of dress, and the decoding data exported in caching can be read by exporting the pointer of caching in structure.
It should be noted that because decoding data is not by output cached copies to specified caching, then decoding data can not
Release, therefore, in the present embodiment, the decoding data finished by way of interface interchange to display discharges.
Referring to Fig. 5, in one exemplary embodiment, step 250 may comprise steps of：
Step 251, the pointer of media decoder object and the pointer of output caching are extracted by structure.
As it was previously stated, when creating media decoder object for structure video playback application program, structure is according to media solution
The pointer of code object and the pointer construction of output caching, and by specifying caching to push to player plug-in unit.
Therefore, for player plug-in unit, after specified caching has carried out structure push, this can just be got
Structure, and the pointer for extracting to obtain the pointer of media decoder object and output caches by the structure.
Step 253, the display interface encapsulated in media decoder object is called by the pointer of media decoder object, and passed through
The pointer of output caching reads the decoding data in output caching.
After the pointer of media decoder object is obtained, just media can be accessed by the pointer of media decoder object and decoded
Object and its display interface, i.e. call the display interface encapsulated in media decoder object.
Correspondingly, after the pointer of output caching is obtained, just output caching can be accessed by exporting the pointer of caching
In decoding data, i.e. with output buffer pointers movement, one by one read output caching in decoding data.
Step 255, decoding data is carried out by display interface to show.
After display interface and decoding data is determined, the mode that player plug-in unit will pass through display interface calling is realized
The display of decoding data, and data to be decoded show and finish release decoding data.
Based on above-mentioned process, player plug-in unit is not really to have handled decoding data, but calls display interface to go
Show and discharge decoding data, with this avoid by decoding data by output cached copies refer to fixed caching and by specify cache into
Row push, so as to improve the efficiency of Video processing, ensure that the fluency of video playback, be advantageous to improve the property of video playback
In one exemplary embodiment, before step 250, method as described above can also comprise the following steps：
The captions structure pointer of caption data is pointed in extension one in structure.
First, captions structure pointer points to caption data, i.e. is just able to access that captions number by captions structure pointer
Secondly, structure extension refers to the pointer of the pointer that media decoder object is with the addition of in structure and output caching
On the basis of, then add captions structure pointer.
Correspondingly, referring to Fig. 6, step 250 can also comprise the following steps：
Step 252, captions structure pointer is extracted by structure, and caption data is obtained by captions structure pointer.
As it was previously stated, when creating media decoder object for structure video playback application program, captions are extended in structure
Structure pointer, and the structure is by specifying caching to push to player plug-in unit.
Therefore, for player plug-in unit, after specified caching has carried out structure push, this can just be got
Structure, and extracted by the structure to obtain captions structure pointer.
Because letter configuration body pointer is directed to caption data, after captions structure pointer is obtained, just can lead to
Cross captions structure pointer and access caption data, i.e. the movement of follow-up captions structure pointer, obtain caption data one by one.
Wherein, caption data can be stored in local cache, for example, local cache includes but is not limited to：Random storage
Device, read-only storage, hard disk, disk, flash memory etc..
Step 254, when carrying out video playback to decoding data, enter according to the Subtitle Demonstration mode indicated in title plug-ins
Row caption data is shown.
Title plug-ins, it is used to indicate whether to show captions, Subtitle Demonstration mode etc..
After caption data is obtained, player plug-in unit just can together show caption data with decoding data.
Specifically, judge whether to show captions by title plug-ins first, when it is determined that during without Subtitle Demonstration, then only
Carry out the display of decoding data.Now, caption data is dropped.
Subtitle Demonstration mode is determined when it is determined that carrying out Subtitle Demonstration, then by title plug-ins, and according to Subtitle Demonstration side
Formula carries out the display of decoding data and caption data, i.e. when carrying out video playback to decoding data, caption data is included
In video playback interface.
Fig. 7 is a kind of specific implementation schematic diagram of the video broadcasting method based on GStreamer frameworks in an application scenarios.
In the application scenarios, by performing step 401, call decoder plug-in unit to decode video data and solved
Code data, and decoding data is stored to the output set to decoder plug-in unit and cached.
By performing step 402, a structure is constructed according to the pointer of the pointer of media decoder object and output caching, and
Structure is copied to specified caching, to be tied subsequently through specified be buffered between decoder plug-in unit and player plug-in unit
The transmission of structure body.Wherein, media decoder object creates for structure video playback application program, can be used for wherein being packaged with
The display interface of video playback is carried out to decoding data.
By performing step 403, specify the structure in caching to be pushed to player plug-in unit, decoding data is substituted with this
By specifying caching to push, decoding data had both been avoided by output cached copies to specified caching, while also assures that GStreamer
Framework flow is followed.
By performing step 404, player plug-in unit is therefrom extracted by specifying the push of caching to get structure
To the pointer of media decoder object and the pointer of output caching.
By performing step 405, the display encapsulated in media decoder object is called to connect by the pointer of media decoder object
Mouth goes the pointer decoding data that is accessed of the display by output caching, and the aobvious of image frame in video playback interface is realized with this
Thus, avoid decoding data and to be referred to determine caching by output cached copies, and then improve the effect of Video processing
Rate, the fluency of video playback is ensure that, be advantageous to improve the performance of video playback.
Following be embodiment of the present disclosure, can be used for performing involved by the disclosure based on GStreamer frameworks
Video broadcasting method.For the details not disclosed in embodiment of the present disclosure, refer to involved by the disclosure based on
The video broadcasting method embodiment of GStreamer frameworks.
Referring to Fig. 8, in one exemplary embodiment, a kind of video play device 700 based on GStreamer frameworks should
For electronic equipment, include but is not limited to：Data acquisition module 710, data decoder module 730 and data playing module 750.
Wherein, data acquisition module 710 is used for by specifying caching to obtain video data.
Data decoder module 730 is used to call decoder plug-in unit to be decoded to obtain decoding data to video data, and will
Decoding data stores the output caching set to decoder plug-in unit.
Data playback module 750 is used for player plug-in unit and obtained by specifying the media decoder object of caching push, and calls
Decoding data during the display interface encapsulated in media decoder object caches to output carries out video playback, and media decoder object is
Build video playback application program and create.
Referring to Fig. 9, in one exemplary embodiment, device 700 as described above also includes but is not limited to：Object definition
Module 810 and structure constructing module 830.
Wherein, object definition module 810 is used to define media decoder object for structure video playback application program.
Structure constructing module 830 is used to construct a structure according to the pointer of media decoder object and the pointer of output caching
Body, and by structure by specifying caching to push to player plug-in unit.
Referring to Fig. 10, in one exemplary embodiment, data playback module 750 includes but is not limited to：Pointer extracting list
Member 751, pointer applying unit 753 and data display unit 755.
Wherein, pointer extracting unit 751 is in the pointer that media decoder object is extracted by structure and the pointer of output caching.
Pointer applying unit 753 is used to call the display encapsulated in media decoder object by the pointer of media decoder object
Interface, and the pointer by exporting caching reads the decoding data exported in caching.
Data display unit 755 is used to be shown by display interface progress decoding data.
In one exemplary embodiment, device 700 as described above also includes but is not limited to：Structure expansion module.
Wherein, structure expansion module is used for the captions structure pointer that caption data is pointed in the extension one in structure.
Correspondingly, Figure 11 is referred to, data playback module 750 also includes but is not limited to：Captions acquiring unit 752 and captions
Display unit 754.
Wherein, captions acquiring unit 752 is used to extract captions structure pointer by structure, and is referred to by captions structure
Pin obtains caption data.
Subtitle Demonstration unit 754 is used for when carrying out video playback to decoding data, according to the word indicated in title plug-ins
Curtain display mode carries out caption data and shown.
It should be noted that the video play device based on GStreamer frameworks that above-described embodiment is provided is being carried out
When video playback based on GStreamer frameworks is handled, only carried out with the division of above-mentioned each functional module for example, actual should
In, it can be completed as needed and by above-mentioned function distribution by different functional modules, i.e. regarding based on GStreamer frameworks
The internal structure of frequency playing device will be divided into different functional modules, to complete all or part of function described above.
In addition, the video play device based on GStreamer frameworks that above-described embodiment is provided is with being based on GStreamer
The embodiment of the video broadcasting method of framework belongs to same design, and wherein modules perform the concrete mode of operation in side
It is described in detail in method embodiment, here is omitted.
In one exemplary embodiment, a kind of electronic equipment, including but not limited to processor and memory.
Wherein, computer-readable instruction is stored with memory, the computer-readable instruction is realized when being executed by processor
As above the video broadcasting method based on GStreamer frameworks in each embodiment.
In one exemplary embodiment, a kind of computer-readable recording medium, is stored thereon with computer program, the calculating
The video broadcasting method based on GStreamer frameworks in each embodiment as above is realized when machine program is executed by processor.
The preferable examples embodiment of the above, the only disclosure, the embodiment for being not intended to limit the disclosure, this
Field those of ordinary skill can very easily carry out corresponding flexible or repair according to the central scope and spirit of the disclosure
Change, therefore the protection domain of the disclosure should be defined by the protection domain required by claims.