You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.9 KiB

8 years ago
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
8 years ago
​
​
​
​
8 years ago
8 years ago
8 years ago
​
​
​
​
​
​
8 years ago
​
8 years ago
8 years ago
​
​
8 years ago
​
​
8 years ago
​
​
​
​
​
​
​
​
​
  1. #ifndef __VIDEOAVLIBSOURCE_H_INCL__
  2. #define __VIDEOAVLIBSOURCE_H_INCL__
  3. #include "../../../components/base/basicLIBAV.h"
  4. #include "../../../components/base/basicMediaSource.h"
  5. #include "../../../components/base/basicSettings.h"
  6. #include "../../../components/base/basicThread.h"
  7. #include "../../../components/base/basicLogCollection.h"
  8. #include "../../../alg/generic/md5.h"
  9. /**
  10. * TODO: Add class description
  11. *
  12. * @author Gagua
  13. */
  14. class videoAVLIBSource : public basicMediaSource, public basicThread {
  15. private:
  16. basicLogCollection * m_pLog;
  17. config_setting_t * m_pConfig;
  18. char m_pCookie[33];
  19. VideoState * m_pVideoState;
  20. AVFrame * m_pFrame;
  21. #ifdef PROCESS_YUV420P
  22. AVFrame * m_pFrameYUV;
  23. #else
  24. AVFrame * m_pFrameBGR;
  25. #endif
  26. uint8_t * m_pOut_buffer;
  27. AVPacket * m_pPacket;
  28. int m_nWidth;
  29. int m_nHeight;
  30. int m_iY_size;
  31. struct SwsContext * img_convert_ctx;
  32. void m_fThreadProc( void );
  33. #ifndef _NOAUDIO_
  34. mediaBus * m_pAudioBus;
  35. static void * m_tAudioProc( void *args);
  36. #endif
  37. bool m_bSizeIsAutomatic;
  38. public:
  39. bool _open( CSTR URI, bool ShowDeviceMenu = false, float framerate=-1.f, int inputPin = -1, int width = -1, int height = -1 , bool scaled=false, int s_width=-1, int s_height=-1 );
  40. bool _close( void );
  41. bool _stop( void );
  42. videoAVLIBSource();
  43. videoAVLIBSource( CSTR URI );
  44. videoAVLIBSource( config_setting_t *CFG );
  45. virtual ~videoAVLIBSource();
  46. bool setSize( int Width,
  47. int Height );
  48. bool setProportionalByWidth( int Width );
  49. bool setProportionalByHeight( int Height );
  50. bool setFPS( int );
  51. bool setName( CSTR Name );
  52. bool setFrameAspectRatio( FrameAspectRatio AspectRatio );
  53. };
  54. #endif // __VIDEOAVLIBSOURCE_H_INCL__