Qt S60 应用程序中的视频?

发布于 2024-08-06 12:50:36 字数 439 浏览 6 评论 0原文

有没有人构建过可以播放(流媒体或本地)视频的 Qt S60 应用程序(第 3 版,FP2)?

我想在小部件中播放视频,而不是使用(例如)QDesktopServices。

我知道有关于如何使用 Symbian 执行此操作的文档,例如 此处< /a> 和此处,但我仍然卡住了。

(提前为交叉发布道歉:我已经在其他地方询问过,但没有成功。)

Has anyone built a Qt S60 app (3rd edition, FP2) that plays (streaming or local) video?

I want to play video 'in' a widget, not with (say) QDesktopServices.

I know there's documentation about how to do this with Symbian, such as here and here but I'm still stuck.

(Apologies in advance for cross-posting: I've asked elsewhere, but with no success.)

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

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

发布评论

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

评论(1

放飞的风筝 2024-08-13 12:50:36

Qt 4 包含一套称为 Phonon 的多媒体 API,它可以让您做到这一点。它们目前正在为 Symbian 实现 - 而Qt for S60“Tower”预发布
不包括对 Symbian 上的 Phonon 的支持,Qt 4.6 就可以了。

同时,您唯一的选择是直接使用 Symbian MMF API。具体来说,您的视频小部件(或其拥有的对象)将需要创建 CVideoPlayerUtility 的实例,因此需要实现 MVideoPlayerUtilityObserver。视频播放器 API 要求客户端提供一个 RWindow 来显示视频 - 这可以通过调用 QWidget::winId() 来获得,它返回一个 CCoeControl*指针。因此,您可以通过调用 All 来获取窗口句柄

RWindow& window = *static_cast<RWindow*>(widget->winId()->DrawableWindow())

,但是,从 Symbian 上的 Qt 应用程序(或实际上任何应用程序)播放视频目前需要大量工作 - 特别是如果您想支持动态调整大小和/或重新调整大小。 - 视频内容的定位。另请注意,Qt 当前在 Symbian 上实现的方式意味着将其他小部件(部分或完全)移动到视频小部件顶部将无法正常工作 - 视频将继续显示在顶部。这是因为调用 QWidget::winId() 目前不会导致 Qt 创建本机 Symbian 窗口,并将在 4.6 中得到纠正。

总之,除非您急于这样做,否则最好等待几周后发布的 4.6 Beta 版。

Qt 4 includes a suite of multimedia APIs called Phonon, which allow you to do just this. They are currently being implemented for Symbian - while the Qt for S60 "Tower" pre-release
does not include support for Phonon on Symbian, Qt 4.6 will do.

In the meantime, your only option is to use the Symbian MMF APIs directly. Specifically, your video widget - or an object owned by it - will need to create an instance of CVideoPlayerUtility, and therefore will need to implement MVideoPlayerUtilityObserver. The video player API requires the client to provide an RWindow in which to display the video - this can be obtained by calling QWidget::winId(), which returns a CCoeControl* pointer. You can therefore obtain a window handle by calling

RWindow& window = *static_cast<RWindow*>(widget->winId()->DrawableWindow())

All in all however, playing video from a Qt app (or indeed any app) on Symbian currently requires quite a lot of work - especially if you want to support dynamic re-sizing and/or re-positioning of the video content. Note also that the way in which Qt is currently implemented on Symbian means that moving other widgets (partially or completely) on top of the video widget will not work correctly - the video will continue to appear on top. This is due to the fact that calling QWidget::winId() currently doesn't cause Qt to create a native Symbian window, and will be rectified in 4.6.

In summary, unless you are in a hurry to do this, it is probably better to wait for the 4.6 beta which is due in a few weeks time.

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