<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mac Daddy World &#187; Cocoa</title>
	<atom:link href="http://macdaddyworld.com/category/cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://macdaddyworld.com</link>
	<description>Stand back, here come the MacDaddies from Ecamm Network</description>
	<lastBuildDate>Tue, 26 Jan 2010 18:14:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adventures in Cocotron</title>
		<link>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/</link>
		<comments>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 17:17:19 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=139</guid>
		<description><![CDATA[The Promise
The promise of Cocotron is a big one.  Wrote a Cocoa app?  Just add a new Xcode target, hit compile and out shoots a Windows version.  Your mountains of Objective-C code now cross compiles and is no longer stranded on the Mac.  You put your feet up, having just shipped [...]]]></description>
			<content:encoded><![CDATA[<p><B>The Promise</B></p>
<p><a href="http://www.cocotron.org/"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/logo.png" alt="" title="" width="40" height="40" class="alignright size-medium wp-image-182" /></a>The promise of <A HREF="http://www.cocotron.org">Cocotron</A> is a big one.  Wrote a Cocoa app?  Just add a new Xcode target, hit compile and out shoots a Windows version.  Your mountains of Objective-C code now cross compiles and is no longer stranded on the Mac.  You put your feet up, having just shipped a Windows app without ever touching a PC.  Your cat brings you a freshly brewed cup of coffee.  Read on for our journey from app to exe.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://click.linksynergy.com/fs-bin/click?id=bsOvCD5lW5Y&#038;offerid=146261.682077289&#038;type=10&#038;subid=http://click.linksynergy.com/fs-bin/click?id=bsOvCD5lW5Y&#038;offerid=146261.682077289&#038;type=10&#038;subid="><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/nice_app.png" alt="" title="" width="412" height="66" class="alignnone size-full wp-image-181" /></a></p>
<p><B>The Goal</B></p>
<p>Back in August, we decided that we should have a Windows version of our <A HREF="http://www.filemagnetapp.com">FileMagnet Uploader</A>, a Mac application which connects to the iPhone via Bonjour and moves files back and forth between the desktop and our FileMagnet iPhone app.  If you&#8217;ve been in this situation before, you know how much fun a line-by-line Windows port can be.  Not only do you have to spend weeks hunched over Visual Studio, re-writing your entire program in a different language, but when you&#8217;re done you now have two separate code bases to manage.  When a friend recommended that we check out Cocotron as an alternative, we were quite skeptical but agreed to try it out.</p>
<p><B>The Proof</B></p>
<p><a href="http://macdaddyworld.com/wp-content/uploads/2008/10/sidebyside_full.png"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/sidebyside.png" alt="" title="sidebyside" width="460" height="339" class="alignnone size-full wp-image-153" /></a></p>
<p>Skip forward two months.  We are now shipping a Windows version of our <A HREF="http://www.filemagnetapp.com">FileMagnet Uploader</A>, built completely with Xcode from the same source files as the Mac version.  Visual Studio was never opened.  But wait&#8230; 2 months?</p>
<p><B>The Details</B></p>
<p>Let&#8217;s back up a bit. What is <a href="http://cocotron.org/">Cocotron</a>?  I&#8217;ll quote from the website:<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>&#8220;The Cocotron is an open source project which aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.&#8217;s Cocoa documentation. This includes the AppKit, Foundation, Objective-C runtime and support APIs such as CoreGraphics and CoreFoundation.&#8221;</TD></TR></TABLE></p>
<p>In addition to this, you get a modified version of the gcc toolchain, allowing all this to be done from your Mac.  The project has an <A HREF="http://www.cocotron.org/Info/MIT_License">MIT License</A>.</p>
<p>It&#8217;s important to point out that Cocotron is targeting more than just Windows.  All of the platform specific code is nicely abstracted using a bridge pattern. The Foundation project is implemented for linux too.</p>
<p><B>Cross Platform?</B></p>
<p>Let&#8217;s back up even more&#8230;</p>
<p>Get a couple of Mac software engineers together around a table of Chinese food and eventually they&#8217;ll start to debate the best way to do a cross-platform app.  Usually, the nicest results come from using a combination of a cross-compiling core and platform specific UI code (a la  Safari, Skype, PhotoShop, etc.)  Anyone who&#8217;s tried to use most cross-compiling UI libraries knows that eventually what you end up with is an app that&#8217;s ugly and unruly on both platforms. At least with Cocotron, you end up with a beautiful Mac app, and hey, Windows apps are kind of ugly anyway so there&#8217;s no loss there.</p>
<p>Cocotron&#8217;s potential usefulness extends beyond user interface.  It also includes a reimplementation of the <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Intro/IntroFoundation.html">Foundation framework</a>. Foundation provides the powerful data structures, string handling, threading, I/O, etc., which is what makes Cocoa great for rapidly and robustly coding an app&#8217;s core logic.  It would be a shame to have to use C++ for an app&#8217;s core instead of Foundation just because you need it to be cross platform.  I can imagine a cross platform app which combines an Objective-C core (using Cocotron&#8217;s port of Foundation) with separate Mac and Windows native UI implementations.</p>
<p><B>Back to Cocotron</B><br />
<a href="http://macdaddyworld.com/wp-content/uploads/2008/10/target.png"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/target.png" alt="" title="target" width="225" height="81" class="alignright size-full wp-image-164" /></a><br />
Simply follow the instructions to install Cocotron. Now, eagerly add the new Windows target to your Xcode project. Now, hit compile.  Now, wait while the errors pile up like  fan-boys at the Apple Store on a release day.</p>
<p>What&#8217;s wrong?  Whoops! It turns out that your app isn&#8217;t only Cocoa after all.  Okay, I&#8217;ll wait here while you go and #ifdef out all of that Mac specific code.  That&#8217;s right&#8230; go find all the Carbon and other Mac-only routines (any Frameworks you&#8217;re using outside of Cocoa, such as AddressBook, CoreData, IOKit, CoreAudio, etc.)  You&#8217;ll have to figure out how to port that stuff later. </p>
<p>Once your app is compiling, you&#8217;ll quickly realize that some methods appear at first glance to exist, but are actually just stubbed out for future implementation.  Ever want to implement a Cocoa class method?  Here&#8217;s your chance!</p>
<p><b>The Reality</b></p>
<p>The majority of Cocotron is spot-on brilliant, but here are some examples of the kind of things that we did to get FileMagnet up and running on Windows:</p>
<p>• Added unicode path support to the NSFileManager class.<br />
• Added support for displaying truncated strings.<br />
• Added support for drawing unicode strings.  (Not very pretty support.)<br />
• Fixed some issues with the NSSocket implementation.<br />
• Worked around or fixed a number of UI bugs. (It was similar to trying to get a Cocoa UI to look right in both OS X 10.4 and 10.5.)<br />
• Since Cocotron is not a complete implementation, we had to implement some methods ourselves, filling in the Windows implementation of the required Cocoa routines.  A few examples:<br />
   &#8211; [NSPropertyList dataFromPropertyList:] (for binary property lists)<br />
   &#8211; [NSImage TIFFRepresentation]<br />
   &#8211; [NSFileManager subpathsAtPath:]<br />
   &#8211; [NSWorkspace iconForFile:]<br />
   &#8211; [NSMutableString replaceOccurrencesOfString:withString:option:]<br />
• Additionally, Ken posted a few issues/requests to the <A HREF="http://groups.google.com/group/cocotron-dev/">Cocotron Google Group</A>, and the team responded amazingly fast; they even implemented some functionality that we needed.</p>
<p>Now that the app has shipped, we&#8217;ll be merging our additions and fixes back into the Cocotron project as soon as possible.</p>
<p>The primary shortcoming of the Cocotron project may be the lack of a flagship product to drive the effort.  It became apparent once we started the port, that the creators weren&#8217;t actively using it to create a shipping application.  For comparison, take the <a href="http://cappuccino.org/">Cappuccino</a> project.  They&#8217;re drinking their own Cocoa by using their new framework to make the awesome <a href="http://280slides.com/">280 Slides</a> presentation tool.  Cocotron desperately needs something in this vein to flush out bugs and unearth crucial but missing functionality.</p>
<p><b>I&#8217;m a PC</b></p>
<p>It&#8217;s true that we do build our app from Xcode, but we still needed to have Windows around for actually running, debugging and testing the app.  However, in this day and age you don&#8217;t need to hop to a different machine.  We simply used <A HREF="http://www.vmware.com/products/fusion/">VMware Fusion</A>.  </p>
<p>One unexpected bonus was the ability to do source-level debugging of our Cocotron app.  The website provides detailed step-by-step <A HREF="http://www.cocotron.org/Tools/Debugging/Insight-GDB">instructions</A> for installing Insight-GDB.  Once it&#8217;s all set up, just one click has you stepping through your Objective-C code on the Windows system.  You can even step into the Cocotron framework&#8217;s source.  (Don&#8217;t you wish you could do that with Cocoa?)</p>
<p>Also, I should point out that Windows users expect an installer, so you still do have to sit down on Windows and figure out how Windows installers and code signing work.  Finally, don&#8217;t forget to struggle through Vista compatibility.  Our app didn&#8217;t exactly work like a dream the first time we tried Vista.  In fact, it didn&#8217;t even install.</p>
<p><B>Cocotron Evolution</B></p>
<p>Today we asked Cocotron co-creator Chris Lloyd about what the team has in store for us:<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>&#8220;Cocotron development going forward will continue to focus on the needs of developers who use the project.  This will revolve around completion of the existing frameworks and the addition of more frameworks. Some of the larger pieces under active development are a complete high quality Quartz 2D (CoreGraphics) rasterizer, AppKit support on Linux via X11 and a Windows cross-debugger which works with Xcode. There has been interest and some work on CoreData so hopefully we can expand on that component too. The more people use it, report bugs and submit patches the better it will become.&#8221;</TD></TR></TABLE></p>
<p>It&#8217;s amazing what this team has been able to accomplish, and it sounds like they&#8217;ll continue to crank out new goodness.</p>
<p><b>In Conclusion</b></p>
<p>Good stuff, but be prepared to roll up your sleeves and join in the fun!  But as Geordi La Forge would say, you don&#8217;t have to take our word for it. Try it out yourself!  Our next Cocotron adventure will be a breeze now that we&#8217;ve fought through the jungle and know just what to expect.  Expect it to work, but don&#8217;t expect it to be super fun.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F10%2F27%2Fadventures-in-cocotron%2F';
  addthis_title  = 'Adventures+in+Cocotron';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Iron Coder Live: PoorLocation!</title>
		<link>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/</link>
		<comments>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 02:49:03 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[c4]]></category>
		<category><![CDATA[ironcoder]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=93</guid>
		<description><![CDATA[We&#8217;re just back from C4[2].  Fantastic speakers and loads of Mac nerdery made for an amazing weekend trip to Chicago. The most unexpected part of the weekend for us was winning the Sunday contest.  Having won Iron Coder Live last year, we weren&#8217;t planning on entering again—that is, until we found out about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rentzsch.com/c4/twoOpen/"><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/c4glasses.png" alt="" title="c4glasses" width="172" height="133" class="alignright size-full wp-image-114" /></a>We&#8217;re just back from <A HREF="http://rentzsch.com/c4">C4[2]</A>.  <A HREF="http://rentzsch.com/c4/twoOpen">Fantastic speakers</A> and loads of Mac nerdery made for an amazing weekend trip to Chicago. The most unexpected part of the weekend for us was winning the Sunday contest.  Having won Iron Coder Live <A HREF="http://www.engadget.com/2007/08/13/mirror-based-video-conferencing-developed-for-iphone/">last year</A>, we weren&#8217;t planning on entering again—that is, until we found out about the <A HREF="http://rentzsch.com/c4/2IronCoderPrizes">amazing prize package</A>.  If there&#8217;s anything you can never have enough of, it&#8217;s Macs&#8230; and software to load onto them.  If you weren&#8217;t there to watch, the entry is a bit difficult to describe but here goes.</p>
<p>In the spirit of the contest, we procrastinated until late Thursday afternoon and hatched a plan in a Starbucks-fueled brainstorm. (The employees at Starbucks are thoroughly convinced that we have no job.)</p>
<p>We had some Core Location-related ideas, but they would have involved lots of running around Chicago with iPhones, and since Wolf had given explicit permission to deviate from the theme &#8220;if the hack was cool enough&#8221;, we decided not to go the Core Location route.  Once we came up with the stupidest idea on the planet, we headed out to buy Radio Shack&#8217;s last four remaining infrared LEDs and some tiny calculator batteries.</p>
<p><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/leds.jpg" alt="" title="LED and battery taped to iPhone" width="153" height="184" class="alignright size-medium wp-image-117" />Six hours later, we had our hack ready:  Using the <A HREF="http://sourceforge.net/projects/darwiin-remote/">WiiRemote.framework</A> and some Apple sample code, we created a Mac app which could track infrared light sources using a Bluetooth link to a Wii Remote to draw colorful lines on the Mac screen.  We also added an HTTP server using Cultured Code&#8217;s <A HREF="http://culturedcode.com/cocoa/">Simple HTTP Server</A> Cocoa project.  We then created an iPhone application to send HTTP requests to the Mac via Wifi.  These requests controlled what kind of &#8220;artwork&#8221; would be generated by the Mac application.  (Line color, thickness, etc.)  As a finishing touch, we taped the infrared LEDs and batteries to the front of the iPhone.  This allowed for a &#8220;digital whiteboard&#8221; effect.  By pressing button on the iPhone&#8217;s cool UI and waving it around in a drawing motion, we were able to paint designs in the Mac program.</p>
<p><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/phoneapp1.png"/><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/phoneapp2.png"/></p>
<p>Friday was something of a blur and no work happened on the hack.  I think I signed up for <A HREF="http://twitter.com/pimpinglen">Twitter</A> at some point.  Tweet.</p>
<p>Saturday afternoon, we decided that we needed a &#8220;clincher&#8221; feature.  A new mode was added to the application (using a UITabBarController of course) which allowed for the positioning and stamping of image files.  We also added iPhone X-axis accelerometer data to the mix to allow for rotating of the stamped images by simply twisting the iPhone.</p>
<p>The next 24 hours was spent trying to decide what images we would use.  We finally decided on Ken and Glen heads, tinfoil hats, nose glasses and fake moustaches, inspired by Josh and Dave&#8217;s <A HREF="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?mt=8&#038;id=284880416">Mr. Shuffle</A> app, and the &#8220;paranoia&#8221; theme.</p>
<p><IMG SRC="http://macdaddyworld.com/wp-content/uploads/2008/09/macapp.png"></p>
<p>After spending Sunday morning in Photoshop lassoing fake moustaches, the live demo was a complete disaster.  We positioned the Wii remote too far away from the Mac for the Bluetooth link to function, and our iPhones randomly jumped from out of our ad-hoc network to the conference network midway through the demo.  Much awkwardness was <A HREF="http://twitter.com/c4/statuses/913116184">twittered</A>.  </p>
<p>In the end, we somehow managed to take first place. Thanks for your votes, and thanks to all of the companies who donated software and t-shirts!</p>
<p>Here&#8217;s the <A HREF="http://macdaddyworld.com/wp-content/uploads/2008/09/poorlocation1.zip">source</A> (875k) for our hack including Mac and iPhone projects.  You&#8217;ll need Xcode 3.1, iPhone SDK and the <A HREF="http://sourceforge.net/projects/darwiin-remote/">WiiRemote.framework</A> if you would like to build it.  You&#8217;ll also need infrared LEDs&#8230; and tape&#8230;</p>
<p><I>Known issues:</I> HTTP did not prove to be the best way to send rapid-fire requests from the iPhone to the Mac.  The iPhone&#8217;s HTTP request system seems to freeze up if we send requests too quickly.  Also, the IP address of the Mac server is hardcoded into the iPhone app for extra credit laziness.  </p>
<p><i>One more thing:</i> This code was mashed together in a few hours, and just barely.  It contains some nasty bits and should not be used as an example of proper or efficient Cocoa programming!</p>
<p>So will anyone actually try this themselves?  Let us know if you do!</p>
<div id="attachment_132" class="wp-caption center" style="width: 510px"><a href="http://macdaddyworld.com/wp-content/uploads/2008/09/output.jpeg"><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/output.jpeg" alt="Actual Program Output" title="Actual Program Output" width="500" height="389" class="size-full wp-image-132" /></a><p class="wp-caption-text">Actual Program Output</p></div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F09%2F08%2Firon-coder-live-poorlocation%2F';
  addthis_title  = 'Iron+Coder+Live%3A+PoorLocation%21';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sneak Preview: iPhoneCam</title>
		<link>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/</link>
		<comments>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 19:06:56 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/</guid>
		<description><![CDATA[Abstract:
Use your iPhone&#8217;s camera as a wireless Mac webcam!  Stream video over Wi-Fi to any Mac video application such as iChat, Photo Booth or Skype.Some History:
After the C4 Iron Coder contest where we made the video conferencing iPhone app, we put down our iPhones and got back to writing Mac software for the rest [...]]]></description>
			<content:encoded><![CDATA[<p><b>Abstract:</b></p>
<p>Use your iPhone&#8217;s camera as a wireless Mac webcam!  Stream video over Wi-Fi to any Mac video application such as iChat, Photo Booth or Skype.<br /><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/meekus.thumbnail.jpg' alt='meekus.jpg' class="alignright" /><br /><b>Some History:</b></p>
<p>After the <a href="http://rentzsch.com/c4/">C4</a> Iron Coder contest where we made the <a href="http://macdaddyworld.com/2007/08/15/hooray-for-sample-app/">video conferencing iPhone app</a>, we put down our iPhones and got back to writing <a href="http://www.ecamm.com/">Mac software</a> for the rest of year.  Nobody knew, and we still don&#8217;t know, what the future of these iPhone apps would and will hold.</p>
<p>Last week I had a strange urge to get back on the iPhone again and solve some problems that had left us stumped this summer.  More specifically, I wanted to get <b>streaming video from the camera</b>. (If you remember our video demo at C4, the frame rate was quite low. This was because, under the strict time limit of the conferece, we weren&#8217;t able to grab from the camera any faster than a frame or two per second.)</p>
<p><b>Meet iPhoneCam:</b></p>
<table align=right border=0 width=128 hspace=10>
<tr>
<td><a target="_new" href="http://www.youtube.com/watch?v=XnNcsdAmpaA"><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/clipping.thumbnail.jpg' alt='clipping' / BORDER=0></a></td>
</tr>
<tr>
<td><font size=-2>Click to <A target="_new" HREF="http://www.youtube.com/watch?v=XnNcsdAmpaA">download a recording</A> of an iChat video conference where I demo it to Glen.  </font></td>
</tr>
</table>
<p>I figured it out: Now we can stream at up to 30 fps.  My proof-of-concept is an iPhone app which <b>streams video over Wi-Fi</b> to a video driver component on the Mac.  This way, you can use the iPhone&#8217;s camera stream in any Mac video program like iChat, Photo Booth or Skype.  </p>
<p>Using <a href="http://www.ecamm.com/mac/ichatusbcam/">iChatUSBCam</a> (so that iChat can see non-iSight video sources), I did a video conference with Glen to show him how it looks.  He recorded it with <a href="http://www.ecamm.com/mac/conferencerecorder/">Conference Recorder</a> so that we could share it on the blog. You can <a target="_new" href="http://www.youtube.com/watch?v=XnNcsdAmpaA">download a demo video here</a>.</p>
<p>But I haven&#8217;t gotten to the clever bit yet. </p>
<p><b>The Clever Bit:</b></p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/images.jpeg' alt='bonjour' class="alignright"/>The iPhone app and the Mac component find each other using Bonjour (zeroconf).  There&#8217;s absolutely no configuration necessary.  If there&#8217;s an iPhone-based camera available, the Mac finds it and uses it automatically.  Glen had the idea to see if Bonjour could be used, and we noticed that <a href="http://poly.share.dj/wiki/index.php/Bonjour">IDMResearch</a> had already provided a nice wrapper around CFNetService.</p>
<p>FAA: (Frequently Answered Answers)</p>
<p>A: No, it only streams video.</p>
<p>A: No, it&#8217;s only for Mac users.</p>
<p>A: iPhoneCam is not yet available to download. We&#8217;ll have something for folks to try soon.  Stop by <A HREF="http://www.ecamm.com/mwsf08/">our booth at MacWorld Expo</A> and maybe we can give you a live demo!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F01%2F12%2Fsneak-preview-iphonecam%2F';
  addthis_title  = 'Sneak+Preview%3A+iPhoneCam';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Caption Crunch</title>
		<link>http://macdaddyworld.com/2007/12/31/caption-crunch/</link>
		<comments>http://macdaddyworld.com/2007/12/31/caption-crunch/#comments</comments>
		<pubDate>Mon, 31 Dec 2007 20:54:24 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/2007/12/31/caption-crunch/</guid>
		<description><![CDATA[From the Fun But Not Entirely Useful Department comes:



Instead of showing the time on the top of your iPhone or iPod Touch, why not put your own message?  
This Mac app will work on any iPhone or iTouch (no hacking required).
Instructions:

Have a Mac.
Download: Caption Crunch.
Run the app.
Connect your iPhone or iTouch.
Enter a message.
Click &#8220;Set [...]]]></description>
			<content:encoded><![CDATA[<p>From the Fun But Not Entirely Useful Department comes:<br />
<br />
<img src='http://macdaddyworld.com/wp-content/uploads/2007/12/picture-15.png' alt='Caption Crunch' /><br />
<br />
Instead of showing the time on the top of your iPhone or iPod Touch, why not put your own message?  </p>
<p>This Mac app will work on any iPhone or iTouch (no hacking required).</p>
<p>Instructions:</p>
<ol>
<li>Have a Mac.</li>
<li>Download: <a href="/CaptionCrunch.zip">Caption Crunch</a>.</li>
<li>Run the app.</li>
<li>Connect your iPhone or iTouch.</li>
<li>Enter a message.</li>
<li>Click &#8220;Set Message&#8221;.</li>
<li>Your iPhone will say &#8220;Restore in Progress&#8221; and may or may not reboot. Wait for it.</li>
</ol>
<p>If it doesn&#8217;t work, just try again.  You can always go back to showing the time using the other button.</p>
<p><b>Download:</b> v1.0: <a href="/CaptionCrunch.zip">Caption Crunch</a> (340K).</p>
<p><TABLE BORDER=0 CELLPADDING=15 CELLSPACING=0><TR><TD BGCOLOR="#FCFFC4"><B>Update:</B> In response to a <A HREF="http://www.tuaw.com/2008/01/10/tuaw-responds-ecamm-to-the-rescue/">user request</A>, we&#8217;ve built an alternate version that changes the carrier string (e.g. AT&#038;T) instead of the time.  Here&#8217;s the link: <A HREF="/CaptionCrunchCarrierString.zip">CaptionCrunchCarrierString.zip</A> (344K).</TD></TR></TABLE></p>
<p><b>DISCLAIMER:</b> This is just for fun and completely at your own risk.  <i>It&#8217;s unlikely to cause any problems, but if it does, we won&#8217;t be able to help.</i></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F12%2F31%2Fcaption-crunch%2F';
  addthis_title  = 'Caption+Crunch';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/12/31/caption-crunch/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>I ♥ DockStar v2.1</title>
		<link>http://macdaddyworld.com/2007/12/27/i-%e2%99%a5-dockstar-v21/</link>
		<comments>http://macdaddyworld.com/2007/12/27/i-%e2%99%a5-dockstar-v21/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 20:21:56 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/2007/12/27/i-%e2%99%a5-dockstar-v21/</guid>
		<description><![CDATA[We rolled out a cool new version of DockStar on Christmas day.  The feature everyone&#8217;s talking about is the clickable indicators in the menu bar.  
Before I was even finished coding this feature, I already knew I couldn&#8217;t live without it.  Glen used more explicit terms; something leading to him and the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ecamm.com/mac/dockstar/"><img src='http://macdaddyworld.com/wp-content/uploads/2007/12/picture-12.png' alt='DockStar v2.1' class="alignright" border=0 /></a>We rolled out a cool <a href="http://www.ecamm.com/mac/dockstar/">new version of DockStar</a> on Christmas day.  The feature everyone&#8217;s talking about is the <b>clickable indicators in the menu bar</b>.  </p>
<p>Before I was even finished coding this feature, I already knew I couldn&#8217;t live without it.  Glen used more explicit terms; something leading to him and the new feature having babies.</p>
<p>In short, you can see unread counts for any mailbox or folder up in the status area, and a simple click on the indicator pops open Mail.app and brings up the right mailbox.  This was a requested feature from DockStar fans. (We get a lot of our best ideas from customers.)  It&#8217;s not limited to unread counts either: You can set each indicator to count flagged messages, total message counts, and even monitor Smart Mailboxes.</p>
<p><a href="http://www.ecamm.com/mac/dockstar/"><img src='http://macdaddyworld.com/wp-content/uploads/2007/12/todo_options.jpg' alt='todos' class="alignright" border=0 /></a>This upgrade brings many new features for Leopard users.  <b>If you use To Do items in Mail.app or Calendar.app, you can use DockStar to monitor the number of incomplete To Dos.  You can also count Notes or even keep track of unread RSS feed items.</b></p>
<p>The DockStar Dashboard Widget also got some improvements. You can now click on the widget to jump right into the relevant mailbox.  </p>
<p>If you&#8217;re a serious emailer, and you&#8217;ve never tried DockStar, you should try the <a href="http://www.ecamm.com/mac/dockstar/">free trial</a>, but be warned: Afterwards, you won&#8217;t be able to live without it.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F12%2F27%2Fi-%25e2%2599%25a5-dockstar-v21%2F';
  addthis_title  = 'I+%E2%99%A5+DockStar+v2.1';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/12/27/i-%e2%99%a5-dockstar-v21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There&#8217;s Something About Input Managers</title>
		<link>http://macdaddyworld.com/2007/11/06/theres-something-about-input-managers/</link>
		<comments>http://macdaddyworld.com/2007/11/06/theres-something-about-input-managers/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 03:39:58 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=43</guid>
		<description><![CDATA[In brief, an Input Manager is a plugin architecture in Cocoa, originally intended as a way to provide alternative text input methods to NSTextViews.  Whenever a Cocoa application launches, it loads all the Input Managers that it finds in the InputManagers folders.  Apple provides sample code with their dev tools for making an [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/11/bundle.jpg' alt='Bundle' class="alignright" />In brief, an Input Manager is a plugin architecture in Cocoa, originally intended as a way to provide alternative text input methods to NSTextViews.  Whenever a Cocoa application launches, it loads all the Input Managers that it finds in the InputManagers folders.  Apple provides sample code with their dev tools for making an Input Manager called HexInputServer.</p>
<p>Input Manager plugins are now commonly used as a quick and easy way to make plugins for any Cocoa app.  At Ecamm, we use a single simple Input Manager, which loads any of our plugins that you have installed such as <a href="http://ecamm.com/mac/dockstar/">DockStar</a>, <a href="http://ecamm.com/mac/iglasses/">iGlasses</a>, or <a href="http://ecamm.com/mac/callrecorder/">Call Recorder</a> into their appropriate applications.  </p>
<p><b>The Mark Twain Effect</b></p>
<p>We received a lot of emails in the months leading up to Leopard with people asking, &#8220;Hey, I heard Input Managers are not going to work in Leopard. <img src='http://macdaddyworld.com/wp-content/uploads/2007/11/death.jpg' alt='paul' class="alignleft" /> What are you going to do?&#8221;  I don&#8217;t know where they heard this, because at no point in the many Leopard pre-releases did Apple completely remove Input Manager support.  In short, <b>rumors of their death were greatly exaggerated.</b>  </p>
<p>We worked our butts off and on October 26th, when the final release of OS X 10.5 rolled off the factory floor, all of our Input Manager-based plugins were ready for Leopard and working quite well.  </p>
<p><b>The Truth About Input Managers</b></p>
<p>So what&#8217;s the deal, what are we doing about it you might ask?<br />
<img src='http://macdaddyworld.com/wp-content/uploads/2007/11/images.jpg' alt='sharp edges' class="alignright" /><br />
In response to security concerns about InputManagers, Apple decided to place a whole slew of new restrictions on whether or not to allow them to load into apps.  These restrictions are very briefly summarized in the <A href="http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSInputManager">10.5 AppKit Release Notes</a>, and I&#8217;ll excerpt that here:</p>
<ol>
<li> The valid installation is now restricted to the /Library/InputManagers folder only. Bundles in other locations are silently ignored.</li>
<li> All the files in the bundle and /Library/InputManagers folder itself must be owned by the root user and admin group. No files inside the bundle can have group or other write permissions.</li>
<li> Processes running with the root privilege (getuid() == 0 or geteuid() == 0) cannot load any bundle input manager.</li>
<li> Processes running with the wheel group privilege cannot load any bundle input manager.</li>
<li> The process must be in the active workspace session at the time of loading the bundles.</li>
<li> The process must not be tainted by changing user or group id (checked by issetugid()).</li>
<li> No 64-bit processes can load any bundle input managers.</li>
</ol>
<p></p>
<p><b>So what does it all mean?</b></p>
<p>Let&#8217;s go over each restriction in detail:</p>
<p><b>1. The valid installation is now restricted to the /Library/InputManagers folder only. Bundles in other locations are silently ignored.</b></p>
<p>On 10.4 and earlier, Input Managers can be installed in the root Library (/Library/InputManagers) or your user Library (/Users/[your user]/Library/InputManagers).  If there is an Input Manager with the same name in both places, it completely ignores the one in the root Library and uses the home Library instead.</p>
<p>On 10.5, only Input Managers in the root Library are allowed to load.  However, if there&#8217;s an Input Manager with the same name in the home Library, it will ignore the one in the root Library and load neither.</p>
<p>Ecamm&#8217;s Input Manager has always lived in the root Library so this change did not affect us.  Additionally, because people sometimes manually move stuff around, our installer has always zapped any Ecamm Input Manager it finds in the home Library.</p>
<p>This change requires all Input Managers be global (affecting all users).  There&#8217;s no longer any way for developers to provide the option to install only for the current user.  This will be a real pain for unprivileged users, as they will no longer be able to install Input Managers without an admin password.  We did have a customer who is an instructor, and uses <a href="http://ecamm.com/mac/callrecorder">Call Recorder</a> in a locked-down computer lab environment. We had helped him install Call Recorder in the user Library. This will no longer be possible, at least not possible using Input Managers.</p>
<p><b>2. All the files in the bundle and /Library/InputManagers folder itself must be owned by the root user and admin group. No files inside the bundle can have group or other write permissions.</b></p>
<p>In 10.5, every file in an Input Manager plugin&#8217;s directory is recursively checked to make sure they meet these ownership and permissions requirements.  Additionally, the InputManagers directory itself must meet these same requirements.  </p>
<p>In a pinch, the following commands can be used to fix ownership and permissions of the InputManagers folder:</p>
<p><code>sudo chown -R root:admin /Library/InputManagers<br />
sudo chmod -R go-w /Library/InputManagers</code></p>
<p>As of their latest versions, the Ecamm installers automatically fix permissions and ownership.  </p>
<p>This requirement was the main hurtle to getting Input Managers working on Leopard, but it makes sense to have these requirements if the goal is make this all safer.</p>
<p><b>3. Processes running with the root privilege (getuid() == 0 or geteuid() == 0) cannot load any bundle input manager.</b></p>
<p>This one is pretty self explanatory as they&#8217;ve given the code they&#8217;re using to make the check.  If getuid() == 0 , it means you&#8217;re logged into your Mac as root.  I&#8217;m not sure why someone would do this or if it&#8217;s even possible.  geteuid() == 0 would indicate that the process is running effectively as root (e is for effective). A process is running effectively as root if you run it using sudo, if it is started programmatically using <code>AuthorizationExecuteWithPrivileges</code>, or if it&#8217;s running with the setuid bit.</p>
<p>This requirement seems like overkill.  The Input Manager has to be owned by root per #2, so why can&#8217;t root run its own plugin?  Oh well, no big deal.  This keeps Input Managers out of sketchy places like loginwindow.</p>
<p>UPDATE: We&#8217;ve had a handful of users with all their apps running with geteuid()==0.  We don&#8217;t yet know why it happens.</p>
<p><b>4. Processes running with the wheel group privilege cannot load any bundle input manager.</b></p>
<p>In 10.5, the process&#8217;s primary group cannot be wheel (wheel is the name of the root group, gid == 0).  Both getgid() and getegid() are checked for 0.<br />
Additionally, the process owner&#8217;s supplementary groups are checked for wheel. </p>
<p>This last bit is the one that caught us off guard.  We eventually determined that a handful of users who reported problems getting our plugins to load were actually failing this requirement.  Their main admin user was a member of the wheel group!  This situation is most likely the result of migrating a user account forward from OS X 10.1 (Puma) or earlier, where all admin users were added to the wheel group by default. </p>
<p>If our installer finds that the current user has wheel in its supplemental group list, it simply removes it.  Because of the way Cocoa is checking the supplemental groups, a full reboot is required before the change takes effect and Input Managers will load.</p>
<p><b>5. The process must be in the active workspace session at the time of loading the bundles.</b></p>
<p>Having an <b>inactive</b> workspace session means that your user is currently switched out via &#8220;Fast User Switching&#8221;.  Fast User Switching allows user B to login without making user A, who was already logged in, have to quit all his programs.  It&#8217;s then possible to quickly switch back and forth between the two users.</p>
<p>Since Input Managers load when an application starts, I&#8217;m not completely sure how an application can start while a user is switched out or what the implications of this are.  Anyone have an idea?  </p>
<p><b>6. The process must not be tainted by changing user or group id (checked by issetugid()).</b></p>
<p>issetugid() makes sure that neither setuid nor setgid have been called.  In short, this function makes sure that the process is currently running with the same uid and gid that it was given at birth (execve).</p>
<p><b>7. No 64-bit processes can load any bundle input managers.</b></p>
<p>This is an interesting requirement.  I can&#8217;t think of any good reason for this. </p>
<p>It turns out that checks 2 through 6 are not made when running in 64-bit. Instead, the validation routine simply returns NO.</p>
<p>If they were to allow 64-bit Input Managers, and we actually wanted to have them load into a 64-bit app, we&#8217;d simply have to rebuild them with 64-bit architectures.</p>
<p>If you thought things got confusing back when binaries were PowerPC, Intel, or both (Universal), then you&#8217;re in for a treat.  There&#8217;s now up to 4 possible architectures that can be in one mach-o file: PowerPC, Intel, PowerPC 64-bit, and Intel 64-bit. The dynamic loader can&#8217;t mix and match architecture types inside one process.  So if you want a plugin to load into a 64-bit application, the plugin will have to be built with 64-bit as one of its architectures.  To get people around problems like this, Apple has provided a &#8220;Open as 32 Bit&#8221; checkbox next to the &#8220;Open using Rosetta&#8221; checkbox.  If, for example, Photoshop is made 64-bit capable, then you&#8217;ll need to use this new checkbox if you want it to be able to load any of your &#8220;old&#8221; 32-bit-only plugins.</p>
<p>Another problem plugin developers are going to have on Leopard involves the new Garbage Collection (GC) in Objective-C 2.  A process running with GC turned on cannot load non-GC plugins. It&#8217;s a little bit more complicated than this, but I won&#8217;t go into details.</p>
<p><B>A strange turn of events</b></p>
<p>As a result of check #3, Input Managers no longer load into certain processes where you&#8217;d probably agree you don&#8217;t want Input Managers.  </p>
<p>For example, on 10.4 and earlier, Input Managers load into loginwindow. This is no longer the case on 10.5. </p>
<p>However, in a very interesting turn of events, Input Managers now load into the Finder.  Go figure. <img src='http://macdaddyworld.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F11%2F06%2Ftheres-something-about-input-managers%2F';
  addthis_title  = 'There%26%238217%3Bs+Something+About+Input+Managers';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/11/06/theres-something-about-input-managers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two-way Video Conferencing for iPhone</title>
		<link>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/</link>
		<comments>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 08:13:51 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=38</guid>
		<description><![CDATA[in which we make the world&#8217;s first useful video phone

Update: Our demo won first place for Iron Coder Live this afternoon! Thanks for your votes everyone!
Update 2: We&#8217;ve added a link to source code at the bottom of the post.   We also made a quick video demo in Starbucks today.

&#160;&#160;&#160;This weekend&#8217;s C-4 developer [...]]]></description>
			<content:encoded><![CDATA[<p><em>in which we make the world&#8217;s first useful video phone</em></p>
<p><HR></p>
<p><b>Update:</b> Our demo won first place for Iron Coder Live this afternoon! Thanks for your votes everyone!</p>
<p><B>Update 2:</B> We&#8217;ve added a link to source code at the bottom of the post.   We also made a quick <A HREF="http://www.youtube.com/watch?v=iew4rXsorTw">video demo</A> in Starbucks today.</p>
<p><HR><br />
<TABLE BORDER=0 ALIGN=right CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;&nbsp;&nbsp;</TD><TD><a href="http://c4.rentzsch.com/1/"><img src="/c4-128.png" WIDTH=65 alt="" BORDER=0/></a></TD></TR></TABLE>This weekend&#8217;s <a href="http://c4.rentzsch.com/1/">C-4</a> developer conference features &#8220;Iron Coder Live&#8221;, a contest in the same vein as <a href="http://www.machack.com/">MacHack</a>.  The event encourages conference attendees to develop creative &#8220;hacks&#8221;, written in within a short timeframe.  This year&#8217;s theme, of course, is iPhone.  </p>
<p>This was a great excuse to buy another iPhone, install the <a href="http://iphone.fiveforty.net/wiki/index.php/Toolchain_Project">iPhone toolchain</a> and waste some time!  Before we knew it, the iCal told us it was Thursday and we were putting the finishing touches on iPhone video conferencing.</p>
<p><CENTER><IMG SRC="/justus.jpg"></CENTER></p>
<p><strong>Camera?  Oh really?</strong></p>
<p>Obviously we had to do something with the iPhone&#8217;s camera.  Doing crazy things with cameras <a href="http://www.ecamm.com/mac/imagewebcam/">is</a> <a href="http://www.ecamm.com/mac/iglasses/">a</a> <a href="http://www.ecamm.com/mac/ichatusbcam/">full</a> <a href="http://www.ecamm.com/mac/huckleberry/">time</a> <a href="http://www.ecamm.com/mac/callrecorder/">job</a> for us!  Our contest entry captures video from the iPhone&#8217;s camera, compresses it, and sends it to a web server, where it&#8217;s relayed to another iPhone, and vice-versa, resulting in a nice two-way video conference.  Need audio too?  That&#8217;s not our department but simply make a phone call to the other person&#8217;s iPhone and put them on speaker phone.  Then fire up our program and you&#8217;re in business.  (Yes, the iPhone makes phone calls apparently.)</p>
<p><strong>Wait for the Clever Bit</strong></p>
<p>Now you&#8217;re probably thinking, how do you do a video conference when the iPhone&#8217;s camera is pointed in the wrong direction?  The iPhone, like every other smartphone that I&#8217;ve seen, has a camera mounted on the back of the device, causing most people to dismiss the possibility of video conferencing right out of the gate.</p>
<p><strong>Phuckleberry</strong></p>
<p>For those of you familiar with the Ecamm product line, you may remember that we sell the <a href="http://www.ecamm.com/mac/huckleberry/">Huckleberry mirror</a>, a periscope for your MacBook or MacBook Pro.  While the Huckleberry II for MacBook Pro doesn&#8217;t quite fit properly on an iPhone, that&#8217;s nothing some wire cutters and imagination couldn&#8217;t fix.  Here are some pictures of our homemade iPhone-Huckleberry-stand running a two-way video conference over wifi.  As you can see, the camera image is reflected off two acrylic mirrors and re-oriented in software.</p>
<p><IMG SRC="/hand1.jpg"><br />
<IMG SRC="/hand2.jpg"><br />
<IMG SRC="/twotable.jpg"><br />
(The orientation changes automatically of course.)</p>
<p><strong>Darn</strong></p>
<p>Ok, whoops, we meant to create something useless and fun.  Surprisingly, this actually works very well, and might be considered downright useful in some scenarios.  I hope that doesn&#8217;t disqualify us from the hack contest&#8230;</p>
<p><strong>The iPhone Toolchain</strong></p>
<p>The first step after <a href="http://iphone.fiveforty.net/wiki/index.php/How_to_Escape_Jail">jailbreaking</a> our iPhones (which sounds dangerous but is actually pretty benign), was downloading and building the iPhone toolchain.  The toolchain is clearly the result of hundreds of hours of work by a devoted group of iPhone dev devotees.  What have they built?  In a Nutshell, devs can now write native iPhone apps in the same integrated development environment we use to write Mac apps, in the same programming lanaguage, using <strong>almost</strong> the same set of APIs.  It&#8217;s pretty overwhelming to think of the possibilites this opens up.  It&#8217;s like a tiny little Mac/phone just like we were all promised!  Thanks to the folks at <a href="http://iphone.fiveforty.net/wiki/index.php?title=Main_Page">iPhone Dev Wiki</a>, and the <a href="http://developer.berlios.de/projects/iphone-binutils/">binutils</a> project, and these <a href="http://ellkro.jot.com/iPhoneHacking">two</a> <a href="http://www.jeremyjohnstone.com/blog/archives/2007/08/05/howto-run-custom-apps-on-iphone-part-1/">pages</a> for getting us up and running within hours.</p>
<p><strong>Source Code</strong></p>
<p>We&#8217;ve decided to post the source code for our contest entry here on the blog.  Please keep in mind, this is most likely not going to be useful to you for anything other than illustrating the mechanisms that we used to accomplish our hack.  The current app does not support more than two users, and will not just compile and magically work, as you will also need a server and a relay script to send the imagery between iPhones.  (We used Perl for that.) </p>
<p>Download here: <a href="/squidge_source.zip">squidge_source.zip</a> (84K)</p>
<p><strong>Sample App</strong></p>
<p>Next on our list, we&#8217;ll be creating an app that will actually let ambitious iPhone users try out the proof of concept.  This primarily involves adding a user interface.  Check back for this.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F08%2F12%2Ftwo-way-video-conferencing-for-iphone%2F';
  addthis_title  = 'Two-way+Video+Conferencing+for+iPhone';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/feed/</wfw:commentRss>
		<slash:comments>166</slash:comments>
		</item>
		<item>
		<title>QuickTime 7.2 Brings Leopard Functionality</title>
		<link>http://macdaddyworld.com/2007/07/13/quicktime-72-brings-leopard-functionality/</link>
		<comments>http://macdaddyworld.com/2007/07/13/quicktime-72-brings-leopard-functionality/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 21:20:20 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[QuickTime]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=30</guid>
		<description><![CDATA[Following a continuing trend of adding new things without telling anyone, the recent QuickTime 7.2 update includes more than just bug fixes.
We&#8217;ve confirmed that the QTKit Capture functionality previously billed as a feature of Leopard is included with the update. (See the section on QuickTime Improvements.)
The fun new functionality is all there after updating to [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/writinguin.thumbnail.gif' alt='writinguin.gif' class=alignright />Following a continuing trend of adding new things without telling anyone, the recent <a href="http://www.apple.com/support/downloads/quicktime72formac.html" target="_new">QuickTime 7.2 update</a> includes more than just bug fixes.<br />
We&#8217;ve confirmed that the QTKit Capture functionality previously billed as a feature of Leopard is included with the update. (<a href="http://developer.apple.com/leopard/overview/" target="_new">See the section on QuickTime Improvements</a>.)</p>
<p>The fun new functionality is all there after updating to 7.2, but there are no new header files (no public API yet).  Also, <strong>the functionality is now used by QuickTime Player Pro</strong>. However, you probably won&#8217;t notice much of a change except a little progress indicator in the Recording section of the prefs when it&#8217;s scanning for cameras, and <em>hopefully</em> a performance improvement. <img src='http://macdaddyworld.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Since it&#8217;s in the wild, I can now talk freely about this cool new feature of QuickTime.</strong>  All of this I learned simply by hunting around and looking at sample traces of a running video stream in the new version of QuickTime Player.</p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/fiendish.jpg' alt='fiendish.jpg' class=alignleft /> QTKit Capture looks to be a total ground-up replacement of the Sequence Grabber.  The Sequence Grabber is a very ancient part of QuickTime, designed long ago as the way to capture streaming audio/video.  It doesn&#8217;t appear to be going away, but QTKit Capture doesn&#8217;t use it internally except for reverse compatibility* with old vdig drivers.  Where the Sequence Grabber uses QuickDraw, QTKit Capture makes heavy use of Core Video and OpenGL.  Also, the top layer is Objective-C so it can be integrated easily into a Cocoa app.</p>
<p><strong>I&#8217;ve done some looking around and found some interesting things:<br />
</strong><br />
It makes use of some new private frameworks.  New to the club are:<br />
CoreMediaAuthoringPrivate.framework<br />
CoreMediaIOServicesPrivate.framework<br />
CoreMediaPrivate.framework</p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/pengy2.thumbnail.png' alt='pengy2.png' class=alignright />CoreMediaIOServicesPrivate&#8217;s framework Resources folder contains a number of plugin modules. There&#8217;s one for AVC (DV cams), IIDC (external iSight), and VDC (the built-in iSight).  In a nutshell, CoreMedia appears to implement a Device Abstraction Layer (A way to allow access to all video devices without having to know the details of the device.)</p>
<p>Other notes:</p>
<ul>
<li>* QTKit Capture still works with existing QuickTime component vdig modules (macam still works). In this case, it is actually running the Sequence Grabber below CoreMedia. For the built-in iSight however, the Sequence Grabber is not being used.  Hopefully, Apple will provide a new way to write plugins for third party devices so the SequenceGrabber doesn&#8217;t have to be used.  However, they do support 3 major video camera standards (IIDC, AVC, and UVC), so device developers going forward would be wise to implement one of these standards, eliminating the need for writing their own driver.</li>
<li>You <em><strong>can</strong></em> build and link against the new functionality if you have the proper header files.</li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F07%2F13%2Fquicktime-72-brings-leopard-functionality%2F';
  addthis_title  = 'QuickTime+7.2+Brings+Leopard+Functionality';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/07/13/quicktime-72-brings-leopard-functionality/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhoneDrive</title>
		<link>http://macdaddyworld.com/2007/07/10/iphonedrive/</link>
		<comments>http://macdaddyworld.com/2007/07/10/iphonedrive/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 00:48:23 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=26</guid>
		<description><![CDATA[
We just finished some marathon coding and are happy to announce iPhoneDrive.  In a nutshell, it lets you use your iPhone for file storage by providing an easy file browser interface.  Version 1.0 is very functional considering that it was written in about one week.  The demo version works just like the [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/iphonedisk.png' alt='iPhoneDrive' class=alignright /><br />
<strong>We just finished some marathon coding and are happy to announce <a href="http://www.ecamm.com/mac/iphonedrive">iPhoneDrive</a>.</strong>  In a nutshell, it lets you use your iPhone for file storage by providing an easy file browser interface.  Version 1.0 is very functional considering that it was written in about one week.  The <a href="http://www.ecamm.com/mac/iphonedrive/iPhoneDrive.zip">demo version</a> works just like the <a href="https://www.ecamm.com/cgi-bin/shopping/cart?p=iphonedrive">paid version</a> but only for a 7 day period.</p>
<p>It supports drag and drop to and from the iPhone.  It also supports transfer of entire folders.  This makes it easy to move large directories back and forth between your Mac and your iPhone.  Since the iPhone uses USB 2.0, the transfer speed is very fast.  Now you can put those spare gigabytes to good use. Backup your important files! Your hard disk could fail at any moment! Do it now!</p>
<p>Here&#8217;s a screenshot:<br />
<img src='http://macdaddyworld.com/wp-content/uploads/2007/07/screen.jpg' alt='iPhoneDrive'/></p>
<p><strong>Reinventing the Wheel</strong></p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/revopower.thumbnail.jpg' alt='Reinventing' class=alignright />You can see we used an NSBrowser for the file browser.  If you&#8217;ve ever tried to use one of these you&#8217;d know that they&#8217;re not very useful out of the box. Drag and drop has to be implemented manually, and the updating of cell data is very flaky, requiring many work-arounds. Also, they don&#8217;t do many of the things that you&#8217;d come to expect from the Finder&#8217;s column view mode.</p>
<p>All said and done, the interface came out pretty good.  I just wish Apple would update NSBrowser to support more of the things found in the Finder column view.  Obviously the Finder isn&#8217;t implemented using NSBrowser (it&#8217;s not even Cocoa for that matter), but it would be nice to have things like elipsification, marquee selecting, and drag and drop in there without having to reinvent the wheel.  </p>
<p>We welcome any feedback about iPhoneDrive. Leave a comment here or use the feedback form on the main Ecamm website.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F07%2F10%2Fiphonedrive%2F';
  addthis_title  = 'iPhoneDrive';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/07/10/iphonedrive/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Megapixel Test Program and more details</title>
		<link>http://macdaddyworld.com/2007/06/28/the-megapixel-test-program-and-more-details/</link>
		<comments>http://macdaddyworld.com/2007/06/28/the-megapixel-test-program-and-more-details/#comments</comments>
		<pubDate>Thu, 28 Jun 2007 14:42:01 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=19</guid>
		<description><![CDATA[The iApps like iChat and Photo Booth only request a 640&#215;480 or smaller image from the iSight. Therefore it can be troublesome to find a way to test the full capabilities of the new 1.3 MP iSight.  That&#8217;s why we wrote our own little test program.
Today we cleaned it up and are posting it [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/06/guage.thumbnail.jpg' alt='MacDaddy' class="alignright"/>The iApps like iChat and Photo Booth only request a 640&#215;480 or smaller image from the iSight. Therefore it can be troublesome to find a way to test the full capabilities of the new 1.3 MP iSight.  That&#8217;s why we wrote our own little test program.</p>
<p>Today we cleaned it up and are posting it here so new-MacBook-Pro-having visitors can try it out see the new and improved image for themselves.</p>
<p>The app requests and displays a video stream from the camera at 1280&#215;1024.  If you&#8217;re on an older iSight it will still stretch the VGA image out to be this size but it won&#8217;t look very good.  The app will report the frame actual size from the ImageDescription at the top.  </p>
<p>There&#8217;s also a snapshot button so you can take your own picture and make your friends jealous of your fancy new laptop.  Sorry: no Photo Booth effects yet! <img src='http://macdaddyworld.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>If you get to try it, leave a comment and let me know how it works for you.<br />
<a href='http://macdaddyworld.com/wp-content/uploads/2007/06/macdaddytestapp.zip' title='The Test App'>The Test App (68 k)</a></p>
<p><b>Tech Talk Follows:</b></p>
<p>The app does Hi-Lite™ a potential reason why Apple might not be yelling from the rooftops about the new camera: You can see right away how slow it is to stream the full sized video.  Why? It&#8217;s more than four times more data than VGA.  The Sequence Grabber was designed decades ago and wasn&#8217;t designed to handle more than NTSC/PAL sizes. Until the Sequence Grabber is revamped, it&#8217;s a little too slow to run such a large stream.</p>
<p>1,280 x 1,024 = 1,310,720 pixels<br />
It&#8217;s 4:2:2 compressed YUV data, so that&#8217;s 2 bytes per pixel or 2,621,440, or 2.5 megabytes per raw frame.<br />
So for full 30 fps video, this translates to about 75 megabytes per second or 600 Mbps.<br />
Now keep in mind the camera controller allows for a compressed MJPEG mode which cuts the required USB bandwidth signifcantly.  (You&#8217;d never fit that over USB 2.0 without compression.) </p>
<p>But even if it is being compressed on-camera, it&#8217;s then being decompressed in the driver and passed to QuickTime in YUV. That&#8217;s a lot of data to push through the poor Sequence Grabber pipes.  Technically, you should be able to request MJPEG data from the sequence grabber, but the default seems to be YUV. I haven&#8217;t tried requesting other compression types as I don&#8217;t actually have one of these new machines in front of me.*</p>
<p><b>More details about the new camera:</b></p>
<p>The original iSight didn&#8217;t advertise itself as a UVC device (It was Vendor Specific).<br />
The new one does advertise as UVC, so you can easily use USB Prober to decode the device descriptor:<br />
According to the descriptor the camera supports the following frame formats:</p>
<p>MJPEG 640&#215;480 @ up to 60fps<br />
MJPEG 720&#215;480 @ up to 60fps<br />
MJPEG 800&#215;600 @ up to 30fps<br />
MJPEG 1024&#215;576 @ up to 30fps<br />
MJPEG 1024&#215;768 @ up to 30fps<br />
MJPEG 1280&#215;960 @ up to 30fps<br />
MJPEG 1280&#215;1024 @ up to 30fps<br />
Uncompressed 640&#215;480 @ up to 30 fps<br />
Uncompressed 352&#215;288 @ up to 30 fps<br />
Uncompressed 160&#215;120 @ up to 30 fps<br />
Uncompressed 704&#215;576 @ up to 25 fps<br />
Uncompressed 720&#215;480 @ up to 25 fps</p>
<p>Maybe another SequenceGrabber savvy engineer out there with the new MBP could experiment and see what you get back from <code>VDGetCompressionTypes</code>.  Can we request MJPEG data through the pipes?</p>
<p>*Another thanks to Dave for running some tests for me on his MBP. Dave is a web designer and <a href="http://www.davedudek.com/" target="_new">has a website that I&#8217;ll plug</a>. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F06%2F28%2Fthe-megapixel-test-program-and-more-details%2F';
  addthis_title  = 'The+Megapixel+Test+Program+and+more+details';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/06/28/the-megapixel-test-program-and-more-details/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
