Changeset 221

Show
Ignore:
Timestamp:
12/31/06 16:36:22 (2 years ago)
Author:
durin42
Message:

As discussed and confirmed on the list, we are now switching completely to the
GNU Lesser General Public License. As such, changing the banner on the top
of all the files, and updating our license file. Removed all remaining
references to libpostproc, and everything still builds!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/FFusionCodec.c

    r220 r221  
    1111//uses libavcodec from ffmpeg 0.4.6 
    1212// 
    13 // This program is free software; you can redistribute it and/or modify 
    14 // it under the terms of the GNU General Public License as published by 
    15 // the Free Software Foundation; either version 2 of the License, o
    16 // (at your option) any later version. 
     13//This library is free software; you can redistribute it and/or 
     14//modify it under the terms of the GNU Lesser General Public 
     15//License as published by the Free Software Foundation; eithe
     16//version 2.1 of the License, or (at your option) any later version. 
    1717// 
    18 // This program is distributed in the hope that it will be useful, 
    19 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
    20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    21 // GNU General Public License for more details. 
     18//This library is distributed in the hope that it will be useful, 
     19//but WITHOUT ANY WARRANTY; without even the implied warranty of 
     20//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     21//Lesser General Public License for more details. 
    2222// 
    23 // You should have received a copy of the GNU General Public License 
    24 // along with this program; if not, write to the Free Software 
    25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     23//You should have received a copy of the GNU Lesser General Public 
     24//License along with this library; if not, write to the Free Software 
     25//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
    2626// 
    2727//--------------------------------------------------------------------------- 
     
    3535#include "EI_Image.h" 
    3636#include "avcodec.h" 
    37 //#include "postprocess.h" 
    3837#include "Codecprintf.h" 
    3938 
     
    4847// Types 
    4948//--------------------------------------------------------------------------- 
    50  
    51 /*typedef struct 
    52 { 
    53     pp_mode_t                   *mode[PP_QUALITY_MAX+1]; 
    54     pp_context_t                *context; 
    55     short                       level; 
    56         AVFrame                 *destBuffer; 
    57 } PostProcParamRecord;*/ 
    5849 
    5950// 32 because that's ffmpeg's INTERNAL_BUFFER_SIZE 
     
    8172    char                        hasy420; 
    8273    char                        alreadyDonePPPref; 
    83 //    PostProcParamRecord               postProcParams; 
    8474        FILE                    *fileLog; 
    8575        int                             futureFrameAvailable; 
     
    261251            DisposeImageCodecMPDrawBandUPP(glob->drawBandUPP); 
    262252        } 
    263                  
    264 /*              if (glob->postProcParams.destBuffer) 
    265                 { 
    266                         av_free(glob->postProcParams.destBuffer); 
    267                 }*/ 
    268253         
    269254        if (glob->avCodec) 
     
    299284                        av_free(glob->inputBuffer); 
    300285                } 
    301                  
    302 /*        for (i=0; i<=PP_QUALITY_MAX; i++) 
    303         { 
    304             if (glob->postProcParams.mode[i]) 
    305                 pp_free_mode(glob->postProcParams.mode[i]); 
    306         } 
    307                  
    308         if (glob->postProcParams.context) 
    309             pp_free_context(glob->postProcParams.context);*/ 
     286 
    310287                if(glob->fileLog) 
    311288                        fclose(glob->fileLog); 
     
    676653    capabilities->extendHeight = 0; 
    677654     
    678     // Post-processing 
    679 /*      if (!glob->postProcParams.context) 
    680         { 
    681                 // allocate a destination buffer so we don't mess with the decoded data 
    682                 glob->postProcParams.destBuffer = avcodec_alloc_frame(); 
    683                 avcodec_default_get_buffer(glob->avContext, glob->postProcParams.destBuffer); 
    684                  
    685                 glob->postProcParams.context = pp_get_context((**p->imageDescription).width, (**p->imageDescription).height, PP_FORMAT_420); 
    686                  
    687                 for (i=0; i<=PP_QUALITY_MAX; i++)  
    688                 { 
    689                          
    690                         if (i <= 2)  
    691                         { 
    692                                 glob->postProcParams.mode[i] = pp_get_mode_by_name_and_quality("h1,v1,dr"/*"al:f"*, i); 
    693                         }  
    694                         else if (i <= 4)  
    695                         { 
    696                                 glob->postProcParams.mode[i] = pp_get_mode_by_name_and_quality("hb,vb,dr,"/*"al:f"*, i); 
    697                         }  
    698                         else  
    699                         { 
    700                                 glob->postProcParams.mode[i] = pp_get_mode_by_name_and_quality("hb,vb,dr,""hb:c,vb:c,dr:c,"/*"al:f"*, i); 
    701                         } 
    702                          
    703                         if (glob->postProcParams.mode[i] == NULL)  
    704                         { 
    705                                 Codecprintf(glob->fileLog, "Error getting PP filter %d!\n", i); 
    706                                  
    707                                 return -1; 
    708                         } 
    709                          
    710                         glob->postProcParams.level = 0;//GetPPUserPreference(); 
    711                 } 
    712         }*/ 
    713655        capabilities->flags |= codecCanAsync | codecCanAsyncWhen; 
    714656         
     
    761703        myDrp->frameNumber = p->frameNumber - 1; 
    762704        myDrp->buffer = NULL; 
    763          
    764     if (p->conditionFlags & codecConditionFirstFrame) 
    765     { 
    766         GetKeys(currentKeyMap); 
    767          
    768                 /*        if ((currentKeyMap[1] & kOptionKeyModifier) && !glob->alreadyDonePPPref) 
    769         { 
    770             glob->alreadyDonePPPref = 1; 
    771                          
    772             bundleRef = CFBundleGetBundleWithIdentifier(CFSTR("net.aldorande.component.FFusion")); 
    773                          
    774             if (bundleRef == NULL) 
    775                 printf("Cannot get main bundle reference\n"); 
    776                          
    777             err = CreateNibReferenceWithCFBundle(bundleRef, CFSTR("main"), &nibRef); 
    778              
    779             if (err != noErr) 
    780                 printf("cannot create nib reference! %d\n", (int)err); 
    781              
    782             if (nibRef != NULL) 
    783             { 
    784                 err = CreateWindowFromNib(nibRef, CFSTR("PostProcessing"), &window); 
    785                  
    786                 if (err != noErr) 
    787                     printf("cannot create window!\n"); 
    788                  
    789                 DisposeNibReference(nibRef); 
    790                                  
    791                 if (window != NULL) 
    792                 { 
    793                     controlID.signature = 'post'; 
    794                     controlID.id = 128; 
    795                      
    796                     err = GetControlByID(window, &controlID, &theControl); 
    797                      
    798                     if (err != noErr) 
    799                     { 
    800                         printf("Cannot get slider hint text control!\n"); 
    801                     } 
    802                                          
    803                     userPreference = GetPPUserPreference(); 
    804                     ChangeHintText(userPreference, theControl); 
    805                      
    806                     controlID.signature = 'post'; 
    807                     controlID.id = 129; 
    808                      
    809                     err = GetControlByID(window, &controlID, &theControl); 
    810                      
    811                     if (err != noErr) 
    812                     { 
    813                         printf("Cannot get slider control!\n"); 
    814                     } 
    815                                          
    816                     SetControl32BitValue(theControl, userPreference); 
    817                                          
    818                     ShowWindow(window); 
    819                      
    820                     handlerUPP = NewEventHandlerUPP(HandlePPDialogWindowEvent); 
    821                      
    822                     eventType.eventClass = kEventClassCommand; 
    823                     eventType.eventKind  = kEventCommandProcess; 
    824                      
    825                     InstallWindowEventHandler(window, handlerUPP, 1, &eventType, window, NULL); 
    826                      
    827                     handlerUPP2 = NewEventHandlerUPP(HandlePPDialogControlEvent); 
    828                      
    829                     eventType.eventClass = kEventClassControl; 
    830                     eventType.eventKind = kEventControlTrack; 
    831                      
    832                     InstallControlEventHandler(theControl, handlerUPP2, 1, &eventType, window, NULL); 
    833                 } 
    834             } 
    835         }*/ 
    836     } 
    837      
    838     /*if ((glob->postProcParams.level >= 0) && (GetPPUserPreference() > 0))  
    839     { 
    840         if (p->conditionFlags & codecConditionCatchUpDiff)  
    841         { 
    842             if (glob->postProcParams.level > 0)  
    843             { 
    844                 glob->postProcParams.level--; 
    845                  
    846                 printf("PP=%i -\n", glob->postProcParams.level); 
    847             } 
    848              
    849             glob->postProcParams.goodness = 0; 
    850         }  
    851         else  
    852         { 
    853             if (++glob->postProcParams.goodness > 5)  
    854             { 
    855                 if (glob->postProcParams.level < PP_QUALITY_MAX + 1)  
    856                 { 
    857                     glob->postProcParams.level++; 
    858                      
    859                     printf("PP=%i +\n", glob->postProcParams.level); 
    860                 } 
    861                  
    862                 glob->postProcParams.goodness = 0; 
    863             } 
    864         } 
    865     }*/ 
    866705         
    867706    return noErr; 
     
    995834    OSErr err = noErr; 
    996835    FFusionDecompressRecord *myDrp = (FFusionDecompressRecord *)drp->userDecompressRecord; 
    997 //      AVFrame *ppDestPic = glob->postProcParams.destBuffer; 
    998836        int i, j; 
    999837         
     
    1041879        { 
    1042880                memcpy(&(glob->lastDisplayedFrame), picture, sizeof(AVFrame)); 
    1043                  
    1044                 // only do post processing if it's a new frame 
    1045 /*              if (glob->postProcParams.level > 0) 
    1046                 { 
    1047                         pp_postprocess(picture->data, picture->linesize,  
    1048                                                    ppDestPic->data, ppDestPic->linesize,  
    1049                                                    myDrp->width, myDrp->height,  
    1050                                                    picture->qscale_table, picture->qstride,  
    1051                                                    glob->postProcParams.mode[glob->postProcParams.level], 
    1052                                                    glob->postProcParams.context, picture->pict_type); 
    1053                         picture = ppDestPic; 
    1054                 }*/ 
    1055881        } 
    1056882         
     
    14991325} 
    15001326 
    1501 /*int GetPPUserPreference() 
    1502 { 
    1503     CFIndex     userPref; 
    1504     Boolean     keyExists; 
    1505     int         ppUserValue = 0; 
    1506      
    1507     userPref = CFPreferencesGetAppIntegerValue(CFSTR("postProcessingLevel"), CFSTR("net.aldorande.component.FFusion"), &keyExists); 
    1508      
    1509     if (keyExists) 
    1510     { 
    1511         ppUserValue = (int)userPref; 
    1512     } 
    1513     else 
    1514     { 
    1515         Codecprintf(NULL, "Key does not exists\n"); 
    1516          
    1517         ppUserValue = 0; 
    1518     } 
    1519      
    1520     return ppUserValue; 
    1521 } 
    1522  
    1523 void SetPPUserPreference(int value) 
    1524 { 
    1525     int     sameValue = value; 
    1526     Boolean syncOK; 
    1527          
    1528     CFPreferencesSetAppValue(CFSTR("postProcessingLevel"), CFNumberCreate(NULL, kCFNumberIntType, &sameValue), CFSTR("net.aldorande.component.FFusion")); 
    1529      
    1530     syncOK = CFPreferencesAppSynchronize(CFSTR("net.aldorande.component.FFusion")); 
    1531      
    1532     if (!syncOK) 
    1533     { 
    1534         Codecprintf(NULL, "Error writing user preference!\n"); 
    1535     } 
    1536 } 
    1537  
    1538 pascal OSStatus HandlePPDialogWindowEvent(EventHandlerCallRef  nextHandler, EventRef theEvent, void* userData) 
    1539 { 
    1540     UInt32      whatHappened; 
    1541     HICommand   commandStruct; 
    1542     UInt32      theCommandID; 
    1543     OSErr       theErr = eventNotHandledErr; 
    1544     OSErr       resErr; 
    1545     WindowRef   window = (WindowRef)userData; 
    1546     SInt32      value = 0; 
    1547     ControlRef  slider; 
    1548     ControlID   controlID; 
    1549      
    1550     whatHappened = GetEventKind(theEvent); 
    1551          
    1552     switch (whatHappened) 
    1553     { 
    1554         case kEventCommandProcess: 
    1555             GetEventParameter(theEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &commandStruct); 
    1556                          
    1557             theCommandID = commandStruct.commandID; 
    1558              
    1559             if (theCommandID == kHICommandOK) 
    1560             { 
    1561                 controlID.id = 129; 
    1562                 controlID.signature = 'post'; 
    1563                 resErr = GetControlByID(window, &controlID, &slider); 
    1564                  
    1565                 if (resErr == noErr) 
    1566                 { 
    1567                     value = GetControl32BitValue(slider); 
    1568                 } 
    1569                 else 
    1570                 { 
    1571                     Codecprintf(NULL, "Unable to get post-processing control value!\n"); 
    1572                 } 
    1573                  
    1574                 SetPPUserPreference(value); 
    1575                                  
    1576                 DisposeWindow(window); 
    1577                  
    1578                 theErr = noErr; 
    1579             } 
    1580                                  
    1581                                 if (theCommandID == kHICommandCancel) 
    1582                                 {                 
    1583                                         DisposeWindow(window); 
    1584                                          
    1585                                         theErr = noErr; 
    1586                                 } 
    1587                                  
    1588                                 break; 
    1589     } 
    1590      
    1591     return theErr; 
    1592 } 
    1593  
    1594 pascal OSStatus HandlePPDialogControlEvent(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) 
    1595 { 
    1596     WindowRef   window = (WindowRef)userData; 
    1597     ControlID   controlID; 
    1598     ControlRef  slider, staticText; 
    1599     OSErr       resErr; 
    1600     SInt32      value; 
    1601     OSErr       result; 
    1602      
    1603     result = CallNextEventHandler(nextHandler, theEvent); 
    1604      
    1605     if (result == noErr) 
    1606     {         
    1607         controlID.id = 128; 
    1608         controlID.signature = 'post'; 
    1609         resErr = GetControlByID(window, &controlID, &staticText); 
    1610          
    1611         controlID.id = 129; 
    1612         controlID.signature = 'post'; 
    1613         resErr = GetControlByID(window, &controlID, &slider); 
    1614          
    1615         value = GetControl32BitValue(slider); 
    1616          
    1617         ChangeHintText(value, staticText); 
    1618     } 
    1619      
    1620     return result; 
    1621 } 
    1622  
    1623 void ChangeHintText(int value, ControlRef staticTextField) 
    1624 { 
    1625     CFStringRef myCFSTR, myIndexCFSTR; 
    1626     OSErr       resErr; 
    1627     CFBundleRef bundleRef; 
    1628      
    1629     bundleRef = CFBundleGetBundleWithIdentifier(CFSTR("net.aldorande.component.FFusion")); 
    1630      
    1631     if (bundleRef == NULL) 
    1632     { 
    1633         Codecprintf(NULL, "Error getting current bundle!\n"); 
    1634     } 
    1635      
    1636     if (myIndexCFSTR = CFStringCreateWithFormatAndArguments(NULL, NULL, CFSTR("%d"), (va_list)&value)) 
    1637     { 
    1638         myCFSTR = CFBundleCopyLocalizedString(bundleRef, myIndexCFSTR, NULL, CFSTR("PostProcessing")); 
    1639     } 
    1640     else 
    1641     { 
    1642         myCFSTR = CFBundleCopyLocalizedString(bundleRef, CFSTR("0"), NULL, CFSTR("PostProcessing")); 
    1643     } 
    1644          
    1645     //resErr = SetControlData(staticTextField, kControlEntireControl, kControlStaticTextTextTag, CFStringGetLength(myCFSTR), CFStringGetCStringPtr(myCFSTR, CFStringGetSystemEncoding())); 
    1646      
    1647     //this works only under 10.2 
    1648     resErr = SetControlData(staticTextField, kControlEntireControl, kControlStaticTextCFStringTag, CFStringGetLength(myCFSTR), &myCFSTR); 
    1649          
    1650     if (resErr != noErr) 
    1651         Codecprintf(NULL, "Could not change control title! (%d) \n", (int)resErr); 
    1652      
    1653     Draw1Control(staticTextField); 
    1654 }*/ 
  • trunk/FFusionCodec.h

    r154 r221  
    1111//uses libavcodec from ffmpeg 0.4.6 
    1212// 
    13 // This program is free software; you can redistribute it and/or modify 
    14 // it under the terms of the GNU General Public License as published by 
    15 // the Free Software Foundation; either version 2 of the License, o
    16 // (at your option) any later version. 
     13//This library is free software; you can redistribute it and/or 
     14//modify it under the terms of the GNU Lesser General Public 
     15//License as published by the Free Software Foundation; eithe
     16//version 2.1 of the License, or (at your option) any later version. 
    1717// 
    18 // This program is distributed in the hope that it will be useful, 
    19 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
    20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    21 // GNU General Public License for more details. 
     18//This library is distributed in the hope that it will be useful, 
     19//but WITHOUT ANY WARRANTY; without even the implied warranty of 
     20//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     21//Lesser General Public License for more details. 
    2222// 
    23 // You should have received a copy of the GNU General Public License 
    24 // along with this program; if not, write to the Free Software 
    25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     23//You should have received a copy of the GNU Lesser General Public 
     24//License along with this library; if not, write to the Free Software 
     25//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
    2626// 
    2727//--------------------------------------------------------------------------- 
  • trunk/FFusionCodec.r

    r217 r221  
    1111//uses libavcodec from ffmpeg 0.4.6 
    1212// 
    13 // This program is free software; you can redistribute it and/or modify 
    14 // it under the terms of the GNU General Public License as published by 
    15 // the Free Software Foundation; either version 2 of the License, o
    16 // (at your option) any later version. 
     13//This library is free software; you can redistribute it and/or 
     14//modify it under the terms of the GNU Lesser General Public 
     15//License as published by the Free Software Foundation; eithe
     16//version 2.1 of the License, or (at your option) any later version. 
    1717// 
    18 // This program is distributed in the hope that it will be useful, 
    19 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
    20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    21 // GNU General Public License for more details. 
     18//This library is distributed in the hope that it will be useful, 
     19//but WITHOUT ANY WARRANTY; without even the implied warranty of 
     20//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     21//Lesser General Public License for more details. 
    2222// 
    23 // You should have received a copy of the GNU General Public License 
    24 // along with this program; if not, write to the Free Software 
    25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     23//You should have received a copy of the GNU Lesser General Public 
     24//License along with this library; if not, write to the Free Software 
     25//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
    2626// 
    2727//--------------------------------------------------------------------------- 
  • trunk/FFusionCodecDispatch.h

    r40 r221  
    1111//uses libavcodec from ffmpeg 0.4.6 
    1212// 
    13 // This program is free software; you can redistribute it and/or modify 
    14 // it under the terms of the GNU General Public License as published by 
    15 // the Free Software Foundation; either version 2 of the License, o
    16 // (at your option) any later version. 
     13//This library is free software; you can redistribute it and/or 
     14//modify it under the terms of the GNU Lesser General Public 
     15//License as published by the Free Software Foundation; eithe
     16//version 2.1 of the License, or (at your option) any later version. 
    1717// 
    18 // This program is distributed in the hope that it will be useful, 
    19 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
    20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    21 // GNU General Public License for more details. 
     18//This library is distributed in the hope that it will be useful, 
     19//but WITHOUT ANY WARRANTY; without even the implied warranty of 
     20//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     21//Lesser General Public License for more details. 
    2222// 
    23 // You should have received a copy of the GNU General Public License 
    24 // along with this program; if not, write to the Free Software 
    25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     23//You should have received a copy of the GNU Lesser General Public 
     24//License along with this library; if not, write to the Free Software 
     25//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
    2626// 
    2727//--------------------------------------------------------------------------- 
  • trunk/LICENSE.txt

    r1 r221  
    1 GNU GENERAL PUBLIC LICENSE 
    2  
    3 Version 2, June 1991 
    4  
    5 Copyright (C) 1989, 1991 Free Software Foundation, Inc.   
    6 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA 
    7  
    8 Everyone is permitted to copy and distribute verbatim copies 
    9 of this license document, but changing it is not allowed. 
    10  
    11 Preamble 
    12  
    13 The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. 
    14  
    15 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. 
    16  
    17 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. 
    18  
    19 For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. 
    20  
    21 We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. 
    22  
    23 Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. 
    24  
    25 Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. 
    26  
    27 The precise terms and conditions for copying, distribution and modification follow. 
    28 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
    29  
    30 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". 
    31  
    32 Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 
    33  
    34 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. 
    35  
    36 You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 
    37  
    38 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: 
    39  
    40     * a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. 
    41  
    42     * b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. 
    43  
    44 * c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) 
    45  
    46 These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. 
    47  
    48 Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. 
    49  
    50 In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 
    51  
    52 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: 
    53  
    54     * a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
    55  
    56     * b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, 
    57  
    58 * c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) 
    59  
    60 The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 
    61  
    62 If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 
    63  
    64 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 
    65  
    66 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 
    67  
    68 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 
    69  
    70 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. 
    71  
    72 If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 
    73  
    74 It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. 
    75  
    76 This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 
    77  
    78 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 
    79  
    80 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 
    81  
    82 Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 
    83  
    84 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. 
    85  
    86 NO WARRANTY 
    87  
    88 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 
    89  
    90 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
    91  
    92 END OF TERMS AND CONDITIONS 
    93 How to Apply These Terms to Your New Programs 
    94  
    95 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. 
    96  
    97 To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. 
    98  
    99 one line to give the program's name and an idea of what it does. 
    100 Copyright (C) yyyy  name of author 
    101  
    102 This program is free software; you can redistribute it and/or 
    103 modify it under the terms of the GNU General Public License 
    104 as published by the Free Software Foundation; either version 2 
    105 of the License, or (at your option) any later version. 
    106  
    107 This program is distributed in the hope that it will be useful, 
    108 but WITHOUT ANY WARRANTY; without even the implied warranty of 
    109 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    110 GNU General Public License for more details. 
    111  
    112 You should have received a copy of the GNU General Public License 
    113 along with this program; if not, write to the Free Software 
    114 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     1                  GNU LESSER GENERAL PUBLIC LICENSE 
     2                       Version 2.1, February 1999 
     3 
     4 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 
     5 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     6 Everyone is permitted to copy and distribute verbatim copies 
     7 of this license document, but changing it is not allowed. 
     8 
     9[This is the first released version of the Lesser GPL.  It also counts 
     10 as the successor of the GNU Library Public License, version 2, hence 
     11 the version number 2.1.] 
     12 
     13                            Preamble 
     14 
     15  The licenses for most software are designed to take away your 
     16freedom to share and change it.  By contrast, the GNU General Public 
     17Licenses are intended to guarantee your freedom to share and change 
     18free software--to make sure the software is free for all its users. 
     19 
     20  This license, the Lesser General Public License, applies to some 
     21specially designated software packages--typically libraries--of the 
     22Free Software Foundation and other authors who decide to use it.  You 
     23can use it too, but we suggest you first think carefully about whether 
     24this license or the ordinary General Public License is the better 
     25strategy to use in any particular case, based on the explanations below. 
     26 
     27  When we speak of free software, we are referring to freedom of use, 
     28not price.  Our General Public Licenses are designed to make sure that 
     29you have the freedom to distribute copies of free software (and charge 
     30for this service if you wish); that you receive source code or can get 
     31it if you want it; that you can change the software and use pieces of 
     32it in new free programs; and that you are informed that you can do 
     33these things. 
     34 
     35  To protect your rights, we need to make restrictions that forbid 
     36distributors to deny you these rights or to ask you to surrender these 
     37rights.  These restrictions translate to certain responsibilities for 
     38you if you distribute copies of the library or if you modify it. 
     39 
     40  For example, if you distribute copies of the library, whether gratis 
     41or for a fee, you must give the recipients all the rights that we gave 
     42you.  You must make sure that they, too, receive or can get the source 
     43code.  If you link other code with the library, you must provide 
     44complete object files to the recipients, so that they can relink them 
     45with the library after making changes to the library and recompiling 
     46it.  And you must show them these terms so they know their rights. 
     47 
     48  We protect your rights with a two-step method: (1) we copyright the 
     49library, and (2) we offer you this license, which gives you legal 
     50permission to copy, distribute and/or modify the library. 
     51 
     52  To protect each distributor, we want to make it very clear that 
     53there is no warranty for the free library.  Also, if the library is 
     54modified by someone else and passed on, the recipients should know 
     55that what they have is not the original version, so that the original 
     56author's reputation will not be affected by problems that might be 
     57introduced by others. 
     58  
     59  Finally, software patents pose a constant threat to the existence of 
     60any free program.  We wish to make sure that a company cannot 
     61effectively restrict the users of a free program by obtaining a 
     62restrictive license from a patent holder.  Therefore, we insist that 
     63any patent license obtained for a version of the library must be 
     64consistent with the full freedom of use specified in this license. 
     65 
     66  Most GNU software, including some libraries, is covered by the 
     67ordinary GNU General Public License.  This license, the GNU Lesser 
     68General Public License, applies to certain designated libraries, and 
     69is quite different from the ordinary General Public License.  We use 
     70this license for certain libraries in order to permit linking those 
     71libraries into non-free programs. 
     72 
     73  When a program is linked with a library, whether statically or using 
     74a shared library, the combination of the two is legally speaking a 
     75combined work, a derivative of the original library.  The ordinary 
     76General Public License therefore permits such linking only if the 
     77entire combination fits its criteria of freedom.  The Lesser General 
     78Public License permits more lax criteria for linking other code with 
     79the library. 
     80 
     81  We call this license the "Lesser" General Public License because it 
     82does Less to protect the user's freedom than the ordinary General 
     83Public License.  It also provides other free software developers Less 
     84of an advantage over competing non-free programs.  These disadvantages 
     85are the reason we use the ordinary General Public License for many 
     86libraries.  However, the Lesser license provides advantages in certain 
     87special circumstances. 
     88 
     89  For example, on rare occasions, there may be a special need to 
     90encourage the widest possible use of a certain library, so that it becomes 
     91a de-facto standard.  To achieve this, non-free programs must be 
     92allowed to use the library.  A more frequent case is that a free 
     93library does the same job as widely used non-free libraries.  In this 
     94case, there is little to gain by limiting the free library to free 
     95software only, so we use the Lesser General Public License. 
     96 
     97  In other cases, permission to use a particular library in non-free 
     98programs enables a greater number of people to use a large body of 
     99free software.  For example, permission to use the GNU C Library in 
     100non-free programs enables many more people to use the whole GNU 
     101operating system, as well as its variant, the GNU/Linux operating 
     102system. 
     103 
     104  Although the Lesser General Public License is Less protective of the 
     105users' freedom, it does ensure that the user of a program that is 
     106linked with the Library has the freedom and the wherewithal to run 
     107that program using a modified version of the Library. 
     108 
     109  The precise terms and conditions for copying, distribution and 
     110modification follow.  Pay close attention to the difference between a 
     111"work based on the library" and a "work that uses the library".  The 
     112former contains code derived from the library, whereas the latter must 
     113be combined with the library in order to run. 
     114  
     115                  GNU LESSER GENERAL PUBLIC LICENSE 
     116   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 
     117 
     118  0. This License Agreement applies to any software library or other 
     119program which contains a notice placed by the copyright holder or 
     120other authorized party saying it may be distributed under the terms of 
     121this Lesser General Public License (also called "this License"). 
     122Each licensee is addressed as "you". 
     123 
     124  A "library" means a collection of software functions and/or data 
     125prepared so as to be conveniently linked with application programs 
     126(which use some of those functions and data) to form executables. 
     127 
     128  The "Library", below, refers to any such software library or work 
     129which has been distributed under these terms.  A "work based on the 
     130Library" means either the Library or any derivative work under 
     131copyright law: that is to say, a work containing the Library or a 
     132portion of it, either verbatim or with modifications and/or translated 
     133straightforwardly into another language.  (Hereinafter, translation is 
     134included without limitation in the term "modification".) 
     135 
     136  "Source code" for a work means the preferred form of the work for 
     137making modifications to it.  For a library, complete source code means 
     138all the source code for all modules it contains, plus any associated 
     139interface definition files, plus the scripts used to control compilation 
     140and installation of the library. 
     141 
     142  Activities other than copying, distribution and modification are not 
     143covered by this License; they are outside its scope.  The act of 
     144running a program using the Library is not restricted, and output from 
     145such a program is covered only if its contents constitute a work based 
     146on the Library (independent of the use of the Library in a tool for 
     147writing it).  Whether that is true depends on what the Library does 
     148and what the program that uses the Library does. 
     149   
     150  1. You may copy and distribute verbatim copies of the Library's 
     151complete source code as you receive it, in any medium, provided that 
     152you conspicuously and appropriately publish on each copy an 
     153appropriate copyright notice and disclaimer of warranty; keep intact 
     154all the notices that refer to this License and to the absence of any 
     155warranty; and distribute a copy of this License along with the 
     156Library. 
     157 
     158  You may charge a fee for the physical act of transferring a copy, 
     159and you may at your option offer warranty protection in exchange for a 
     160fee. 
     161  
     162  2. You may modify your copy or copies of the Library or any portion 
     163of it, thus forming a work based on the Library, and copy and 
     164distribute such modifications or work under the terms of Section 1 
     165above, provided that you also meet all of these conditions: 
     166 
     167    a) The modified work must itself be a software library. 
     168 
     169    b) You must cause the files modified to carry prominent notices 
     170    stating that you changed the files and the date of any change. 
     171 
     172    c) You must cause the whole of the work to be licensed at no 
     173    charge to all third parties under the terms of this License. 
     174 
     175    d) If a facility in the modified Library refers to a function or a 
     176    table of data to be supplied by an application program that uses 
     177    the facility, other than as an argument passed when the facility 
     178    is invoked, then you must make a good faith effort to ensure that, 
     179    in the event an application does not supply such function or 
     180    table, the facility still operates, and performs whatever part of 
     181    its purpose remains meaningful. 
     182 
     183    (For example, a function in a library to compute square roots has 
     184    a purpose that is entirely well-defined independent of the 
     185    application.  Therefore, Subsection 2d requires that any 
     186    application-supplied function or table used by this function must 
     187    be optional: if the application does not supply it, the square 
     188    root function must still compute square roots.) 
     189 
     190These requirements apply to the modified work as a whole.  If 
     191identifiable sections of that work are not derived from the Library, 
     192and can be reasonably considered independent and separate works in 
     193themselves, then this License, and its terms, do not apply to those 
     194sections when you distribute them as separate works.  But when you 
     195distribute the same sections as part of a whole which is a work based 
     196on the Library, the distribution of the whole must be on the terms of 
     197this License, whose permissions for other licensees extend to the 
     198entire whole, and thus to each and every part regardless of who wrote 
     199it. 
     200 
     201Thus, it is not the intent of this section to claim rights or contest 
     202your rights to work written entirely by you; rather, the intent is to 
     203exercise the right to control the distribution of derivative or 
     204collective works based on the Library. 
     205 
     206In addition, mere aggregation of another work not based on the Library 
     207with the Library (or with a work based on the Library) on a volume of 
     208a storage or distribution medium does not bring the other work under 
     209the scope of this License. 
     210 
     211  3. You may opt to apply the terms of the ordinary GNU General Public 
     212License instead of this License to a given copy of the Library.  To do 
     213this, you must alter all the notices that refer to this License, so 
     214that they refer to the ordinary GNU General Public License, version 2, 
     215instead of to this License.  (If a newer version than version 2 of the 
     216ordinary GNU General Public License has appeared, then you can specify 
     217that version instead if you wish.)  Do not make any other change in 
     218these notices. 
     219  
     220  Once this change is made in a given copy, it is irreversible for 
     221that copy, so the ordinary GNU General Public License applies to all 
     222subsequent copies and derivative works made from that copy. 
     223 
     224  This option is useful when you wish to copy part of the code of 
     225the Library into a program that is not a library. 
     226 
     227  4. You may copy and distribute the Library (or a portion or 
     228derivative of it, under Section 2) in object code or executable form 
     229under the terms of Sections 1 and 2 above provided that you accompany 
     230it with the complete corresponding machine-readable source code, which 
     231must be distributed under the terms of Sections 1 and 2 above on a 
     232medium customarily used for software interchange. 
     233 
     234  If distribution of object code is made by offering access to copy 
     235from a designated place, then o