Advertisement
Guest User

Untitled

a guest
Dec 27th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #ifndef __LIVE_SOURCE_WITH_X264_H
  2. #define __LIVE_XOURCE_WITH_X264_H
  3.  
  4. #include "x264Encoder.h"
  5.  
  6. #include <iostream>
  7. #include <queue>
  8. #include <FramedSource.hh>
  9. #include <assert.h>
  10. #include "IRIS_EXT.h"
  11.  
  12. using namespace std;
  13.  
  14. class LiveSourceWithx264:public FramedSource
  15. {
  16. public:
  17. static LiveSourceWithx264* createNew(UsageEnvironment& env);
  18. static EventTriggerId eventTriggerId;
  19. char* rawImage;
  20. bool state_copy;
  21. protected:
  22. LiveSourceWithx264(UsageEnvironment& env);
  23. virtual ~LiveSourceWithx264(void);
  24. private:
  25. virtual void doGetNextFrame();
  26. static void deliverFrame0(void* clientData);
  27. void deliverFrame();
  28. void encodeNewFrame();
  29. static unsigned referenceCount;
  30. std::queue<x264_nal_t> nalQueue;
  31. timeval currentTime;
  32.  
  33. // videoCaptureDevice is my BGR data source. You can have according to your need
  34. // Remember the x264 encoder wrapper we wrote in the start
  35. x264Encoder *encoder;
  36. };
  37.  
  38. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement