5

Does anyone know the correct way to replace old QTMovieCurrentSizeAttribute and QTMovieSizeDidChangeNotification tasks? I'm trying to clean out old deprecated code.

I've found that QTMovieNaturalSizeDidChangeNotification is not a replacement for QTMovieSizeDidChangeNotification. Likewise QTMovieNaturalSizeAttribute is not a replacement for QTMovieCurrentSizeAttribute. Natural Size refers to the QTMovie's native resolution, while Current Size refer to the resolution at which a QTMovie is being displayed (this may also be the resolution to which the movie is being decoded, which can resize from native). For example, if the source was anamorphic or had non-square pixels, then Natural and Current Sizes will not be the same. The difference is easily seen in the Movie Inspector Window of the QuickTime 7 Player.

As near as I can tell, QuickTime X allows multiple views into the same QTMovie, so the notion of Current Size needed to be replaced by something new. (Perhaps the Current Size functionality was moved into QTMovieView? Or a decoder query?) Can anyone refer me to documentation or sample code for the new way?

Any sample code of a Movie Inspector Window that has been updated to show Natural and Current ('Actual') Sizes, without using deprecated code, would be ideal. This has been very confusing to tackle, so far.

Manlio
  • 10,768
  • 9
  • 50
  • 79
Brian
  • 101
  • 2

1 Answers1

0

Is this useful? 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());
}
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
  • Probably more relevant is the definition of `cacheMovieScale` in the same file, which gets an undocumented attribute with the key `@"QTMoviePreferredTransformAttribute"`, whose value is an NSAffineTransform. – Peter Hosey Dec 30 '11 at 00:53