A kind of live method and apparatus
Technical field
The present invention relates to field of computer technology, more particularly to a kind of live method and apparatus.
Background technology
Network direct broadcasting has been increasingly becoming amusement and the exchange way of a kind of main flow of the modern life.Make a general survey of current each platform
The live application program in main broadcaster end, or even other kinds of application program, be all to use one process mode operation, i.e. program
All functions are all integrated in a process and performed.
The problem of although one process pattern has the advantages of framework is simple, maintains easily, but existence and stability is low, example
As if certain module goes wrong, it is possible to cause whole process to be collapsed, it is necessary to could be solved by reset routine.
Therefore, there is the technical problem for how improving the live program operation stability in main broadcaster end in prior art.
The content of the invention
The embodiments of the invention provide a kind of live method and apparatus, be at least used to solve existing for prior art how
Improve the technical problem of the live program operation stability in main broadcaster end.
In a first aspect, the invention provides a kind of live method, including:
Start the live application program in main broadcaster end;
Obtain the host process of the live application program in main broadcaster end;
The host process creates coding pass and/or plug-in unit loading process, the coding pass are used to be based on the master
The control of control process encodes out video flowing, and feeds back the video flowing to the host process, and the plug-in unit loading process is used for
Plug-in unit is loaded in the plug-in unit loading process, and the plug-in unit of loading is called according to the control of the host process;
The host process obtains the video flowing;
The host process is by the video stream to direct broadcast server, so that the direct broadcast server is by the video
The spectators' end equipment for accessing the direct broadcast server is issued in circulation.
Optionally, the host process for obtaining the live application program in main broadcaster end, including:
Judge the operational mode of the live application program in main broadcaster end pre-set;
If the operational mode is first mode, the host process of the live application program in main broadcaster end is created,
Wherein, in the first mode, the host process will create the coding pass and plug-in unit loading process;
If the operational mode is second mode, the address of the default host process is obtained, and based on describedly
The host process is accessed in location, wherein, in the second mode, the host process will create the coding pass and described
Plug-in unit loads process.
Optionally, it is described coding pass and/or plug-in unit loading process are created by the host process before, also wrap
Include:
Judge the operational mode of the live application program in main broadcaster end pre-set;
If the operational mode is the 3rd pattern, obtaining expression needs to create the coding pass or plug-in unit loading
The marker bit of process;
It is described that coding pass and/or plug-in unit are created by the host process if the marker bit is the first marker bit
Loading process, it is specially:The plug-in unit is created by the host process and loads process;
It is described that coding pass and/or plug-in unit are created by the host process if the marker bit is the second marker bit
Loading process, it is specially:The coding pass is created by the host process.
Optionally, if the host process creates the coding pass, the host process obtains the video flowing
Including:
The host process sends coded command to coding counterfoil module, to notify the coding pass encoded video stream;
The coding pass calls the coding local service module being connected with the coding counterfoil module to encode out described regard
Frequency flows;
The coding pass calls encodes coding agent interface module that local service module is connected to the master with described
The video flowing that control progress feedback encodes out.
Optionally, if the host process does not create the coding pass, the host process obtains the video flowing
Including:
The host process sends coded command to coding counterfoil module;
The coding counterfoil module calls the coding local service module being connected with the coding counterfoil module to encode out institute
State video flowing;
The coding local service module calls the coding agent interface module being connected with the coding local service module
The video flowing gone out to the host process feedback encoding.
Optionally, if the host process creates the plug-in unit loading process, methods described also includes:
Plug-in unit loading process reads loading catalogue, enumerated to the host process need to be loaded into the main broadcaster end it is straight
Broadcast the plug-in unit in application program;
The host process determines to need the target plug-in loaded, and notifies target described in the plug-in unit loading process to insert
Part;
The plug-in unit loading process loads in the plug-in unit process and runs the target plug-in;
The plug-in unit loads the operation result that process feeds back the target plug-in to the host process.
Second aspect, the invention provides a kind of live device, including:
Start unit, for starting the live application program in main broadcaster end;
Host process acquiring unit, for obtaining the host process of the live application program in main broadcaster end;
Process creation unit, it is used to be based on institute for creating coding pass and/or plug-in unit loading process, the coding pass
The control for stating host process encodes out video flowing, and feeds back the video flowing to the host process, and the plug-in unit loads process
For loading plug-in unit in the plug-in unit loading process, and the plug-in unit loaded is called according to the control of the host process;
Video flowing acquiring unit, for obtaining the video flowing;
Transmitting element, for by the video stream to direct broadcast server so that the direct broadcast server will described in regard
The spectators' end equipment for accessing the direct broadcast server is issued in frequency circulation.
Optionally, the host process acquiring unit is used for the live application program in main broadcaster end that judgement is pre-set
Operational mode;If the operational mode is first mode, the host process of the live application program in main broadcaster end is created,
Wherein, in the first mode, the host process will create the coding pass and plug-in unit loading process;If institute
It is second mode to state operational mode, obtains the address of the default host process, and access the master control based on the address
Process, wherein, in the second mode, the host process will create the coding pass and plug-in unit loading process.
Optionally, described device also includes:
Mode determination, for creating coding pass and/or plug-in unit loading process by the host process described
Before, the operational mode of the live application program in main broadcaster end pre-set is judged;
Acquiring unit is marked, if being the 3rd pattern for the operational mode, is added in establishment coding pass and/or plug-in unit
It is loaded into before journey, obtains and represent to need the marker bit for creating the coding pass or plug-in unit loading process;
If the marker bit is the first marker bit, the process creation unit is specifically used for creating by the host process
Build the plug-in unit loading process;
If the marker bit is the second marker bit, the process creation unit is specifically used for creating by the host process
Build the coding pass.
Optionally, if the host process creates the coding pass, the video flowing acquiring unit is used for volume
Code counterfoil module sends coded command, and to notify the coding pass encoded video stream, the coding pass calls and the volume
The coding local service module of code counterfoil module connection encodes out the video flowing, and the coding pass calls and the code book
The video flowing that the coding agent interface module of ground service module connection goes out to the video flowing acquiring unit feedback encoding.
Optionally, if the host process does not create the coding pass, the video flowing acquiring unit is used for volume
Code counterfoil module sends coded command, and the coding counterfoil module calls the coding being connected with the coding counterfoil module locally to take
Business module coding goes out the video flowing, and the coding local service module calls the volume being connected with the coding local service module
The video flowing that code proxy interface module goes out to the video flowing acquiring unit feedback encoding.
Optionally, if the host process creates the plug-in unit loading process, described device also includes:
Plug-in unit reading unit, catalogue is loaded for reading, being enumerated to the host process needs to be loaded into the main broadcaster end
Plug-in unit in live application program;
Determining unit, for determining to need the target plug-in loaded, and target described in the plug-in unit loading process is notified to insert
Part;
Plug-in unit loading unit, for being loaded in the plug-in unit process and running the target plug-in;
Plug-in unit feedback unit, for feeding back the operation result of the target plug-in to the host process.
The third aspect, the invention provides a kind of computer-readable recording medium, computer program is stored thereon with, the journey
The step of any one of first aspect methods described is realized when sequence is executed by processor.
Fourth aspect, a kind of computer equipment, including memory, processor and storage are on a memory and can be in processor
The computer program of upper operation, the step of realizing any one of first aspect methods described during the computing device described program.
Said one or multiple technical schemes in the embodiment of the present application, at least there is following one or more technology effects
Fruit:
In the technical scheme of the embodiment of the present invention, start the live application program in main broadcaster end first, and it is straight to obtain main broadcaster end
The host process of application program is broadcast, then host process further creates coding pass and/or plug-in unit loading process, coding pass
Video flowing is encoded out for the control based on host process, and video flowing is fed back to host process, plug-in unit loading process is used for
Plug-in unit is loaded in plug-in unit loading process, and the plug-in unit of loading is called according to the control of host process, then host process is obtained and regarded
Frequency flows, and then again by video stream to direct broadcast server, and then makes direct broadcast server that video flowing is transmitted into the live clothes of access
Spectators' end equipment of business device.Because the embodiment of the present invention uses multi-process, using coding pass encoded video stream, using plug-in unit plus
Journey loading plug-in unit is loaded into, so the exception of encoding function and pin function will not both influence each other, does not also interfere with host process,
So avoid causes program crashing because one or more functions are abnormal so that the live application program in main broadcaster end is more stably
Operation, thus solves the technical problem that the live program operation stability in main broadcaster end how is improved existing for prior art.
Brief description of the drawings
Fig. 1 is method flow diagram live in the embodiment of the present invention;
Fig. 2 is apparatus structure schematic diagram live in the embodiment of the present invention;
Fig. 3 is the structural representation of Computer equipment of the embodiment of the present invention.
Embodiment
The embodiments of the invention provide a kind of live method and apparatus, be at least used to solve existing for prior art how
Improve the technical problem of the live program operation stability in main broadcaster end.
In order to solve the above-mentioned technical problem, technical scheme thinking provided by the invention is as follows:
In the technical scheme of the embodiment of the present invention, start the live application program in main broadcaster end first, and it is straight to obtain main broadcaster end
The host process of application program is broadcast, then host process further creates coding pass and/or plug-in unit loading process, coding pass
Video flowing is encoded out for the control based on host process, and video flowing is fed back to host process, plug-in unit loading process is used for
Plug-in unit is loaded in plug-in unit loading process, and the plug-in unit of loading is called according to the control of host process, then host process is obtained and regarded
Frequency flows, and then again by video stream to direct broadcast server, and then makes direct broadcast server that video flowing is transmitted into the live clothes of access
Spectators' end equipment of business device.Because the embodiment of the present invention uses multi-process, using coding pass encoded video stream, using plug-in unit plus
Journey loading plug-in unit is loaded into, so the exception of encoding function and pin function will not both influence each other, does not also interfere with host process,
So avoid causes program crashing because one or more functions are abnormal so that the live application program in main broadcaster end is more stably
Operation, thus solves the technical problem that the live program operation stability in main broadcaster end how is improved existing for prior art.
Technical solution of the present invention is described in detail below by accompanying drawing and specific embodiment, it should be understood that the application
Specific features in embodiment and embodiment are the detailed description to technical scheme, rather than to present techniques
The restriction of scheme, in the case where not conflicting, the technical characteristic in the embodiment of the present application and embodiment can be mutually combined.
The terms "and/or", only a kind of incidence relation for describing affiliated partner, expression may have three kinds of passes
System, for example, A and/or B, can be represented:Individualism A, while A and B be present, these three situations of individualism B.In addition, herein
Middle character "/", it is a kind of relation of "or" to typically represent forward-backward correlation object.
First aspect present invention provides a kind of live method, refer to Fig. 1, is side live in the embodiment of the present invention
Method flow chart.This method includes:
S101:Start the live application program in main broadcaster end;
S102:Obtain the host process of the live application program in main broadcaster end;
S103:The host process creates coding pass and/or plug-in unit loading process, the coding pass are used to be based on institute
The control for stating host process encodes out video flowing, and feeds back the video flowing to the host process, and the plug-in unit loads process
For loading plug-in unit in the plug-in unit loading process, and the plug-in unit loaded is called according to the control of the host process;
S104:The host process obtains the video flowing;
S105:The host process is by the video stream to direct broadcast server, so that the direct broadcast server is by institute
State video flowing and be transmitted to the spectators' end equipment for accessing the direct broadcast server.
Specifically, the live application program in main broadcaster end is started in S101.During specific implementation, main broadcaster end is live should
The live application that be may be mounted at program in main broadcaster's end equipment such as mobile phone, tablet personal computer or desktop computer, the present invention, which is not done, to be had
Body limits.The technical scheme in the embodiment of the present invention is introduced for convenience, hereafter by with installed in the desktop of Windows systems
It is introduced exemplified by the live application program in main broadcaster end on brain.
In S102, with the startup of the live application program in main broadcaster end, the corresponding master for creating the live application program in main broadcaster end
Control process.Next, in S103, host process will create coding pass and/or plug-in unit loading process as required.
Specifically, the coding pass in the embodiment of the present invention encodes out video flowing for the control based on host process,
And feed back video flowing to host process.More specifically, coding pass receives the initialization command of host process and coded command is entered
Row initialization and coding, and by the data transfer after coding to host process.
Plug-in unit loading process is used to load plug-in unit in plug-in unit loading process, and is called and loaded according to the control of host process
Plug-in unit.More specifically, plug-in unit loading process serves as the loader of the live application plug in main broadcaster end, to be loaded original
Enter the plug-in unit in host process to be loaded into plug-in unit loading process, and then make host process no longer need to load plug-in unit, and then keep away
The situation for causing host process to collapse because of the problem of plug-in unit is exempted from.Plug-in unit loading process one side mould in the embodiment of the present invention
Draw up plug-in unit loading and run the environment of relied on host process, on the other hand response obtains image from host process, obtained
Take audio etc. to order, to the image and audio of host process feedback plug-in unit generation, make normally draw in host process and come from
The image and broadcasting sound of plug-in unit.
Host process is the host process of the live application program in main broadcaster end, management plug-in unit loading process and coding pass.Also,
If monitoring coding pass to exit extremely, host process will re-create coding pass automatically so that coding pass can be fast
Speed is restarted.
Further, because host process, coding pass and plug-in unit loading process are different processes, in order that a plurality of process
Collaboration provides the various services of the live application program in main broadcaster end, is interacted between process by way of process communication.Process is led to
The mode of letter includes RPC (remote procedure call protocol, RemoteProcedure Call Protocol) and name pipeline etc.
Deng the present invention is not particularly limited, and those skilled in the art can be according to actually being selected.Hereinafter
Then it is introduced by taking RPC as an example.
For the live application program in main broadcaster end in the embodiment of the present invention, host process, coding pass and plug-in unit add
It is loaded into journey and runs on backstage, is then interacted on foreground by interface program with main broadcaster.Interface program is that main broadcaster really carries out man-machine friendship
Mutual program, in realization, interface program need to give video pictures the preview window to host process to draw.Main broadcaster is at interface
On calling can be forwarded in host process and handle by RPC.Also, interface program need to also be in the feelings that host process collapses extremely
Under condition, start and recover host process.
Above is the introduction to each process in multi-process pattern of the present invention.During specific implementation, in different feelings
Main broadcaster may have different demands, such as main broadcaster to use one process pattern for the ease of safeguarding to incline under condition, or in order to
Program temperature can use multi-process pattern, and plug-in unit loading process etc. can not be created in the case where that need not use plug-in unit,
In order to meet the needs of different, the live application program in main broadcaster end in the embodiment of the present invention can be according at least following 4 kinds of operations
Mode operation.
First mode:
First mode LIVE_ENCODER_PROXY_WITH_SERVER is specially multi-process pattern.In the flrst mode,
Host process RpcLiveEncoderServer will be created after the live application program launching in main broadcaster end, and (host process can also be named
For other), then host process RpcLiveEncoderServer can be considered as server by the live application program in main broadcaster end, with visitor
The identity access host process RpcLiveEncoderServer at family end.Then, the live application program in main broadcaster end is to host process
Calling, can by RPC ask be sent to host process RpcLiveEncoderServer.
In the flrst mode, host process RpcLiveEncoderServer can further create coding pass
RpcLiveEncoderEncoder (name of coding pass can also be other) and plug-in unit loading process
RpcPluginLoader (name of plug-in unit loading process can also be other).
Second mode:
Second mode LIVE_ENCODER_PROXY_WITHOUT_SERVER is also multi-process pattern.With first mode not
With the live application program in main broadcaster end need not voluntarily create host process under the second mode
RpcLiveEncoderServer, and be attached in an existing default host process.Similarly, the live application in main broadcaster end
Host process RpcLiveEncoderServer can be considered as server by program, according to the address of server with the identity of client
Access default host process.
During specific implementation, the host process in second mode can be the process that upper layer application creates.Second mould
Compared to first mode, advantage is to be easy to extend host process from upper layer application formula;First mode is excellent compared to second mode
Gesture is to be easy to the live application program in main broadcaster end directly to manage host process, and host process be by main broadcaster end application program from
What oneself created, therefore incompatible possibility is low.
Under the second mode, host process RpcLiveEncoderServer also can further create coding pass
RpcLiveEncoderEncoder and plug-in unit loading process RpcPluginLoader.
3rd pattern:
3rd pattern LIVE_ENCODER_PROXY_STUB is also multi-process pattern.Wherein, the master control in the 3rd pattern is entered
Journey RpcLiveEncoderServer is similar to the host process in first mode or second mode.In a third mode, master control
Process RpcLiveEncoderServer can further create coding pass RpcLiveEncoderServer or plug-in unit load into
One in journey RpcPluginLoader.In embodiments of the present invention, host process is indicated by pre-setting marker bit
RpcLiveEncoderServer generates coding pass RpcLiveEncoderServer or plug-in unit loading process
RpcPluginLoader。
Specifically, the first marker bit LIVE_ENCODER_REMOTE_PLUGIN represents to need to create plug-in unit loading process
RpcPluginLoader, the second marker bit LIVE_ENCODER_REMOTE_ENCODER represent to need to create coding pass
RpcLiveEncoderServer。
So, during specific implementation, if necessary to add plug-in unit, and influence of the plug-in unit to host process is reduced,
The 3rd pattern can be then selected, and pre-sets the first marker bit;Encoded if necessary to single process, avoid encoding function to master
Control process influences, and when need not add plug-in unit, then can select the 3rd pattern, and pre-set the second marker bit.
Fourth mode:
Fourth mode LIVE_ENCODER_LOCAL_SERVICE is one process pattern.Under fourth mode, main broadcaster end is straight
Broadcast application program and only create a process, i.e. host process.The encoding function of the live application in main broadcaster end realizes in host process,
Plug-in unit is also carried in host process.
Under fourth mode, host process RpcLiveEncoderServer will not further create other processes.
Introduction based on more than to four kinds of operational modes, it can be seen that the live application program in main broadcaster end is in different operational modes
Under will obtain host process in different ways, therefore the S102 in the embodiment of the present invention realizes especially by following process:
Judge the operational mode of the live application program in main broadcaster end pre-set;
If the operational mode is first mode, the host process of the live application program in main broadcaster end is created,
Wherein, in the first mode, the host process will create the coding pass and plug-in unit loading process;
If the operational mode is second mode, the address of the default host process is obtained, and based on describedly
The host process is accessed in location, wherein, in the second mode, the host process will create the coding pass and described
Plug-in unit loads process.
Specifically, the operational mode for first determining whether to pre-set is any in four kinds of patterns above.If main broadcaster
The operational mode of setting is first mode, then is created that host process by the live application program in main broadcaster end;What if main broadcaster was set
Operational mode is second mode, then the live application program in main broadcaster end obtains the address of default host process, is then based on the ground
Default host process is accessed in location.Also, the host process in the first mode and in a second mode, got will be created further
Coding pass and plug-in unit loading process.
In addition, if the operational mode that main broadcaster is set is fourth mode, then the live application program in main broadcaster end only creates master control
One process of process, with one process mode operation.If the operational mode that main broadcaster is set is the 3rd pattern, main broadcaster end is live should
After obtaining host process with program, host process further also need to create in coding pass or plug-in unit loading process one enters
Journey.Specifically, also include before S103:The operational mode of the live application program in main broadcaster end pre-set is judged, if operation
Pattern is the 3rd pattern, then further obtains and represent to need the marker bit for creating coding pass or plug-in unit loading process, if mark
Note position is the first marker bit, and S103 is specially:Plug-in unit is created by host process and loads process;If marker bit is the second mark
Position, S103 are specially:Coding pass is created by host process.
By setting different operational modes to make the live application program in main broadcaster end with list it can be seen from foregoing description
Process or multi-process operation, meet different performance requirements.Also, by setting different marker bits to load plug-in unit
One in function and encoding function is independent from host process.
Further, encoding function is usually the live application program in main broadcaster end one of function of core the most, in prior art
In, realize that each function, interface and parameter of encoding function etc. are encapsulated in coding module.Host process will encode mould when running
Block is loaded into host process, and then host process can arbitrarily call each function, interface and the parameter of encoding function.At this
In inventive embodiments, because the live application program in main broadcaster end can not only have been run but also can have been run with multi-process with one process, therefore, in order to
Make the live application program in main broadcaster end no matter one process operation or multi-process run can be with normal encoding, the embodiment of the present invention pair
Coding module has at least made following improvement:
The encoding function of coding module of the prior art is encapsulated in a module, i.e.,
In LiveEncoderLocalService coding local service modules;Add for receiving instruction, and the instruction that will be received
The module being forwarded in coding local service module, i.e. LiveEncoderStub coding counterfoil modules;Addition one is used to simulate
The original output interface of coding module, and the module of transparent transmission coding local service module result, i.e.,
LiveEncoderProxy coding agent modules.Make LiveEncoderLocalService coding local service module connections
LiveEncoderStub encodes counterfoil module, and makes LiveEncoderProxy coding agents module connect
LiveEncoderLocalService encodes local service module.Optionally, LiveEncoderLocalService is encoded
Local service module, LiveEncoderStub coding counterfoil modules and LiveEncoderProxy coding agent modules are encapsulated in
In one module, i.e. LiveEncoder coding modules.
To the improved introduction of coding module based on more than, below just to the embodiment of the present invention how the coding after application enhancements
Module coding is introduced.
(1) if host process creates coding pass, i.e. the live application program in main broadcaster end operates in first mode, second
Under pattern and (under the second marker bit) the 3rd pattern, host process obtains video flowing and included in S104:
The host process sends coded command to coding counterfoil module, to notify the coding pass encoded video stream;
The coding pass calls the coding local service module being connected with the coding counterfoil module to encode out described regard
Frequency flows;
The coding pass calls encodes coding agent interface module that local service module is connected to the master with described
The video flowing that control progress feedback encodes out.
Specifically, if host process call coding module create coding pass, then just by main broadcaster end it is live answer
Independently realized with the encoding function of program from host process into coding pass.Coding pass is subordinated to coding module.When need
When encoding, host process sends coded command to lead to by communicating by the RPC between coding pass to coding counterfoil module
Know that coding pass starts to encode.Coding pass in response to coded command, call correlation technique in coding local service module and
Function performs coded command, so as to encode out video flowing.Then, coding pass recalls coding agent module
LiveEncoderProxy is by RPC passages to the good video flowing of host process feedback encoding.
And then in S105, host process is by video stream to direct broadcast server, and then direct broadcast server is by video flowing
It is transmitted to and watches in spectators' end equipment of the spectators of the main broadcaster.And then spectators' end equipment decodes live regard to decoding video stream
Frequency is watched for spectators.
(2) if host process does not create coding pass, i.e., the live application program in main broadcaster end operate in the 3rd pattern and
Under (the first marker bit) the 3rd pattern, host process obtains video flowing and included in S104:
The host process sends coded command to coding counterfoil module;
The coding counterfoil module calls the coding local service module being connected with the coding counterfoil module to encode out institute
State video flowing;
The coding local service module calls the coding agent interface module being connected with the coding local service module
The video flowing gone out to the host process feedback encoding.
Specifically, if host process does not create coding pass, then the encoding function of the live application program in main broadcaster end
Then still realized by host process.Specifically, when host process needs encoded video stream, coded command is generated.Then, master control
Process sends coded command to coding counterfoil module.Then, counterfoil module is encoded to coding local service module transmission coding to refer to
Order, to call the method and function encoded video stream that encode in local service module.Then, encoding local service module will encode
The video stream of completion gives coding agent module, and then video flowing is transparently transmitted to host process by coding agent module again.
Above is to host process and coding pass how the introduction encoded using the coding module after improvement, below
Coding pass then how is created to host process, and the specific cataloged procedure of coding pass is introduced.
The process for creating coding pass to host process first is introduced.In embodiments of the present invention, host process is created
Building coding pass includes following process:
The host process calling process creates function;
The ID of the host process is passed to the process creation function by the host process;
The host process runs coding pass described in the process creation function creation, and the coding pass is creating
Cheng Hou, process context is initialized, and based on the ID connections master of the host process possessed by the process creation function
Control process.
Specifically, host process calls one volume of process creation CreateProcess function creations of Windows systems
Code process RpcLiveEncoderEncoder.Host process, can be by host process when calling CreateProcess functions
Process ID passes to CreateProcess functions as command line parameter, and then by the coding of CreateProcess function creations
Can obtains the process ID of host process in order line after process RpcLiveEncoderEncoder starts.Then, master control
Process operation CreateProcess function creations go out coding pass RpcLiveEncoderEncoder.Next, coding pass
Process context is initialized, and establishes the connection with host process, specifically, coding pass passes through following procedure initialization process ring
Border simultaneously connects host process:
Coding pass register initial service function and video flowing the encoding service function;
Create the video shared drive of storage audio-visual-materials and store the audio shared drive of audio material;
Obtain the ID connections host process of the host process possessed by the process creation function;
Based on the connection with the host process, mark and institute to the host process transmission video shared drive
State the mark of audio shared drive.
Specifically, coding pass RpcLiveEncoderEncoder is by calling RpcCreateInstance methods to create
A RPC communication client instance handle hRpc is built, accordingly, host process is server.Then, call
RpcRegisterProcedure functions, by coding pass RpcLiveEncoderEncoder initialization service function init_
Encoder is registered in hRpc, and video flowing encoding service function encode_raw_buffer is registered in hRpc.
In the embodiment of the present invention, initialization service function init_encoder is used for the initialization command for responding host process, according to first
Nominal parameter in beginningization order completes coding initial work, and encoding stream server functions encode_raw_buffer is used for
The coded command of host process is responded, the audio-visual-materials in host process specified memory and audio material are encoded, and will
Acquired data return to host process after coding.
Next, create the internal memory of storage audio-visual-materials and audio material.In embodiments of the present invention, it is contemplated that if needed
Encode the higher video flowing of definition, such as 1080p video flowing, then the data volume per two field picture is all bigger;Meanwhile
If using the data between RPC transmission processes, larger performance consumption is also brought along, therefore in order to avoid coded data need not
The transmission wanted, the embodiment of the present invention optimize performance by the way of shared drive.Specifically, Windows systems are called
One entitled RpcLiveEncoderEncoder_video_X of CreateFileMapping function creations video shared drive,
And create entitled RpcLiveEncoderEncoder_Audio_X audio shared drive.Certainly, implementing
Cheng Zhong, the name of video shared drive and audio shared drive can be according to being actually configured, and the present invention is not particularly limited.
Next, the process ID of the host process in coding pass reading order row, calls RpcStartService functions
The RPC communication passage established between host process.Then, the client_process_ of host process is called based on RPC passages
Ready functions, to notify host process coding pass initialization process context to complete.
Calling of the host process according to coding pass to client_process_ready functions, is obtained out of RPC passages
SessionId session id of the coding pass in RPC connections, and determine that coding pass context initialization is completed, and then follow-up
During informed code process encoded video stream as needed.
In addition, sessionId of the host process based on coding pass calls the rpc_encoder_ of coding pass
Sharememory_name functions obtain the video shared drive mark and audio shared drive mark that coding pass is created.
By said process, the establishment to coding pass is just completed.Next, to the specific cataloged procedure of coding pass
It is introduced.
First, in order that spectators' end equipment can smoothly obtain and decoded video streams, it is necessary to first carried to spectators' end equipment
For solving harbour parameter.Therefore, before encoding out video flowing by coding pass and feeding back to host process, in addition to:
The host process sends initialization command to the coding pass, and the initialization command includes being used to instruct institute
The nominal parameter that coding pass determines solution harbour parameter is stated, the solution harbour parameter includes video solution harbour parameter and audio decoder
Head parameter;
The coding pass is based on the initial command and runs the initialization service function, with based on the nominal parameter
Obtain the video solution harbour parameter and the audio decoder head parameter;
The coding pass feeds back the video solution harbour parameter and the audio decoder head parameter to the host process,
So that the host process sends the video solution harbour parameter and the audio decoder head parameter to the direct broadcast server,
The video solution harbour parameter and the audio decoder head parameter are transmitted to spectators' end equipment by the direct broadcast server again.
Specifically, host process sends initialization init_encoder orders to coding pass.The order includes being used for
Coding pass is instructed to determine the nominal parameter of solution harbour parameter, and nominal parameter is then true according to the selection of main broadcaster by host process
It is fixed.In embodiments of the present invention, nominal parameter includes but is not limited to resolution information (width width and height height), depending on
Frequency code rate videoBitrate, video frame rate fps, video encoder type videoCodec, the channel number of audio coder
AudioChannel, audio sample rate audioSampleRate, audio code rate audioBitrate, and audio coder class
Type audioCodec.
Coding pass is after RPC channel receptions initialize init_encoder orders, by initializing service function init_
Encoder is responded, specifically:Call CreateMediaFile one multimedia file IMediaFile interface of function creation;So
The video encoder type videoCodec in init_encoder orders calls IMediaFile interfaces afterwards
CreateEncoder methods create video encoder the interface videoEncoder, Yi Jigen that a type is videoCodec
CreateEncoder methods are called to create a class according to the audio coder type audioCodec in init_encoder orders
Type is audioCodec video encoder interface audioEncoder;Call video encoder interface videoEncoder's
Open methods using the width width of encoded video, height height, video code rate videoBitrate, video frame rate fps as
Parameter initializes video encoder interface IMediaEncoder, and calls audio coder audioEncoder Open
Method, by the channel number audioChannel, audio sample rate audioSampleRate, audio code rate of audio coder
AudioBitrate is as a parameter to initialization audio coder audioEncoder.
Then, coding pass calls the readVideoHeader of IMediaFile interfaces to get video encoder interface
IMediaEncoder video solution harbour parameter videoHeader, and call IMediaFile interfaces
ReadAudioHeader methods obtain audio coder audioEncoder audio decoder head parameter audioHeader.
Then, coding pass is by the video solution harbour parameter videoHeader got and audio decoder head parameter
AudioHeader is sent to host process by RPC passages.And host process then can further by video solution harbour parameter
VideoHeader and audio decoder head parameter audioHeader is sent to direct broadcast server, so direct broadcast server by video
Solution harbour parameter videoHeader and audio decoder head parameter audioHeader is sent to each spectators' end equipment.So, see
Many end equipment cans according to video solution harbour parameter videoHeader and audio decoder head parameter audioHeader to regarding
Frequency and audio carry out decoding broadcasting.
After obtaining solution harbour parameter, it is possible to obtain the video flowing of coding.In embodiments of the present invention, pass through in S104
Coding pass obtains encoded video stream especially by following process:
The coding pass receives the coded command that the host process is sent;
Based on the coded command, the video prestored by the host process is extracted from the video sharing internal memory
Material, and share the audio material that extraction is prestored by the host process in internal memory from the audio;
Audio-visual-materials described in running the video flowing encoding service function pair are encoded, and obtain video data encoder, with
And the audio material is encoded, coded audio data is obtained, the video flowing includes the video data encoder and institute
State coded audio data;
The video data encoder and the coded audio data are fed back into the host process.
Specifically, host process is according to the mark of the video shared drive obtained above, it would be desirable to the video material of coding
Material is prestored in video shared drive, and the mark according to the audio shared drive obtained above, it would be desirable to coding
Audio material is prestored in audio shared drive.During specific implementation, the content of audio-visual-materials and audio material is led to
It is often matching, such as from same file or has the collection of main broadcaster's end equipment.Then, needing to encode out video flowing
When, host process sends coded command encode_raw_buffer by the RPC passages between coding pass to coding pass.
After coding pass receives encode_raw_buffer orders, responded by coding function, specifically:Call
The Encode methods of videoEncoder interfaces, the audio-visual-materials read in video shared drive are encoded, by Video coding
Data return to host process;And audioEncoder Encode methods are called, to the audio material in audio shared drive
Material is encoded, and coded audio data is returned into host process.Wherein, video data encoder and coded audio data, which are formed, regards
Frequency flows, and the two is corresponding according to time shaft.
It is exactly the introduction to coding pass encoded video stream above.By said process, coding pass is achieved that individually
Encoded video stream.
After host process receives the video flowing returned from coding pass, video flowing is stored in transmit queue and is sent to
Direct broadcast server.And then direct broadcast server is transmitted to each spectators' end equipment, spectators after video flowing is received, then by video flowing
End equipment is decoded successively to the video flowing received, and then the live video of main broadcaster is played to user, is thus completed live.
In addition, during specific implementation, coding pass may due to exception and collapse, answered in order that main broadcaster end is live
It can continue to encode with program and then continue live, the live broadcasting method in the embodiment of the present invention can further include:
The host process monitors whether the coding pass collapses;
If the host process monitors coding pass collapse, the host process re-create it is described encode into
Journey.
Specifically, the running status of host process monitoring coding pass, if monitoring coding pass collapse, according to
The mode of establishment coding pass described above re-creates coding pass, and just it is no longer repeated herein.
Above is the introduction to coding pass, the method for loading process and plug-in unit loading to plug-in unit below is introduced.
In embodiments of the present invention, the plug-in unit of the live application program in main broadcaster end is carried in inside plug-in unit loading process, and then
The operation of host process is not interfered with extremely even if plug-in unit yet.Similar to coding pass, plug-in unit process is also by RPC passages and master
Control process connects, also, plug-in unit process can be called to simulate the environment that plug-in unit is loaded into host process by RPC passages
The relevant interface of host process, make plug-in unit can be with normal load and operation.
The host process of prior art before plug-in unit is loaded, it is necessary to which plug-in unit knows has, so loading plug-in unit it
It is preceding, it is necessary to enumerate plug-in unit.Plug-in unit in the embodiment of the present invention loads process before plug-in unit is loaded, it is also desirable to host process piece
Lift plug-in unit.Specifically, being loaded in plug-in unit loading process in plug-in unit loading process needs to add in the live application program in main broadcaster end
Before the target plug-in of load, in addition to:
The host process creates plug-in unit enumerator process;
What the plug-in unit enumerator process was enumerated present in current loading catalogue to the host process and can loaded
Alternative plug-in unit;
The host process determines to determine the target plug-in from the alternative plug-in unit, and notifies the plug-in unit to load
Target plug-in described in process.
The process for creating plug-in unit enumerator process to host process first is introduced, and host process is created in the following way
Build plug-in unit enumerator process:
The host process calling process creates function;
The ID of the host process is passed to the process creation function by the host process;
The host process runs plug-in unit enumerator process described in the process creation function creation, the plug-in unit enumerator
Process initializes process context after the completion of establishment, and based on the host process possessed by the process creation function
The ID connections host process.
Host process loads the long-range plugin manager modules of RpcPluginManager, and the module is responsible for plug-in unit enumerator and entered
Journey RpcPluginFinder establishment, and order RpcPluginFinder to enumerate the function of plug-in unit.Will
After RpcPluginManager module loadings are into host process, the CreatePluginManager functions in the module are called,
Create a plugin manager interface IPluginManager.
Next, host process calls plugin manager interface IPluginManager initialization init methods, make
Init methods further call the process creation function CreateProcess of Windows systems to create plug-in unit enumerator process
RpcPluginFinder.When calling CreateProcess functions, host process can also regard the process ID of host process
Command line parameter passes to CreateProcess functions.
Next, host process operation, which creates function CreateProcess cans, is created that plug-in unit enumerator process
RpcPluginFinder.
The establishment of plug-in unit enumerator process is just completed by said process.And plug-in unit enumerator process is creating completion
Afterwards, it is also desirable to initialize process context, and establish the connection with host process.Specifically, plug-in unit enumerator process passes through
Following procedure initialization environment:
Registration, which is enumerated plug-in unit function and enumerated, in the plug-in unit enumerator process exits function;
Obtain the ID connections host process of the host process possessed by the process creation function.
Specifically, by calling RpcCreateInstance to create a RPC communication client instance handle hRpc;
RpcRegisterProcedure functions are called, the power function of plug-in unit will be enumerated, that is, enumerate plug-in unit function get_plugins notes
Volume enumerates enumerate plug-in unit instruction of the plug-in unit function for responding host process and goes to enumerate plug-in unit into hRpc;Call
RpcRegisterProcedure functions, it will enumerate and exit function and be also registered in hRpc, enumerate and exit function and be used to respond master
Control process get send after all plug-in units enumerate exit instruction, exit plug-in unit enumeration process;Master in order line
The process ID of control process, RpcStartService functions are called, the RPC passages established between host process;Master control is called to enter
The client_process_ready functions of journey, to notify host process plug-in unit enumerator process initialization to complete.
Calling of the host process according to plug-in unit enumerator process to client_process_ready functions, from RPC passages
SessionId session id of the plug-in unit enumerator process in RPC connections is inside got, and at the beginning of determining plug-in unit enumerator process context
Beginningization is completed, and then notice plug-in unit enumerator process enumerates plug-in unit as needed in subsequent process.
By said process, the establishment to plug-in unit enumerator process is just completed.Next, have to plug-in unit enumerator process
The enumeration process of body is introduced.Plug-in unit enumerator process is enumerated present in current loading catalogue and can added to host process
The alternative plug-in unit carried, including:
What the plug-in unit enumerator reception host process was sent enumerates instruction, and plug-in unit function process is enumerated described in calling
Read all plug-in units under the loading catalogue;
Legal plug-in unit is filtered out from all plug-in units;
The standby plug-in unit that the live application program in the main broadcaster end is supported is filtered out from the legal plug-in unit.
Specifically, the alternative plug-in unit in the embodiment of the present invention refers to the plug-in unit for host process selection loading.Work as master
When control process needs to load plug-in unit, it can first be sent to plug-in unit enumerator process and enumerate instruction, obtain all alternative plug-in units.Plug-in unit piece
After what act device process was sent from RPC channel reception to host process enumerates instruction, call enumeration function get_plugins to enumerate and work as
All plug-in units under preceding loading catalogue.
Specifically, get_plugins function calls FindFirstFile functions, first under loading catalogue is obtained
DLL (dynamic link library, Dynamic Link Library) file.Then, get_plugins function calls FindNextFile
Function continues to obtain next dll file under loading catalogue.If FindNextFile function return values are true, represent to obtain
Next dll file has been arrived, then has performed FindNextFile functions again, continues to obtain next dll file;If
FindNextFile function return values are fictitious time, represent to have obtained all dll files under loading catalogue.As long as
The return value of FindNextFile functions is true, then carries out obtaining next dll file, until FindNextFile functions return
Value is false.
During specific implementation, main broadcaster is possible to be added to some illegal plug-in units in loading catalogue, still
Illegal plug-in unit can not load, therefore after getting all plug-in units, determine whether the plug-in unit that obtains is legal, will
Illegal plug-in unit filters out.
Specifically, the LoadLibrary functions of calling system load each dll file, if it is possible to successfully call
LoadLibrary functions, then represent that the dll file is legal;, whereas if LoadLibrary function calls fail, then table
Show that the dll file is illegal.After calling LoadLibrary functions for each dll file, by illegal dll file from adding
Carry and unloaded in catalogue, legal dll file is retained.
Further, for the live application program in main broadcaster end, although a plug-in unit is legal, main broadcaster end is live
Application program is also possible to not support the plug-in unit, therefore in embodiments of the present invention, in order to ensure finally to be provided for host process
Alternative plug-in unit be plug-in unit that the live application program in main broadcaster end is supported, it is also necessary to carried out further directed to legal dll file
Filter, so as to obtain the plug-in unit that the live application program in main broadcaster end is supported.
During specific implementation, plug-in unit enumerator process is filtered according to different supports conditions, and the present invention is not done
Concrete restriction.For example, the plug-in unit that the live application program in main broadcaster end is supported possesses the plug-in unit of export function, that
, specifically judge whether the method that can be supported is legal plug-in unit:The GetProcAddress functions of calling system obtain one
Export function in individual legal dll file, if it is possible to get export function, it is determined that plug-in unit corresponding to the dll file is
The plug-in unit that the live application program in main broadcaster end can be supported, and then the plug-in unit is left alternative plug-in unit;, whereas if do not get
Exporting function, it is determined that plug-in unit corresponding to the dll file is the plug-in unit do not supported of the live application program in main broadcaster end, and then from loading
The plug-in unit is unloaded in catalogue.
By said process, one or more alternative plug-in units are just obtained.Next, plug-in unit enumerator process by with master
The RPC passages of control process, the title for the alternative plug-in unit determined is supplied to host process.
Further, in order to save the system resource of main broadcaster's end equipment, enumerate and work as to host process in plug-in unit enumerator process
Present in preceding loading catalogue and after the alternative plug-in unit that can load, in addition to:
The host process sends exit instruction to the plug-in unit enumerator process;
The plug-in unit enumerator be based on the exit instruction call described in enumerate and exit function and terminate process.
Specifically, host process is sent out after the plug-in unit that plug-in unit enumerator process is enumerated is received to plug-in unit enumeration process
Send exit instruction.After plug-in unit enumerator process receives exit instruction, calling, which is enumerated, to be exited function and exits plug-in unit enumerator process.
Next, host process chooses target plug-in from alternative plug-in unit automatically, or it is true according to the selection operation of main broadcaster
Target plug-in corresponding to fixed, then by loading the RPC passages of process with plug-in unit, by the title notice plug-in unit loading of target plug-in
Process.And then plug-in unit loads dll file of the process according to the name acquiring target plug-in of target process, so as to load and run
Target plug-in.
One specific example, it is assumed that the plug-in unit currently loaded needs to call the addition method of host process to load,
So, plug-in unit loading process detects plug-in unit and added by the addition method with the RPC passages of host process calling host process
Method method, so as to successfully load.Further, host process calls plug-in component operation, and plug-in unit loads process by entering with master control
What the RPC channel receptions host process of journey was sent triggers the instruction of the plug-in component operation, and then triggers the plug-in component operation.The plug-in unit is transported
Subtraction method is needed to use during row, then, plug-in unit loads process by calling host process with the RPC passages of host process
Subtraction method, the plug-in unit is handled using subtraction method, so as to obtain result.Plug-in unit loading process obtains this and inserted
The result of part operation, feeds back to host process by the RPC passages with host process by the operation result of the plug-in unit.
In addition, if the plug-in unit of loading can produce image and audio, i.e. plug-in unit needs to show image and sound to main broadcaster, that
Plug-in unit, which loads process, then to be needed to enter image caused by plug-in unit and audio transmission to master control by the RPC passages with host process
Journey.Then, host process shows image further according to Image Rendering window caused by plug-in unit, and by player plays audio,
So as to which image caused by plug-in unit and sound are showed into main broadcaster.
Certainly, host process is equally also required to monitor plug-in unit loading process, therefore the embodiment of the present invention also includes with lower section
Case:
The host process monitors whether the plug-in unit loading process collapses;
If the host process monitors the plug-in unit loading process collapse, the plug-in unit loading process is re-created.
Specifically, host process monitoring plug-in unit loading running state of a process, collapsed if monitoring plug-in unit loading process
Burst, then re-creating plug-in unit enumerator in the way of establishment plug-in unit enumerator process described above and plug-in unit loading process enters
Journey and plug-in unit loading process, just it is no longer repeated herein.
Based on the inventive concept same with method live in previous embodiment, second aspect of the present invention also provides a kind of straight
The device broadcast, as shown in Fig. 2 including:
Start unit 101, for starting the live application program in main broadcaster end;
Host process acquiring unit 102, for obtaining the host process of the live application program in main broadcaster end;
Process creation unit 103, it is used for base for creating coding pass and/or plug-in unit loading process, the coding pass
Video flowing is encoded out in the control of the host process, and the video flowing, the plug-in unit loading are fed back to the host process
Process is used to load plug-in unit in the plug-in unit loading process, and the plug-in unit of loading is called according to the control of the host process;
Video flowing acquiring unit 104, for obtaining the video flowing;
Transmitting element 105, for by the video stream to direct broadcast server so that the direct broadcast server will described in
Video flowing is transmitted to the spectators' end equipment for accessing the direct broadcast server.
Specifically, the host process acquiring unit 102 is used to judge the live application in main broadcaster end pre-set
The operational mode of program, wherein, in the first mode, the host process will create the coding pass and the plug-in unit
Loading process;If the operational mode is first mode, the host process of the live application program in main broadcaster end is created;
If the operational mode is second mode, the address of the default host process is obtained, and based on address access institute
Host process is stated, wherein, in the second mode, the host process will create the coding pass and plug-in unit loading
Process.
Further, described device also includes:
Mode determination, for creating coding pass and/or plug-in unit loading process by the host process described
Before, the operational mode of the live application program in main broadcaster end pre-set is judged;
Acquiring unit is marked, if being the 3rd pattern for the operational mode, is added in establishment coding pass and/or plug-in unit
It is loaded into before journey, obtains and represent to need the marker bit for creating the coding pass or plug-in unit loading process;
If the marker bit is the first marker bit, the process creation unit 103 is specifically used for entering by the master control
Journey creates the plug-in unit loading process;
If the marker bit is the second marker bit, the process creation unit 103 is specifically used for entering by the master control
Journey creates the coding pass.
Further, if the host process creates the coding pass, the video flowing acquiring unit 104 be used for
Encode counterfoil module and send coded command, to notify the coding pass encoded video stream, the coding pass call with it is described
The coding local service module of coding counterfoil module connection encodes out the video flowing, and the coding pass calls and the coding
The video flowing that the coding agent interface module of local service module connection goes out to the video flowing acquiring unit feedback encoding.
And if the host process does not create the coding pass, the video flowing acquiring unit 104 is then used for volume
Code counterfoil module sends coded command, and the coding counterfoil module calls the coding being connected with the coding counterfoil module locally to take
Business module coding goes out the video flowing, and the coding local service module calls the volume being connected with the coding local service module
The video flowing that code proxy interface module goes out to the video flowing acquiring unit feedback encoding.
(1) if the embodiment of the present invention need create coding pass, then the process creation unit 103 be used for call into
Journey creates function, and the ID of the host process is passed into the process creation function, runs the process creation function creation institute
Coding pass is stated, the coding pass initializes process context, and had based on the process creation function after the completion of establishment
The ID connections host process for the host process having.
Further, described device also includes coding pass environment initial cell, is completed for being created in the coding pass
Afterwards, process context, and the ID connections master control based on the host process possessed by the process creation function are initialized
Process, specifically for the register initial service function in the coding pass and video flowing encoding service function, create storage
The video shared drive of audio-visual-materials and the audio shared drive for storing audio material, obtain the process creation function and are had
The ID connections host process for the host process having, the connection based on the coding pass Yu the host process, to
The host process sends the mark of the video shared drive and the mark of the audio shared drive.
Further, described device also includes coding initialization unit, for being encoded described by the coding pass
Before going out video flowing and feeding back to the host process, initialization command, the initialization command are sent to the coding pass
Including for instructing the coding pass to determine the nominal parameter of solution harbour parameter, the solution harbour parameter includes video solution harbour
Parameter and audio decoder head parameter, the initialization service function is run based on the initial command, with based on the specified ginseng
Number obtains the video solution harbour parameter and the audio decoder head parameter, feeds back the video solution harbour to the host process
Parameter and the audio decoder head parameter, so that the host process is by the video solution harbour parameter and the audio decoder head
Parameter is sent to the direct broadcast server, and the direct broadcast server is again by the video solution harbour parameter and the audio decoder head
Parameter is transmitted to spectators' end equipment.
The video flowing acquiring unit 104 is used to receive the coded command that the host process is sent;Based on the coding
Order, extracts the audio-visual-materials that are prestored by the host process from the video sharing internal memory, and from the audio
Share the audio material that extraction is prestored by the host process in internal memory;Run the video flowing encoding service function pair institute
State audio-visual-materials to be encoded, obtain video data encoder, and the audio material is encoded, obtain audio coding number
According to the video flowing includes the video data encoder and the coded audio data;By the video data encoder and described
Coded audio data feeds back to the host process.
Further, described device also includes coding pass monitoring unit, for monitoring whether the coding pass collapses;
If monitoring the coding pass collapse, the coding pass is re-created.
(2) if the host process creates the plug-in unit loading process, described device also includes:
Plug-in unit loading unit, need to load in the live application program for loading in the plug-in unit loading process
Target plug-in.
So, the process creation unit 103, which is additionally operable to the loading in the plug-in unit loading process, needs described live
Before the target plug-in loaded in application program, plug-in unit enumerator process is created;
Described device also includes plug-in unit enumeration unit, for being enumerated to the host process present in current loading catalogue
And the alternative plug-in unit that can be loaded;
Determining unit, for determining to determine the target plug-in from the alternative plug-in unit, and the plug-in unit is notified to add
It is loaded into Cheng Suoshu target plug-ins.
Specifically, the process creation unit 103 is used for calling process establishment function, and the ID of the host process is passed
Enter the process creation function, run plug-in unit enumerator process described in the process creation function creation, the plug-in unit enumerator
Process initializes process context after the completion of establishment, and based on the host process possessed by the process creation function
The ID connections host process.
Further, described device also includes plug-in unit loading process context initial cell, for entering in the plug-in unit enumerator
After the completion of journey creates, process context is initialized, and the ID based on the host process possessed by the process creation function connects
The host process is connect, function is exited specifically for registering to enumerate plug-in unit function and enumerate in the plug-in unit enumerator process,
Obtain the ID connections host process of the host process possessed by the process creation function.
Further, the plug-in unit enumeration unit is used to receiving the instruction of enumerating that the host process sends, described in calling
Enumerate plug-in unit function process and read all plug-in units loaded under catalogue;Legal insert is filtered out from all plug-in units
Part;The standby plug-in unit that the live application program in the main broadcaster end is supported is filtered out from the legal plug-in unit.
Further, described device also includes exiting unit, for entering in the plug-in unit enumerator process to the master control
Journey is enumerated present in current loading catalogue and after the alternative plug-in unit that can be loaded, and is sent and is moved back to the plug-in unit enumerator process
Go out instruction, based on the exit instruction call described in enumerate and exit function and terminate process.
Further, described device also includes plug-in unit loading process monitoring unit, for monitoring the plug-in unit loading process
Whether collapse, if monitoring the plug-in unit loading process collapse, re-create the plug-in unit loading process.
The various change mode and instantiation of live method in the embodiment of earlier figures 1 are equally applicable to the present embodiment
Live device, by the foregoing detailed description to live method, those skilled in the art are clear that this reality
The implementation of device live in example is applied, thus it is succinct for specification, it will not be described in detail herein.
Based on the inventive concept same with method live in previous embodiment, the present invention also provides a kind of computer-readable
Storage medium, computer program is stored thereon with, the program realizes appointing for live method described previously when being executed by processor
The step of one method.
Based on the inventive concept same with method live in previous embodiment, the present invention also provides a kind of computer and set
It is standby, as shown in figure 3, including memory 204, processor 202 and being stored on memory 204 and can run on processor 202
Computer program, the processor 202 realizes either one of the method for control progress bar described previously when performing described program
The step of method.
Wherein, in figure 3, bus architecture (being represented with bus 200), bus 200 can include any number of interconnection
Bus and bridge, bus 200 deposited what the one or more processors including being represented by processor 202 and memory 204 represented
The various circuits of reservoir link together.Bus 200 can also will ancillary equipment, voltage-stablizer and management circuit etc. it
Various other circuits of class link together, and these are all it is known in the art, therefore, no longer being carried out further to it herein
Description.EBI 206 provides interface between bus 200 and receiver 201 and transmitter 203.Receiver 201 and transmitter
203 can be same element, i.e. transceiver, there is provided for the unit to be communicated over a transmission medium with various other devices.
Processor 202 is responsible for bus 200 and common processing, and memory 204 can be used to store processor
202 perform operate when used data.
Said one or multiple technical schemes in the embodiment of the present application, at least there is following one or more technology effects
Fruit:
In the technical scheme of the embodiment of the present invention, start the live application program in main broadcaster end first, and it is straight to obtain main broadcaster end
The host process of application program is broadcast, then host process further creates coding pass and/or plug-in unit loading process, coding pass
Video flowing is encoded out for the control based on host process, and video flowing is fed back to host process, plug-in unit loading process is used for
Plug-in unit is loaded in plug-in unit loading process, and the plug-in unit of loading is called according to the control of host process, then host process is obtained and regarded
Frequency flows, and then again by video stream to direct broadcast server, and then makes direct broadcast server that video flowing is transmitted into the live clothes of access
Spectators' end equipment of business device.Because the embodiment of the present invention uses multi-process, using coding pass encoded video stream, using plug-in unit plus
Journey loading plug-in unit is loaded into, so the exception of encoding function and pin function will not both influence each other, does not also interfere with host process,
So avoid causes program crashing because one or more functions are abnormal so that the live application program in main broadcaster end is more stably
Operation, thus solves the technical problem that the live program operation stability in main broadcaster end how is improved existing for prior art.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.