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.

65 lines
1.9 KiB

7 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 "../../../alg/generic/md5.h"
  7. #ifndef __linux__
  8. //#include "platform/ms/platform_support.h"
  9. #endif
  10. /**
  11. * TODO: Add class description
  12. *
  13. * @author Gagua
  14. */
  15. class videoAVLIBSource : public basicMediaSource {
  16. private:
  17. config_setting_t *m_pConfig;
  18. char m_pCookie[33];
  19. VideoState *m_pVideoState;
  20. AVFrame *m_pFrame;
  21. #ifdef PROCESS_YUV420P
  22. #else
  23. AVFrame *m_pFrameBGR;
  24. #endif
  25. uint8_t *m_pOut_buffer;
  26. AVPacket *m_pPacket;
  27. int m_nWidth;
  28. int m_nHeight;
  29. int m_iY_size;
  30. struct SwsContext *img_convert_ctx;
  31. void m_fThreadProc( void );
  32. #ifndef _NOAUDIO_
  33. mediaBus *m_pAudioBus;
  34. static void *m_tAudioProc( void *args);
  35. #endif
  36. bool m_bSizeIsAutomatic;
  37. public:
  38. 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 );
  39. bool _close( void );
  40. bool _stop( void );
  41. // Constructor
  42. videoAVLIBSource();
  43. videoAVLIBSource( CSTR URI );
  44. videoAVLIBSource( config_setting_t *CFG );
  45. // Destructor
  46. virtual ~videoAVLIBSource();
  47. bool setSize( int Width,
  48. int Height );
  49. bool setProportionalByWidth( int Width );
  50. bool setProportionalByHeight( int Height );
  51. bool setFPS( int );
  52. bool setName( CSTR Name );
  53. bool setFrameAspectRatio( FrameAspectRatio AspectRatio );
  54. //bool setConfig();
  55. };
  56. #endif // __VIDEOAVLIBSOURCE_H_INCL__