2018-03-12 18:57:20 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2018-03-13 13:56:44 +08:00
|
|
|
|
using System.Net;
|
2018-03-12 18:57:20 +08:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace BililiveRecorder.FlvProcessor
|
|
|
|
|
{
|
|
|
|
|
public class FlvStreamProcessor : IDisposable
|
|
|
|
|
{
|
2018-03-13 13:56:44 +08:00
|
|
|
|
public RecordInfo Info; // not used for now.
|
|
|
|
|
public readonly FlvHeader Header = new FlvHeader();
|
|
|
|
|
private readonly List<FlvDataBlock> dataBlocks = new List<FlvDataBlock>();
|
|
|
|
|
|
|
|
|
|
|
2018-03-13 13:21:01 +08:00
|
|
|
|
public event BlockProcessedEvent BlockProcessed;
|
2018-03-12 18:57:20 +08:00
|
|
|
|
|
2018-03-13 13:56:44 +08:00
|
|
|
|
|
2018-03-12 18:57:20 +08:00
|
|
|
|
public FlvStreamProcessor(RecordInfo info)
|
|
|
|
|
{
|
|
|
|
|
Info = info;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-18 18:55:28 +08:00
|
|
|
|
public void AddBytes(byte[] data)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2018-03-13 13:21:01 +08:00
|
|
|
|
|
|
|
|
|
public FlvClipProcessor Clip()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 18:57:20 +08:00
|
|
|
|
#region IDisposable Support
|
|
|
|
|
private bool disposedValue = false; // To detect redundant calls
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
if (!disposedValue)
|
|
|
|
|
{
|
|
|
|
|
if (disposing)
|
|
|
|
|
{
|
|
|
|
|
// TODO: dispose managed state (managed objects).
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
|
|
|
|
|
// TODO: set large fields to null.
|
|
|
|
|
|
|
|
|
|
disposedValue = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.
|
|
|
|
|
// ~FlvProcessor() {
|
|
|
|
|
// // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
|
|
|
|
|
// Dispose(false);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// This code added to correctly implement the disposable pattern.
|
|
|
|
|
void IDisposable.Dispose()
|
|
|
|
|
{
|
|
|
|
|
// Do not change this code. Put cleanup code in Dispose(bool disposing) above.
|
|
|
|
|
Dispose(true);
|
|
|
|
|
// TODO: uncomment the following line if the finalizer is overridden above.
|
|
|
|
|
// GC.SuppressFinalize(this);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|