OBSVideoFrame.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include "OBSVideoFrame.h"
  2. OBSVideoFrame::OBSVideoFrame(long width, long height)
  3. {
  4. this->width = width;
  5. this->height = height;
  6. this->rowBytes = width * 2;
  7. this->data = new unsigned char[width * height * 2 + 1];
  8. }
  9. HRESULT OBSVideoFrame::SetFlags(BMDFrameFlags newFlags)
  10. {
  11. flags = newFlags;
  12. return S_OK;
  13. }
  14. HRESULT OBSVideoFrame::SetTimecode(BMDTimecodeFormat format,
  15. IDeckLinkTimecode *timecode)
  16. {
  17. UNUSED_PARAMETER(format);
  18. UNUSED_PARAMETER(timecode);
  19. return 0;
  20. }
  21. HRESULT
  22. OBSVideoFrame::SetTimecodeFromComponents(BMDTimecodeFormat format,
  23. uint8_t hours, uint8_t minutes,
  24. uint8_t seconds, uint8_t frames,
  25. BMDTimecodeFlags flags)
  26. {
  27. UNUSED_PARAMETER(format);
  28. UNUSED_PARAMETER(hours);
  29. UNUSED_PARAMETER(minutes);
  30. UNUSED_PARAMETER(seconds);
  31. UNUSED_PARAMETER(frames);
  32. UNUSED_PARAMETER(flags);
  33. return 0;
  34. }
  35. HRESULT OBSVideoFrame::SetAncillaryData(IDeckLinkVideoFrameAncillary *ancillary)
  36. {
  37. UNUSED_PARAMETER(ancillary);
  38. return 0;
  39. }
  40. HRESULT OBSVideoFrame::SetTimecodeUserBits(BMDTimecodeFormat format,
  41. BMDTimecodeUserBits userBits)
  42. {
  43. UNUSED_PARAMETER(format);
  44. UNUSED_PARAMETER(userBits);
  45. return 0;
  46. }
  47. long OBSVideoFrame::GetWidth()
  48. {
  49. return width;
  50. }
  51. long OBSVideoFrame::GetHeight()
  52. {
  53. return height;
  54. }
  55. long OBSVideoFrame::GetRowBytes()
  56. {
  57. return rowBytes;
  58. }
  59. BMDPixelFormat OBSVideoFrame::GetPixelFormat()
  60. {
  61. return pixelFormat;
  62. }
  63. BMDFrameFlags OBSVideoFrame::GetFlags()
  64. {
  65. return flags;
  66. }
  67. HRESULT OBSVideoFrame::GetBytes(void **buffer)
  68. {
  69. *buffer = this->data;
  70. return S_OK;
  71. }