整理代码

pull/107/head
xufulong 5 years ago
parent 4f08770cf0
commit c9beb5c957
  1. 2
      Live/src/main/java/com/frank/live/Push/VideoPusher.java
  2. 18
      Live/src/main/java/com/frank/live/PushActivity.java

@ -2,7 +2,6 @@ package com.frank.live.Push;
import android.graphics.ImageFormat;
import android.hardware.Camera;
import android.util.Log;
import android.view.SurfaceHolder;
import com.frank.live.LiveUtil;
@ -116,7 +115,6 @@ public class VideoPusher extends Pusher implements SurfaceHolder.Callback, Camer
public void onPreviewFrame(byte[] data, Camera camera) {
camera.addCallbackBuffer(previewBuffer);
if(isPushing){
// Log.i("VideoPusher", "isPushing...");
liveUtil.pushVideoData(data);
}
}

@ -11,6 +11,7 @@ import android.os.Bundle;
import android.os.Environment;
import androidx.annotation.NonNull;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.View;
@ -81,13 +82,13 @@ public class PushActivity extends Activity implements Callback {
private void initView(){
//SurfaceView
mSmartCameraView = (SmartCameraView) findViewById(R.id.gl_surfaceview);
mSmartCameraView = findViewById(R.id.gl_surfaceview);
//美颜类型
beautyTypeSelector = (Spinner) findViewById(R.id.beauty_type_selctor);
beautyTypeSelector = findViewById(R.id.beauty_type_selctor);
//静音
btnMute = (Button) findViewById(R.id.button_mute);
btnMute = findViewById(R.id.button_mute);
//拍照
img_photo = (ImageView) findViewById(R.id.img_photo);
img_photo = findViewById(R.id.img_photo);
}
private void initListener(){
@ -246,16 +247,16 @@ public class PushActivity extends Activity implements Callback {
int rotation = activity.getWindowManager ().getDefaultDisplay ().getRotation ();
int degrees = 0;
switch (rotation) {
case 0:
case Surface.ROTATION_0:
degrees = 0;
break;
case 1:
case Surface.ROTATION_90:
degrees = 90;
break;
case 2:
case Surface.ROTATION_180:
degrees = 180;
break;
case 3:
case Surface.ROTATION_270:
degrees = 270;
break;
}
@ -275,7 +276,6 @@ public class PushActivity extends Activity implements Callback {
@Override
protected void onDestroy(){
Log.i(TAG, "activity destory!");
if ( isStart ) {
isStart = false;

Loading…
Cancel
Save