VideoRenderer.cpp 1.2 KB

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