2/20/2010

QTMovieView delegate hidden method

QTMovieView has delegate that follows

- (CIImage *)view:(QTMovieView *)view willDisplayImage:(CIImage *)image;

This delegate method is not listed in current newly SDK's document.
But it's defined in QTMovieView.h in QTKit.framework.
It works properly.
On default, this method has name conflict with QTCaptureView delegate

- (CIImage *)view:(QTCaptureView *)view willDisplayImage:(CIImage *)image;

Xcode will show warning about conflict.
You can implement QTMovieView delegate method as follow

- (CIImage *)view:(id)view willDisplayImage:(CIImage *)image {

if ([view isKindOfClass:[QTMovieView class]]) {
  //your code
  return image;
  }

return image;
}

QTMovieView にはドキュメントに載ってないけど header に定義されてる delegateメソッドがある。
ただ QTMovieCaptureView の delegateメソッド名と被っているので、Xcode でビルドすると警告が出る。クラス名の部分を id なんかにしてやって、メソッド内でメソッドの送り主が意図するクラスかどうかをチェックして必要に応じて処理するといいんじゃないかという話。

spec OS 10.6.2, Xcode 3.2.1, 3.2.2

2/14/2010

Quartz Composer movie export


Quartz Composer で File > Export as QuickTime Movie...
QuickTime 書き出しする際にムービーの分数秒数の指定ができるけど、ここで指定した値が正しく反映されない。確か以前は正しく反映されていたはず。いつからこの問題が起きたのかは分からないけどとりあえず OS v10.6.2, Quartz Composer v4.0 では正しく機能しないよう。
Terminal で

defaults write NSGlobalDomain QuartzComposerDefaultMovieDuration 90

としてデフォルトの書き出し秒数を指定してやることでムービーの秒数を指定してやることができる。ということは Quartz Composer が書き出し時の秒数オプションを無視してデフォルト設定を使用してしまっているということになる。
ムービーの書き出し時間を変更したいその都度ターミナルでこのコマンドを打てばいいんだけど、、まぁそりゃないな。


On Quartz Composer, File > Export as QuickTime Movie...
It's possible to specify movie duration, but exported movie that include Quartz Composer Track doesn't have specified duration.
on Terminal

defaults write NSGlobalDomain QuartzComposerDefaultMovieDuration 90

this command can specify exported movie's duration.
But why function that specifies duration is not working properly?
It's strange that Quartz Composer use default duration always.

spec OS 10.6.2, Quartz Composer 4.0

about this blog

・このブログについて
日々プログラムをしていて気付いたことや疑問に思ったことをメモしていきます。
・目標
Tips, bugはなるべく英語で書く。

-about this blog
I take notes of awareness and doubt in programming.
-aim
Write Tips and bug in English as possible. (Sorry, I'm not good at English.)