CN107678801A - A kind of method and apparatus of plug-in unit loading - Google Patents

A kind of method and apparatus of plug-in unit loading Download PDF

Info

Publication number
CN107678801A
CN107678801A CN201710930088.0A CN201710930088A CN107678801A CN 107678801 A CN107678801 A CN 107678801A CN 201710930088 A CN201710930088 A CN 201710930088A CN 107678801 A CN107678801 A CN 107678801A
Authority
CN
China
Prior art keywords
plug
unit
host process
host
loading
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
Application number
CN201710930088.0A
Other languages
Chinese (zh)
Other versions
CN107678801B (en
Inventor
杨亮
陈少杰
张文明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Internet Service Co ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710930088.0A priority Critical patent/CN107678801B/en
Priority to PCT/CN2017/109671 priority patent/WO2019071680A1/en
Publication of CN107678801A publication Critical patent/CN107678801A/en
Application granted granted Critical
Publication of CN107678801B publication Critical patent/CN107678801B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiments of the invention provide a kind of method and apparatus of plug-in unit loading, are at least used for solving the technical problem that the live program operation stability in main broadcaster end how is improved existing for prior art.Methods described includes: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 plug-in unit loading process;The plug-in unit loading process loads the target plug-in for needing to be loaded in the live application program in the plug-in unit loading process.

Description

A kind of method and apparatus of plug-in unit loading
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and apparatus of plug-in unit loading.
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 plug-in unit 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 method and apparatus of plug-in unit loading, are at least used to solve existing for prior art How the technical problem of main broadcaster end live program operation stability is improved.
In a first aspect, the invention provides a kind of method of plug-in unit loading, 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 plug-in unit loading process;
The plug-in unit loading process loads needs in the plug-in unit loading process and loaded in the live application program Target plug-in.
Optionally, load in plug-in unit loading process in the plug-in unit loading process needs live to apply journey described Before the target plug-in loaded in sequence, 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.
Optionally, the host process creates plug-in unit enumerator process, including:
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.
Optionally, the plug-in unit enumerator process initializes process context, and create based on the process after the completion of establishment The ID connections host process of the host process possessed by function is built, including:
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.
Optionally, the plug-in unit enumerator process is enumerated present in current loading catalogue to the host process and can The alternative plug-in unit of loading, 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.
Optionally, enumerated in the plug-in unit enumerator process to the host process present in current loading catalogue and energy After the alternative plug-in unit enough loaded, 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.
Optionally, methods described also includes:
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.
Second aspect, the invention provides a kind of device of plug-in unit loading, 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, for creating plug-in unit loading process;
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.
Optionally, the process creation unit be additionally operable in the plug-in unit loading process loading need it is described it is live should Before the target plug-in loaded in 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.
Optionally, the process creation unit is used for calling process establishment function, and the ID of the host process is passed into institute Process creation function is stated, runs plug-in unit enumerator process described in the process creation function creation, the plug-in unit enumerator process After the completion of establishment, process context is initialized, and the ID based on the host process possessed by the process creation function connects Connect the host process.
Optionally, 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.
Optionally, the plug-in unit enumeration unit is used for the instruction of enumerating for receiving the host process transmission, described piece of calling Lift plug-in unit function process and read all plug-in units loaded under 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.
Optionally, described device also includes exiting unit, in the plug-in unit enumerator process to the host process Enumerate present in current loading catalogue and after the alternative plug-in unit that can be loaded, send and exit to the plug-in unit enumerator process Instruction, based on the exit instruction call described in enumerate and exit function and terminate process.
Optionally, described device also includes plug-in unit loading process monitoring unit, is for monitoring the plug-in unit loading process No collapse, if monitoring the plug-in unit loading process collapse, re-create the plug-in unit loading 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, the invention provides a kind of computer equipment, including memory, processor and storage are on a memory And the computer program that can be run on a processor, realize described in any one of first aspect during the computing device described program The step of method.
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 plug-in unit loading process, and adds in plug-in unit loading process Carry the target plug-in for needing to be loaded in live application program.Because the embodiment of the present invention uses multi-process, loaded using plug-in unit Process loads plug-in unit, so the exception of pin function does not interfere with host process, so avoiding due to one or more functions Extremely program crashing is caused so that the live application program in main broadcaster end is more stably run, and thus solves prior art presence The technical problem for how improving the live program operation stability in main broadcaster end.
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 method and apparatus of plug-in unit loading, are at least used to solve existing for prior art How the technical problem of main broadcaster end live program operation stability is improved.
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 plug-in unit loading process, and adds in plug-in unit loading process Carry the target plug-in for needing to be loaded in live application program.Because the embodiment of the present invention uses multi-process, loaded using plug-in unit Process loads plug-in unit, so the exception of pin function does not interfere with host process, so avoiding due to one or more functions Extremely program crashing is caused so that the live application program in main broadcaster end is more stably run, and thus solves prior art presence The technical problem for how improving the live program operation stability in main broadcaster end.
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, Remote Procedure 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;If the operational mode is first mode, the master of the live application program in main broadcaster end is created Control process, wherein, in the first mode, the host process will create the coding pass and the plug-in unit load into Journey;If the operational mode is second mode, the address of the default host process is obtained, and access based on the address The host process, wherein, in the second mode, the host process will create the coding pass and the plug-in unit adds It is loaded into journey.
Further, described device also includes:
Mode determination, for it is described by the host process create coding pass or plug-in unit load process it Before, judge the operational mode of the live application program in main broadcaster end pre-set;
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 and/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 plug-in unit loading process, and adds in plug-in unit loading process Carry the target plug-in for needing to be loaded in live application program.Because the embodiment of the present invention uses multi-process, loaded using plug-in unit Process loads plug-in unit, so the exception of pin function does not interfere with host process, so avoiding due to one or more functions Extremely program crashing is caused so that the live application program in main broadcaster end is more stably run, and thus solves prior art presence The technical problem for how improving the live program operation stability in main broadcaster end.
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.

Claims (10)

  1. A kind of 1. method of plug-in unit loading, it is characterised in that 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 plug-in unit loading process;
    The plug-in unit loading process loads the mesh for needing to be loaded in the live application program in the plug-in unit loading process Mark plug-in unit.
  2. 2. the method as described in claim 1, it is characterised in that load process in the plug-in unit loading process in the plug-in unit Before the target plug-in that loading needs load in the live application program, in addition to:
    The host process creates plug-in unit enumerator process;
    The plug-in unit enumerator process is enumerated present in current loading catalogue and can loaded alternative to the host process 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 loading process The target plug-in.
  3. 3. method as claimed in claim 2, it is characterised in that the host process creates plug-in unit enumerator process, including:
    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 After the completion of establishment, process context is initialized, and the ID based on the host process possessed by the process creation function connects Connect the host process.
  4. 4. method as claimed in claim 3, it is characterised in that the plug-in unit enumerator process is after the completion of establishment, initialization Process context, and the ID connections host process based on the host process possessed by the process creation function, including:
    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.
  5. 5. method as claimed in claim 4, it is characterised in that the plug-in unit enumerator process is enumerated to the host process to be worked as Present in preceding loading catalogue and the alternative plug-in unit that can load, including:
    What the plug-in unit enumerator reception host process was sent enumerates instruction, and the reading of plug-in unit function process is enumerated described in calling 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.
  6. 6. method as claimed in claim 5, it is characterised in that enumerated in the plug-in unit enumerator process to the host process It is current to load present in catalogue and after the alternative plug-in unit that loaded, 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.
  7. 7. the method as described in claim 1, it is characterised in that methods described also includes:
    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.
  8. A kind of 8. device of plug-in unit loading, it is characterised in that 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, for creating plug-in unit loading process;
    Plug-in unit loading unit, for the mesh that loading needs load in the live application program in the plug-in unit loading process Mark plug-in unit.
  9. 9. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is held by processor The step of any one of claim 1-7 methods described is realized during row.
  10. 10. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that the step of any one of claim 1-7 methods described is realized during the computing device described program Suddenly.
CN201710930088.0A 2017-10-09 2017-10-09 A kind of method and apparatus of plug-in unit load Active CN107678801B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710930088.0A CN107678801B (en) 2017-10-09 2017-10-09 A kind of method and apparatus of plug-in unit load
PCT/CN2017/109671 WO2019071680A1 (en) 2017-10-09 2017-11-07 Plug-in loading method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710930088.0A CN107678801B (en) 2017-10-09 2017-10-09 A kind of method and apparatus of plug-in unit load

Publications (2)

Publication Number Publication Date
CN107678801A true CN107678801A (en) 2018-02-09
CN107678801B CN107678801B (en) 2018-09-04

Family

ID=61139910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710930088.0A Active CN107678801B (en) 2017-10-09 2017-10-09 A kind of method and apparatus of plug-in unit load

Country Status (2)

Country Link
CN (1) CN107678801B (en)
WO (1) WO2019071680A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804082A (en) * 2018-05-10 2018-11-13 北京酷我科技有限公司 A kind of implementation method of plug-in unit JSBridge
CN109344035A (en) * 2018-09-30 2019-02-15 北京奇虎科技有限公司 A kind of progress control method of application program, device, equipment and storage medium
CN109361591A (en) * 2018-07-27 2019-02-19 北京联合大学 A kind of personal messages paradigmatic system based on plug-in unit
CN109408155A (en) * 2018-11-07 2019-03-01 北京奇艺世纪科技有限公司 Using starting method and apparatus
CN112243140A (en) * 2019-07-16 2021-01-19 腾讯科技(北京)有限公司 Information processing method and device
CN112463335A (en) * 2020-12-03 2021-03-09 Oppo广东移动通信有限公司 Application program running method and device and storage medium
CN113656091A (en) * 2021-07-28 2021-11-16 广州虎牙科技有限公司 Method for realizing independent broadcasting process, related device and equipment
CN117076159A (en) * 2023-10-10 2023-11-17 统信软件技术有限公司 Plug-in calling method and device, electronic equipment and computer readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110708366A (en) * 2019-09-24 2020-01-17 深圳市迅雷网络技术有限公司 Plug-in process management method, related method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097529A (en) * 2006-06-29 2008-01-02 腾讯科技(深圳)有限公司 Progress invoking method of shared windows
US20150365627A1 (en) * 2014-06-13 2015-12-17 Arcsoft Inc. Enhancing video chatting
US20160050445A1 (en) * 2014-08-15 2016-02-18 Fox Digital Enterprises, Inc. Data repository for sports and entertainment information
CN106686420A (en) * 2016-12-09 2017-05-17 广州华多网络科技有限公司 Live streaming application program management method and apparatus
CN106713304A (en) * 2016-12-19 2017-05-24 北京星辰美豆文化传播有限公司 Webcast method, apparatus and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081709B (en) * 2009-12-01 2017-05-24 联想(北京)有限公司 Method and device for disabling browser plug-in and terminal
CN102156663B (en) * 2011-03-22 2013-07-31 北京书生国际信息技术有限公司 Implementation method and device of plugin
CN102426537B (en) * 2011-11-02 2014-07-02 北京数码大方科技股份有限公司 Method and device for calling main program progress by external integration progress in CAD (Computer - Aided Design)
CN103793224B (en) * 2014-01-17 2017-07-28 北京奇虎科技有限公司 The display methods and device of a kind of window
CN107613312B (en) * 2017-10-09 2018-08-21 武汉斗鱼网络科技有限公司 A kind of method and apparatus of live streaming

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097529A (en) * 2006-06-29 2008-01-02 腾讯科技(深圳)有限公司 Progress invoking method of shared windows
US20150365627A1 (en) * 2014-06-13 2015-12-17 Arcsoft Inc. Enhancing video chatting
US20160050445A1 (en) * 2014-08-15 2016-02-18 Fox Digital Enterprises, Inc. Data repository for sports and entertainment information
CN106686420A (en) * 2016-12-09 2017-05-17 广州华多网络科技有限公司 Live streaming application program management method and apparatus
CN106713304A (en) * 2016-12-19 2017-05-24 北京星辰美豆文化传播有限公司 Webcast method, apparatus and electronic equipment

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804082A (en) * 2018-05-10 2018-11-13 北京酷我科技有限公司 A kind of implementation method of plug-in unit JSBridge
CN109361591A (en) * 2018-07-27 2019-02-19 北京联合大学 A kind of personal messages paradigmatic system based on plug-in unit
CN109361591B (en) * 2018-07-27 2022-03-22 北京联合大学 Personal message aggregation system based on plug-in
CN109344035A (en) * 2018-09-30 2019-02-15 北京奇虎科技有限公司 A kind of progress control method of application program, device, equipment and storage medium
CN109408155A (en) * 2018-11-07 2019-03-01 北京奇艺世纪科技有限公司 Using starting method and apparatus
CN109408155B (en) * 2018-11-07 2021-11-02 北京奇艺世纪科技有限公司 Application starting method and device
CN112243140A (en) * 2019-07-16 2021-01-19 腾讯科技(北京)有限公司 Information processing method and device
CN112463335A (en) * 2020-12-03 2021-03-09 Oppo广东移动通信有限公司 Application program running method and device and storage medium
CN113656091A (en) * 2021-07-28 2021-11-16 广州虎牙科技有限公司 Method for realizing independent broadcasting process, related device and equipment
CN117076159A (en) * 2023-10-10 2023-11-17 统信软件技术有限公司 Plug-in calling method and device, electronic equipment and computer readable storage medium
CN117076159B (en) * 2023-10-10 2024-01-05 统信软件技术有限公司 Plug-in calling method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
WO2019071680A1 (en) 2019-04-18
CN107678801B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN107678801B (en) A kind of method and apparatus of plug-in unit load
CN107613312B (en) A kind of method and apparatus of live streaming
CN103250410B (en) In video conference with the novel interaction systems and method of participant
CN105635751B (en) A kind of video cloud platform plays the method and device of video
CN104837052A (en) Playing method of multimedia data and device
CN113965751B (en) Screen content coding method, device, equipment and storage medium
CN106101794A (en) The processing method of a kind of virtual desktop video data, Apparatus and system
CN107770567B (en) A kind of method and apparatus of live streaming
WO2018119711A1 (en) Multimedia encoding/decoding method and device for multi-operating system, and electronic device
CN101009836A (en) Embedded video playing device based on the dual processor
CN108055594A (en) Implementation method, device, computer equipment and the storage medium of edge section
CN107547451A (en) A kind of multipath server, CPU connection methods and device
CN116456496A (en) Resource scheduling method, storage medium and electronic equipment
CN116546262A (en) Data processing method, device, equipment and storage medium
CN106973307A (en) A kind of video equipment access method and device
CN111866508A (en) Video processing method, device, medium and electronic equipment
CN114339112B (en) Video call method, electronic equipment and system
EP2819012B1 (en) Automated compression of data
CN113068008B (en) Decoding method, encoding method, code stream transmission method, electronic equipment and system
US11012479B2 (en) Methods for capturing and broadcasting user computer sessions and related computer program products
CN113691813B (en) Transcoding card using method, system, storage medium and device
CN116827826B (en) Method and device for evaluating edge node and computer readable storage medium
CN114157919A (en) Data processing method and system, cloud terminal, server and computing equipment
KR102537913B1 (en) Method And Apparatus for Displaying VMI Screen and Local Screen in Specific Region
CN106998365B (en) Audio and video processor, intelligent teaching device, intelligent teaching system and method

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
TR01 Transfer of patent right

Effective date of registration: 20231113

Address after: Room 606-609, Compound Office Complex Building, No. 757, Dongfeng East Road, Yuexiu District, Guangzhou, Guangdong Province, 510699

Patentee after: China Southern Power Grid Internet Service Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right