本文整理汇总了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();
}
示例2: RtmpCamera2
import android.view.SurfaceView; //导入方法依赖的package包/类
public RtmpCamera2(SurfaceView surfaceView, ConnectCheckerRtmp connectChecker) {
super(surfaceView, surfaceView.getContext());
srsFlvMuxer = new SrsFlvMuxer(connectChecker);
}
示例3: RtspCamera2
import android.view.SurfaceView; //导入方法依赖的package包/类
public RtspCamera2(SurfaceView surfaceView, ConnectCheckerRtsp connectCheckerRtsp) {
super(surfaceView, surfaceView.getContext());
rtspClient = new RtspClient(connectCheckerRtsp);
}
示例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);
}
});
}