Changeset 224

Show
Ignore:
Timestamp:
02/04/08 21:38:56 (2 years ago)
Author:
rcrowley
Message:

FFmpeg linking statically, see the README.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/MacUploadr.app/Contents/Resources/application.ini

    r220 r224  
    1313Name=Flickr Uploadr 
    1414Version=3.0.5 
    15 BuildID=2008012201 
     15BuildID=2008012401 
    1616Copyright=Copyright © 2007 - Yahoo!, Inc. 
    1717ID=uploadr@flickr.com 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/api.js

    r219 r224  
    100100                                'path': photo.path 
    101101                        } 
    102                 }, 'http://api.flickr.com/services/upload/', false, true, id); 
     102//              }, 'http://up.flickr.com/services/upload/', false, true, id); 
     103                }, 'http://api.dev.flickr.com/services/upload/', false, true, id); 
    103104 
    104105        }, 
     
    579580                // If requested, open the site 
    580581                if (go_to_flickr) { 
    581                         launch_browser('http://flickr.com/photos/upload/done/?b=' + 
     582//                      launch_browser('http://flickr.com/photos/upload/done/?b=' + 
     583                        launch_browser('http://dev.flickr.com/photos/upload/done/?b=' + 
    582584                                upload.timestamps.earliest + '-' + upload.timestamps.latest + 
    583585                                '-' + users.nsid); 
     
    681683                                        'perms': 'write', 
    682684                                        'frob': users.frob, 
    683                                 }, 'http://api.flickr.com/services/auth/' + (fresh ? 'fresh/' : ''), true); 
     685//                              }, 'http://api.flickr.com/services/auth/' + (fresh ? 'fresh/' : ''), true); 
     686                                }, 'http://api.dev.flickr.com/services/auth/' + (fresh ? 'fresh/' : ''), true); 
    684687                                pages.go('auth'); 
    685688                        } 
     
    770773                                users.filesize = parseInt(user.getElementsByTagName( 
    771774                                        'filesize')[0].getAttribute('maxkb')); 
     775Components.utils.reportError('users.filesize: ' + users.filesize); 
    772776                                sets = user.getElementsByTagName('sets')[0].getAttribute('remaining'); 
    773777                                if ('lots' == sets) { 
     
    11311135        } 
    11321136        if (null == url) { 
    1133                 url = 'http://api.flickr.com/services/rest/'; 
     1137//              url = 'http://api.flickr.com/services/rest/'; 
     1138                url = 'http://api.dev.flickr.com/services/rest/'; 
    11341139        } 
    11351140        if (null == browser) { 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/clh.js

    r197 r224  
    2121        for (var i = 0; i < ii; ++i) { 
    2222                var arg = queue[i]; 
    23                 if (photos.is_photo(arg)) { 
    24                         if (/^file:\/\//.test(arg)) { 
    25                                 arg = Cc['@mozilla.org/network/protocol;1?name=file'].getService( 
    26                                         Ci.nsIFileProtocolHandler).getFileFromURLSpec(arg).path; 
    27                         } 
     23                if (photos.can_has(arg)) { 
    2824                        paths.push(arg); 
    2925                } 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/dock.xul

    r171 r224  
    3333                                // Add this photo, converting file:// URL to a native path 
    3434                                var arg = window.arguments[0]; 
    35                                 if (win && win.photos.is_photo(arg)) { 
    36                                         if (/^file:\/\//.test(arg)) { 
    37                                                 arg = Cc['@mozilla.org/network/protocol;1?name=file'].getService( 
    38                                                         Ci.nsIFileProtocolHandler).getFileFromURLSpec(arg).path; 
    39                                         } 
     35                                if (win && win.photos.can_has(arg)) { 
    4036                                        win.threads.worker.dispatch(new win.PhotoAdd(arg), 
    4137                                                win.threads.worker.DISPATCH_NORMAL); 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/drag.js

    r197 r224  
    3131                                        } else { 
    3232                                                var path = f.QueryInterface(Ci.nsILocalFile).path; 
    33                                                 if (photos.is_photo(path)) { 
     33                                                if (photos.can_has(path)) { 
    3434                                                        paths.push(path); 
    3535                                                } 
     
    4343                                } else { 
    4444                                        var path = d.first.data.QueryInterface(Ci.nsILocalFile).path; 
    45                                         if (photos.is_photo(path)) { 
     45                                        if (photos.can_has(path)) { 
    4646                                                paths.push(path); 
    4747                                        } 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/meta.js

    r214 r224  
    229229                document.getElementById('no_meta').style.display = 'none'; 
    230230                buttons.remove.enable(); 
    231                 document.getElementById('t_rotate_l').className = 'enabled'; 
    232                 document.getElementById('t_rotate_r').className = 'enabled'; 
     231 
     232                // Only allow rotation for photos or mixed selections 
     233                var have_photos = false; 
     234                for each (var i in photos.selected) { 
     235                        have_photos = photos.is_photo(photos.list[i].path) ? true : have_photos; 
     236                } 
     237                if (have_photos) { 
     238                        document.getElementById('t_rotate_l').className = 'enabled'; 
     239                        document.getElementById('t_rotate_r').className = 'enabled'; 
     240                } 
     241 
    233242        }, 
    234243 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js

    r214 r224  
    6565                fp.init(window, locale.getString('dialog.add'), 
    6666                        Ci.nsIFilePicker.modeOpenMultiple); 
    67                 fp.appendFilters(Ci.nsIFilePicker.filterImages); 
    68                 fp.appendFilter('TIFF', 'tiff; TIFF; tif; TIF'); 
     67                var can_has_video = 'object' == typeof users.is_pro || users.is_pro; 
     68Components.utils.reportError('can_has_video: ' + can_has_video); 
     69                if (can_has_video) { 
     70                        fp.appendFilter('Photos and Videos', 
     71                                'jpeg; jpg; gif; png; tiff; tif; bmp; mp4; mpeg; mpg; avi; wmv; mov; dv; 3gp'); 
     72                } 
     73                fp.appendFilter('Photos', 'jpeg; jpg; gif; png; tiff; tif; bmp'); 
     74                if (can_has_video) { 
     75                        fp.appendFilter('Videos', 'mp4; mpeg; mpg; avi; wmv; mov; dv; 3gp'); 
     76                } 
    6977                fp.displayDirectory = def; 
    7078                var res = fp.show(); 
     
    7482                        while (files.hasMoreElements()) { 
    7583                                var arg = files.getNext().QueryInterface(Ci.nsILocalFile).path; 
    76                                 if (photos.is_photo(arg)) { 
     84                                if (photos.can_has(arg)) { 
    7785                                        paths.push(arg); 
    7886                                } 
     
    98106                var ii = paths.length; 
    99107                for (var i = 0; i < ii; ++i) { 
     108                        var p; 
    100109                        if ('object' == typeof paths[i]) { 
    101                                 photos._add(paths[i].path); 
     110                                p = paths[i].path; 
     111                        } else { 
     112                                p = paths[i]; 
     113                        }                        
     114                        if (/^file:\/\//.test(p)) { 
     115                                p = Cc['@mozilla.org/network/protocol;1?name=file'].getService( 
     116                                        Ci.nsIFileProtocolHandler).getFileFromURLSpec(p).path; 
     117                        } 
     118                        photos._add(p); 
     119                        if ('object' == typeof paths[i]) { 
    102120                                photos.list[photos.list.length - 1] = paths[i]; 
    103                         } else { 
    104                                 photos._add(paths[i]); 
    105121                        } 
    106122                } 
     
    151167 
    152168                // Create and show the thumbnail 
    153                 threads.worker.dispatch(new Thumb(id, uploadr.conf.thumbSize, path), 
     169                threads.worker.dispatch(new Thumb(id, uploadr.conf.thumb_size, path), 
    154170                        threads.worker.DISPATCH_NORMAL); 
    155171 
     
    225241                buttons.upload.disable(); 
    226242                for (var i = 0; i < ii; ++i) { 
    227                         block_sort(); 
    228243                        var p = photos.list[s[i]]; 
    229                         photos.batch_size -= p.size; 
    230                         var img = document.getElementById('photo' + p.id).getElementsByTagName('img')[0]; 
    231                         img.className = 'loading'; 
    232                         img.setAttribute('width', 16); 
    233                         img.setAttribute('height', 8); 
    234                         img.src = 'chrome://uploadr/skin/balls-16x8-trans.gif'; 
    235                         threads.worker.dispatch(new Rotate(p.id, degrees, uploadr.conf.thumbSize, 
    236                                 p.path), threads.worker.DISPATCH_NORMAL); 
     244                        if (photos.is_photo(p.path)) { 
     245                                block_sort(); 
     246                                photos.batch_size -= p.size; 
     247                                var img = document.getElementById('photo' + p.id).getElementsByTagName('img')[0]; 
     248                                img.className = 'loading'; 
     249                                img.setAttribute('width', 16); 
     250                                img.setAttribute('height', 8); 
     251                                img.src = 'chrome://uploadr/skin/balls-16x8-trans.gif'; 
     252                                threads.worker.dispatch(new Rotate(p.id, degrees, uploadr.conf.thumb_size, 
     253                                        p.path), threads.worker.DISPATCH_NORMAL); 
     254                        } 
    237255                } 
    238256                threads.worker.dispatch(new EnableUpload(), threads.worker.DISPATCH_NORMAL); 
     
    262280                                img.onclick(); 
    263281                        } 
     282                } 
     283 
     284                // Drop videos if we're a free user 
     285                if (!users.is_pro) { 
     286                         
    264287                } 
    265288 
     
    275298                        for each (var p in list) { 
    276299                                if (null != p) { 
    277  
    278                                         // Resize because of user settings 
    279                                         if (null != settings.resize && -1 != settings.resize && 
    280                                                 (p.width > settings.resize || p.height > settings.resize)) { 
    281                                                 resizing = true; 
    282                                                 threads.worker.dispatch(new Resize(p.id, settings.resize, 
    283                                                         p.path), threads.worker.DISPATCH_NORMAL); 
     300                                        if (photos.is_photo(p.path)) { 
     301 
     302                                                // Resize because of user settings 
     303                                                if (null != settings.resize && -1 != settings.resize && 
     304                                                        (p.width > settings.resize || p.height > settings.resize)) { 
     305                                                        resizing = true; 
     306                                                        threads.worker.dispatch(new Resize(p.id, settings.resize, 
     307                                                                p.path), threads.worker.DISPATCH_NORMAL); 
     308                                                } 
     309 
     310                                                // Resize because of upload limits 
     311                                                else if (p.size > users.filesize) { 
     312                                                        resizing = true; 
     313                                                        threads.worker.dispatch(new Resize(p.id, -1, p.path), 
     314                                                                threads.worker.DISPATCH_NORMAL); 
     315                                                } 
     316 
     317                                                // Not resizing so record size now 
     318                                                else { 
     319                                                        ready_size += p.size; 
     320                                                } 
     321 
    284322                                        } 
    285323 
    286                                         // Resize because of upload limits 
    287                                         else if (p.size > users.filesize) { 
    288                                                 resizing = true; 
    289                                                 threads.worker.dispatch(new Resize(p.id, -1, p.path), 
    290                                                         threads.worker.DISPATCH_NORMAL); 
    291                                         } 
    292  
    293                                         // Not resizing so record size now 
    294                                         else { 
    295                                                 ready_size += p.size; 
     324                                        // Videos have special rules 
     325                                        else if (photos.is_video(p.path)) { 
     326                                                // TODO: What do we do with a video bigger than 100MB? 
    296327                                        } 
    297328 
     
    515546        // Decide if a given path is a photo 
    516547        is_photo: function(path) { 
    517                 return /.+\.(jpe?g|tiff?|gif|png|bmp)$/i.test(path); 
     548                return /\.(jpe?g|tiff?|gif|png|bmp)$/i.test(path); 
     549        }, 
     550 
     551        // Similarly, is it a video 
     552        is_video: function(path) { 
     553                return /\.(mp4|mpe?g|avi|wmv|mov|dv|3gp)$/i.test(path); 
     554        }, 
     555 
     556        // More complicated test to see if a user can add the given file 
     557        can_has: function(path) { 
     558                if (users.username) { 
     559                        if (users.is_pro) { 
     560Components.utils.reportError('can_has: pro'); 
     561                                return photos.is_photo(path) || photos.is_video(path); 
     562                        } else { 
     563Components.utils.reportError('can_has: not pro'); 
     564                                return photos.is_photo(path); 
     565                        } 
     566                } else { 
     567Components.utils.reportError('can_has: offline'); 
     568 
     569                        // TODO: Special dialog informing them that we're going to drop 
     570                        // videos if it turns out they're not pro 
     571 
     572                        return photos.is_photo(path) || photos.is_video(path); 
     573                } 
    518574        } 
    519575 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/settings.js

    r193 r224  
    106106                var u = eval(users.list.toSource()); 
    107107                var result = {}; 
     108Components.utils.reportError('users.filesize: ' + users.filesize); 
    108109                window.openDialog('chrome://uploadr/content/settings.xul', 'dialog_settings', 
    109110                        'chrome,modal', users.username, u, locale.getFormattedString( 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js

    r204 r224  
    3535 
    3636// Thumbnail thread wrapper 
    37 var Thumb = function(id, thumbSize, path, auto_select) { 
     37var Thumb = function(id, thumb_size, path, auto_select) { 
    3838        this.id = id; 
    39         this.thumbSize = thumbSize; 
     39        this.thumb_size = thumb_size; 
    4040        this.path = path; 
    41         if (null == auto_select) { 
    42                 this.auto_select = false; 
    43         } else { 
    44                 this.auto_select = auto_select; 
    45         } 
     41        this.auto_select = null == auto_select ? false : auto_select; 
    4642}; 
    4743Thumb.prototype = { 
    4844        run: function() { 
    4945                try { 
    50  
    51                         // Create a thumbnail and pass the result back to the UI thread 
    52                         var result = threads.gm.thumb(this.thumbSize, this.path); 
     46                        var result; 
     47 
     48                        // Thumbnail your photos 
     49                        if (photos.is_photo(this.path)) { 
     50                                result = threads.gm.thumb(this.thumb_size, this.path); 
     51                        } 
     52 
     53                        // But get a keyframe for videos 
     54                        else if (photos.is_video(this.path)) { 
     55                                result = threads.gm.keyframe(this.thumb_size, this.path); 
     56                        } 
     57 
    5358                        threads.main.dispatch(new ThumbCallback(this.id, result, this.auto_select), 
    5459                                threads.main.DISPATCH_NORMAL); 
     
    7782                        // Parse the returned string 
    7883                        //   <orient>###<width>###<height>###<date_taken>###<thumb_width>###<thumb_height>###<thumb_path>###<title>###<description>###<tags> 
     84Components.utils.reportError('result: ' + this.result); 
    7985                        var thumb = this.result.split('###'); 
    8086 
     
    95101                                photos.list[this.id].width = parseInt(thumb[1]); 
    96102                                photos.list[this.id].height = parseInt(thumb[2]); 
    97                                 if ('' == thumb[3]) { 
     103                                if (/\d{4}:\d{2}:\d{2} \d{2}:\d{2}:\d{2}/.test(thumb[3])) { 
     104                                        photos.list[this.id].date_taken = thumb[3]; 
     105                                } else { 
    98106                                        var f = Cc['@mozilla.org/file/local;1'].createInstance( 
    99107                                                Ci.nsILocalFile); 
     
    113121                                                ':' + month + ':' + day + ' ' + hours + ':' + 
    114122                                                minutes + ':' + seconds; 
    115                                 } else { 
    116                                         photos.list[this.id].date_taken = thumb[3]; 
    117123                                } 
    118124                                img.setAttribute('width', thumb[4]); 
     
    183189                                free.update(); 
    184190 
     191Components.utils.reportError('photos.list[this.id]: ' + photos.list[this.id].toSource()); 
     192 
    185193                        } 
    186194 
     
    218226 
    219227// Rotate thread wrapper 
    220 var Rotate = function(id, degrees, thumbSize, path) { 
     228var Rotate = function(id, degrees, thumb_size, path) { 
    221229        this.id = id; 
    222230        this.degrees = degrees; 
    223         this.thumbSize = thumbSize; 
     231        this.thumb_size = thumb_size; 
    224232        this.path = path; 
    225233}; 
     
    240248                                threads.main.dispatch(new RotateCallback(this.id, rotate[1]), 
    241249                                        threads.main.DISPATCH_NORMAL); 
    242                                 result = threads.gm.thumb(this.thumbSize, 
     250                                result = threads.gm.thumb(this.thumb_size, 
    243251                                        rotate[1]); 
    244252                                threads.main.dispatch(new ThumbCallback(this.id, result, 
     
    393401 
    394402                        if (null == resize) { 
    395                                 Components.utils.reportError(result); 
     403                                Components.utils.reportError(this.result); 
    396404                        } else { 
    397405                                list = photos.ready[photos.ready.length - 1]; 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js

    r203 r224  
    6060 
    6161        tips: function() { 
     62                mouse.show_photos(); 
    6263                pages.go('help'); 
    6364        }, 
     
    104105        update: function(percent) { 
    105106                var bar = document.getElementById(this.id); 
    106                 bar.width = Math.round(this.width * Math.max(0, Math.min(1, percent))); 
     107                if (null != bar) { 
     108                        bar.width = Math.round(this.width * Math.max(0, Math.min(1, percent))); 
     109                } 
    107110        }, 
    108111        clear: function() { 
     
    184187 
    185188// Now hack locale.getFormattedString to work like it should 
     189//   Apparently the docs were just wrong and it must be a capital S 
     190//   So, this function will go away eventually 
    186191locale.getFormattedString = function(id, args) { 
    187192        var str = locale.getString(id); 
    188193        var ii = args.length; 
    189194        for (var i = 0; i < ii; ++i) { 
    190                 var regex = new RegExp('%' + (i + 1) + '\\$[ds]'); 
     195                var regex = new RegExp('%' + (i + 1) + '\\$[dDsS]'); 
    191196                str = str.replace(regex, args[i]); 
    192197        } 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/uploadr.js

    r220 r224  
    2929 
    3030                // Size of thumbnails 
    31                 thumbSize: 100, 
     31                thumb_size: 100, 
    3232 
    3333                // Scrolling threshold for dragging (pixels); 
     
    6363                // 
    6464 
     65                // Maximum size of a video upload (megabytes) 
     66                video_max: 100, 
     67 
    6568                // Upload mode 
    6669                //   Must be 'sync' or 'async' 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile

    r192 r224  
    99# 
    1010 
    11 # Headers and libraries 
    12 GECKO_SDK := ../gecko-sdk 
    13 GM_INCLUDE := /usr/local/include/GraphicsMagick 
    14 GM_LIB := /usr/local/lib 
    15 EXIV_INCLUDE := /usr/local/include/exiv2 
    16 #EXIV_LIB := /usr/local/lib # Same as GraphicsMagick lib 
    17 X11_LIB := /usr/X11R6/lib 
    18 PORTS_LIB := /opt/local/lib 
    19 XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current 
    20  
    2111PLATFORM := $(filter mac ppc linux universal, $(MAKECMDGOALS)) 
    2212COMPONENT := $(filter gm key clh, $(MAKECMDGOALS)) 
     13 
     14GECKO_SDK := ../gecko-sdk.$(PLATFORM) 
     15GM_INCLUDE := -I/usr/local/include/GraphicsMagick 
     16GM_LIB := -L/usr/local/lib 
     17EXIV_INCLUDE := -I/usr/local/include/exiv2 
     18EXIV_LIB := -L/usr/local/lib -L/usr/lib 
     19FF_INCLUDE := -I/usr/local/include/ffmpeg 
     20FF_LIB := -L/usr/local/lib 
     21X11_LIB := -L/usr/X11R6/lib 
     22PORTS_LIB := -L/opt/local/lib 
     23XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current 
    2324 
    2425ifeq (mac, $(PLATFORM)) 
     
    6869gm: 
    6970ifneq (universal, $(PLATFORM)) 
    70         @echo "Building the GraphicsMagick XPCOM component..." 
     71        @echo "Building the GraphicsMagick/FFmpeg XPCOM component..." 
    7172ifeq (mac, $(PLATFORM)) 
    72         @echo "Building XPT file..." 
    73         $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 
     73        @echo "Building the GraphicsMagick/FFmpeg XPT file..." 
     74        $(GECKO_SDK)/bin/xpidl \ 
    7475                -m header \ 
    75                 -I$(GECKO_SDK).$(PLATFORM)/idl \ 
     76                -I$(GECKO_SDK)/idl \ 
    7677                flIGM.idl 
    77         $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 
     78        $(GECKO_SDK)/bin/xpidl \ 
    7879                -m typelib \ 
    79                 -I$(GECKO_SDK).$(PLATFORM)/idl \ 
     80                -I$(GECKO_SDK)/idl \ 
    8081                flIGM.idl 
    8182endif 
    8283        g++ -w -c -O2 \ 
    8384                -o flGM.o \ 
    84                 -I$(GECKO_SDK).$(PLATFORM)/include \ 
    85                 -I$(GM_INCLUDE) \ 
    86                 -I$(EXIV_INCLUDE) \ 
     85                -I$(GECKO_SDK)/include \ 
     86                $(GM_INCLUDE) \ 
     87                $(EXIV_INCLUDE) \ 
     88                $(FF_INCLUDE) \ 
    8789                $(DEFINE) \ 
    8890                flGM.cpp 
    8991        g++ -w -c -O2 \ 
    9092                -o flGMModule.o \ 
    91                 -I$(GECKO_SDK).$(PLATFORM)/include \ 
    92                 -I$(GM_INCLUDE) \ 
    93                 -I$(EXIV_INCLUDE) \ 
     93                -I$(GECKO_SDK)/include \ 
    9494                $(DEFINE) \ 
    9595                flGMModule.cpp 
    96 #       g++ -dynamiclib -O2 \ 
    97 #               -o gm.dylib.$(PLATFORM) \ 
    98 #               flGM.o flGMModule.o \ 
    99 #               -L$(GECKO_SDK).$(PLATFORM)/lib \ 
    100 #               -L$(GM_LIB) \ 
    101 #               -L$(X11_LIB) \ 
    102 #               -L$(PORTS_LIB) \ 
    103 #               -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \ 
    104 #               -lxpcomglue_s -lxpcom -lnspr4 \ 
    105 #               -lGraphicsMagick -lGraphicsMagick++ \ 
    106 #               -lexiv2 \ 
    107 #               -lX11 \ 
    108 #               -lz -lbz2 \ 
    109 #               -lxml2 \ 
    110 3               -lXext \ 
    111 #               -ljpeg -lpng -ltiff 
    11296        g++ -dynamiclib -O2 \ 
    11397                -o gm.dylib.$(PLATFORM) \ 
    11498                flGM.o flGMModule.o \ 
    115                 -L$(GECKO_SDK).$(PLATFORM)/lib \ 
    116                 -L$(GM_LIB) \ 
    117                 -L$(PORTS_LIB) \ 
     99                -L$(GECKO_SDK)/lib \ 
     100                $(GM_LIB) \ 
     101                $(PORTS_LIB) \ 
    118102                -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \ 
    119103                -lxpcomglue_s -lxpcom -lnspr4 \ 
    120104                -lGraphicsMagick -lGraphicsMagick++ \ 
    121                 -lexiv2
     105                -lexiv2 -liconv
    122106                -lz -lbz2 \ 
    123107                -lxml2 \ 
    124                 -ljpeg -lpng -ltiff 
     108                -ljpeg -lpng -ltiff \ 
     109                -lavformat -lavcodec -lavutil \ 
     110                -Wl,-read_only_relocs,suppress 
    125111else 
    126         @echo "Not building the GraphicsMagick XPCOM component" 
     112        @echo "Not building the GraphicsMagick/FFmpeg XPCOM component" 
    127113endif 
    128114 
     
    133119        @echo "Building the API key XPCOM component..." 
    134120ifeq (mac, $(PLATFORM)) 
    135         @echo "Building XPT file..." 
     121        @echo "Building the API key XPT file..." 
    136122        $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 
    137123                -m header \ 
     
    166152 
    167153clh: 
    168         @echo "Building XPT file..." 
     154        @echo "Building the CLH XPT file..." 
    169155        $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 
    170156                -m typelib \ 
     
    174160 
    175161 
    176 test: 
    177         g++ -w -c -O2 -o gm_test.o -I$(GM_INCLUDE) -I$(EXIV_INCLUDE) gm_test.cpp 
     162gm_test: 
     163        g++ -w -c -O2 -o gm_test.o $(GM_INCLUDE) $(EXIV_INCLUDE) gm_test.cpp 
    178164        g++ -O2 -o gm_test gm_test.o \ 
    179                 -L$(GM_LIB) \ 
    180                 -L$(X11_LIB) \ 
    181                 -L$(PORTS_LIB) \ 
     165                $(GM_LIB) \ 
     166                $(PORTS_LIB) \ 
    182167                -lGraphicsMagick++ -lGraphicsMagick \ 
    183168                -lexiv2 \ 
    184                 -lX11 \ 
    185169                -lz -lbz2 \ 
    186170                -lxml2 \ 
    187                 -lXext \ 
    188171                -ljpeg -lpng -ltiff 
     172 
     173gm_clean: 
     174        rm -f gm_test gm_test.o 
     175 
     176 
     177 
     178ff_test: 
     179        g++ -w -c -O2 -o ff_test.o \ 
     180                $(GM_INCLUDE) $(EXIV_INCLUDE) $(FF_INCLUDE) \ 
     181                ff_test.cpp 
     182        g++ -O2 -o ff_test ff_test.o \ 
     183                $(GM_LIB) \ 
     184                $(PORTS_LIB) \ 
     185                -lavformat -lavcodec -lavutil \ 
     186                -lGraphicsMagick++ -lGraphicsMagick \ 
     187                -lexiv2 \ 
     188                -lz -lbz2 \ 
     189                -lxml2 \ 
     190                -ljpeg -lpng -ltiff 
     191 
     192ff_clean: 
     193        rm -f ff_test ff_test.o 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/flGM.cpp

    r210 r224  
    1919#include "iptc.hpp" 
    2020 
     21// Goofy FFmpeg requires C linkage 
     22extern "C" { 
     23#include <avcodec.h> 
     24#include <avformat.h> 
     25} 
     26 
    2127#include <stdlib.h> 
    22 #include <iostream> 
    2328#include <sstream> 
    2429#include <string> 
     
    370375//   On Windows there is little to do, but Macs must go from UTF-8 to UTF-16 
    371376void unconv_path(string & path_s, nsAString & _retval) { 
     377        size_t pos = path_s.find("###", 0); 
     378        while (string::npos != pos) { 
     379                path_s.replace(pos, 3, "{---THREE---POUND---DELIM---}"); 
     380                pos = path_s.find("###", pos); 
     381        } 
    372382        char * o = (char *)path_s.c_str(); 
    373383#ifdef XP_MACOSX 
     
    432442                // Get the path as a C++ string 
    433443                path_s = conv_path(path, false); 
    434                 if (0 == path_s) { 
     444                if (!path_s) { 
    435445                        return NS_ERROR_INVALID_ARG; 
    436446                } 
     
    520530                        bh = img.baseColumns(); 
    521531                } 
    522               int base = bw > bh ? bw : bh; 
     532//            int base = bw > bh ? bw : bh; 
    523533                out1 << bw << "###" << bh << "###"; 
    524534 
     
    534544 
    535545                // Thumbnail width and height 
    536                 float r; 
    537546                ostringstream dim; 
    538547                if (bw > bh) { 
    539                         r = (float)bh * (float)square / (float)bw; 
     548                        float r = (float)bh * (float)square / (float)bw; 
    540549                        out1 << square << "###" << round(r); 
    541550                        dim << square << "x" << round(r); 
    542551                } else { 
    543                         r = (float)bw * (float)square / (float)bh; 
     552                        float r = (float)bw * (float)square / (float)bh; 
    544553                        out1 << round(r) << "###" << square; 
    545554                        dim << round(r) << "x" << square; 
     
    568577                // Create a new path 
    569578                thumb_s = find_path(path_s, "-thumb"); 
    570                 if (0 == thumb_s) { 
     579                if (!thumb_s) { 
    571580                        return NS_ERROR_NULL_POINTER; 
    572581                } 
     
    579588 
    580589                // Find the sharpen sigma as the website does 
    581               double sigma; 
    582               if (base <= 800) { 
    583                       sigma = 1.9; 
    584               } else if (base <= 1600) { 
    585                       sigma = 2.85; 
    586               } else { 
    587                       sigma = 3.8; 
    588               } 
     590//            double sigma; 
     591//            if (base <= 800) { 
     592//                    sigma = 1.9; 
     593//            } else if (base <= 1600) { 
     594//                    sigma = 2.85; 
     595//            } else { 
     596//                    sigma = 3.8; 
     597//            } 
    589598 
    590599                // Create the actual thumbnail 
    591600                img.scale(dim.str()); 
    592               img.sharpen(1, sigma); 
     601//            img.sharpen(1, sigma); 
    593602                img.compressType(Magick::NoCompression); 
    594603                img.write(*thumb_s); 
     
    642651 
    643652                path_s = conv_path(path, false); 
    644                 if (0 == path_s) { 
     653                if (!path_s) { 
    645654                        return NS_ERROR_INVALID_ARG; 
    646655                } 
     
    658667                // Create a new path 
    659668                rotate_s = find_path(path_s, "-rotate"); 
    660                 if (0 == rotate_s) { 
     669                if (!rotate_s) { 
    661670                        return NS_ERROR_NULL_POINTER; 
    662671                } 
     
    707716        try { 
    708717                path_s = conv_path(path, false); 
    709                 if (0 == path_s) { 
     718                if (!path_s) { 
    710719                        return NS_ERROR_INVALID_ARG; 
    711720                } 
     
    763772                // Create a new path 
    764773                resize_s = find_path(path_s, "-resize"); 
    765                 if (0 == resize_s) { 
     774                if (!resize_s) { 
    766775                        return NS_ERROR_NULL_POINTER; 
    767776                } 
     
    807816 
    808817} 
     818 
     819NS_IMETHODIMP flGM::Keyframe(PRInt32 square, const nsAString & path, nsAString & _retval) { 
     820        string * path_s = conv_path(path, false); 
     821        if (!path_s) { 
     822                return NS_ERROR_INVALID_ARG; 
     823        } 
     824 
     825        // Open the file 
     826        av_register_all(); 
     827        AVFormatContext *format_ctx; 
     828        if (av_open_input_file(&format_ctx, path_s->c_str(), 0, 0, 0)) { 
     829                return NS_ERROR_NULL_POINTER; 
     830        } 
     831        if (0 > av_find_stream_info(format_ctx)) { 
     832                return NS_ERROR_NULL_POINTER; 
     833        } 
     834        int stream = -1; 
     835        for (int i = 0; i < format_ctx->nb_streams; ++i) { 
     836                if (CODEC_TYPE_VIDEO == format_ctx->streams[i]->codec->codec_type) { 
     837                        stream = i; 
     838                        break; 
     839                } 
     840        } 
     841        if (-1 == stream) { 
     842                return NS_ERROR_NULL_POINTER; 
     843        } 
     844        AVCodecContext * codec_ctx = format_ctx->streams[stream]->codec; 
     845        AVCodec * codec = avcodec_find_decoder(codec_ctx->codec_id); 
     846        if (!codec) { 
     847                return NS_ERROR_NULL_POINTER; 
     848        } 
     849        if(0 > avcodec_open(codec_ctx, codec)) { 
     850                return NS_ERROR_NULL_POINTER; 
     851        } 
     852        AVFrame * video_frame = avcodec_alloc_frame(); 
     853        AVFrame * img_frame = avcodec_alloc_frame(); 
     854        if (!video_frame || !img_frame) { 
     855                return NS_ERROR_NULL_POINTER; 
     856        } 
     857        int bytes = avpicture_get_size(PIX_FMT_RGB24, codec_ctx->width, 
     858                codec_ctx->height); 
     859        uint8_t * buffer = (uint8_t *)av_malloc(bytes * sizeof(uint8_t)); 
     860        if (!buffer) { 
     861                return NS_ERROR_NULL_POINTER; 
     862        } 
     863        avpicture_fill((AVPicture *)img_frame, buffer, PIX_FMT_RGB24, 
     864                codec_ctx->width, codec_ctx->height); 
     865 
     866        // Play through 15% of the video 
     867        int64_t seek = (int64_t)(0.15 * (double)format_ctx->duration * 
     868                (double)codec_ctx->time_base.num / (double)codec_ctx->time_base.den); 
     869        int i = 0; 
     870        AVPacket packet; 
     871        int have_frame; 
     872        while (0 <= av_read_frame(format_ctx, &packet)) { 
     873                if (packet.stream_index == stream) { 
     874                        avcodec_decode_video(codec_ctx, video_frame, &have_frame, 
     875                                 packet.data, packet.size); 
     876                        if (have_frame && seek == ++i) { 
     877                                img_convert((AVPicture *)img_frame, PIX_FMT_RGB24, 
     878                                        (AVPicture*)video_frame, codec_ctx->pix_fmt, 
     879                                        codec_ctx->width, codec_ctx->height); 
     880 
     881                                // Convert the keyframe to a PPM in a byte array 
     882                                char header[32]; 
     883                                sprintf(header, "P6\n%d %d\n255\n", codec_ctx->width, 
     884                                        codec_ctx->height); 
     885                                int size = strlen(header) + 3 * codec_ctx->width * 
     886                                        codec_ctx->height; 
     887                                char * bytes = (char *)malloc(size); 
     888                                if (!bytes) { 
     889                                        return NS_ERROR_NULL_POINTER; 
     890                                } 
     891                                memcpy(bytes, header, strlen(header)); 
     892                                char * bytes_p = bytes + strlen(header); 
     893                                int b = codec_ctx->width * 3; 
     894                                int jj = codec_ctx->height; 
     895                                for (int j = 0; j < jj; ++j) { 
     896                                        memcpy(bytes_p, img_frame->data[0] + j * 
     897                                                img_frame->linesize[0], b); 
     898                                        bytes_p += b; 
     899                                } 
     900 
     901                                // Convert the PPM array to a JPEG on disk 
     902                                string * thumb_s = 0; 
     903                                try { 
     904                                        Magick::Image img(Magick::Blob(bytes, size)); 
     905 
     906                                        // Output the size of the video and the embedded timestamp 
     907                                        int bw = img.baseColumns(), bh = img.baseRows(); 
     908                                        ostringstream out; 
     909                                        out << "###" << bw << "###" << bh << "###" 
     910                                                << format_ctx->timestamp << "###"; 
     911 
     912                                        // Resize the output as a thumbnail 
     913                                        //   This is almost certainly overkill, as I've never 
     914                                        //   seen a video in portrait mode 
     915                                        ostringstream dim; 
     916                                        if (bw > bh) { 
     917                                                float r = (float)bh * (float)square / (float)bw; 
     918                                                out << square << "###" << round(r); 
     919                                                dim << square << "x" << round(r); 
     920                                        } else { 
     921                                                float r = (float)bw * (float)square / (float)bh; 
     922                                                out << round(r) << "###" << square; 
     923                                                dim << round(r) << "x" << square; 
     924                                        } 
     925                                        out << "###"; 
     926 
     927                                        // Resize and save the thumbnail 
     928                                        img.scale(dim.str()); 
     929                                        img.compressType(Magick::NoCompression); 
     930                                        path_s->append(".jpg"); 
     931                                        thumb_s = find_path(path_s, "-thumb"); 
     932                                        if (!thumb_s) { 
     933                                                return NS_ERROR_NULL_POINTER; 
     934                                        } 
     935                                        delete path_s; path_s = 0; 
     936                                        img.write(*thumb_s); 
     937 
     938                                        // If all went well, return stuff 
     939                                        string out_s = out.str(); 
     940                                        char * o = (char *)out_s.c_str(); 
     941                                        nsCString utf8; 
     942                                        while (*o) { 
     943                                                utf8.Append(*o++); 
     944                                        } 
     945                                        _retval.Append(NS_ConvertUTF8toUTF16(utf8)); 
     946                                        unconv_path(*thumb_s, _retval); 
     947                                        delete thumb_s; thumb_s = 0; 
     948 
     949                                } catch (Magick::Exception & e) { 
     950                                        delete path_s; 
     951                                        delete thumb_s; 
     952                                        char * o = (char *)e.what(); 
     953                                        while (*o) { 
     954                                                _retval.Append(*o++); 
     955                                        } 
     956                                } 
     957 
     958                                free(bytes); 
     959                                av_free_packet(&packet); 
     960                                break; 
     961                        } 
     962                } 
     963                av_free_packet(&packet); 
     964        } 
     965 
     966        // Clean yo' mess 
     967        av_free(buffer); 
     968        av_free(img_frame); 
     969        av_free(video_frame); 
     970        avcodec_close(codec_ctx); 
     971        av_close_input_file(format_ctx); 
     972 
     973        return NS_OK; 
     974} 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/flIGM.idl

    r144 r224  
    1717        AString rotate(in long degrees, in AString path); 
    1818        AString resize(in long square, in AString path); 
     19        AString keyframe(in long square, in AString path); 
    1920}; 
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/gm_test.cpp

    r149 r224  
    1010#include "iptc.hpp" 
    1111 
    12 #include "nsStringAPI.h" 
     12//#include "nsStringAPI.h" 
    1313 
    1414using namespace std; 
  • trunk/uploadr/Makefile

    r220 r224  
    99# 
    1010 
     11INTL := $(filter de-de en-US es-us fr-fr it-it ko-kr pt-br zh-hk, $(MAKECMDGOALS)) 
     12ifeq (de-de, $(INTL)) 
     13INTL_SHORT := de 
     14endif 
     15ifeq (en-US, $(INTL)) 
     16INTL_SHORT := en 
     17endif 
     18ifeq (es-us, $(INTL)) 
     19INTL_SHORT := es 
     20endif 
     21ifeq (fr-fr, $(INTL)) 
     22INTL_SHORT := fr 
     23endif 
     24ifeq (it-it, $(INTL)) 
     25INTL_SHORT := it 
     26endif 
     27ifeq (ko-kr, $(INTL)) 
     28INTL_SHORT := kr 
     29endif 
     30ifeq (pt-br, $(INTL)) 
     31INTL_SHORT := br 
     32endif 
     33ifeq (zh-hk, $(INTL)) 
     34INTL_SHORT := hk 
     35endif 
     36 
     37# The base of this path (everything up to INTL) must exist before running make 
     38PKG := ~/Desktop/build/$(INTL) 
     39 
     40# Version number for Uploadr 
    1141VER := 3.0.5 
     42 
     43# Location of Mozilla tree 
     44MOZILLA := ~/mozilla 
     45 
    1246SRC := MacUploadr.app/Contents 
    13 PKG := ~/Desktop/build 
    14 BUILD := $(PKG)/Flickr\ Uploadr.app/Contents 
     47APP := $(PKG)/Flickr\ Uploadr.app 
     48BUILD := $(APP)/Contents 
    1549GM_VER := 1.1.10 
    1650 
    17 INTL := $(filter de-de en-US es-us fr-fr it-it ko-kr pt-br zh-hk, $(MAKECMDGOALS)) 
    18  
    1951all: 
    20         @echo "This target doesn't do anything!  Specify one of these:" 
    21         @echo "  <INTL> build     Copy everything of interest to ~/Desktop/build/" 
     52        make de-de build 
     53        make en-US build 
     54        make es-us build 
     55        make fr-fr build 
     56        make it-it build 
     57        make ko-kr build 
     58        make pt-br build 
     59        make zh-hk build 
     60        make de-de mar 
     61        make en-US mar 
     62        make es-us mar 
     63        make fr-fr mar 
     64        make it-it mar 
     65        make ko-kr mar 
     66        make pt-br mar 
     67        make zh-hk mar 
    2268 
    2369de-de: 
     
    4793build: 
    4894 
     95        # Saving the previous version 
     96        rm -rf $(PKG)/old 
     97        mv $(APP) $(PKG)/old 
     98 
    4999        # Package structure 
    50         rm -rf $(PKG) 
    51         mkdir $(PKG) 
    52100        mkdir $(PKG)/Flickr\ Uploadr.app 
    53101        ln -s /Applications $(PKG)/Applications 
     
    120168        cp $(SRC)/Resources/components/*.js $(BUILD)/Resources/components/ 
    121169 
    122         # Record this build for posterity 
    123         rm -rf ~/Desktop/builds/$(INTL)/* 
    124         cp -R $(PKG)/Flickr\ Uploadr.app ~/Desktop/builds/$(INTL)/ 
    125  
    126170        # Copy to DMG 
    127171        cp -R $(PKG)/* /Volumes/Flickr\ Uploadr\ $(VER)/ 
     
    129173                /Volumes/Flickr\ Uploadr\ $(VER)/.i.png 
    130174        ln -s .i.png /Volumes/Flickr\ Uploadr\ $(VER)/i.png 
     175 
     176mar: 
     177 
     178        # Making MAR files 
     179        ln -s Flickr\ Uploadr.app $(PKG)/new 
     180        PATH="$(PATH):$(MOZILLA)/other-licenses/bsdiff:$(MOZILLA)/modules/libmar/tool" \ 
     181                $(MOZILLA)/tools/update-packaging/make_full_update.sh \ 
     182                $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).complete.mar $(PKG)/new 
     183        PATH="$(PATH):$(MOZILLA)/other-licenses/bsdiff:$(MOZILLA)/modules/libmar/tool" \ 
     184                $(MOZILLA)/tools/update-packaging/make_incremental_update.sh \ 
     185                $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).partial.mar $(PKG)/old $(PKG)/new 
     186        rm $(PKG)/new 
     187 
     188        # Size and hash for the XML file 
     189        @ls -l $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).complete.mar | awk '{print "Complete size: ",$$5}' 
     190        @md5 $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).complete.mar | awk '{print "Complete MD5:  ",$$4}' 
     191        @ls -l $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).partial.mar | awk '{print "Partial size: ",$$5}' 
     192        @md5 $(PKG)/FlickrUploadr-$(VER)-$(INTL_SHORT).partial.mar | awk '{print "Partial MD5:  ",$$4}' 
  • trunk/uploadr/NOTES

    r212 r224  
    33 
    44 
    5 Expand gm.thumb to return the date taken as well for use in sorting 
    6         MySQL format would be nice, as that is string-sortable 
    7  
    85Offer a preference to not create thumbnails in the name of speed 
    9         Accomplish this with special case param of thumbSize = 0 to gm.thumb 
     6        Accomplish this with special case param of thumb_size = 0 to gm.thumb 
    107        This will still return the date taken but will not actually do the thumbing 
    11  
    12 As of 8-21-2007 
    13         Thumbing 127 8 MP JPEGs 
    14                 Uploadr 3 Mac           97 seconds 
    15                 Uploadr 3 Win           278 seconds 
    16                 Uploadr 2.5 Win         312 seconds 
    17  
    18  
    19  
    20 9-7-2007 meeting with Gino & Stewart 
    21  
    22 Make sure it's smart when network drops 
    23 *** Partial batch tagging - tag a >1 photo selection all at once - append to individual tags 
    24 Tooltips on toolbar buttons 
    25 Save state of unuploaded photos on exit 
    26 Tabs for batches (two total - the uploading batch and the editing batch) 
    27         When you start upload, create a new tab for the next batch 
    28         jUploadr/Chronic style photo progress indication 
    29         User must DO SOMETHING to get to the new batch once uploading starts (button to switch tabs) 
    30 Ordering options instead of a default 
    31         Date taken (fallback to alpha if date taken not available) 
    32         Let me order them 
    33         Reverse the current thing 
    34  
    35 Twiki page! 
    36  
    37 Look into embedding Flash into the Uploadr - Picnik 
    38  
    39  
    40  
    41 Drag selecting photos 
    42         I couldn't figure out any way other than hardcoding the offsets to make the box actually 
    43         track the cursor.  document.getElementById('photos').offsetTop isn't set?! 
    44  
    45  
    46  
    47 9-12-2007 meeting with Gino & Stewart 
    48  
    49 Partial batch metadata 
    50         Overwrite titles always 
    51         Append to description always (prefix with \n\n) 
    52                 Could have a pref for append/overwrite for description - nah 
    53         Confirmation on clicking save 
    54         *** Make blank title or description not overwrite each photo *** 
    55                 Do all partial batches like the changed_* checks in settings.js 
    56         "Leave unchanged" checkbox for privacy metadata that unchecks if they change something 
    57 Re-adding to a batch after failure 
    58         Preserve order in the queue, which is the order they wanted 
    59 Add add-to-set option for each photo and for partial batches 
    60 Nix the per-photo resize options 
    618 
    629 
     
    13380 
    13481 
    135 Rough speed tests 2007-10-31 
    136         Thumbing 7 photos 
    137                 Uploadr 2.3             Mac             3s 
    138                 Uploadr 3.0             Mac             5s 
    139                 Uploadr 2.3             PPC             7s 
    140                 Uploadr 3.0             PPC             s 
    141                 Uploadr 2.5             Win             7s 
    142                 Uploadr 3.0             Win             13s 
    143  
    144  
    145  
    14682Files changed in my hacked up XULRunner locales 
    14783        locale/xx-xx/global/dialog.properties 
    14884        locale/xx-xx/global/wizard.dtd 
    14985        locale/xx-xx/mozapps/update/* 
     86 
     87 
     88 
     89Errors building FFmpeg into XPCOM: 
     90 
     91ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option 
     92/usr/local/lib/libavcodec.a(dsputil_mmx.o) definition of common _mm_flags (size 16) 
     93/usr/local/lib/libavcodec.a(h261.o) definition of common _ff_h261_rl_table_store (size 400) 
     94/usr/local/lib/libavcodec.a(cabac.o) definition of common _ff_h264_lps_range (size 512) 
     95/usr/local/lib/libavcodec.a(cabac.o) definition of common _ff_h264_mlps_state (size 256) 
     96/usr/local/lib/libavcodec.a(mpeg12.o) definition of common _ff_mpeg12_static_rl_table_store (size 784) 
     97/usr/local/lib/libavcodec.a(msmpeg4data.o) definition of common _ff_msmp4_dc_chroma_vlc (size 32) 
     98/usr/local/lib/libavcodec.a(msmpeg4data.o) definition of common _ff_msmp4_dc_luma_vlc (size 32) 
     99/usr/local/lib/libavcodec.a(msmpeg4data.o) definition of common _ff_msmp4_mb_i_vlc (size 16) 
     100/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_4mv_block_pattern_vlc (size 64) 
     101/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_ac_coeff_table (size 128) 
     102/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_bfraction_vlc (size 16) 
     103/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_cbpcy_p_vlc (size 64) 
     104/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_imode_vlc (size 16) 
     105/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_mv_diff_vlc (size 64) 
     106/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_norm2_vlc (size 16) 
     107/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_norm6_vlc (size 16) 
     108/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_subblkpat_vlc (size 48) 
     109/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_ttblk_vlc (size 48) 
     110/usr/local/lib/libavcodec.a(vc1data.o) definition of common _ff_vc1_ttmb_vlc (size 48) 
     111/usr/local/lib/libavcodec.a(msmpeg4.o) definition of common _ff_inter_intra_vlc (size 16) 
     112/usr/local/lib/libavcodec.a(msmpeg4.o) definition of common _ff_mb_non_intra_vlc (size 64) 
     113/usr/local/lib/libavcodec.a(cabac.o) definition of common _ff_h264_lps_state (size 128) 
     114/usr/local/lib/libavcodec.a(cabac.o) definition of common _ff_h264_mps_state (size 128) 
     115/usr/bin/libtool: internal link edit command failed 
     116 
     117 
     118 
     119ld: Undefined symbols: 
     120__Z11img_convertP9AVPictureiPKS_iii 
     121__Z12avcodec_openP14AVCodecContextP7AVCodec 
     122__Z13av_read_frameP15AVFormatContextP8AVPacket 
     123__Z13avcodec_closeP14AVCodecContext 
     124__Z14avpicture_fillP9AVPicturePhiii 
     125__Z15av_register_allv 
     126__Z18av_open_input_filePP15AVFormatContextPKcP13AVInputFormatiP18AVFormatParameters 
     127__Z18avpicture_get_sizeiii 
     128__Z19av_close_input_fileP15AVFormatContext 
     129__Z19av_find_stream_infoP15AVFormatContext 
     130__Z19avcodec_alloc_framev 
     131__Z20avcodec_decode_videoP14AVCodecContextP7AVFramePiPhi 
     132__Z20avcodec_find_decoder7CodecID 
     133__Z7av_freePv 
     134__Z9av_mallocj 
     135 
     136 
     137 
     138Software Update 
     139 
     140Partials are broken.  Eh. 
     141 
     142 
     143 
  • trunk/uploadr/README

    r182 r224  
    175175 
    176176 
     177FFmpeg 
     178------------------------------------------------------------------------ 
     179 
     180Windows 
     181------- 
     182 
     183? 
     184 
     185Mac 
     186--- 
     187 
     188This configure line works but uses the *.dylib files. 
     189 
     190  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     191    --disable-mmx --disable-static --enable-shared 
     192 
     193This configure line can build static ff_test but not static flGM. 
     194 
     195  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     196    --disable-mmx --enable-static --disable-shared 
     197 
     198This configure line is no change over the above.  Additionally, using 
     199the '-read_only_relocs suppress' option with flGM itself doesn't help. 
     200 
     201  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     202    --disable-mmx --enable-static --disable-shared \ 
     203    --extra-ldflags='-read_only_relocs suppress' 
     204 
     205Found a way to keep even ffmpeg from building. 
     206 
     207  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     208    --disable-mmx --enable-static --disable-shared \ 
     209    --extra-ldflags='-read_only_relocs suppress' --extra-cflags=-fno-common 
     210  $ cp config.mak config.mak.sav 
     211  $ sed 's/-mdynamic-no-pic//g' config.mak.sav > config.mak 
     212  $ make 
     213    ... 
     214    cabac.h: In function 'get_cabac_noinline': 
     215    cabac.h:529: error: PIC register '%ebx' clobbered in 'asm' 
     216 
     217The issue lies in -mdynamic-no-pic, which is used (and needed?) to build 
     218ffmpeg.  ff_test will build when flGM will not because -mdynamic-no-pic 
     219can't be used to build shared libraries. 
     220 
     221People working on Blender seem to have similar issues so I'm going to 
     222try removing -fPIC as they suggest. 
     223 
     224  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     225    --disable-vhook --disable-mmx --enable-static --disable-shared \ 
     226    --extra-ldflags='-read_only_relocs suppress' --extra-cflags=-fno-common 
     227  $ cp config.mak config.mak.sav 
     228  $ sed 's/-mdynamic-no-pic//g' config.mak.sav | \ 
     229    sed 's/-fPIC//g' > config.mak 
     230 
     231That doesn't work - I get the same %ebx error as above. 
     232 
     233After again asking the smarter people on #xulrunner, I started from 
     234scratch on FFmpeg.  This works: 
     235 
     236  $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 
     237  $ cd ffmpeg 
     238  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
     239    --disable-vhook --disable-mmx --enable-static --disable-shared \ 
     240    --extra-cflags=-fno-common 
     241  $ make && sudo make install 
     242 
     243 
     244 
    177245Building XPCOM components 
    178246------------------------------------------------------------------------ 
     
    199267------------------------------------------------------------------------ 
    200268 
    201 Win 
    202 --- 
     269Windows 
     270------- 
    203271 
    204272On Windows, there is very little left to be done.  The root of your 
     
    215283On Mac, the app can be launched by double-clicking on MacUploadr.app 
    216284in Finder. 
     285 
     286 
     287 
     288Software Update Service 
     289------------------------------------------------------------------------ 
     290 
     291Windows 
     292------- 
     293 
     294? 
     295 
     296Mac 
     297--- 
     298 
     299Info on how to build MAR files is here: 
     300 
     301  http://wiki.mozilla.org/Software_Update:HowToManuallyGenerateMARFiles 
     302 
     303Start with your mozconfig file, XULRunner style: 
     304 
     305  http://developer.mozilla.org/en/docs/XULRunner:Build_Instructions 
     306 
     307Then a regular Mozilla build environment, following these: 
     308 
     309  http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites 
     310 
     311Altogether, at this point it should look like this: 
     312 
     313  ~/.mozconfig: 
     314  mk_add_options MOZ_CO_PROJECT=all 
     315  ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk 
     316  ac_add_options --disable-javaxpcom 
     317  ac_add_options --enable-application=xulrunner 
     318 
     319  $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co \ 
     320    mozilla/client.mk 
     321  $ cd mozilla 
     322  $ make -f client.mk checkout 
     323  $ make -f client.mk build 
     324 
     325There may be an easier way, something like what Songbird does: 
     326 
     327  http://publicsvn.songbirdnest.com/browser/trunk/build/mozconfig/ \ 
     328    xulrunner.windows.debug.i686.mozconfig 
     329