Comments (9)
稍等,有点事在忙
from rtmprecoder.
好的,您慢来!
from rtmprecoder.
Camera 这个类的默认展示方向是横向的,它有一个setDisplayOrientation(int degrees) 方法,传入90 度就可以变成纵向的了。不过这个类现在已经被Deprecated 了,这是我很久之前写的一个demo项目,所以一直也没改,建议你换成Camera2
from rtmprecoder.
public CameraView(Context context, Camera camera) {
super(context);
Log.w("camera", "camera view");
mCamera = camera;
mHolder = getHolder();
mHolder.addCallback(CameraView.this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mCamera.setPreviewCallback(CameraView.this);
mCamera.setDisplayOrientation(90);
}
可以加在CameraView的构造函数里面或者获取到Camera对象的时候
from rtmprecoder.
谢谢,我成功试出来了,另外我试了下,这个 view 长宽比似乎要符合16.2比12.4,否则的话影像的比例会有偏差,请问这是正常现象吗
from rtmprecoder.
不是 你看add camera view注释下面那段 是根据屏幕长款设置 CameraView的长宽,因为你把Camera设成竖直的了,所以那里的长宽设置倒过来了,你可以相应换下就好了应该。我回家了手上没有环境,你先自己试一下吧。
from rtmprecoder.
是这样的,我把这个 view 设成全萤幕了,但是比例跟一般相机相差满多的,我在猜会不会是 camera 抓下来的大小是固定的关系,这边我给个两张图来看看比较清楚
from rtmprecoder.
是的,只支持几种固定尺寸 你可以google一下Android Camera 拉伸问题 上面会有解决方案
from rtmprecoder.
非常感谢,研究后解决了
from rtmprecoder.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtmprecoder.