VideoLayer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef NULLSOFT_VIDEOLAYERH
  2. #define NULLSOFT_VIDEOLAYERH
  3. #include "WMHandler.h"
  4. #include "OutputStream.h"
  5. #include <wmsdk.h>
  6. #include "VideoDataConverter.h"
  7. #include "Config.h"
  8. #include "VideoThread.h"
  9. #define VIDEO_ACCEPTABLE_JITTER (config_video_jitter*10000)
  10. #define VIDEO_ACCEPTABLE_JITTER_MS (config_video_jitter)
  11. class VideoLayer : public WMHandler
  12. {
  13. public:
  14. VideoLayer(IWMReader *_reader);
  15. ~VideoLayer();
  16. bool IsOpen();
  17. void Kill();
  18. private:
  19. // WMHandler
  20. void VideoFrameDrop(DWORD lateness);
  21. void SampleReceived(QWORD &timeStamp, QWORD &duration, unsigned long &outputNum, unsigned long &flags, INSSBuffer *&sample);
  22. void Opened();
  23. void AudioBufferMilliseconds(long ms);
  24. void Closed();
  25. void Started();
  26. void Stopped();
  27. void HasVideo(bool &video);
  28. // utility methods
  29. bool AttemptOpenVideo(VideoOutputStream *attempt);
  30. bool OpenVideo();
  31. // other people's data
  32. IWMReader *reader;
  33. // our data
  34. IWMReaderAdvanced2 *reader2;
  35. IWMHeaderInfo *header;
  36. int videoOutputNum;
  37. DWORD offset;
  38. long nextRest;
  39. VideoDataConverter *converter;
  40. VideoOutputStream *videoStream;
  41. bool videoOpened;
  42. QWORD catchupTime;
  43. double aspect;
  44. int fourcc;
  45. bool flip;
  46. int videoWidth, videoHeight;
  47. HANDLE killSwitch;
  48. DWORD earlyDelivery;
  49. bool drmProtected;
  50. bool video_output_opened;
  51. VideoThread videoThread;
  52. };
  53. #endif