StreamProcessor.h 658 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "FLVProcessor.h"
  3. #include "../nu/RingBuffer.h"
  4. class StreamProcessor : public FLVProcessor
  5. {
  6. public:
  7. StreamProcessor();
  8. private:
  9. int Write(void *data, size_t datalen, size_t *written);
  10. int Process();
  11. uint64_t Seek(uint64_t position);
  12. size_t Read(void *data, size_t bytes);
  13. uint64_t GetProcessedPosition();
  14. bool GetFrame(size_t frameIndex, FrameData &frameData);
  15. uint32_t GetMaxTimestamp();
  16. bool GetPosition(int time_in_ms, size_t *frameIndex, bool needVideoKeyFrame);
  17. bool IsStreaming() { return true; }
  18. FLVHeader *GetHeader();
  19. private:
  20. RingBuffer buffer;
  21. uint64_t bytesWritten;
  22. bool readHeader;
  23. FLVHeader header;
  24. };