CN107911700A - A kind of hardware coding/decoding method, decoding device and storage medium based on virtualization - Google Patents
A kind of hardware coding/decoding method, decoding device and storage medium based on virtualization Download PDFInfo
- Publication number
- CN107911700A CN107911700A CN201711062609.1A CN201711062609A CN107911700A CN 107911700 A CN107911700 A CN 107911700A CN 201711062609 A CN201711062609 A CN 201711062609A CN 107911700 A CN107911700 A CN 107911700A
- Authority
- CN
- China
- Prior art keywords
- operating system
- decoding
- decoded
- video data
- hardware
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a kind of hardware coding/decoding method, decoding device and storage medium based on virtualization.Video data to be decoded is obtained in the present invention in the first operating system, first operating system is the operating system of virtual machine, the video data to be decoded is intercepted by default hook program in first operating system, the video data to be decoded is sent to the second operating system, second operating system is the operating system of host, the video data to be decoded is decoded in second operating system, to obtain corresponding decoding video data.By the way that the video data to be decoded in the first operating system is forwarded to the second operating system in the present invention, to call GPU to be decoded, improve and carry out decoding the problem of cpu load brought is excessive by CPU, also just solve virtual machine existing physical equipment operation when carrying out video decoding in the prior art and bear excessive technical problem.
Description
Technical field
The present invention relates to Internet technical field, more particularly to a kind of hardware coding/decoding method based on virtualization, decoding to set
Standby and storage medium.
Background technology
Present physical machine realizes video decoding, and there are two ways, i.e. software decoding and hardware decoding.Wherein, software decodes
Refer to, videoconference client utilizes central processing unit (Central Processing by way of calling figure decoding interface
Unit, CPU) carry out video decoding;Hardware decoding refers to that videoconference client calls vision hardware to accelerate (DirectX Video
Acceleration, DXVA) decoding interface, to be carried out using graphics processor (Graphics Processing Unit, GPU)
Video decodes.It is apparent that from the angle for the performance burden for reducing CPU, hardware decoding is as a kind of more preferably decoding process.
But above-mentioned is that physical machine carries out the decoded mode of video, when going down to carry out video decoding in virtualization scene,
The decoding scheme of mainstream is there is also two kinds at present, i.e., video card is led directly to and virtual pattern processing unit (virtual GPU, vGPU) skill
Art, the vGPU technologies are the virtualization for GPU.Wherein, video card, which is led directly to, refers to, by VFIO technologies by physical machine
GPU, which is penetrated into a virtual machine, carries out decoding effort, and the VFIO is a set of User space driver framework;VGPU technologies refer to,
The video card in a physical machine is divided into multiple virtual video cards in the case where manufacturer supports, and is penetrated by VFIO technologies.
The decoded solution of video under scene is virtualized by two kinds to be compared, the advantage that video card is led directly to is Ke Yijie
The peak performance of nearly physical display card, still, is limited to Peripheral Component Interconnect standard (Peripheral Component in physical machine
Interconnect, PCI) slot and cost limitation, single server at most only can be inserted into 2 video cards, i.e., can only support 2 to 8
A user;The advantage of vGPU is to be similar to the access performance of true video card, and has preferable compatibility, still, current
There is larger cost price using vGPU under market environment, also, different vendor or different types of vGPU technologies may
Hardware decoding can be not supported to accelerate.So carrying out video decoding in the case where virtualizing scene, apply currently on the market the most
Common processing mode, remains as and carries out software decoding using virtual video card, that is, calls CPU to be decoded, specifically, in void
When multi-path high-definition network monitoring video is played in plan machine, due to needing to be decoded using virtual video card, cause the CPU of virtual machine
Occupancy is higher, significantly have impact on virtual machine performance and usage experience, so, virtual machine existence when carrying out video decoding
Manage equipment operation and bear excessive technical problem.
The above is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that the above is existing skill
Art.
The content of the invention
It is a primary object of the present invention to provide a kind of hardware coding/decoding method based on virtualization, decoding device and storage to be situated between
Matter, it is intended to which the virtual machine excessive technology of existing physical equipment operation burden when carrying out video decoding in the prior art that solves is asked
Topic.
To achieve the above object, the present invention provides a kind of hardware coding/decoding method based on virtualization, the described method includes with
Lower step:
Video data to be decoded is obtained in the first operating system, first operating system is the operation system of virtual machine
System;
The video data to be decoded is intercepted by default hook program in first operating system, waits to solve by described
Code video data is sent to the second operating system, and second operating system is the operating system of host, the virtual machine fortune
Row is in the host;
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video
Data.
Preferably, it is described video data to be decoded is obtained in the first operating system before, the method further includes:
In response to hardware solution code instruction input by user in first operating system, according to the hardware solution code instruction
Find the video card attribute information of preservation;
The video card attribute information is matched with each default video card attribute information in first operating system;
In successful match, perform described in the step of obtaining video data to be decoded in the first operating system.
Preferably, it is described in first operating system in response to hardware solution code instruction input by user, according to described
Before hardware solution code instruction finds the video card attribute information of preservation, the method further includes:
Default video card information command is obtained in first operating system, by the default video card information command send to
Second operating system, to obtain the video card attribute information of the host;
The video card attribute information is fed back into first operating system in second operating system, and is preserved extremely
First operating system.
Preferably, it is described in first operating system in response to hardware solution code instruction input by user, according to described
Hardware solution code instruction finds the video card attribute information of preservation, specifically includes:
In response to hardware solution code instruction input by user in first operating system, from the hardware solution code instruction
Extract current decoding mark;
Judge that the current decoding is identified whether as default decoding mark in first operating system;
The default decoding mark is identified as in the current decoding in first operating system, according to the hardware
Solution code instruction finds the video card attribute information of preservation.
Preferably, it is described that the video data to be decoded is decoded in second operating system, with acquisition pair
After the decoding video data answered, the method further includes:
By the decoding video data sending in second operating system to first operating system;
The decoding video data are carried out rendering processing in first operating system, to realize the displaying of video.
Preferably, it is described to send the video data to be decoded to the second operating system, specifically include:
The video data to be decoded is stored in default shared memory space, the default shared memory space is described
First operating system is shared with second operating system.
Preferably, it is described that the video data to be decoded is decoded in second operating system, with acquisition pair
The decoding video data answered, specifically include:
Predetermined hardware decoding API is called to decode the video data to be decoded in second operating system,
To obtain corresponding decoding video data.
Preferably, it is described that the video data to be decoded is decoded in second operating system, with acquisition pair
The decoding video data answered, specifically include:
Corresponding decoder is created according to default decoder configuration in second operating system;
The video data to be decoded is decoded by the decoder in second operating system, to obtain
Corresponding decoding video data.
In addition, to achieve the above object, the present invention also provides a kind of decoding device, the decoding device includes:Microphone,
Memory, processor and the decoding of the hardware based on virtualization that is stored on the memory and can run on the processor
Program, the hardware decoding program based on virtualization are arranged for carrying out the step of the hardware coding/decoding method based on virtualization
Suddenly.
In addition, to achieve the above object, the present invention also provides a kind of storage medium, it is stored with and is based on the storage medium
The hardware decoding program of virtualization, realized when the hardware decoding program based on virtualization is executed by processor it is described based on
The step of hardware coding/decoding method of virtualization.
By the way that the video data to be decoded in the first operating system is forwarded to the second operating system in the present invention, to call
GPU is decoded, and is improved and is carried out decoding the problem of cpu load brought is excessive by CPU, also just solves in the prior art
Excessive technical problem is born in virtual machine existing physical equipment operation when carrying out video decoding.
Brief description of the drawings
Fig. 1 is the decoding device structure diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of the hardware coding/decoding method first embodiment of the invention based on virtualization;
Fig. 3 is the flow diagram of the hardware coding/decoding method second embodiment of the invention based on virtualization;
Fig. 4 is the flow diagram of the hardware coding/decoding method 3rd embodiment of the invention based on virtualization;
Fig. 5 is the flow diagram of the hardware coding/decoding method fourth embodiment of the invention based on virtualization;
Fig. 6 is the flow diagram of hardware coding/decoding method the 5th embodiment of the invention based on virtualization.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
With reference to Fig. 1, Fig. 1 is the decoding device structure diagram for the hardware running environment that the embodiment of the present invention is related to.
As shown in Figure 1, the decoding device can include:Processor 1001, such as CPU, communication bus 1002, user interface
1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is used for realization the connection communication between these components.
User interface 1003 can include display screen (Display), optional user interface 1003 can also include standard wireline interface,
Wave point, the wireline interface for user interface 1003 can be USB interface in the present invention.Network interface 1004 optionally may be used
With including standard wireline interface and wireless interface (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory, also may be used
To be stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be
Independently of the storage device of aforementioned processor 1001.
The decoding device can be the electronic equipments such as PC or server.
It will be understood by those skilled in the art that the structure shown in Fig. 1 does not form the restriction to decoding device, can wrap
Include than illustrating more or fewer components, either combine some components or different components arrangement.
As shown in Figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network
Believe module, Subscriber Interface Module SIM and the hardware decoding program based on virtualization.
In the decoding device shown in Fig. 1, network interface 1004 is mainly used for connecting background server, is taken with the backstage
Device be engaged in into row data communication;User interface 1003 is mainly used for connecting peripheral hardware;The decoding device is called by processor 1001
The hardware decoding program based on virtualization stored in memory 1005, and perform following operation:
Video data to be decoded is obtained in the first operating system, first operating system is the operation system of virtual machine
System;
The video data to be decoded is intercepted by default hook program in first operating system, waits to solve by described
Code video data is sent to the second operating system, and second operating system is the operating system of host, the virtual machine fortune
Row is in the host;
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video
Data.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
In response to hardware solution code instruction input by user in first operating system, according to the hardware solution code instruction
Find the video card attribute information of preservation;
The video card attribute information is matched with each default video card attribute information in first operating system;
In successful match, perform described in the step of obtaining video data to be decoded in the first operating system.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
Default video card information command is obtained in first operating system, by the default video card information command send to
Second operating system, to obtain the video card attribute information of the host;
The video card attribute information is fed back into first operating system in second operating system, and is preserved extremely
First operating system.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
In response to hardware solution code instruction input by user in first operating system, from the hardware solution code instruction
Extract current decoding mark;
Judge that the current decoding is identified whether as default decoding mark in first operating system;
The default decoding mark is identified as in the current decoding in first operating system, according to the hardware
Solution code instruction finds the video card attribute information of preservation.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
By the decoding video data sending in second operating system to first operating system;
The decoding video data are carried out rendering processing in first operating system, to realize the displaying of video.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
The video data to be decoded is stored in default shared memory space, the default shared memory space is described
First operating system is shared with second operating system.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
Predetermined hardware decoding API is called to decode the video data to be decoded in second operating system,
To obtain corresponding decoding video data.
Further, processor 1001 can call the decoding journey of the hardware based on virtualization stored in memory 1005
Sequence, also performs following operation:
Corresponding decoder is created according to default decoder configuration in second operating system;
The video data to be decoded is decoded by the decoder in second operating system, to obtain
Corresponding decoding video data.
By the way that the video data to be decoded in the first operating system is forwarded to the second operating system in the present embodiment, to adjust
Decoded with GPU, improve and carry out decoding the problem of cpu load brought is excessive by CPU, also just solve the prior art
Excessive technical problem is born in the existing physical equipment operation when carrying out video decoding of middle virtual machine.
Based on above-mentioned hardware configuration, the embodiment of the proposition hardware coding/decoding method of the invention based on virtualization.
With reference to Fig. 2, Fig. 2 is the flow diagram of the hardware coding/decoding method first embodiment of the invention based on virtualization.
In the first embodiment, the hardware coding/decoding method based on virtualization comprises the following steps:
Step S10:Video data to be decoded is obtained in the first operating system, first operating system is virtual machine
Operating system;
It is understood that a physical machine can be invented by more logical computers by virtualization technology, wherein, can
The logical computer fictionalized is known as virtual machine, physical machine is known as host.Wherein, the operating system of virtual machine operation can
It is different from the operating system of host operation, such as, virtual machine can run community Enterprise Operation System (Community
Enterprise Operating System, CentOS) i.e. the first operating system, host can run Windows operating system
That is the second operating system, certainly, the operating system and the operating system of the two run for virtual machine with host whether phase
Together, the present embodiment is not restricted this.
Step S20:The video data to be decoded is intercepted by default hook program in first operating system, will
The video data to be decoded is sent to the second operating system, and second operating system is the operating system of host, described
Virtual machine is run in the host;
In the concrete realization, when opening videoconference client in virtual machine and carrying out video playing, it is necessary to be regarded to broadcasting
Frequency is decoded, in order to improve decoded efficiency and evade falling that to carry out the excessive CPU operations that decoding brings using CPU negative
Carry, first can send video data to be decoded to the second operating system by the first operating system, GPU is called by the second operating system
Decoded, be also achieved that in the case where virtualizing scene video data carries out decoded decoding process by GPU.For specific
Implementation, can be sent the video data to be decoded in the first operating system to the second operation system by default hook program
System, the hook program (Hook) is used to monitor specified message, when specified message reaches, in the corresponding target processing of the message
Before function handles the message, hook program priority treatment specifies message, so, hook program is realized in message transmission
Way the message is processed, certainly, hook program also can midway end message transmission.In the present embodiment, preset
Hook program is by linking up with DXVA decoding interfaces, will be to be decoded in transmission when getting the video data to be decoded specified
Video data is forwarded to the second operating system.
Step S30:The video data to be decoded is decoded in second operating system, it is corresponding to obtain
Decoding video data.
It is understood that after the second operating system gets video data to be decoded, since the second operating system is
The operating system of host, different from virtual machine, host can directly invoke GPU and be decoded, then can call GPU to be decoded
Video data is decoded, and is also achieved that treating decoding video data by GPU under virtualization scene carries out decoded technology
Scheme.Also, because being decoded by hardware GPU, the characteristic of physical equipment is made full use of, can preferably reduce virtual machine
The utilization rate of CPU.
By the way that the video data to be decoded in the first operating system is forwarded to the second operating system in the present embodiment, to adjust
Decoded with GPU, improve and carry out decoding the problem of cpu load brought is excessive by CPU, also just solve the prior art
Excessive technical problem is born in the existing physical equipment operation when carrying out video decoding of middle virtual machine.
With reference to Fig. 3, Fig. 3 is the flow diagram of the hardware coding/decoding method second embodiment of the invention based on virtualization, base
In the embodiment shown in above-mentioned Fig. 2, the second embodiment of the proposition hardware coding/decoding method of the invention based on virtualization.
In a second embodiment, before the step S10, the method further includes:
Step S101:In response to hardware solution code instruction input by user in first operating system, according to described hard
Part solution code instruction finds the video card attribute information of preservation;
It is understood that when carrying out video monitoring, if being implemented by the hardware coding/decoding method first based on virtualization
Step in example carries out video decoding, can first determine the physical characteristic of host before video decoding, judge host
Whether performance supports current video decoding operation.
In the concrete realization, when user opens video monitoring client terminal in virtual machine, will first be searched in virtual machine
The video card attribute information preserved, the video card attribute information are the physical attribute information of GPU, such as the frequency of video card, broadband
Ability rating etc. is solved firmly with DXVA, for describing the service ability of GPU., can for the acquisition modes of the video card attribute information
Before user opens video monitoring client terminal progress video decoding, alternatively, when user starts shooting, request host is hard to obtain
The attribute information of part GPU and preservation, quickly to determine video card attribute information when in use, without repeating to obtain during decoding every time
Take.
Step S102:In first operating system by the video card attribute information and each default video card attribute information into
Row matching;
It should be appreciated that since the physical property of different GPU has differences with the decoding capability that can be provided, carrying out
Before decoding, the decoding capability of current GPU will be first determined.For example the video card attribute information being stored in virtual machine is obtained, will
The video card attribute information is matched with default video card attribute information, to judge whether to decoding operate.Such as if virtual machine
The video card attribute information of the GPU of middle preservation includes DXVA2_ModeH264_E (DXVA2_ModeH264_VLD_NoFGT) i.e. grades
E, grade E are a kind of rank of the decoding acceleration capacity of video card, if in view of the overall load of physical machine operation, by default video card
Attribute information is arranged to DXVA2_ModeH264_B (DXVA2_ModeH264_MoComp_FGT) i.e. grade B, decodes H.264
Ability has been divided into A to F totally 6 grades, and wherein A is minimum, and F is highest.Certainly, ability rating is higher than the grade A of grade B,
Also decoding condition is met, so, default video card attribute information may include grade A and grade B.So physical machine that will be found
Real video card attribute information, that is, grade E is matched with default video card attribute information, and matching is unsuccessful, shows existing physical machine
In GPU performances be unsatisfactory for default decoding request, can prompt user decode failure or prompting GPU do not support current operation.
In successful match, step S10 is performed.
In order to obtain video card attribute information in advance and preserve, before step S101, the method further includes:
Step S1011:Default video card information command is obtained in first operating system, by the default video card information
Instruction is sent to second operating system, to obtain the video card attribute information of the host;
It is understood that since virtual machine does not have real physics GPU, so, the DXVA that can not directly invoke GPU connects
Mouth carries out hardware decoding, so, will be in virtual machine (Virtual when realizing first embodiment with second embodiment
Machine, VM) one virtual machine Agent layer of middle increase, which can be known as to VM agencies, virtual machine and host
Information communication will using VM act on behalf of as transfer carry out information exchange, including by video data to be decoded by virtual machine packing forwarding
To host and etc., it all will first send to VM and act on behalf of, then host is forwarded to by VM agencies.Wherein, VM agencies will simulate place
The attribute information of host hardware GPU, by way of hook, to realize the operation simulation for video decoding process.
In the concrete realization, when virtual machine gets video data to be decoded, video card attribute information will be first obtained, works as void
When not preserving video card attribute information in plan machine, the video card attribute information can be asked to host.
Step S1012:The video card attribute information is fed back to first operation in second operating system is
System, and preserve to first operating system.
It should be appreciated that after the video card attribute information is got from host, which can be preserved
It is local to virtual machine, in order to which the judgement of the decoding capability of physical machine is carried out in subsequent operation according to video card attribute information.Wherein,
The video card attribute information got can be preserved in the VM agencies into virtual machine.
By the way that the physical attribute information of GPU is matched with carrying out the attribute information of decoding operate requirement in this example,
To judge whether the performance of physical machine meets decoding request;Meanwhile virtual machine can ask video card attribute information and incite somebody to action to host
The video card attribute information of feedback is preserved to virtual machine local, and directly video card attribute letter is obtained from local when being convenient for decoding operate
Breath improves decoding efficiency to judge decoding performance.
With reference to Fig. 4, Fig. 4 is the flow diagram of the hardware coding/decoding method 3rd embodiment of the invention based on virtualization, base
In the embodiment shown in above-mentioned Fig. 3, the 3rd embodiment of the proposition hardware coding/decoding method of the invention based on virtualization.
In the third embodiment, the step S101, specifically includes:
Step S1011 ':In response to hardware solution code instruction input by user in first operating system, from described hard
Current decoding mark is extracted in part solution code instruction;
It is understood that in order to make the use of user more flexible, user can unrestricted choice whether open virtual machine and lead to
Cross GPU and carry out the decoded decoding process of video.For example user is in virtual machine when opening video monitoring client terminal, user can will
The decoded option of GPU hardware is set on state, so, what is extracted from the hardware solution code instruction of user's operation generation works as
Preceding decoding mark represents to open GPU hardware decoding.
Step S1012 ':Judge that the current decoding is identified whether as default decoding mark in first operating system
Know;
In the concrete realization, will if current decoding is identified as the decoding mark for representing to open GPU hardware decoding function
The video card attribute information preserved in virtual machine is searched, to carry out subsequent operation, hardware decoding process is implemented by GPU.
Step S1013 ':The default decoding mark is identified as in the current decoding in first operating system,
The video card attribute information of preservation is found according to the hardware solution code instruction.
By the judgment step for default decoding mark in the present embodiment, can assigning active user, whether to open GPU hard
The authority of part decoding function, easy to user flexibility carries out decoding operate.
With reference to Fig. 5, Fig. 5 is the flow diagram of the hardware coding/decoding method fourth embodiment of the invention based on virtualization, base
In the embodiment shown in above-mentioned Fig. 2, the fourth embodiment of the proposition hardware coding/decoding method of the invention based on virtualization.
In the fourth embodiment, after the step S30, the method further includes:
Step S40:By the decoding video data sending in second operating system to first operating system;
It is understood that after the second operating system completes video decoding, in order to enable user can be straight in virtual machine
The decoded video of viewing is connect, the decoded decoding video data back of video can will be completed in the second operating system to virtual machine.
Step S50:The decoding video data are carried out rendering processing in first operating system, to realize video
Displaying.
It should be appreciated that after virtual machine gets decoding video data, progress video is rendered into processing, so that
User can in videoconference client direct viewing video.
Further, can be by described in order to reduce the volume of transmitted data of virtual machine and host in video decoding process
Video data to be decoded is stored in default shared memory space, the default shared memory space for first operating system with
Second operating system is shared.
It is understood that by preserving video data to be decoded into shared memory space so that regarded to be decoded
Frequency evidence is sent to, in actual motion, there will be no the mistake of data transfer the step of the second operating system by the first operating system
Journey, because the core position that the video data is stored is shared by the first operating system and the second operating system, so, number
The step of according to sending to the second operating system, be substantially converted to and send data storage location to the second operating system, can be larger
Ground reduces volume of transmitted data, improves the decoded efficiency of video.Certainly, decoded decoding video data can be also stored in default
Shared memory space.
Further, in order to improve the decoded efficiency of video, it is described in second operating system to described to be decoded
Video data is decoded, and to obtain corresponding decoding video data, be may particularly include, is called in second operating system
Predetermined hardware decoding application programming interface (Application Programming Interface, API) is waited to solve to described
Code video data is decoded, to obtain corresponding decoding video data.
It is understood that host when carrying out hardware decoding by GPU, can call predetermined hardware decoding API to carry out
Decoding operate.Wherein, the predetermined hardware decoding API can be DXVA interfaces etc., and video is solved by linking up with DXVA interfaces
Code, can preferably improve the decoded performance of video and efficiency.
By the way that by the decoding video data feedback in host to virtual machine, video is carried out easy to virtual machine in the present embodiment
Play operation.
With reference to Fig. 6, Fig. 6 is the flow diagram of hardware coding/decoding method the 5th embodiment of the invention based on virtualization, base
In the embodiment shown in above-mentioned Fig. 2, the 5th embodiment of the proposition hardware coding/decoding method of the invention based on virtualization.
In the 5th embodiment, the step S30, specifically includes:
Step S301:Corresponding decoder is created according to default decoder configuration in second operating system;
It is understood that the decoded idiographic flow of video is, will be first according to default decoding in order to carry out video decoding
Device configuration creates decoder, and certainly, decoder configuration can also carry out self-defined.
Step S302:The video data to be decoded is solved by the decoder in second operating system
Code, to obtain corresponding decoding video data.
In the concrete realization, decoder will call BeginFrame methods to be decoded, and during decoded, can pass through
GetBuffer goes to obtain the data cached of DXVA decoders, with the filling cached, and goes to release by ReleaseBuffer
It is data cached to put this.When above-mentioned data processing is completed, Execute is decoded, and EndFrame terminates to decode, and also just completes
The decoding of decoding video data is treated, generates corresponding decoding video data;, will when judging that above-mentioned data processing does not complete
GetBuffer is performed again to go to obtain the data cached of DXVA decoders until judging that data processing is completed.
Certainly, when end decodes, the decoder created will be deleted, is re-created again when decoding next time.
Video decoding is carried out by above-mentioned steps in the present embodiment, can preferably improve the decoded efficiency of video.
In addition, the embodiment of the present invention also proposes a kind of storage medium, it is stored with the storage medium based on virtualization
Hardware decoding program, realizes following operation when the hardware decoding program based on virtualization is executed by processor:
Video data to be decoded is obtained in the first operating system, first operating system is the operation system of virtual machine
System;
The video data to be decoded is intercepted by default hook program in first operating system, waits to solve by described
Code video data is sent to the second operating system, and second operating system is the operating system of host, the virtual machine fortune
Row is in the host;
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video
Data.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
In response to hardware solution code instruction input by user in first operating system, according to the hardware solution code instruction
Find the video card attribute information of preservation;
The video card attribute information is matched with each default video card attribute information in first operating system;
In successful match, perform described in the step of obtaining video data to be decoded in the first operating system.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
Default video card information command is obtained in first operating system, by the default video card information command send to
Second operating system, to obtain the video card attribute information of the host;
The video card attribute information is fed back into first operating system in second operating system, and is preserved extremely
First operating system.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
In response to hardware solution code instruction input by user in first operating system, from the hardware solution code instruction
Extract current decoding mark;
Judge that the current decoding is identified whether as default decoding mark in first operating system;
The default decoding mark is identified as in the current decoding in first operating system, according to the hardware
Solution code instruction finds the video card attribute information of preservation.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
By the decoding video data sending in second operating system to first operating system;
The decoding video data are carried out rendering processing in first operating system, to realize the displaying of video.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
The video data to be decoded is stored in default shared memory space, the default shared memory space is described
First operating system is shared with second operating system.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
Predetermined hardware decoding API is called to decode the video data to be decoded in second operating system,
To obtain corresponding decoding video data.
Further, following operation is also realized when the hardware decoding program based on virtualization is executed by processor:
Corresponding decoder is created according to default decoder configuration in second operating system;
The video data to be decoded is decoded by the decoder in second operating system, to obtain
Corresponding decoding video data.
By the way that the video data to be decoded in the first operating system is forwarded to the second operating system in the present embodiment, to adjust
Decoded with GPU, improve and carry out decoding the problem of cpu load brought is excessive by CPU, also just solve the prior art
Excessive technical problem is born in the existing physical equipment operation when carrying out video decoding of middle virtual machine.
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or system including a series of elements not only include those key elements, and
And other elements that are not explicitly listed are further included, or further include as this process, method, article or system institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Also there are other identical element in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.Word first, second, with
And third use does not indicate that any order, these words can be construed to title.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art
Going out the part of contribution can be embodied in the form of software product, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, computer, solves
Decoding apparatus, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair
The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made, is directly or indirectly used in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of hardware coding/decoding method based on virtualization, it is characterised in that the described method comprises the following steps:
Video data to be decoded is obtained in the first operating system, first operating system is the operating system of virtual machine;
The video data to be decoded is intercepted by default hook program in first operating system, to be decoded is regarded described
Frequency data sending to the second operating system, second operating system is the operating system of host, and the virtual machine is run on
In the host;
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video number
According to.
2. the hardware coding/decoding method based on virtualization as claimed in claim 1, it is characterised in that described in the first operating system
Before middle acquisition video data to be decoded, the method further includes:
In response to hardware solution code instruction input by user in first operating system, searched according to the hardware solution code instruction
To the video card attribute information of preservation;
The video card attribute information is matched with each default video card attribute information in first operating system;
In successful match, perform described in the step of obtaining video data to be decoded in the first operating system.
3. the hardware coding/decoding method based on virtualization as claimed in claim 2, it is characterised in that described in the described first operation
In response to hardware solution code instruction input by user in system, the video card attribute that preservation is found according to the hardware solution code instruction is believed
Before breath, the method further includes:
Default video card information command is obtained in first operating system, the default video card information command is sent to described
Second operating system, to obtain the video card attribute information of the host;
The video card attribute information is fed back into first operating system in second operating system, and is preserved to described
First operating system.
4. the hardware coding/decoding method based on virtualization as claimed in claim 2, it is characterised in that described in the described first operation
In response to hardware solution code instruction input by user in system, the video card attribute that preservation is found according to the hardware solution code instruction is believed
Breath, specifically includes:
In response to hardware solution code instruction input by user in first operating system, extracted from the hardware solution code instruction
Go out current decoding mark;
Judge that the current decoding is identified whether as default decoding mark in first operating system;
The default decoding mark is identified as in the current decoding in first operating system, is decoded according to the hardware
Instruction finds the video card attribute information of preservation.
5. the hardware coding/decoding method based on virtualization as described in any one of Claims 1-4, it is characterised in that described
The video data to be decoded is decoded in second operating system, with obtain corresponding decoding video data it
Afterwards, the method further includes:
By the decoding video data sending in second operating system to first operating system;
The decoding video data are carried out rendering processing in first operating system, to realize the displaying of video.
6. the hardware coding/decoding method based on virtualization as described in any one of Claims 1-4, it is characterised in that described
The video data to be decoded is sent to the second operating system, is specifically included:
The video data to be decoded is stored in default shared memory space, the default shared memory space is described first
Operating system is shared with second operating system.
7. the hardware coding/decoding method based on virtualization as described in any one of Claims 1-4, it is characterised in that described
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video data, tool
Body includes:
Predetermined hardware decoding API is called to decode the video data to be decoded in second operating system, to obtain
Take corresponding decoding video data.
8. the hardware coding/decoding method based on virtualization as described in any one of Claims 1-4, it is characterised in that described
The video data to be decoded is decoded in second operating system, to obtain corresponding decoding video data, tool
Body includes:
Corresponding decoder is created according to default decoder configuration in second operating system;
The video data to be decoded is decoded by the decoder in second operating system, to obtain correspondence
Decoding video data.
9. a kind of decoding device, it is characterised in that the decoding device includes:Memory, processor and it is stored in the storage
On device and the hardware decoding program based on virtualization that can run on the processor, the hardware decoding based on virtualization
Such as the hardware decoding side described in any item of the claim 1 to 8 based on virtualization is realized when program is performed by the processor
The step of method.
A kind of 10. storage medium, it is characterised in that the hardware decoding program based on virtualization is stored with the storage medium,
Such as base described in any item of the claim 1 to 8 is realized when the hardware decoding program based on virtualization is executed by processor
In the hardware coding/decoding method of virtualization the step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711062609.1A CN107911700B (en) | 2017-10-31 | 2017-10-31 | Virtualization-based hardware decoding method, decoding equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711062609.1A CN107911700B (en) | 2017-10-31 | 2017-10-31 | Virtualization-based hardware decoding method, decoding equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107911700A true CN107911700A (en) | 2018-04-13 |
CN107911700B CN107911700B (en) | 2020-07-03 |
Family
ID=61843180
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711062609.1A Active CN107911700B (en) | 2017-10-31 | 2017-10-31 | Virtualization-based hardware decoding method, decoding equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107911700B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020135721A1 (en) * | 2018-12-29 | 2020-07-02 | 中兴通讯股份有限公司 | Method and system for cloud desktop virtual machine to implement 3d capability |
CN112905243A (en) * | 2019-11-15 | 2021-06-04 | 成都鼎桥通信技术有限公司 | Method and device for simultaneously operating two systems |
CN114157919A (en) * | 2020-09-07 | 2022-03-08 | 华为云计算技术有限公司 | Data processing method and system, cloud terminal, server and computing equipment |
CN115002087A (en) * | 2022-05-31 | 2022-09-02 | 济南浪潮数据技术有限公司 | Audio and video data transmission method, system, device and storage medium |
CN115002087B (en) * | 2022-05-31 | 2024-07-02 | 济南浪潮数据技术有限公司 | Audio and video data transmission method, system, device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120213294A1 (en) * | 2008-04-15 | 2012-08-23 | Desktone, Inc. | Media Acceleration for Virtual Computing Services |
CN102981887A (en) * | 2011-09-06 | 2013-03-20 | 联想(北京)有限公司 | Data processing method and electronic device |
CN105791892A (en) * | 2016-03-02 | 2016-07-20 | 汉柏科技有限公司 | Video redirecting method based on desktop cloud, cloud server and video redirecting system |
CN106797388A (en) * | 2016-12-29 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Cross-system multi-medium data decoding method, device, electronic equipment and computer program product |
CN106888385A (en) * | 2017-01-17 | 2017-06-23 | 武汉噢易云计算股份有限公司 | Video broadcasting method and system of the client under virtualized environment |
-
2017
- 2017-10-31 CN CN201711062609.1A patent/CN107911700B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120213294A1 (en) * | 2008-04-15 | 2012-08-23 | Desktone, Inc. | Media Acceleration for Virtual Computing Services |
CN102981887A (en) * | 2011-09-06 | 2013-03-20 | 联想(北京)有限公司 | Data processing method and electronic device |
CN105791892A (en) * | 2016-03-02 | 2016-07-20 | 汉柏科技有限公司 | Video redirecting method based on desktop cloud, cloud server and video redirecting system |
CN106797388A (en) * | 2016-12-29 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Cross-system multi-medium data decoding method, device, electronic equipment and computer program product |
CN106888385A (en) * | 2017-01-17 | 2017-06-23 | 武汉噢易云计算股份有限公司 | Video broadcasting method and system of the client under virtualized environment |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020135721A1 (en) * | 2018-12-29 | 2020-07-02 | 中兴通讯股份有限公司 | Method and system for cloud desktop virtual machine to implement 3d capability |
CN112905243A (en) * | 2019-11-15 | 2021-06-04 | 成都鼎桥通信技术有限公司 | Method and device for simultaneously operating two systems |
CN112905243B (en) * | 2019-11-15 | 2022-05-13 | 成都鼎桥通信技术有限公司 | Method and device for simultaneously operating double systems |
CN114157919A (en) * | 2020-09-07 | 2022-03-08 | 华为云计算技术有限公司 | Data processing method and system, cloud terminal, server and computing equipment |
CN115002087A (en) * | 2022-05-31 | 2022-09-02 | 济南浪潮数据技术有限公司 | Audio and video data transmission method, system, device and storage medium |
CN115002087B (en) * | 2022-05-31 | 2024-07-02 | 济南浪潮数据技术有限公司 | Audio and video data transmission method, system, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107911700B (en) | 2020-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11909820B2 (en) | Method and apparatus for execution of applications in a cloud system | |
CN111494936A (en) | Picture rendering method, device, system and storage medium | |
EP4223379A1 (en) | Cloud gaming processing method, apparatus and device, and storage medium | |
CN107911700A (en) | A kind of hardware coding/decoding method, decoding device and storage medium based on virtualization | |
JP5411386B1 (en) | Server and method for providing game | |
US20120083343A1 (en) | Online game system and method of data resource handling for an online game | |
CN106797398B (en) | For providing the method and system of virtual desktop serve to client | |
CN107147921A (en) | Based on section and the intelligence CDN video playback accelerated methods dispatched and equipment | |
CN103873886B (en) | Image information processing method, device and system | |
CN104067627B (en) | Method, device, system and computer-readable medium that a kind of video is redirected | |
CN109784011A (en) | Watermark generation method and device | |
KR101595103B1 (en) | Server and method for providing a game | |
WO2002092177A2 (en) | Method and arrangement for providing an interactive game including three-dimensional graphics | |
CN110876078B (en) | Animation picture processing method and device, storage medium and processor | |
CN108600331A (en) | Interactive interface rendering method, client, terminal and system | |
CN101127780A (en) | Method for downloading, saving and replaying online video and construction of online video network | |
CN110881046A (en) | Method, device, medium and terminal equipment for docking WebRTC protocol by cloud mobile phone | |
US11516284B2 (en) | Interactive system, terminal apparatus, server apparatus, control method, program, and recording medium | |
TWI814134B (en) | Remote rendering system, method and device based on virtual mobile architecture | |
CN109068159B (en) | Digital media circuit system based on MIPS framework TV SoC chip, digital media playing device and method | |
CN104038778B (en) | Multimedia redirects the control method and device played | |
CN112245902A (en) | Switching method and device of terminal equipment | |
JP5504370B1 (en) | Server and method for displaying video on client terminal | |
CN107920259A (en) | Virtual platform video playing accelerated method, virtual machine server and storage medium | |
CN107682387A (en) | Cloud terminal server and cloud terminal system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |