完善了通过指令下发的直播流程
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user