旋转在Videoview实际videobuffer [英] Rotating the actual videobuffer in Videoview

查看:206
本文介绍了旋转在Videoview实际videobuffer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个App专为Android的GoogleTV的装置,其中使用或迫使应用程序比山水之外的任何方向未启用,并不会从我想通以后启用,在现实的应用只是一旦崩溃试图运行 setRequestedOrientation();

I am currently developing an App specifically for android's GoogleTV devices where using or forcing the orientation of the app to anything other than landscape is not enabled, and will not be enabled in the future from what i have figured, in actuality the app simply crashes upon trying to run setRequestedOrientation();

Videoviews继承正常的意见,东西的位置属性,如 SETX SETY 键,即 SetRotation

Videoviews inherit the positional properties from normal views, Stuff like SetX, SetY and namely SetRotation.

您可以在videoview的旋转设置为90度,但实际videobuffer不会转动。
我从使用旧的媒体播放器都试过了> surfaceview.getHolder()。lockcanvas()。旋转(度)在各方面都可以想象,以覆盖的onDraw 扩展正常类的自定义videoview,其中没有我能得到成功合作的方法。

You can set the videoview's rotation to 90 degrees, but the actual videobuffer will NOT rotate. I've tried everything from using the old mediaplayer > surfaceview.getHolder().lockcanvas().rotate(degrees) in every way imaginable, to overwriting the onDraw method of a custom videoview that extends the normal class, none of which i could get working successfully.

在简单地说,我怎么能旋转的实际视频videoview内,在不改变设备的方向?
如果你有它的内容的旋转videoview工作的例子也旋转请解释你如何得到它的工作。

In a nutshell, How can i rotate the ACTUAL video within the videoview, without changing the device's orientation? if you have a working example of a rotated videoview with the contents of it also rotated please do explain how you got it working.

先谢谢了。

我想请你注意,我们正在为Android 3.1,也一切到目前为止已经codeD动态,所有imageviews和videoview通过code创建的,只有特定的布局发展,我们使用Z的索引项的 layout.xml 文件已被定义。

I'd like you to note that we're developing for android 3.1 and also that everything so far has been coded dynamically, all imageviews and videoview are created through code, only the specific Layouts that we use for Z indexing items have been defined in the layout.xml file.

推荐答案

VideoView不支持,即使组成矩阵的设置是否正确,并使用旋转属性的视频旋转。

VideoView does not support rotation of video even if composition matrix is set correctly and rotation attribute is used.

你可以做的就是用TextureView并设置其属性旋转=90(例如)。然后,它会旋转框架,但宽高比是,你需要处理你自己的东西。为了做到这一点,你可以使用textTureView.setScaleX((screenHeight * 1.0F)/屏幕宽度)

What you can do is to use TextureView and set its attribute rotation="90" (for example). It then will rotate the frames but the aspect ratio is something that you need to handle your self. In order to do so you can use textTureView.setScaleX((screenHeight * 1.0f) / screenWidth)

更多详情请看这里:<一href=\"http://stackoverflow.com/questions/8586526/rotating-an-android-videoview/16490065#16490065\">Rotating一个Android VideoView

这篇关于旋转在Videoview实际videobuffer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆