VideoRenderer.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include <cstdint>
  2. #include <memory>
  3. #include <iostream>
  4. #include "PCANBasic.h"
  5. #include "../common/comm.h"
  6. #include "api.h"
  7. #include "VideoRenderer.h"
  8. #include "message_queue.h"
  9. VideoRenderer::VideoRenderer()
  10. {
  11. start_=false;
  12. }
  13. VideoRenderer::~VideoRenderer()
  14. {
  15. }
  16. /*
  17. void VideoRenderer::SetRenderSize(int32_t width,int32_t height)
  18. {
  19. SetSize(width,height);
  20. }
  21. void VideoRenderer::SetSize(int32_t width, int32_t height)
  22. {
  23. if (width_ == width && height_ == height) {
  24. return;
  25. }
  26. width_ = width;
  27. height_ = height;
  28. image_.reset(new uint8_t[width * height * 4]);
  29. }
  30. */
  31. void VideoRenderer::FrameCallback(void* user_data,void* data,const int32_t stride,const int32_t frame_width,const int32_t frame_height)
  32. {
  33. std::cout<<"FrameCallback"<<std::endl;
  34. // auto ptr = static_cast<VideoRenderer *>(user_data);
  35. // ptr->OnArgb32FrameReady(data, stride, frame_width, frame_height);
  36. }
  37. void VideoRenderer::OnArgb32FrameReady(const void* data, const int stride, const int frame_width, const int frame_height)
  38. {
  39. /*
  40. if(start_==false) return;
  41. std::cout<<frame_width<<","<<frame_height<<std::endl;
  42. */
  43. }
  44. void VideoRenderer::StartRender(bool bStart)
  45. {
  46. start_=bStart;
  47. }