基本信息
源码名称:android GlSurfaceView 显示摄像头
源码大小:22.67M
文件格式:.rar
开发语言:Java
更新时间:2016-03-31
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

package sskj.com.openglcamera;

import android.app.Activity;
import android.os.*;
import android.util.Log;
import android.view.WindowManager;
import android.widget.RelativeLayout;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class MainActivity extends Activity
{
    private CameraGLSurfaceView mGLView = null;
    private RGBAGLSurfaceView mRGBAGLView = null;
    private DrawYUVView mDrawView = null;
    private CameraView cameraView = null;
    private RelativeLayout previewLayout = null,GLpreviewLayout = null,DrawpreviewLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        //创建一个GLSurfaceView实例然后设置为activity的ContentView.
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
        RelativeLayout.LayoutParams layoutParams = null;
        //GL绘制窗口
        GLpreviewLayout = (RelativeLayout)findViewById(R.id.GLpreviewLayout);
        layoutParams = new RelativeLayout.LayoutParams(640,480);
        //mGLView = new CameraGLSurfaceView(this);
        mRGBAGLView = new RGBAGLSurfaceView(this);
        GLpreviewLayout.addView(mRGBAGLView, layoutParams);
        //视频窗口
        previewLayout = (RelativeLayout)findViewById(R.id.previewLayout);
        layoutParams = new RelativeLayout.LayoutParams(640,480);
        cameraView = new CameraView(this);
        cameraView.setSaveFrameCallback(mRGBAGLView);
        previewLayout.addView(cameraView, layoutParams);
        Log.v(CameraGLSurfaceView.ACTIVITY_TAG, "onCreate");
    }
}