DeckLinkAPI_v7_1.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /* -LICENSE-START-
  2. ** Copyright (c) 2009 Blackmagic Design
  3. **
  4. ** Permission is hereby granted, free of charge, to any person or organization
  5. ** obtaining a copy of the software and accompanying documentation covered by
  6. ** this license (the "Software") to use, reproduce, display, distribute,
  7. ** execute, and transmit the Software, and to prepare derivative works of the
  8. ** Software, and to permit third-parties to whom the Software is furnished to
  9. ** do so, all subject to the following:
  10. **
  11. ** The copyright notices in the Software and this entire statement, including
  12. ** the above license grant, this restriction and the following disclaimer,
  13. ** must be included in all copies of the Software, in whole or in part, and
  14. ** all derivative works of the Software, unless such copies or derivative
  15. ** works are solely in the form of machine-executable object code generated by
  16. ** a source language processor.
  17. **
  18. ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  21. ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  22. ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  23. ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  24. ** DEALINGS IN THE SOFTWARE.
  25. ** -LICENSE-END-
  26. */
  27. /* DeckLinkAPI_v7_1.h */
  28. #ifndef __DeckLink_API_v7_1_h__
  29. #define __DeckLink_API_v7_1_h__
  30. #include "DeckLinkAPI.h"
  31. #include "DeckLinkAPI_v10_11.h"
  32. // "B28131B6-59AC-4857-B5AC-CD75D5883E2F"
  33. #define IID_IDeckLinkDisplayModeIterator_v7_1 (REFIID){0xB2,0x81,0x31,0xB6,0x59,0xAC,0x48,0x57,0xB5,0xAC,0xCD,0x75,0xD5,0x88,0x3E,0x2F}
  34. // "AF0CD6D5-8376-435E-8433-54F9DD530AC3"
  35. #define IID_IDeckLinkDisplayMode_v7_1 (REFIID){0xAF,0x0C,0xD6,0xD5,0x83,0x76,0x43,0x5E,0x84,0x33,0x54,0xF9,0xDD,0x53,0x0A,0xC3}
  36. // "EBD01AFA-E4B0-49C6-A01D-EDB9D1B55FD9"
  37. #define IID_IDeckLinkVideoOutputCallback_v7_1 (REFIID){0xEB,0xD0,0x1A,0xFA,0xE4,0xB0,0x49,0xC6,0xA0,0x1D,0xED,0xB9,0xD1,0xB5,0x5F,0xD9}
  38. // "7F94F328-5ED4-4E9F-9729-76A86BDC99CC"
  39. #define IID_IDeckLinkInputCallback_v7_1 (REFIID){0x7F,0x94,0xF3,0x28,0x5E,0xD4,0x4E,0x9F,0x97,0x29,0x76,0xA8,0x6B,0xDC,0x99,0xCC}
  40. // "AE5B3E9B-4E1E-4535-B6E8-480FF52F6CE5"
  41. #define IID_IDeckLinkOutput_v7_1 (REFIID){0xAE,0x5B,0x3E,0x9B,0x4E,0x1E,0x45,0x35,0xB6,0xE8,0x48,0x0F,0xF5,0x2F,0x6C,0xE5}
  42. // "2B54EDEF-5B32-429F-BA11-BB990596EACD"
  43. #define IID_IDeckLinkInput_v7_1 (REFIID){0x2B,0x54,0xED,0xEF,0x5B,0x32,0x42,0x9F,0xBA,0x11,0xBB,0x99,0x05,0x96,0xEA,0xCD}
  44. // "333F3A10-8C2D-43CF-B79D-46560FEEA1CE"
  45. #define IID_IDeckLinkVideoFrame_v7_1 (REFIID){0x33,0x3F,0x3A,0x10,0x8C,0x2D,0x43,0xCF,0xB7,0x9D,0x46,0x56,0x0F,0xEE,0xA1,0xCE}
  46. // "C8B41D95-8848-40EE-9B37-6E3417FB114B"
  47. #define IID_IDeckLinkVideoInputFrame_v7_1 (REFIID){0xC8,0xB4,0x1D,0x95,0x88,0x48,0x40,0xEE,0x9B,0x37,0x6E,0x34,0x17,0xFB,0x11,0x4B}
  48. // "C86DE4F6-A29F-42E3-AB3A-1363E29F0788"
  49. #define IID_IDeckLinkAudioInputPacket_v7_1 (REFIID){0xC8,0x6D,0xE4,0xF6,0xA2,0x9F,0x42,0xE3,0xAB,0x3A,0x13,0x63,0xE2,0x9F,0x07,0x88}
  50. #if defined(__cplusplus)
  51. class IDeckLinkDisplayModeIterator_v7_1;
  52. class IDeckLinkDisplayMode_v7_1;
  53. class IDeckLinkVideoFrame_v7_1;
  54. class IDeckLinkVideoInputFrame_v7_1;
  55. class IDeckLinkAudioInputPacket_v7_1;
  56. class BMD_PUBLIC IDeckLinkDisplayModeIterator_v7_1 : public IUnknown
  57. {
  58. public:
  59. virtual HRESULT STDMETHODCALLTYPE Next (IDeckLinkDisplayMode_v7_1* *deckLinkDisplayMode) = 0;
  60. };
  61. class BMD_PUBLIC IDeckLinkDisplayMode_v7_1 : public IUnknown
  62. {
  63. public:
  64. virtual HRESULT STDMETHODCALLTYPE GetName (const char **name) = 0;
  65. virtual BMDDisplayMode STDMETHODCALLTYPE GetDisplayMode () = 0;
  66. virtual long STDMETHODCALLTYPE GetWidth () = 0;
  67. virtual long STDMETHODCALLTYPE GetHeight () = 0;
  68. virtual HRESULT STDMETHODCALLTYPE GetFrameRate (BMDTimeValue *frameDuration, BMDTimeScale *timeScale) = 0;
  69. };
  70. class BMD_PUBLIC IDeckLinkVideoOutputCallback_v7_1 : public IUnknown
  71. {
  72. public:
  73. virtual HRESULT STDMETHODCALLTYPE ScheduledFrameCompleted (IDeckLinkVideoFrame_v7_1* completedFrame, BMDOutputFrameCompletionResult result) = 0;
  74. };
  75. class BMD_PUBLIC IDeckLinkInputCallback_v7_1 : public IUnknown
  76. {
  77. public:
  78. virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived (IDeckLinkVideoInputFrame_v7_1* videoFrame, IDeckLinkAudioInputPacket_v7_1* audioPacket) = 0;
  79. };
  80. // IDeckLinkOutput_v7_1. Created by QueryInterface from IDeckLink.
  81. class BMD_PUBLIC IDeckLinkOutput_v7_1 : public IUnknown
  82. {
  83. public:
  84. // Display mode predicates
  85. virtual HRESULT STDMETHODCALLTYPE DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDDisplayModeSupport_v10_11 *result) = 0;
  86. virtual HRESULT STDMETHODCALLTYPE GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1* *iterator) = 0;
  87. // Video output
  88. virtual HRESULT STDMETHODCALLTYPE EnableVideoOutput (BMDDisplayMode displayMode) = 0;
  89. virtual HRESULT STDMETHODCALLTYPE DisableVideoOutput () = 0;
  90. virtual HRESULT STDMETHODCALLTYPE SetVideoOutputFrameMemoryAllocator (IDeckLinkMemoryAllocator* theAllocator) = 0;
  91. virtual HRESULT STDMETHODCALLTYPE CreateVideoFrame (int32_t width, int32_t height, int32_t rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1* *outFrame) = 0;
  92. virtual HRESULT STDMETHODCALLTYPE CreateVideoFrameFromBuffer (void* buffer, int32_t width, int32_t height, int32_t rowBytes, BMDPixelFormat pixelFormat, BMDFrameFlags flags, IDeckLinkVideoFrame_v7_1* *outFrame) = 0;
  93. virtual HRESULT STDMETHODCALLTYPE DisplayVideoFrameSync (IDeckLinkVideoFrame_v7_1* theFrame) = 0;
  94. virtual HRESULT STDMETHODCALLTYPE ScheduleVideoFrame (IDeckLinkVideoFrame_v7_1* theFrame, BMDTimeValue displayTime, BMDTimeValue displayDuration, BMDTimeScale timeScale) = 0;
  95. virtual HRESULT STDMETHODCALLTYPE SetScheduledFrameCompletionCallback (IDeckLinkVideoOutputCallback_v7_1* theCallback) = 0;
  96. // Audio output
  97. virtual HRESULT STDMETHODCALLTYPE EnableAudioOutput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount) = 0;
  98. virtual HRESULT STDMETHODCALLTYPE DisableAudioOutput () = 0;
  99. virtual HRESULT STDMETHODCALLTYPE WriteAudioSamplesSync (void* buffer, uint32_t sampleFrameCount, uint32_t *sampleFramesWritten) = 0;
  100. virtual HRESULT STDMETHODCALLTYPE BeginAudioPreroll () = 0;
  101. virtual HRESULT STDMETHODCALLTYPE EndAudioPreroll () = 0;
  102. virtual HRESULT STDMETHODCALLTYPE ScheduleAudioSamples (void* buffer, uint32_t sampleFrameCount, BMDTimeValue streamTime, BMDTimeScale timeScale, uint32_t *sampleFramesWritten) = 0;
  103. virtual HRESULT STDMETHODCALLTYPE GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount) = 0;
  104. virtual HRESULT STDMETHODCALLTYPE FlushBufferedAudioSamples () = 0;
  105. virtual HRESULT STDMETHODCALLTYPE SetAudioCallback (IDeckLinkAudioOutputCallback* theCallback) = 0;
  106. // Output control
  107. virtual HRESULT STDMETHODCALLTYPE StartScheduledPlayback (BMDTimeValue playbackStartTime, BMDTimeScale timeScale, double playbackSpeed) = 0;
  108. virtual HRESULT STDMETHODCALLTYPE StopScheduledPlayback (BMDTimeValue stopPlaybackAtTime, BMDTimeValue *actualStopTime, BMDTimeScale timeScale) = 0;
  109. virtual HRESULT STDMETHODCALLTYPE GetHardwareReferenceClock (BMDTimeScale desiredTimeScale, BMDTimeValue *elapsedTimeSinceSchedulerBegan) = 0;
  110. };
  111. // IDeckLinkInput_v7_1. Created by QueryInterface from IDeckLink.
  112. class BMD_PUBLIC IDeckLinkInput_v7_1 : public IUnknown
  113. {
  114. public:
  115. virtual HRESULT STDMETHODCALLTYPE DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDDisplayModeSupport_v10_11 *result) = 0;
  116. virtual HRESULT STDMETHODCALLTYPE GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1 **iterator) = 0;
  117. // Video input
  118. virtual HRESULT STDMETHODCALLTYPE EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat, BMDVideoInputFlags flags) = 0;
  119. virtual HRESULT STDMETHODCALLTYPE DisableVideoInput () = 0;
  120. // Audio input
  121. virtual HRESULT STDMETHODCALLTYPE EnableAudioInput (BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount) = 0;
  122. virtual HRESULT STDMETHODCALLTYPE DisableAudioInput () = 0;
  123. virtual HRESULT STDMETHODCALLTYPE ReadAudioSamples (void* buffer, uint32_t sampleFrameCount, uint32_t *sampleFramesRead, BMDTimeValue *audioPacketTime, BMDTimeScale timeScale) = 0;
  124. virtual HRESULT STDMETHODCALLTYPE GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount) = 0;
  125. virtual HRESULT STDMETHODCALLTYPE StartStreams () = 0;
  126. virtual HRESULT STDMETHODCALLTYPE StopStreams () = 0;
  127. virtual HRESULT STDMETHODCALLTYPE PauseStreams () = 0;
  128. virtual HRESULT STDMETHODCALLTYPE SetCallback (IDeckLinkInputCallback_v7_1* theCallback) = 0;
  129. };
  130. // IDeckLinkVideoFrame_v7_1. Created by IDeckLinkOutput::CreateVideoFrame.
  131. class BMD_PUBLIC IDeckLinkVideoFrame_v7_1 : public IUnknown
  132. {
  133. public:
  134. virtual long STDMETHODCALLTYPE GetWidth () = 0;
  135. virtual long STDMETHODCALLTYPE GetHeight () = 0;
  136. virtual long STDMETHODCALLTYPE GetRowBytes () = 0;
  137. virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat () = 0;
  138. virtual BMDFrameFlags STDMETHODCALLTYPE GetFlags () = 0;
  139. virtual HRESULT STDMETHODCALLTYPE GetBytes (void* *buffer) = 0;
  140. };
  141. // IDeckLinkVideoInputFrame_v7_1. Provided by the IDeckLinkInput_v7_1 frame arrival callback.
  142. class BMD_PUBLIC IDeckLinkVideoInputFrame_v7_1 : public IDeckLinkVideoFrame_v7_1
  143. {
  144. public:
  145. virtual HRESULT STDMETHODCALLTYPE GetFrameTime (BMDTimeValue *frameTime, BMDTimeValue *frameDuration, BMDTimeScale timeScale) = 0;
  146. };
  147. // IDeckLinkAudioInputPacket_v7_1. Provided by the IDeckLinkInput_v7_1 callback.
  148. class BMD_PUBLIC IDeckLinkAudioInputPacket_v7_1 : public IUnknown
  149. {
  150. public:
  151. virtual long STDMETHODCALLTYPE GetSampleCount () = 0;
  152. virtual HRESULT STDMETHODCALLTYPE GetBytes (void* *buffer) = 0;
  153. virtual HRESULT STDMETHODCALLTYPE GetAudioPacketTime (BMDTimeValue *packetTime, BMDTimeScale timeScale) = 0;
  154. };
  155. #endif // defined(__cplusplus)
  156. #endif // __DeckLink_API_v7_1_h__