This commit is contained in:
Genteure 2018-03-13 14:23:53 +08:00
parent aa2a4f1519
commit 3b33e9d65f
6 changed files with 98 additions and 3 deletions

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BililiveRecorder.Core
{
public delegate void StreamStatusChangedEvent(object sender, StreamStatusChangedArgs e);
public class StreamStatusChangedArgs
{
public StreamStatus status;
}
}

View File

@ -4,6 +4,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using BililiveRecorder.FlvProcessor;
@ -13,13 +14,29 @@ namespace BililiveRecorder.Core
{
public int RoomID;
public StreamMonitor streamMonitor;
public FlvStreamProcessor Processor; // FlvProcessor
public readonly ObservableCollection<FlvClipProcessor> Clips = new ObservableCollection<FlvClipProcessor>();
private HttpWebRequest webRequest;
public RecordedRoom()
{
Processor.BlockProcessed += Processor_BlockProcessed;
streamMonitor.StreamStatusChanged += StreamMonitor_StreamStatusChanged;
}
private void StreamMonitor_StreamStatusChanged(object sender, StreamStatusChangedArgs e)
{
if (e.status.isStreaming)
{
// TODO: 失败重试逻辑 & 掉线重连逻辑
_StartRecord();
}
}
private void _StartRecord()
{
throw new NotImplementedException();
}
// Called by API or GUI

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BililiveRecorder.Core
{
public class StreamMonitor
{
public event StreamStatusChangedEvent StreamStatusChanged;
public void Check()
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BililiveRecorder.Core
{
public class StreamStatus
{
// TODO:
public bool isStreaming
{
get
{
return false;
}
}
public bool HttpAPIStreaming
{
get
{
return false;
}
set
{
}
}
public bool DanmakuStreaming
{
get
{
return false;
}
set
{
}
}
}
}

View File

@ -11,8 +11,6 @@ namespace BililiveRecorder.FlvProcessor
public readonly FlvHeader Header = new FlvHeader();
private readonly List<FlvDataBlock> dataBlocks = new List<FlvDataBlock>();
private HttpWebRequest webRequest;
public event BlockProcessedEvent BlockProcessed;

View File

@ -11,6 +11,14 @@
- 绑定 ObservableCollection
- 命令行 + 配置文件 跨平台录制工具 | Standard
- WPF界面
- `Recorder` 核心录制逻辑在这里
- `StreamMonitor`
- `DanmakuReceiver`
- `HttpWebRequest`
- `FlvStreamProcessor`
- `ObservableCollection<FlvClipProcessor>`
## flv处理模块 `FlvStreamProcessor`
- 对外提供的API应该继承 IDisposable