5

QTMovieCurrentSizeAttributeoldと QTMovieSizeDidChangeNotificationtasksを置き換える正しい方法を知っている人はいますか? 古い廃止されたコードを一掃しようとしています。

QTMovieNaturalSizeDidChangeNotificationの代わりにならないことがわかりましたQTMovieSizeDidChangeNotification。同様にQTMovieNaturalSizeAttributeの代わりにはなりませんQTMovieCurrentSizeAttributeNatural SizeQTMovieのネイティブ解像度をCurrent Size指し、QTMovieが表示されている解像度を指します (これは、ネイティブからサイズ変更できるムービーがデコードされている解像度である場合もあります)。たとえば、ソースがアナモルフィックであるか、正方形でないピクセルを持っている場合、と は同じではNaturalありCurrent Sizeません。この違いは、QuickTime 7 Player の Movie Inspector ウィンドウで簡単に確認できます。

私が知る限り、QuickTime X では同じQTMovieに複数のビューを表示できるため、 の概念をCurrent Size新しいものに置き換える必要がありました。(おそらく、Current Size機能はQTMovieView? またはデコーダー クエリに移動されましたか?) 新しい方法のドキュメントまたはサンプル コードを参照してもらえますか?

Natural非推奨のコードを使用せずに、およびを表示するように更新された Movie Inspector ウィンドウのサンプル コードCurrent ('Actual') Sizesが理想的です。これまでのところ、これに取り組むのは非常に紛らわしいものでした。

4

1 に答える 1

0

これは役に立ちますか?http://opensource.apple.com/source/WebCore/WebCore-955.66/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

IntSize MediaPlayerPrivate::naturalSize() const
{
    if (!metaDataAvailable())
        return IntSize();

    // In spite of the name of this method, return QTMovieNaturalSizeAttribute transformed by the 
    // initial movie scale because the spec says intrinsic size is:
    //
    //    ... the dimensions of the resource in CSS pixels after taking into account the resource's 
   //    dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the 
   //    format used by the resource

    NSSize naturalSize = [[m_qtMovie.get() attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
    return IntSize(naturalSize.width * m_scaleFactor.width(), naturalSize.height * m_scaleFactor.height());
}
于 2011-12-30T00:02:29.963 に答える