OTT terminal solution based on customizing browser
Technical field
The present invention relates to the linux system of OTT terminal and the compatibility method of Android system, specifically a kind of OTT terminal solution based on customizing browser.
Background technology
In November, 2012, millet issue OTT Set Top Box, halted after one week, in March, 2013, millet associating CNTV successfully brings back to life box.OTT terminal is made popular by market thus, and Ge great Internet firm issues the OTT terminal of oneself in succession.Happy depending on having issued after C1, C1S two Set Top Box, in May, 2013, issued first super TV X60.In September, 2013, millet, like that strange skill, Ali's philosophy release Own Brand televisor, the conventional television manufacturer release new architecture that also follows up.
On August 1st, 2013, State Council prints and distributes < < " broadband China " strategy and embodiment > >, the operators such as telecommunications, movement, UNICOM have started region action, bandwidth operator among the people etc. also get involved competition, accelerated layout and the enforcement of broadband market, this has just little by little met the requirement of OTT service to broadband speeds.Therefore, each operator starts to proceed to open OTT from the IPTV of sealing, and has carried out various trials.
OTT terminal form mainly contains two kinds, Set Top Box and televisor.Which kind of form no matter, its operating system was mainly the embedded systems such as Linux originally.In November, 2007, Google and 84 hardware manufacturer, software developer and the open handheld device of establishment alliances of telecom operators research and develop improvement Android system jointly, subsequently, Google has issued the source code of Android, in May, 2010, Google issued a new product G oogle TV, and in listing in autumn then.OTT terminal enters the intelligence epoch thus, and domestic big or small manufacturer has released Set Top Box or the televisor of the Android system of oneself one after another.
So the current OTT terminal that exists a large amount of Linux and Android, the terminal of Linux is mainly present in IPTV network, and each is runed commercial city and by upgrading, is making OTT terminal into gradually.And new intelligent OTT terminal major part is all used Android system, and Android is widely used, and becomes the new standard of intelligent OTT terminal.
The OTT terminal of current each manufacturer does not all accomplish to take into account linux system and Android system, main cause is that the display system of linux system is mainly browser, its framework mostly is BS, and the display system of Android system is not limited to browser, also have a lot of local demonstrations, its framework mostly is CS.
Mainly there is following problem in present stage:
The demonstration incompatibility problem of 1.Linux system and Android system, causes linux system software transplanting after Android, need to from the beginning develop.
2.Android system version is too many, and between version, has incompatibility problem, causes the exploitation of each version different, needs a large amount of developers.
3. each manufacturer is all at the Android system API of customization oneself, and the terminal that causes each manufacturer is distinguishing, and exploitation need to be made corresponding modification for manufacturer.
The terminal of 4.Android system is a lot, and resolution also has several, causes user in each terminal experience and show inconsistent.
5.Linux system and Android system are very different on showing, cause the browser on linux system can not be applied directly in Android system, need a large amount of modifications.
Browser in 6.Linux system, after being transplanted to Android system, does not directly use the demonstration of Android system, causes the browser transplanted in Android system slow.
Summary of the invention
The present invention proposes a kind of OTT terminal solution based on customizing browser, the linux system and the incompatible variety of issue causing of Android system that to solve existing OTT terminal technology, exist.
Technical scheme of the present invention is achieved in that
An OTT terminal solution based on customizing browser, comprises the following steps:
The compiling system of the browser engine that a. can use on linux system is modified, for running on the program compilation of Android system;
B. with reference to the relation between the code of the described browser engine on linux system, the program of writing in Android system realizes file;
C. the compiling system of revising the third party library of described browser engine needs, compiles out static library available in Android system;
D. revise the external interface code of described browser engine.
Wherein, described browser engine is webkit browser engine.
Wherein, described compiling system is cmake or aotutools.
Wherein, described third party library is curl, cairo, fontconfig, freetype, icu, jpeg, png, xml2 or sqlite3.
A kind of concrete scheme is that when described compiling system is cmake, described step a is the CMakeLists file with reference to the cmake of Efl or GTK platform, writes new CMakeLists file for running on the program compilation of Android operating system.
Preferred version is, also comprise customizing functions step after described steps d, described customizing functions step makes the Function Extension of Javascript can be expanded or be realized by being built into mode in DOM label by Plugin mode the Function Extension of Javascript by revising Plugin expansion interface mode.
Preferred version is, described customizing functions step comprises by the mode of Plugin or the mode of built-in Java object and realizes mutually calling between Java and Javascript.
Preferred version is, also comprises that Optimization Steps, described Optimization Steps comprise demonstration Graphics is modified after described customizing functions step, all pictures all carried out to buffer memory, and directly decode in the hardware internal memory of local system.
Preferred version is, also comprise that Optimization Steps, described Optimization Steps comprise by directly calling OpenGLES2.0 or showing by revising this locality that third party library uses the method for OpenGLES2.0 to realize Android system indirectly after described customizing functions step.
Beneficial effect of the present invention is:
The present invention has solved the problem that existing OTT terminal faces well:
The demonstration of 1.Linux system and Android system can be compatible, and the software on linux system has been transplanted in Android system easily.
2.Android system version is too many, and between version, has incompatiblely, can move the browser of same customization on the different editions of Android.
3. each manufacturer is all at the Android system API of customization oneself, and the difference between these API can be compatible in the browser of customization.
The terminal of 4.Android system is a lot, and resolution also has several, and the browser customizing for different resolution can show same content.
5.Linux system and Android system are very different on showing, the browser of customization has been compatible Linux and the API of Android system, can in two systems, use same code.
Browser in 6.Linux system, after being transplanted to Android system, does not directly use the demonstration of Android system, and the browser of customization is when optimizing, and this locality that has increased Android system shows.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic diagram that is related between Webkit browser engine code;
Fig. 2 is the schematic diagram that is related between Webkit browser engine and third party library;
Fig. 3 is the position view of interface code;
Fig. 4 is the position view of Plugin;
Fig. 5 is the schematic diagram that calls between Java and Javascript;
Fig. 6 is cross-domain access schematic diagram between HTML in Web;
Fig. 7 is failed download retry procedure schematic diagram;
Fig. 8 is that Javascript is to carrying the schematic diagram that calls of player in Android system.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Technological core of the present invention is customizing browser, optimizes browser, so that compatible operating system, display engine and system architecture etc. well.The browser of the present embodiment is customize and optimize on the basis of the Webkit browser engine of increasing income.Webkit browser engine has source code structure clearly, and therefore the rendering speed being exceedingly fast is transplanted and safeguard all more convenient in embedded system.
The present embodiment is mainly three aspects, transplanting, customizing functions and optimization to the modification of Webkit browser engine.First be to transplant, its detailed step is as follows:
A. the compiling system of webkit browser engine is modified, for running on the program compilation of Android system:
The source code of downloading webkit browser engine from www.webkit.org website, this can need a period of time, preferably uses git Version to download.
Revise the compiling system of webkit browser engine: compiling system mainly contains four at present: autotools, cmake, xcode and vc.Wherein autotools and cmake can be used on linux system, and the writing and generate all than the easy understanding of autotools of cmake, and therefore selecting cmake is the compiling system of transplanting Webkit browser engine.Using at present the four platforms that has of cmake compiling system: Efl, WinCE, BlackBerry and GTK, wherein Efl and GTK can be used on linux system, therefore can, with reference to the CMakeLists file of these two cmake compiling systems, write new CMakeLists file for running on the program compilation of Android operating system.
B. with reference to the Webkit browser engine on linux system, realize, as the relation between the Webkit browser engine code of Fig. 1 demonstration, the program of writing in Android system realizes file.Here mainly concentrate on the program file that platform is relevant, and be mainly wherein the modification of two aspects, one is to show graphics, and one is event Event.
C. the compiling system of revising the third party library of browser engine needs, compiles out static library available in Android system:
Download the third party library that Webkit browser engine needs, as Fig. 2 shows the relation between Webkit browser engine and third party library.The third party library that Webkit browser engine uses is all the storehouse of increasing income, and therefore can download source code, and revise its compiling system, compiles out static library available in Android system.For convenient, revise and compiling third party library, the present embodiment has rewritten the compiling system of all third party libraries of using by cmake compiling system.Third party library is mainly curl, cairo, fontconfig, freetype, icu, jpeg, png, xml2, sqlite3 etc.
D. revise the external interface code of browser engine:
Revise the external interface code of Webkit browser engine, so that can in Android system, use, as the position of Fig. 3 display interface code.The present embodiment mainly Efl based on Webkit1 realize to be revised, most of built-in browser use less than code all remove, and it is simpler, conveniently to revise API.Also can modify targetedly according to actual needs.
Transplant Webkit browser engine after Android system, also need to carry out customizing functions, so that develop better OTT end product, customizing functions step makes the Function Extension of Javascript can be expanded or be realized by being built into mode in DOM label by Plugin mode the Function Extension of Javascript by revising Plugin expansion interface mode.
The present embodiment is expanded Javascript function by the mode of Plugin, and the function of increase is as follows:
Function 1: revise Plugin expansion interface mode, the expansion of Javascript can be expanded by Plugin mode, as Fig. 4 shows the position of Plugin.
Function 2: by the Plugin mode of revising, realize Android operating system program and write the language Javascript that writes of language Java and Web program and directly mutually call, as Fig. 5 shows calling between Java and Javascript.
Function 3: as shown in Figure 6, realize in Web the function of cross-domain access between HTML.
Function 4: as shown in Figure 7, realize when network is downloaded Web resource, the function of retry after failure, can be increased in network when bad, the successful probability of resource downloading like this.
Function 5: as shown in Figure 8, increase Javascript to carrying calling of player in Android system by function 2, and increase to return and call.
After customizing Web kit browser engine, the required all functions of OTT terminal can have been completed, but the efficiency of operation also needs further raising, therefore also need the Webkit browser engine of customization to carry out necessary optimization, especially aspect demonstration Graphics, the present embodiment has mainly been revised 2 points:
1. demonstration Graphics is modified, all pictures are all carried out to buffer memory, and directly decode in the hardware internal memory of local system, when picture is shown, can improve significantly display efficiency like this.
2. by this locality of directly calling OpenGLES2.0 or indirectly use the method for OpenGLES2.0 to realize Android system by modification third party library, show.In Android system, directly use the display system OpenGLES2.0 carrying can further improve the efficiency of demonstration.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.