完善了通过指令下发的直播流程

This commit is contained in:
董宏宇
2021-02-05 17:31:32 +08:00
parent cc9f96dc14
commit 81592c2a1a
6 changed files with 35 additions and 61 deletions

View File

@@ -1,7 +1,6 @@
package com.mogo.cloud;
import android.os.Bundle;
import android.util.Log;
import com.mogo.cloud.live.manager.CameraFrameManager;
import com.mogo.cloud.live.manager.ILiveStreamManager;
@@ -21,7 +20,6 @@ public class LivePushActivity extends BaseLiveActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 初始化直播流管理
ILiveStreamManager liveStreamManager = LiveStreamManagerImpl.getInstance(this, Devices.getSn());
liveStreamManager.uploadCamStatus(1, 1);
@@ -29,22 +27,13 @@ public class LivePushActivity extends BaseLiveActivity {
@Override
public void onVideoFrame(byte[] bytes, int bytesLength) {
if (!isLive) {
return;
}
//Log.i(TAG, "onVideoFrame byte length: " + bytesLength);
CameraFrameManager.getInstance().notifyYUVData(bytes, 1280, 720, 3);
}
@Override
public void toggleLive(boolean isLive) {
Log.i(TAG, "toggleLive : " + isLive);
this.isLive = isLive;
if (isLive) {
PushService.startService(this, PushService.ACTION_START_RTMP_PUSH, Devices.getSn());
} else {
PushService.startService(this, PushService.ACTION_STOP_RTMP_PUSH, null);
}
}
@Override