Changeset 224
- Timestamp:
- 02/04/08 21:38:56 (2 years ago)
- Files:
-
- trunk/uploadr/MacUploadr.app/Contents/Resources/application.ini (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/api.js (modified) (5 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/clh.js (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/dock.xul (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/drag.js (modified) (2 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/meta.js (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js (modified) (8 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/settings.js (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js (modified) (8 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js (modified) (3 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/uploadr.js (modified) (2 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile (modified) (5 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/ff_test.cpp (added)
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/flGM.cpp (modified) (12 diffs)
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/flIGM.idl (modified) (1 diff)
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/gm_test.cpp (modified) (1 diff)
- trunk/uploadr/Makefile (modified) (4 diffs)
- trunk/uploadr/NOTES (modified) (2 diffs)
- trunk/uploadr/README (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/uploadr/MacUploadr.app/Contents/Resources/application.ini
r220 r224 13 13 Name=Flickr Uploadr 14 14 Version=3.0.5 15 BuildID=2008012 20115 BuildID=2008012401 16 16 Copyright=Copyright © 2007 - Yahoo!, Inc. 17 17 ID=uploadr@flickr.com trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/api.js
r219 r224 100 100 'path': photo.path 101 101 } 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); 103 104 104 105 }, … … 579 580 // If requested, open the site 580 581 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=' + 582 584 upload.timestamps.earliest + '-' + upload.timestamps.latest + 583 585 '-' + users.nsid); … … 681 683 'perms': 'write', 682 684 '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); 684 687 pages.go('auth'); 685 688 } … … 770 773 users.filesize = parseInt(user.getElementsByTagName( 771 774 'filesize')[0].getAttribute('maxkb')); 775 Components.utils.reportError('users.filesize: ' + users.filesize); 772 776 sets = user.getElementsByTagName('sets')[0].getAttribute('remaining'); 773 777 if ('lots' == sets) { … … 1131 1135 } 1132 1136 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/'; 1134 1139 } 1135 1140 if (null == browser) { trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/clh.js
r197 r224 21 21 for (var i = 0; i < ii; ++i) { 22 22 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)) { 28 24 paths.push(arg); 29 25 } trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/dock.xul
r171 r224 33 33 // Add this photo, converting file:// URL to a native path 34 34 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)) { 40 36 win.threads.worker.dispatch(new win.PhotoAdd(arg), 41 37 win.threads.worker.DISPATCH_NORMAL); trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/drag.js
r197 r224 31 31 } else { 32 32 var path = f.QueryInterface(Ci.nsILocalFile).path; 33 if (photos. is_photo(path)) {33 if (photos.can_has(path)) { 34 34 paths.push(path); 35 35 } … … 43 43 } else { 44 44 var path = d.first.data.QueryInterface(Ci.nsILocalFile).path; 45 if (photos. is_photo(path)) {45 if (photos.can_has(path)) { 46 46 paths.push(path); 47 47 } trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/meta.js
r214 r224 229 229 document.getElementById('no_meta').style.display = 'none'; 230 230 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 233 242 }, 234 243 trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/photos.js
r214 r224 65 65 fp.init(window, locale.getString('dialog.add'), 66 66 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; 68 Components.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 } 69 77 fp.displayDirectory = def; 70 78 var res = fp.show(); … … 74 82 while (files.hasMoreElements()) { 75 83 var arg = files.getNext().QueryInterface(Ci.nsILocalFile).path; 76 if (photos. is_photo(arg)) {84 if (photos.can_has(arg)) { 77 85 paths.push(arg); 78 86 } … … 98 106 var ii = paths.length; 99 107 for (var i = 0; i < ii; ++i) { 108 var p; 100 109 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]) { 102 120 photos.list[photos.list.length - 1] = paths[i]; 103 } else {104 photos._add(paths[i]);105 121 } 106 122 } … … 151 167 152 168 // Create and show the thumbnail 153 threads.worker.dispatch(new Thumb(id, uploadr.conf.thumb Size, path),169 threads.worker.dispatch(new Thumb(id, uploadr.conf.thumb_size, path), 154 170 threads.worker.DISPATCH_NORMAL); 155 171 … … 225 241 buttons.upload.disable(); 226 242 for (var i = 0; i < ii; ++i) { 227 block_sort();228 243 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 } 237 255 } 238 256 threads.worker.dispatch(new EnableUpload(), threads.worker.DISPATCH_NORMAL); … … 262 280 img.onclick(); 263 281 } 282 } 283 284 // Drop videos if we're a free user 285 if (!users.is_pro) { 286 264 287 } 265 288 … … 275 298 for each (var p in list) { 276 299 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 284 322 } 285 323 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? 296 327 } 297 328 … … 515 546 // Decide if a given path is a photo 516 547 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) { 560 Components.utils.reportError('can_has: pro'); 561 return photos.is_photo(path) || photos.is_video(path); 562 } else { 563 Components.utils.reportError('can_has: not pro'); 564 return photos.is_photo(path); 565 } 566 } else { 567 Components.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 } 518 574 } 519 575 trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/settings.js
r193 r224 106 106 var u = eval(users.list.toSource()); 107 107 var result = {}; 108 Components.utils.reportError('users.filesize: ' + users.filesize); 108 109 window.openDialog('chrome://uploadr/content/settings.xul', 'dialog_settings', 109 110 'chrome,modal', users.username, u, locale.getFormattedString( trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/threads.js
r204 r224 35 35 36 36 // Thumbnail thread wrapper 37 var Thumb = function(id, thumb Size, path, auto_select) {37 var Thumb = function(id, thumb_size, path, auto_select) { 38 38 this.id = id; 39 this.thumb Size = thumbSize;39 this.thumb_size = thumb_size; 40 40 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; 46 42 }; 47 43 Thumb.prototype = { 48 44 run: function() { 49 45 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 53 58 threads.main.dispatch(new ThumbCallback(this.id, result, this.auto_select), 54 59 threads.main.DISPATCH_NORMAL); … … 77 82 // Parse the returned string 78 83 // <orient>###<width>###<height>###<date_taken>###<thumb_width>###<thumb_height>###<thumb_path>###<title>###<description>###<tags> 84 Components.utils.reportError('result: ' + this.result); 79 85 var thumb = this.result.split('###'); 80 86 … … 95 101 photos.list[this.id].width = parseInt(thumb[1]); 96 102 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 { 98 106 var f = Cc['@mozilla.org/file/local;1'].createInstance( 99 107 Ci.nsILocalFile); … … 113 121 ':' + month + ':' + day + ' ' + hours + ':' + 114 122 minutes + ':' + seconds; 115 } else {116 photos.list[this.id].date_taken = thumb[3];117 123 } 118 124 img.setAttribute('width', thumb[4]); … … 183 189 free.update(); 184 190 191 Components.utils.reportError('photos.list[this.id]: ' + photos.list[this.id].toSource()); 192 185 193 } 186 194 … … 218 226 219 227 // Rotate thread wrapper 220 var Rotate = function(id, degrees, thumb Size, path) {228 var Rotate = function(id, degrees, thumb_size, path) { 221 229 this.id = id; 222 230 this.degrees = degrees; 223 this.thumb Size = thumbSize;231 this.thumb_size = thumb_size; 224 232 this.path = path; 225 233 }; … … 240 248 threads.main.dispatch(new RotateCallback(this.id, rotate[1]), 241 249 threads.main.DISPATCH_NORMAL); 242 result = threads.gm.thumb(this.thumb Size,250 result = threads.gm.thumb(this.thumb_size, 243 251 rotate[1]); 244 252 threads.main.dispatch(new ThumbCallback(this.id, result, … … 393 401 394 402 if (null == resize) { 395 Components.utils.reportError( result);403 Components.utils.reportError(this.result); 396 404 } else { 397 405 list = photos.ready[photos.ready.length - 1]; trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/ui.js
r203 r224 60 60 61 61 tips: function() { 62 mouse.show_photos(); 62 63 pages.go('help'); 63 64 }, … … 104 105 update: function(percent) { 105 106 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 } 107 110 }, 108 111 clear: function() { … … 184 187 185 188 // 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 186 191 locale.getFormattedString = function(id, args) { 187 192 var str = locale.getString(id); 188 193 var ii = args.length; 189 194 for (var i = 0; i < ii; ++i) { 190 var regex = new RegExp('%' + (i + 1) + '\\$[d s]');195 var regex = new RegExp('%' + (i + 1) + '\\$[dDsS]'); 191 196 str = str.replace(regex, args[i]); 192 197 } trunk/uploadr/MacUploadr.app/Contents/Resources/chrome/content/uploadr/uploadr.js
r220 r224 29 29 30 30 // Size of thumbnails 31 thumb Size: 100,31 thumb_size: 100, 32 32 33 33 // Scrolling threshold for dragging (pixels); … … 63 63 // 64 64 65 // Maximum size of a video upload (megabytes) 66 video_max: 100, 67 65 68 // Upload mode 66 69 // Must be 'sync' or 'async' trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile
r192 r224 9 9 # 10 10 11 # Headers and libraries12 GECKO_SDK := ../gecko-sdk13 GM_INCLUDE := /usr/local/include/GraphicsMagick14 GM_LIB := /usr/local/lib15 EXIV_INCLUDE := /usr/local/include/exiv216 #EXIV_LIB := /usr/local/lib # Same as GraphicsMagick lib17 X11_LIB := /usr/X11R6/lib18 PORTS_LIB := /opt/local/lib19 XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current20 21 11 PLATFORM := $(filter mac ppc linux universal, $(MAKECMDGOALS)) 22 12 COMPONENT := $(filter gm key clh, $(MAKECMDGOALS)) 13 14 GECKO_SDK := ../gecko-sdk.$(PLATFORM) 15 GM_INCLUDE := -I/usr/local/include/GraphicsMagick 16 GM_LIB := -L/usr/local/lib 17 EXIV_INCLUDE := -I/usr/local/include/exiv2 18 EXIV_LIB := -L/usr/local/lib -L/usr/lib 19 FF_INCLUDE := -I/usr/local/include/ffmpeg 20 FF_LIB := -L/usr/local/lib 21 X11_LIB := -L/usr/X11R6/lib 22 PORTS_LIB := -L/opt/local/lib 23 XULRUNNER := ../../Frameworks/XUL.framework/Versions/Current 23 24 24 25 ifeq (mac, $(PLATFORM)) … … 68 69 gm: 69 70 ifneq (universal, $(PLATFORM)) 70 @echo "Building the GraphicsMagick XPCOM component..."71 @echo "Building the GraphicsMagick/FFmpeg XPCOM component..." 71 72 ifeq (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 \ 74 75 -m header \ 75 -I$(GECKO_SDK) .$(PLATFORM)/idl \76 -I$(GECKO_SDK)/idl \ 76 77 flIGM.idl 77 $(GECKO_SDK) .$(PLATFORM)/bin/xpidl \78 $(GECKO_SDK)/bin/xpidl \ 78 79 -m typelib \ 79 -I$(GECKO_SDK) .$(PLATFORM)/idl \80 -I$(GECKO_SDK)/idl \ 80 81 flIGM.idl 81 82 endif 82 83 g++ -w -c -O2 \ 83 84 -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) \ 87 89 $(DEFINE) \ 88 90 flGM.cpp 89 91 g++ -w -c -O2 \ 90 92 -o flGMModule.o \ 91 -I$(GECKO_SDK).$(PLATFORM)/include \ 92 -I$(GM_INCLUDE) \ 93 -I$(EXIV_INCLUDE) \ 93 -I$(GECKO_SDK)/include \ 94 94 $(DEFINE) \ 95 95 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 -ltiff112 96 g++ -dynamiclib -O2 \ 113 97 -o gm.dylib.$(PLATFORM) \ 114 98 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) \ 118 102 -L$(XULRUNNER) -Wl,-executable_path,$(XULRUNNER) \ 119 103 -lxpcomglue_s -lxpcom -lnspr4 \ 120 104 -lGraphicsMagick -lGraphicsMagick++ \ 121 -lexiv2 \105 -lexiv2 -liconv \ 122 106 -lz -lbz2 \ 123 107 -lxml2 \ 124 -ljpeg -lpng -ltiff 108 -ljpeg -lpng -ltiff \ 109 -lavformat -lavcodec -lavutil \ 110 -Wl,-read_only_relocs,suppress 125 111 else 126 @echo "Not building the GraphicsMagick XPCOM component"112 @echo "Not building the GraphicsMagick/FFmpeg XPCOM component" 127 113 endif 128 114 … … 133 119 @echo "Building the API key XPCOM component..." 134 120 ifeq (mac, $(PLATFORM)) 135 @echo "Building XPT file..."121 @echo "Building the API key XPT file..." 136 122 $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 137 123 -m header \ … … 166 152 167 153 clh: 168 @echo "Building XPT file..."154 @echo "Building the CLH XPT file..." 169 155 $(GECKO_SDK).$(PLATFORM)/bin/xpidl \ 170 156 -m typelib \ … … 174 160 175 161 176 test:177 g++ -w -c -O2 -o gm_test.o -I$(GM_INCLUDE) -I$(EXIV_INCLUDE) gm_test.cpp162 gm_test: 163 g++ -w -c -O2 -o gm_test.o $(GM_INCLUDE) $(EXIV_INCLUDE) gm_test.cpp 178 164 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) \ 182 167 -lGraphicsMagick++ -lGraphicsMagick \ 183 168 -lexiv2 \ 184 -lX11 \185 169 -lz -lbz2 \ 186 170 -lxml2 \ 187 -lXext \188 171 -ljpeg -lpng -ltiff 172 173 gm_clean: 174 rm -f gm_test gm_test.o 175 176 177 178 ff_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 192 ff_clean: 193 rm -f ff_test ff_test.o trunk/uploadr/MacUploadr.app/Contents/Resources/components/flGM.cpp
r210 r224 19 19 #include "iptc.hpp" 20 20 21 // Goofy FFmpeg requires C linkage 22 extern "C" { 23 #include <avcodec.h> 24 #include <avformat.h> 25 } 26 21 27 #include <stdlib.h> 22 #include <iostream>23 28 #include <sstream> 24 29 #include <string> … … 370 375 // On Windows there is little to do, but Macs must go from UTF-8 to UTF-16 371 376 void 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 } 372 382 char * o = (char *)path_s.c_str(); 373 383 #ifdef XP_MACOSX … … 432 442 // Get the path as a C++ string 433 443 path_s = conv_path(path, false); 434 if ( 0 ==path_s) {444 if (!path_s) { 435 445 return NS_ERROR_INVALID_ARG; 436 446 } … … 520 530 bh = img.baseColumns(); 521 531 } 522 int base = bw > bh ? bw : bh;532 // int base = bw > bh ? bw : bh; 523 533 out1 << bw << "###" << bh << "###"; 524 534 … … 534 544 535 545 // Thumbnail width and height 536 float r;537 546 ostringstream dim; 538 547 if (bw > bh) { 539 r = (float)bh * (float)square / (float)bw;548 float r = (float)bh * (float)square / (float)bw; 540 549 out1 << square << "###" << round(r); 541 550 dim << square << "x" << round(r); 542 551 } else { 543 r = (float)bw * (float)square / (float)bh;552 float r = (float)bw * (float)square / (float)bh; 544 553 out1 << round(r) << "###" << square; 545 554 dim << round(r) << "x" << square; … … 568 577 // Create a new path 569 578 thumb_s = find_path(path_s, "-thumb"); 570 if ( 0 ==thumb_s) {579 if (!thumb_s) { 571 580 return NS_ERROR_NULL_POINTER; 572 581 } … … 579 588 580 589 // 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 // } 589 598 590 599 // Create the actual thumbnail 591 600 img.scale(dim.str()); 592 img.sharpen(1, sigma);601 // img.sharpen(1, sigma); 593 602 img.compressType(Magick::NoCompression); 594 603 img.write(*thumb_s); … … 642 651 643 652 path_s = conv_path(path, false); 644 if ( 0 ==path_s) {653 if (!path_s) { 645 654 return NS_ERROR_INVALID_ARG; 646 655 } … … 658 667 // Create a new path 659 668 rotate_s = find_path(path_s, "-rotate"); 660 if ( 0 ==rotate_s) {669 if (!rotate_s) { 661 670 return NS_ERROR_NULL_POINTER; 662 671 } … … 707 716 try { 708 717 path_s = conv_path(path, false); 709 if ( 0 ==path_s) {718 if (!path_s) { 710 719 return NS_ERROR_INVALID_ARG; 711 720 } … … 763 772 // Create a new path 764 773 resize_s = find_path(path_s, "-resize"); 765 if ( 0 ==resize_s) {774 if (!resize_s) { 766 775 return NS_ERROR_NULL_POINTER; 767 776 } … … 807 816 808 817 } 818 819 NS_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 17 17 AString rotate(in long degrees, in AString path); 18 18 AString resize(in long square, in AString path); 19 AString keyframe(in long square, in AString path); 19 20 }; trunk/uploadr/MacUploadr.app/Contents/Resources/components/gm_test.cpp
r149 r224 10 10 #include "iptc.hpp" 11 11 12 #include "nsStringAPI.h"12 //#include "nsStringAPI.h" 13 13 14 14 using namespace std; trunk/uploadr/Makefile
r220 r224 9 9 # 10 10 11 INTL := $(filter de-de en-US es-us fr-fr it-it ko-kr pt-br zh-hk, $(MAKECMDGOALS)) 12 ifeq (de-de, $(INTL)) 13 INTL_SHORT := de 14 endif 15 ifeq (en-US, $(INTL)) 16 INTL_SHORT := en 17 endif 18 ifeq (es-us, $(INTL)) 19 INTL_SHORT := es 20 endif 21 ifeq (fr-fr, $(INTL)) 22 INTL_SHORT := fr 23 endif 24 ifeq (it-it, $(INTL)) 25 INTL_SHORT := it 26 endif 27 ifeq (ko-kr, $(INTL)) 28 INTL_SHORT := kr 29 endif 30 ifeq (pt-br, $(INTL)) 31 INTL_SHORT := br 32 endif 33 ifeq (zh-hk, $(INTL)) 34 INTL_SHORT := hk 35 endif 36 37 # The base of this path (everything up to INTL) must exist before running make 38 PKG := ~/Desktop/build/$(INTL) 39 40 # Version number for Uploadr 11 41 VER := 3.0.5 42 43 # Location of Mozilla tree 44 MOZILLA := ~/mozilla 45 12 46 SRC := MacUploadr.app/Contents 13 PKG := ~/Desktop/build 14 BUILD := $( PKG)/Flickr\ Uploadr.app/Contents47 APP := $(PKG)/Flickr\ Uploadr.app 48 BUILD := $(APP)/Contents 15 49 GM_VER := 1.1.10 16 50 17 INTL := $(filter de-de en-US es-us fr-fr it-it ko-kr pt-br zh-hk, $(MAKECMDGOALS))18 19 51 all: 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 22 68 23 69 de-de: … … 47 93 build: 48 94 95 # Saving the previous version 96 rm -rf $(PKG)/old 97 mv $(APP) $(PKG)/old 98 49 99 # Package structure 50 rm -rf $(PKG)51 mkdir $(PKG)52 100 mkdir $(PKG)/Flickr\ Uploadr.app 53 101 ln -s /Applications $(PKG)/Applications … … 120 168 cp $(SRC)/Resources/components/*.js $(BUILD)/Resources/components/ 121 169 122 # Record this build for posterity123 rm -rf ~/Desktop/builds/$(INTL)/*124 cp -R $(PKG)/Flickr\ Uploadr.app ~/Desktop/builds/$(INTL)/125 126 170 # Copy to DMG 127 171 cp -R $(PKG)/* /Volumes/Flickr\ Uploadr\ $(VER)/ … … 129 173 /Volumes/Flickr\ Uploadr\ $(VER)/.i.png 130 174 ln -s .i.png /Volumes/Flickr\ Uploadr\ $(VER)/i.png 175 176 mar: 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 3 3 4 4 5 Expand gm.thumb to return the date taken as well for use in sorting6 MySQL format would be nice, as that is string-sortable7 8 5 Offer a preference to not create thumbnails in the name of speed 9 Accomplish this with special case param of thumb Size = 0 to gm.thumb6 Accomplish this with special case param of thumb_size = 0 to gm.thumb 10 7 This will still return the date taken but will not actually do the thumbing 11 12 As of 8-21-200713 Thumbing 127 8 MP JPEGs14 Uploadr 3 Mac 97 seconds15 Uploadr 3 Win 278 seconds16 Uploadr 2.5 Win 312 seconds17 18 19 20 9-7-2007 meeting with Gino & Stewart21 22 Make sure it's smart when network drops23 *** Partial batch tagging - tag a >1 photo selection all at once - append to individual tags24 Tooltips on toolbar buttons25 Save state of unuploaded photos on exit26 Tabs for batches (two total - the uploading batch and the editing batch)27 When you start upload, create a new tab for the next batch28 jUploadr/Chronic style photo progress indication29 User must DO SOMETHING to get to the new batch once uploading starts (button to switch tabs)30 Ordering options instead of a default31 Date taken (fallback to alpha if date taken not available)32 Let me order them33 Reverse the current thing34 35 Twiki page!36 37 Look into embedding Flash into the Uploadr - Picnik38 39 40 41 Drag selecting photos42 I couldn't figure out any way other than hardcoding the offsets to make the box actually43 track the cursor. document.getElementById('photos').offsetTop isn't set?!44 45 46 47 9-12-2007 meeting with Gino & Stewart48 49 Partial batch metadata50 Overwrite titles always51 Append to description always (prefix with \n\n)52 Could have a pref for append/overwrite for description - nah53 Confirmation on clicking save54 *** Make blank title or description not overwrite each photo ***55 Do all partial batches like the changed_* checks in settings.js56 "Leave unchanged" checkbox for privacy metadata that unchecks if they change something57 Re-adding to a batch after failure58 Preserve order in the queue, which is the order they wanted59 Add add-to-set option for each photo and for partial batches60 Nix the per-photo resize options61 8 62 9 … … 133 80 134 81 135 Rough speed tests 2007-10-31136 Thumbing 7 photos137 Uploadr 2.3 Mac 3s138 Uploadr 3.0 Mac 5s139 Uploadr 2.3 PPC 7s140 Uploadr 3.0 PPC s141 Uploadr 2.5 Win 7s142 Uploadr 3.0 Win 13s143 144 145 146 82 Files changed in my hacked up XULRunner locales 147 83 locale/xx-xx/global/dialog.properties 148 84 locale/xx-xx/global/wizard.dtd 149 85 locale/xx-xx/mozapps/update/* 86 87 88 89 Errors building FFmpeg into XPCOM: 90 91 ld: 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 119 ld: 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 138 Software Update 139 140 Partials are broken. Eh. 141 142 143 trunk/uploadr/README
r182 r224 175 175 176 176 177 FFmpeg 178 ------------------------------------------------------------------------ 179 180 Windows 181 ------- 182 183 ? 184 185 Mac 186 --- 187 188 This 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 193 This 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 198 This configure line is no change over the above. Additionally, using 199 the '-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 205 Found 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 217 The issue lies in -mdynamic-no-pic, which is used (and needed?) to build 218 ffmpeg. ff_test will build when flGM will not because -mdynamic-no-pic 219 can't be used to build shared libraries. 220 221 People working on Blender seem to have similar issues so I'm going to 222 try 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 231 That doesn't work - I get the same %ebx error as above. 232 233 After again asking the smarter people on #xulrunner, I started from 234 scratch 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 177 245 Building XPCOM components 178 246 ------------------------------------------------------------------------ … … 199 267 ------------------------------------------------------------------------ 200 268 201 Win 202 --- 269 Windows 270 ------- 203 271 204 272 On Windows, there is very little left to be done. The root of your … … 215 283 On Mac, the app can be launched by double-clicking on MacUploadr.app 216 284 in Finder. 285 286 287 288 Software Update Service 289 ------------------------------------------------------------------------ 290 291 Windows 292 ------- 293 294 ? 295 296 Mac 297 --- 298 299 Info on how to build MAR files is here: 300 301 http://wiki.mozilla.org/Software_Update:HowToManuallyGenerateMARFiles 302 303 Start with your mozconfig file, XULRunner style: 304 305 http://developer.mozilla.org/en/docs/XULRunner:Build_Instructions 306 307 Then a regular Mozilla build environment, following these: 308 309 http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites 310 311 Altogether, 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 325 There 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