mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 03:32:20 +08:00
~
This commit is contained in:
parent
aa2a4f1519
commit
3b33e9d65f
12
BililiveRecorder.Core/Events.cs
Normal file
12
BililiveRecorder.Core/Events.cs
Normal 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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
17
BililiveRecorder.Core/StreamMonitor.cs
Normal file
17
BililiveRecorder.Core/StreamMonitor.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
43
BililiveRecorder.Core/StreamStatus.cs
Normal file
43
BililiveRecorder.Core/StreamStatus.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
|
8
Note.md
8
Note.md
|
@ -11,6 +11,14 @@
|
|||
- 绑定 ObservableCollection
|
||||
- 命令行 + 配置文件 跨平台录制工具 | Standard
|
||||
|
||||
- WPF界面
|
||||
- `Recorder` 核心录制逻辑在这里
|
||||
- `StreamMonitor`
|
||||
- `DanmakuReceiver`
|
||||
- `HttpWebRequest`
|
||||
- `FlvStreamProcessor`
|
||||
- `ObservableCollection<FlvClipProcessor>`
|
||||
|
||||
## flv处理模块 `FlvStreamProcessor`
|
||||
|
||||
- 对外提供的API应该继承 IDisposable
|
||||
|
|
Loading…
Reference in New Issue
Block a user