Wednesday, April 21, 2010

Using the QTKit Framework

From here: http://developer.apple.com/quicktime/qtkit.html


The heart of QuickTime is its comprehensive underlying framework which is powerful, extensible, and flexible. This framework provides developers with the ability to display, import, export, modify, and capture more than 200 different media types. Until recently, however, using this power from Cocoa applications hasn't always been straightforward. Before the release of Mac OS X Tiger, anything more than display and playback of QuickTime files required using a set of Carbon APIs that were distinctly foreign to most Cocoa developers.
That has all changed. With Mac OS X Tiger comes QuickTime 7, which features a redesigned core architecture and provides a modernized Cocoa interface called QTKit. QTKit allows Cocoa developers to leverage a useful subset of QuickTime's capabilities. It not only allows you to play QuickTime movies, but to edit, splice, combine, and transcode them. And, if you need to go beyond its abilities, QTKit makes it easy to get to the underlying QuickTime primitives and directly use the more than 2500 functions in the QuickTime procedural API.
In essence, QTKit brings a deeper level of integration with QuickTime to the premier programming environment on Mac OS X.
This article shows how the QTKit framework is structured and introduces you to the essential concepts you'll need to understand to get up and running. First, let's review why QuickTIme is so important and what it brings to developers.

QTKit API Overview


For more info see the link above.


What Can You Do With QTKit?

With just the overview of QTKit that we've given here, you can see that QTKit lets you access an enormous amount of power from QuickTime and build it into your application in a straightforward fashion. What can you do with this knowledge now? You could create a media browser that would let you keep tabs on all the various kinda of meta-data about a large collection of QuickTime movies. You could build a command-line tool that would grab several frames from a set of movies and make a web page that allowed users to browse a collection remotely and choose the movie they wanted to download. Or, you could even build the next video editing tool customized for your own internal workflow.
The sky is the limit. QTKit brings an unprecedented ease of development to more than 15 years of multimedia experience in the QuickTime platform. It brings the premier multimedia platform to the premier application creation platform.

For More Information on QTKit

Using this article as a springboard, you should be able to dive into code and, with the help of the documentation, create your own QuickTime based Cocoa application. Along the way, you'll want to take advantage of the following resources:

Mac automation resources

Best to my view resources about Mac Automator and Applescript:

http://www.automatedworkflows.com
http://automatoractions.com
http://automatorworld.com
http://macscripter.net
http://search.macupdate.com/search.php?keywords=developer:%2BRosanne%20%2BCashriel
http://www.apple.com/downloads/macosx/automator



Example workflows:
http://www.automatedworkflows.com/software/automator_actions/example_workflows.html

Tuesday, April 13, 2010

OpenUSB

http://sourceforge.net/projects/openusb
http://sourceforge.net/apps/mediawiki/pyusb/index.php?title=Main_Page

Анализатор USB траффика от компании LeCroy:

http://www.lecroy.com/ProtocolAnalyzer/ProtocolStandard.aspx?standardID=4&capid=103

Hashtable thread safety

Hashtable is thread safe for use by multiple reader threads and a single writing thread.
It is thread safe for multi-thread use when only one of the threads perform write (update) operations, which allows for lock-free reads provided that the writers are serialized to the Hashtable. To support multiple writers all operations on the Hashtable must be done through the wrapper returned by the Synchronized method, provided that there are no threads reading the Hashtable object.

Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.

Synchronized supports multiple writing threads, provided that no threads are reading the Hashtable.
The synchronized wrapper does not provide thread-safe access in the case of one or more readers and one or more writers.

Hashtable myCollection = new Hashtable();
 
//... multiple thread usage via Hashtable.Synchronized(myCollection);
lock(myCollection.SyncRoot) {
  foreach (Object item in myCollection) {
  // ... here is reading operation
  }
}

Powered by Blogger.