QTMovieCurrentSizeAttribute 和 QTMovieSizeDidChangeNotification 替换

发布于 2024-11-11 02:22:50 字数 851 浏览 2 评论 0原文

有谁知道替换旧的 QTMovieCurrentSizeAttributeQTMovieSizeDidChangeNotification 任务的正确方法?我正在尝试清除旧的已弃用代码。

我发现 QTMovieNaturalSizeDidChangeNotification 不能替代 QTMovieSizeDidChangeNotification。同样,QTMovieNaturalSizeAttribute 也不能替代 QTMovieCurrentSizeAttributeNatural Size 指的是 QTMovie 的原生分辨率,而 Current Size 指的是 QTMovie 的分辨率正在显示(这也可能是电影正在解码的分辨率,可以从本机调整大小)。例如,如果源是变形的或具有非方形像素,则“自然”和“当前大小”将不同。在 QuickTime 7 Player 的电影检查器窗口中可以轻松看出差异。

据我所知,QuickTime X 允许在同一 QTMovie 中使用多个视图,因此需要用新的内容来替换 Current Size 的概念。 (也许当前大小功能已移至QTMovieView?或解码器查询?)任何人都可以向我推荐文档或示例代码以了解新方法吗?

任何已更新为显示自然当前(“实际”)尺寸且不使用已弃用代码的影片检查器窗口示例代码都是理想的选择。到目前为止,解决这个问题非常令人困惑。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一片旧的回忆 2024-11-18 02:22:50

这有用吗? 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());
}

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());
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文