A kind of hardware-accelerated control method of Flash and system
Technical field
The present invention relates to Internet technical field, be specifically related to hardware-accelerated control method and the system of Flash in a kind of browser.
Background technology
Flash technology has become the technical standard of interactive polar plot and Web animation, widespread use in all kinds of internet applications, after the Flash plug-in unit that is applicable to browser has been installed in user personal computer, just can watch the Flash special efficacys such as the video in webpage.From Flash9 version, introduce " hardware-accelerated " function, hardware-accelerated is exactly to utilize hardware module to carry out instead of software algorithm to make full use of the intrinsic rapid charater of hardware.Open the hardware-accelerated occupancy that can effectively reduce CPU, the now branched high definition resolution of the highest 1080P of holding of Online Video, open the hardware-accelerated video card that can utilize video data is shared to processing, reduce the occupancy of CPU, like this for the lower super utmost point of some cpu performances this, or the computer of master's machine can be more smooth.
The advantage of hardware decoding is that efficiency is high, low in energy consumption, heat power consumption is low, and shortcoming is that to lack strong support limitation larger, arranges comparatively complicated.When hardware decoding comes into force, three processors, CPU, GPU and APU pass through bus exchanging data.Hardware decoding needs that hardware has that hardware decoder module, relevant driving coordinate, suitable playout software and the setting correct to playout software, lacks one and can not open hardware decoding function.Once decoding, hardware unsuccessfully just there will be flower screen, fuzzy mosaic etc.; The serious phenomenon of pausing or crashing of occurring while even causing displaying video full frame.Can there is bug in current some Flash version, cause part video card playing flash video in the situation that unlatching Flash is hardware-accelerated to occur flower screen.
In order to allow the Flash program of installing in user personal computer adapt to as much as possible the Flash application in different web pages; prior art can be chosen in when user enters the Web page, to check whether the version of Flash program in subscription client machine is up-to-date conventionally, is upgraded to latest edition if not just pointing out user to download up-to-date Flash installation bag.Employing said method is updated to the mode of newest F lash version, although convenient and simple, due to the soft and hardware environmental difference of different clients, still very high even if incompatible possibility occurs for latest edition Flash program and system environments.
In sum, cause that video web page broadcasting occurs that the reason of flower screen or pause stuck phenomenon has a lot, there are Flash version reason, hardware compatibility reason, the hardware-accelerated reasons such as complexity that arrange, cause that the reason of flower screen or pause stuck phenomenon appears in video web page broadcasting and be difficult to identify for domestic consumer, enable to find out reason, due to Flash hardware-accelerated more complicated is set, domestic consumer also cannot solve the problem that Flash object cannot normally be played up.The present invention proposes for the problems referred to above just a kind of in browser to the hardware-accelerated method of controlling of Flash, solve these technical matterss, promote the user who uses browser to see the Flash special efficacys such as video and experience.
Summary of the invention
For the defect existing in prior art, the object of the present invention is to provide the hardware-accelerated control method of a kind of Flash and system, judge whether to open hardware-accelerated according to the source of Flash.
For achieving the above object, the technical solution used in the present invention is as follows:
The hardware-accelerated control method of a kind of Flash, comprising:
Browser receives the uniform resource position mark URL of user's request, and the each Flash object requests in the asked URL page is created respectively to Flash object;
Obtain the configuration file of local Flash program, according to configuration file, described Flash object is carried out to setup of attribute;
Check that asked URL is whether in the preset storehouse of URL, if by the hardware-accelerated setup of attribute in Flash object properties for closing, the asked URL page is played up, directly the asked URL page is played up if not.
Optionally, the hardware-accelerated control method of a kind of Flash as above, the preset storehouse of described URL is local preset storehouse.
Optionally, the hardware-accelerated control method of a kind of Flash as above, the preset lab setting of described URL is beyond the clouds.
Optionally, the hardware-accelerated control method of a kind of Flash as above, that in the preset storehouse of described URL, store is the URL that occurs the website of compatibility issue in the time that flash object loads.
Optionally, the hardware-accelerated control method of a kind of Flash as above, if browser kernel is webkit kernel, revises the hardware-accelerated setup of attribute of Flash object by kidnapping the executable file of local Flash program.
Optionally, the hardware-accelerated control method of a kind of Flash as above, if browser kernel is IE kernel, by the application programming interface of Hung system, in the time reading the configuration file of local Flash program, the hardware-accelerated attribute of Flash object is modified.
The hardware-accelerated control system of a kind of Flash, comprising:
Flash Object Creation module, creates respectively Flash object for each Flash object requests of the URL page that user is asked;
Flash setup of attribute module, for obtaining the configuration file of subscriber's local Flash program, and carries out setup of attribute according to configuration file to described Flash object;
URL page rendering module, be used for revising hardware-accelerated attribute, the asked URL page is played up, concrete mode for: check that asked URL is whether in the preset storehouse of URL, if by the hardware-accelerated setup of attribute in Flash object properties for closing, the URL page to request is played up, and directly the URL page of request is played up if not.
Beneficial effect of the present invention is: method and system of the present invention, by the abduction that Flash is arranged, realize and judged whether to open hardware-accelerated according to the source of Flash, the flower screen or the stuck problem of pausing that when video web page is play, occur are solved, promote and used browser to watch the user of the Flash special efficacys such as video to experience, do not affect again and when user browses high definition website or plays page trip, use function of hardware acceleration simultaneously.
Brief description of the drawings
Fig. 1 is the structured flowchart of the hardware-accelerated control system of a kind of Flash in the specific embodiment of the invention;
Fig. 2 is the process flow diagram of the hardware-accelerated control method of a kind of Flash in the specific embodiment of the invention.
Embodiment
Below in conjunction with Figure of description and embodiment, the present invention is described in further detail.
Fig. 1 shows the structured flowchart of the hardware-accelerated control system of a kind of Flash in the specific embodiment of the invention, and this system comprises Flash Object Creation module 11, Flash setup of attribute module 12 and URL page rendering module 13, wherein,
Flash Object Creation module 11 creates respectively Flash object for each Flash object requests of the uniform resource position mark URL page that user is asked;
Flash setup of attribute module 12 is for obtaining the configuration file of subscriber's local Flash program, and according to configuration file, described Flash object carried out to setup of attribute;
URL page rendering module 13 is for revising hardware-accelerated attribute, the asked URL page is played up, concrete mode for: check that asked URL is whether in the preset storehouse of URL, if by the hardware-accelerated setup of attribute in Flash object properties for closing, the URL page to request is played up, and directly the URL page of request is played up if not.
Fig. 2 shows the process flow diagram of the hardware-accelerated control method of a kind of Flash in the specific embodiment of the invention, and the method comprises:
S21: the each Flash object requests in the asked uniform resource position mark URL page is created respectively to Flash object;
Hardware-accelerated (Hardware acceleration) refers in computing machine the technology by very large calculated amount work allocation is processed to the workload that alleviates central processing unit to special hardware, and especially in image is processed, this technology is very often used.In fact, when webpage is play, hardware-accelerated unlatching or close conventionally can not exert an influence to the sharpness of the video in webpage, and hardware-accelerated common has impact to big game.And that whether Flash opens is hardware-accelerated, to come into force to all browsers of this ground, the present invention propose in browser to the hardware-accelerated method of controlling of Flash, by Flash arrange abduction, accomplished to determine whether opening hardware-accelerated according to the source of Flash.
In the time that browser receives the URL of user's request, first in the URL page that needs judgement to ask, whether there is Flash object requests, if exist, continue whole flow process, if there is not Flash object requests in the URL page, finishing control flow process, directly plays up the URL page of user's request.
In the time having Flash object requests in the URL page that user asks, judge the number of Flash object requests in the page, to creating Flash object for each Flash object requests respectively.
S22: Flash object is carried out to setup of attribute according to the configuration file of local Flash program;
In the time creating Flash object, need to obtain the configuration file of subscriber's local Flash program, and according to the configuration file of subscriber's local Flash program, the Flash object creating in S21 be carried out to every setup of attribute.
In present embodiment, the configuration file of local Flash program mainly refers to the default configuration of the local flash program version of installing to supported this locality application, such as GPU(Graphic Processing Unit, graphic process unit) configuration such as hardware-accelerated, camera, Mike, memory cache size.Different users likely installs the flash of different editions, the flash program of different editions is supported different hardware, flash program inside have oneself logic, have default configuration, in the default configuration of local Flash program, the configuration of flash program acquiescence is to open function of hardware acceleration.
S23: the hardware-accelerated attribute in amendment Flash object properties, the asked URL page is played up.
Judge the source of Flash, determine whether opening hardware-accelerated according to the source of Flash object, concrete mode is as follows:
Check that URL that user asks is whether in preset storehouse, if by the hardware-accelerated setup of attribute in Flash object properties for closing, Flash Object Creation completes, and browser is played up the URL page of request, and browser is directly normally played up the URL page of request if not.Wherein, that in the preset storehouse of URL, store is the URL that occurs the website of compatibility issue in the time that flash object loads, and the preset storehouse of URL can be a url database of manual maintenance, and preset storehouse can be local preset storehouse, can be also preset storehouse, high in the clouds.
In S23, the hardware-accelerated attribute in Flash object properties is modified while arranging, for different browser cores, can adopt different alter modes, specific as follows:
If browser kernel is webkit kernel, revise the hardware-accelerated setup of attribute of Flash object by kidnapping the executable file of local Flash program.For webkit core browser, playing up Flash object Shi Shi and called the GCSWF32.dll file of Flash program, therefore can revise by kidnapping GCSWF32.dll file the hardware-accelerated attribute configuration of Flash object;
If browser kernel is IE kernel, by the application programming interface (such as monitoring ReadFile function) of Hung system, in the time reading the configuration file of local Flash program, the hardware-accelerated attribute of Flash object is modified.
The hardware-accelerated control method of Flash of the present invention and system, by the abduction that Flash is arranged, judge whether to open hardware-accelerated according to the source of Flash, solve video web page by the method and system and play flower screen or the stuck problem of pausing, do not affect again and when user browses other high definition websites or plays page trip, use hardware-accelerated function simultaneously.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if these amendments of the present invention and within modification belongs to the scope of the claims in the present invention and equivalent technology thereof, the present invention is also intended to comprise these changes and modification interior.