当前位置: 首页>>代码示例>>Java>>正文


Java SurfaceView.getContext方法代码示例

本文整理汇总了Java中android.view.SurfaceView.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceView.getContext方法的具体用法?Java SurfaceView.getContext怎么用?Java SurfaceView.getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.SurfaceView的用法示例。


在下文中一共展示了SurfaceView.getContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ExtVideoCapture

import android.view.SurfaceView; //导入方法依赖的package包/类
public ExtVideoCapture(SurfaceView sv) {
    sv.getHolder().addCallback(this);
    sv.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
    mContext = sv.getContext();
}
 
开发者ID:pili-engineering,项目名称:PLDroidRTCStreaming,代码行数:6,代码来源:ExtVideoCapture.java

示例2: RtmpCamera2

import android.view.SurfaceView; //导入方法依赖的package包/类
public RtmpCamera2(SurfaceView surfaceView, ConnectCheckerRtmp connectChecker) {
  super(surfaceView, surfaceView.getContext());
  srsFlvMuxer = new SrsFlvMuxer(connectChecker);
}
 
开发者ID:pedroSG94,项目名称:rtmp-rtsp-stream-client-java,代码行数:5,代码来源:RtmpCamera2.java

示例3: RtspCamera2

import android.view.SurfaceView; //导入方法依赖的package包/类
public RtspCamera2(SurfaceView surfaceView, ConnectCheckerRtsp connectCheckerRtsp) {
  super(surfaceView, surfaceView.getContext());
  rtspClient = new RtspClient(connectCheckerRtsp);
}
 
开发者ID:pedroSG94,项目名称:rtmp-rtsp-stream-client-java,代码行数:5,代码来源:RtspCamera2.java

示例4: onCreate

import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_live_camera);
        if (Build.VERSION.SDK_INT >= 23) {
            permissionCheck();
        } else {
            mHasPermission = true;
        }
        mScaledTouchSlop = ViewConfiguration.get(this).getScaledTouchSlop();//判断是否滑动的基准
        getExtraData();
        initView();
        setRequestedOrientation(screenOrientation ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        //采集
        _CameraSurface = (SurfaceView) findViewById(R.id.camera_surface);
        _CameraSurface.getHolder().addCallback(_CameraSurfaceCallback);
        _CameraSurface.setOnTouchListener(mOnTouchListener);
        //对焦,缩放
        mDetector = new GestureDetector(_CameraSurface.getContext(), mGestureDetector);
        mScaleDetector = new ScaleGestureDetector(_CameraSurface.getContext(), mScaleGestureListener);

        mMediaRecorder = AlivcMediaRecorderFactory.createMediaRecorder();
        mMediaRecorder.init(this);

        //注册推流状态回调监听
        mMediaRecorder.setOnRecordStatusListener(mRecordStatusListener);
        mMediaRecorder.setOnNetworkStatusListener(mOnNetworkStatusListener);
        mMediaRecorder.setOnRecordErrorListener(mOnErrorListener);

        mConfigure.put(AlivcMediaFormat.KEY_CAMERA_FACING, cameraFrontFacing);
        mConfigure.put(AlivcMediaFormat.KEY_I_FRAME_INTERNAL, 3);
        mConfigure.put(AlivcMediaFormat.KEY_MAX_ZOOM_LEVEL, 3);
        mConfigure.put(AlivcMediaFormat.KEY_OUTPUT_RESOLUTION, resolution);
        mConfigure.put(AlivcMediaFormat.KEY_MAX_VIDEO_BITRATE, maxBitrate * 1000);
        mConfigure.put(AlivcMediaFormat.KEY_BEST_VIDEO_BITRATE, bestBitrate * 1000);
        mConfigure.put(AlivcMediaFormat.KEY_MIN_VIDEO_BITRATE, minBitrate * 1000);
        mConfigure.put(AlivcMediaFormat.KEY_INITIAL_VIDEO_BITRATE, initBitrate * 1000);
        mConfigure.put(AlivcMediaFormat.KEY_DISPLAY_ROTATION, screenOrientation ? AlivcMediaFormat.DISPLAY_ROTATION_90 : AlivcMediaFormat.DISPLAY_ROTATION_0);
//        mConfigure.put(AlivcMediaFormat.KEY_EXPOSURE_COMPENSATION, 10);//曝光度
        mConfigure.put(AlivcMediaFormat.KEY_WATERMARK, mWatermark);
        mConfigure.put(AlivcMediaFormat.KEY_FRAME_RATE, frameRate);
        mConfigure.put(AlivcMediaFormat.KEY_AUDIO_BITRATE, 32000);
        mConfigure.put(AlivcMediaFormat.KEY_AUDIO_SAMPLE_RATE, 44100);

        setLogo();

        wx_user_name.post(new Runnable() {
            @Override
            public void run() {
                View pop_talk_view = LayoutInflater.from(LiveCameraActivity.this).inflate(R.layout.pop_talk_layout, null);
                c_pop_talk_empty_tip = pop_talk_view.findViewById(R.id.c_pop_talk_empty_tip);
                pop_comment = new CustomPopupWindow.Builder(LiveCameraActivity.this)
                        .setView(pop_talk_view)
                        .setWidthAndHeight(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT)
                        .setOutsideTouchable(true)
                        .setAnimationStyle(R.style.AnimationFade)
                        .create();
                pop_comment.setOnDismissListener(new PopupWindow.OnDismissListener() {
                    @Override
                    public void onDismiss() {
                        int visible = push_state ? View.VISIBLE : View.INVISIBLE;
                        push_state_ll.setVisibility(visible);
                    }
                });
                mListView = (ListView) pop_talk_view.findViewById(R.id.lv_pop_comment);
            }
        });
    }
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:69,代码来源:LiveCameraActivity.java


注:本文中的android.view.SurfaceView.getContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。