When providing a software developer kit (SDK) for video processing applications, it is desirable to include a large number of functionalities stored in libraries accessible to the software developer. The software developer may want to access all, some, or none of the functionalities. The SDK can additionally include a video processing application framework for executing basic video processing application functionality that can be expanded on by the developer. The libraries included in the SDK can be loaded by the video processing application either statically or dynamically.
Dynamic loading is a mechanism by which a computer program can, at run time, load a library into memory, retrieve the addresses of functions and variables contained in the library via names, execute those functions or access those variables, and unload the library from memory once the operations are done. This mechanism allows a computer program to startup in absence of these libraries, to discover available libraries, and to potentially gain additional functionalities. This makes it easy to control whether to use an additional functionality based on the results of dynamic loading. However, dynamic loading results in a slower application, due to the library load times, and the loss of optimizations possible by compiling the libraries together with the application. Dynamic loading can also cause problems if the version of the library loaded is not the version expected by the developer or if the library is not present, etc.
Static libraries avoid the problems of dynamic libraries, however, the advantages are lost as well. On the other hand, static libraries have a problem in that including a set of static libraries called by the framework requires all of the libraries to be linked to the final executable, increasing the executable size.
Various embodiments of the invention are disclosed in the following detailed description and the accompanying drawings.
The invention can be implemented in numerous ways, including as a process; an apparatus; a system; a composition of matter; a computer program product embodied on a computer readable storage medium; and/or a processor, such as a processor configured to execute instructions stored on and/or provided by a memory coupled to the processor. In this specification, these implementations, or any other form that the invention may take, may be referred to as techniques. In general, the order of the steps of disclosed processes may be altered within the scope of the invention. Unless stated otherwise, a component such as a processor or a memory described as being configured to perform a task may be implemented as a general component that is temporarily configured to perform the task at a given time or a specific component that is manufactured to perform the task. As used herein, the term ‘processor’ refers to one or more devices, circuits, and/or processing cores configured to process data, such as computer program instructions.
A detailed description of one or more embodiments of the invention is provided below along with accompanying figures that illustrate the principles of the invention. The invention is described in connection with such embodiments, but the invention is not limited to any embodiment. The scope of the invention is limited only by the claims and the invention encompasses numerous alternatives, modifications and equivalents. Numerous specific details are set forth in the following description in order to provide a thorough understanding of the invention. These details are provided for the purpose of example and the invention may be practiced according to the claims without some or all of these specific details. For the purpose of clarity, technical material that is known in the technical fields related to the invention has not been described in detail so that the invention is not unnecessarily obscured.
A system for video development kits is disclosed. A system for video development kits with control of executable size comprises an SDK, comprising: a framework, wherein the framework calls a pointing function; and an SDK library function wherein the SDK library function comprises a video processing function. The system for video development kits with control of executable size additionally comprises the pointing function to deliver a pointer, wherein the pointer points to the SDK library function, and wherein the pointing function includes a preprocessor conditional to remove a code section that refers to the SDK library function.
In some embodiments, a system for video development kits includes a set of library functions that are loaded statically, but achieve the benefits of dynamic loading. The system for video development includes an SDK including a video processing framework and a set of video processing library functions that are loaded statically. When software including static libraries is compiled, static library functionality that is not used is left out of the compiled application; however, the library functions are accessed by the framework and are thus all included in the final application. The system for video development kits indirectly accesses the static library functionality via a pointer function. Rather than calling the static library functionality directly, the framework calls the pointer function with the name of the desired library functionality. The pointer function returns a pointer to the desired library function, which is utilized by the framework to execute the desired functionality. In the event that the developer does not wish to utilize the library functionality, the developer removes the portion of the pointer function referring to the library functionality (e.g., using a preprocessor conditional). This removes the only reference to the library functionality in the application, and when the application is compiled, the unused library is left out of the final application, reducing the application size.
Framework 204 and developer code 208 utilize pointing function 210 for accessing functions in video processing library 206. In some embodiments, pointing function 210 additionally comprises a preprocessor conditional to remove a code section that refers to a function in video processing library 206. In some embodiments, each code section in pointing function 210 referring to a function in video processing library 206 can be removed using a preprocessor conditional. In the event the developer developing video processing application 200 determines that a library function in video processing library 206 is not necessary for video processing application 200, the developer indicates for the preprocessor conditional to remove the code section referring to the library function from pointing function 210. Removing the code section referring to a library function from pointing function 210 causes there to be no reference to the library function anywhere within video processing application 200. In some embodiments, when software including a statically linked library is compiled, any library function that is not referred to is removed on compilation. In this way a developer can make use of a software development kit including a statically linked library comprising many different functions and a framework making use of those functions, while causing any functions not necessary for the finished application to be left out of the compiled code.
A code section is shown below illustrating an embodiment of code accessing a video processing library function (e.g., GetFunctionSetHLS) via a pointing function (e.g., GetFuncPointer):
typedef void (* FunctionSetHLSPointer) (FunctionSetHLS *pSet);
FunctionSetHLS cFunctionSetHLS;
memset(&cFunctionSetHLS, 0, sizeof(FunctionSetHLS));
FunctionSetHLSPointer pFunc=GetFuncPointer(“GetFunctionSetHLS”);
if (NULL !=pFunc) {
}
else {
}
// use HLS
void *handle=NULL;
cFunctionSetHLS.Init(&handle);
. . .
A code section is shown below illustrating an embodiment of code for a function for accessing a set of library functions:
typedef struct
{
} FunctionSetHLS;
void GetFunctionSetHLS(FunctionSetHLS *pSet)
{
}
In some embodiments, GetFunctionSetHLS provides the function set of preparing HLS video date.
A code section is shown below illustrating an embodiment of code for a pointing function (e.g., GetFuncPointer) allowing access to a set of video processing library functions (e.g., GetFunctionSetHLS, GetFunctionSmoothStream, GetFunctionSetDash):
#define_ENABLE_HLS 1
#define_ENABLE_SMOOTHSTREAM 1
#define_ENABLE_DASH 1
void* GetFuncPointer(const char *pFunctionName)
{
#if (_ENABLE_HLS)
#endif
#if (_ENABLE_SMOOTHSTREAM)
#endif
#if (_ENABLE_DASH)
#endif
}
Although the foregoing embodiments have been described in some detail for purposes of clarity of understanding, the invention is not limited to the details provided. There are many alternative ways of implementing the invention. The disclosed embodiments are illustrative and not restrictive.
Number | Name | Date | Kind |
---|---|---|---|
5822591 | Hochmuth | Oct 1998 | A |
5911070 | Solton | Jun 1999 | A |
5925109 | Bartz | Jul 1999 | A |
6279151 | Breslau | Aug 2001 | B1 |
6381735 | Hunt | Apr 2002 | B1 |
7073167 | Iwashita | Jul 2006 | B2 |
7076804 | Kershenbaum et al. | Jul 2006 | B2 |
7103878 | Fahs et al. | Sep 2006 | B2 |
7140003 | Decker | Nov 2006 | B2 |
7346849 | Mulligan et al. | Mar 2008 | B1 |
7496889 | Sutter | Feb 2009 | B2 |
7523450 | Cardinell | Apr 2009 | B2 |
7856624 | Plum | Dec 2010 | B2 |
7971194 | Gilboa | Jun 2011 | B1 |
8099721 | Miceli | Jan 2012 | B2 |
8302084 | Simon | Oct 2012 | B2 |
8869123 | Mykland | Oct 2014 | B2 |
20030028864 | Bowen | Feb 2003 | A1 |
20040039934 | Land et al. | Feb 2004 | A1 |
20040117780 | Sea | Jun 2004 | A1 |
20060041873 | Pandarinathan | Feb 2006 | A1 |
20080028373 | Yang | Jan 2008 | A1 |
20100079489 | Cheng et al. | Apr 2010 | A1 |
20110314442 | Bondhugula | Dec 2011 | A1 |
20140365995 | Gazzillo | Dec 2014 | A1 |
Entry |
---|
Courbot, et al., “Efficient Off-Board Deployment and Customization of Virtual Machine-Based Embedded Systems”, ACM 2010; [retrieved on Sep. 6, 2015]; Retrieved from Internet <URL;http://dl.acm.org/citation.cfm?id=1698772.1698779>; pp. 211-263. |
Reynolds, et al., “On the feasibility of an AOSD approach to Linux kernel extensions”, 2008 ACM; [retrieved on Sep. 6, 2015]; Retrieved from Internet <URL;http://dl.acm.org/citation.cfm?id=1404891,1404899>; pp. 1-7. |
Soule, Foster, “Removal Bias: a New Cause of Code Growth in Tree Based Evolutionary Programming”, 1998 IEEE;[retrieved on Sep. 6, 2015]; Retrieved from Internet <URL;http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=700151>; pp. 781-786. |
Kotzmann, Mossenbock, “Run-Time Support for Optimizations Based on Escape Analysis”; 2007 IEEE; [retrieved on Sep. 6, 2015]; Retrieved from Internet <URL;http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4145104>; pp. 49-60. |