Background technology
FFmpeg is a Free Service of developing under Linux of increasing income, it provides and has recorded, the total solution of conversion and fluidisation sound, video, support the multimedia file formats that the overwhelming majority is common, for example support common DIVX file or Xvid file or the like with mpeg, the encapsulation of AVI form.Because FFmpeg is based on the Linux exploitation, the C/C++ compiler that modal Visual Studio provides under its source code and the Windows is also incompatible, therefore want to use FFmpeg, the problem that will solve is exactly the translation and compiling environment of a similar Linux of configuration under Windows at first.In the prior art, this translation and compiling environment adopts the MSys+MinGW system to realize that wherein the full name of MSys is Minimalist GNUSystem on Windows, is classic GNU environment under the Windows; And the full name of MinGW is Minimalist GNU for Windows, is a kind of GCC (GNUCompiler C) compiler that operates on the windows platform, and the MSys+MinGW system just is meant and utilizes scrambler MinGW to compile under translation and compiling environment MSys.
The configuration of MSys+MinGW system can and be integrated by the installation under Windows and realize, and if use FFmpeg in this system, also needs FFmpeg is compiled, and regenerates the FFmpeg engineering.
The generation of FFmpeg engineering realizes by integrating FFmpeg source file, the library file of FFmpeg own and third party library file.Wherein the FFmpeg source file comprises FFmpeg source code and some control routines; The library file of FFmpeg own comprises coded system part, form part and control section, and these three parts are compiled into three storehouses by correspondence, and these three storehouses can be called when regenerating the FFmpeg engineering; And the third party library file can be a library file of supporting FFmpeg arbitrarily, can be that the static library file also can be a dynamic library file, when link third party library file and the library file of FFmpeg own, for fear of the source code of revising among the FFmpeg, usually all can compile, generate third party's dynamic link library file the third party library file.
The process that regenerates the FFmpeg engineering can be shown as shown in Figure 1 by simple table: at first dispose translation and compiling environment (step 10); Then the third party library file is compiled into third party's dynamic link library file (step 20); Link the own library file of third party's dynamic link library file and FFmpeg again, generate information bank file Library1 (step 30); Last integrate information library file Library1 and FFmpeg source file generate FFmpeg engineering (step 40).
In said process, because the FFmpeg source code in the FFmpeg source file is the version control system (SVN that leaves free a, open source code in, Subversion), therefore, can only adopt the operation of order line that the FFmpeg source file is conducted interviews, and the mode of operation of order line is comparatively complicated, and these personnel that make custom work down in Integrated Development Environment (IDE, Integrated Development Environment) are difficult to left-hand seat; In addition, in this process, because the third party library file has just been carried out simple compiling, and the method for debugging proposed, therefore having caused integrating the third party library file can't realize debugging fully and compiling in interior FFmpeg engineering, thereby operating personnel can only understand the principle of work of engineering from the source code of FFmpeg engineering magnanimity, and can not realize the real-time follow-up to the FFmpeg source code.
Summary of the invention
The invention provides a kind of compiling system and method for FFmpeg engineering, in order to solve that compilation scheme in the prior art adopts full command line mode and the problem that is difficult to left-hand seat.
The invention provides a kind of system and method that the third party library file is compiled, can only compile the third party library file in order to solve in the prior art, and can't be to its problem of debugging.
For this reason, the present invention adopts following scheme:
A kind of compiling system of FFmpeg engineering comprises: third party library file collector, be used under the translation and compiling environment of supporting FFmpeg, the third party library file being compiled, and generate corresponding third party's dynamic link library file; Link module is used for the third party's dynamic link library file link with library file of FFmpeg own and the generation of third party library file collector, generates the information bank file that includes third party's dynamic link library file information and the library file information of FFmpeg own; Graphical compiling console module is used under default graphical translation and compiling environment, and the own library file information of FFmpeg in the information bank file of FFmpeg source file and link module generation is compiled into executable file; Third party's dynamic link library file information in the information bank file that executable file that compiling is generated and link module generate is launched, and obtains source code before FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Wherein said compiling system also comprises: the Debugging message receiver module, be used for before the third party library file is compiled, and receive the Debugging message that is used to debug the third party library file of user's input; Debugging message adds module, is used for the Debugging message that Debugging message receiver module being used to of receiving debugged the third party library file is joined third party library file before the compiling.
A kind of Compilation Method of FFmpeg engineering comprises: under the translation and compiling environment of supporting FFmpeg, with third party library file compiling becoming third party's dynamic link library file; Link third party's dynamic link library file and the library file of FFmpeg own generate the information bank file that includes third party's dynamic link library file information and the library file information of FFmpeg own; Under default graphical translation and compiling environment, the library file information of the FFmpeg in FFmpeg source file and the information bank file own is compiled into executable file; Executable file and the third party's dynamic link library file information in the information bank file that compiling generates are launched, obtained the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Wherein said before the compiling of third party library file is become third party's dynamic link library file, also comprise step: the Debugging message that is used to debug the third party library file that receives user's input; The Debugging message of being used for of receiving being debugged the third party library file joins the third party library file.
A kind of system that the third party library file is compiled comprises: the Debugging message receiver module is used to receive the Debugging message that is used to debug the third party library file that the user imports; Debugging message adds module, and the Debugging message that is used for Debugging message receiver module being used to of receiving debugged the third party library file joins the third party library file.
A kind of method that the third party library file is compiled comprises: the Debugging message that is used to debug the third party library file that receives user's input; The Debugging message of being used for of receiving being debugged the third party library file joins the third party library file.
The present invention adopts under patterned translation and compiling environment the compilation scheme of FFmpeg engineering, the FFmpeg engineering is compiled, thereby can avoid in the prior art compiling of FFmpeg engineering adopted full command line mode and be difficult to the drawback of left-hand seat, make the compiling of FFmpeg engineering is simplified greatly, be easy to left-hand seat.
The scheme that the present invention compiles the third party library file passes through to add the method for Debugging message in the third party library file, make the third party library file realize and to debug, thereby make operating personnel in the process that the FFmpeg engineering is rebuild, can realize the real-time follow-up of source code.
Embodiment
The embodiment of the invention at first proposes a kind of compilation scheme of FFmpeg engineering, can realize the graphical compiling to the FFmpeg engineering, thereby solves in the prior art that compilation scheme to the FFmpeg engineering adopts full command line mode and the problem that is difficult to left-hand seat.
As shown in Figure 2, the composition structural representation of a kind of FFmpeg engineering compiling system that proposes for the embodiment of the invention.This system comprises three modules: third party library file collector 100, link module 200 and graphically compile console module 300.Wherein the concrete effect of each ingredient is as follows:
Third party library file collector 100 is used under the translation and compiling environment of default support FFmpeg the third party library file being compiled, and generates corresponding third party's dynamic link library file;
Link module 200, be used for the library file of FFmpeg own and third party's dynamic link library file of being generated by third party library file collector 100 are linked, generate the information bank file that includes third party's dynamic link library file information and the library file information of FFmpeg own;
Graphical compiling console module 300, be used under default graphical translation and compiling environment, be compiled into executable file with the FFmpeg source file with by the own library file information of FFmpeg in the information bank file of link module 200 generations, and will compile the executable file of generation and, obtain the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file by the expansion of the third party's dynamic link library file information in the information bank file of link module 200 generations.
Based on the concrete principle of work of graphical compiling console module 300, the concrete composition structure of the graphical compiling console module 300 that the embodiment of the invention proposes comprises as shown in Figure 3:
Compiling submodule 301 is used under default graphical translation and compiling environment, is compiled into executable file with the FFmpeg source file with by the own library file information of FFmpeg in the information bank file of link module 200 generations;
Launch submodule 302, be used for to compile submodule 301 and compile third party's dynamic link library file information expansion that the executable file that generates reaches the information bank file that is generated by link module 200, obtain the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Accordingly, the embodiment of the invention has also proposed a kind of FFmpeg engineering compiling method, its specific implementation flow process as shown in Figure 4, the specific implementation process of this method is as follows:
Step 41 under the translation and compiling environment of default support FFmpeg, compiles the third party library file, generates corresponding third party's dynamic link library file;
Step 42 links the third party's dynamic link library file and the library file of FFmpeg own of above-mentioned generation, generates the information bank file Library2 that includes third party's dynamic link library file information and the library file information of FFmpeg own;
Step 43 under default graphical translation and compiling environment, is compiled into executable file with the own library file information of FFmpeg among the information bank file Library2 of FFmpeg source file and above-mentioned generation;
Step 44, executable file and the third party's dynamic link library file information among the information bank file Library2 that above-mentioned compiling generates are launched, obtained the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Once more, the embodiment of the invention has proposed the compilation scheme of another kind of FFmpeg engineering, not only can realize the graphical compiling to the FFmpeg engineering, also can realize simultaneously the debugging to the FFmpeg engineering.
As shown in Figure 5, the composition structural representation of another the FFmpeg engineering compiling system that proposes for the embodiment of the invention.This system comprises: Debugging message receiver module 1000, Debugging message add module 2000, third party library file collector 3000, link module 4000 and graphically compile console module 5000.Wherein the concrete effect of each ingredient is as follows:
Debugging message receiver module 1000 is used to receive the Debugging message that is used to debug the third party library file that the user imports;
Debugging message adds module 2000, be used under the translation and compiling environment of default support FFmpeg, the Debugging message of Debugging message receiver module being used for of receiving being debugged the third party library file joins the third party library file, but generates the third party library file that has Debugging message;
Third party library file collector 3000, but be used for the third party library file that has Debugging message that Debugging message adding module 2000 generates is compiled, generate corresponding third party's dynamic link library file;
Link module 4000, be used for third party's dynamic link library file that third party library file collector 3000 generates is linked with the library file of FFmpeg own, generate the information bank file that includes third party's dynamic link library file information and the library file information of FFmpeg own;
Graphical compiling console module 5000, be used under default graphical translation and compiling environment, be compiled into executable file with the FFmpeg source file with by the own library file information of FFmpeg in the information bank file of link module 4000 generations, and will compile the executable file of generation and, obtain the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file by the expansion of the third party's dynamic link library file information in the information bank file of link module 4000 generations.
Wherein, Debugging message adds the mode that Debugging message that module 2000 will be used for debugging the third party library file joins the third party library file, the Debugging message that will be used for debugging the third party library file is written to the third party library file, and, the mode that the Debugging message that will be used for debugging the third party library file is written to the third party library file include but not limited to into:
The mode that write order is capable;
Write the mode of script.
Based on the concrete principle of work of graphical compiling console module 5000, the concrete composition structure of the graphical compiling console module 5000 that the embodiment of the invention proposes specifically comprises:
The compiling submodule is used under default graphical translation and compiling environment, is compiled into executable file with the FFmpeg source file with by the own library file information of FFmpeg in the information bank file of link module 4000 generations;
Launch submodule, third party's dynamic link library file information of the information bank file that is used for executable file that compiling submodule compiling is generated and is generated by link module 4000 is launched, and obtains source code before FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Accordingly, the embodiment of the invention has also proposed another kind of FFmpeg engineering compiling method, as shown in Figure 6, is another FFmpeg engineering compiling method flow diagram of embodiment of the invention proposition.The specific implementation process of this method is as follows:
Step 601 receives the Debugging message that is used to debug the third party library file that the user imports;
Step 602, under the translation and compiling environment of default support FFmpeg, the Debugging message of being used for of receiving being debugged the third party library file joins the third party library file;
Step 603 will add third party library file compiling becoming third party's dynamic link library file of Debugging message;
Step 604 links the third party's dynamic link library file and the library file of FFmpeg own of above-mentioned generation, generates information bank file Library3;
Step 605 under default graphical translation and compiling environment, is compiled into executable file with the own library file information of FFmpeg among FFmpeg source file and the information bank file Library3;
Step 606, executable file and the third party's dynamic link library file information among the information bank file Library3 that above-mentioned compiling generates are launched, obtained the preceding source code of FFmpeg source file, the library file of FFmpeg own and each the self-corresponding compiling of third party's dynamic link library file.
Wherein, the mode that Debugging message is joined in the third party library file is that Debugging message is written in the third party library file, and with Debugging message be written to mode in the third party library file include but not limited to into:
The mode that write order is capable;
Write the mode of script.
The embodiment of the invention has also proposed a kind of Compilation Method of third party library file, by add Debugging message in the third party library file, realizes debugging of third party library file.
The method that the third party library file is compiled that the embodiment of the invention proposes comprises step:
Receive the Debugging message that is used to debug the third party library file of user's input;
The Debugging message of being used for of receiving being debugged the third party library file joins the third party library file.
Wherein, the mode that the Debugging message that being used for of receiving debugged the third party library file joins the third party library file is: the Debugging message that being used for of will receiving debugged the third party library file is written to the third party library file, and being used for of will receiving the Debugging message of debugging the third party library file mode that is written to the third party library file include but not limited to into:
The mode that write order is capable;
Write the mode of script.
Accordingly, the embodiment of the invention has also proposed a kind of system that the third party library file is compiled, and comprising:
The Debugging message receiver module is used to receive the Debugging message that is used to debug the third party library file that the user imports;
Debugging message adds module, and the Debugging message that is used for Debugging message receiver module being used to of receiving debugged the third party library file joins the third party library file.
Wherein, the mode that the Debugging message that will be used for debugging the third party library file joins the third party library file is: the Debugging message that will be used for debugging the third party library file is written to the third party library file, and the Debugging message that will be used for debugging the third party library file mode that is written to the third party library file include but not limited to into:
The mode that write order is capable;
Write the mode of script.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.