11 #include "AddonClass.h" 12 #include "Exception.h" 13 #include "ServiceBroker.h" 14 #include "application/ApplicationComponents.h" 15 #include "application/ApplicationPlayer.h" 16 #include "commons/Buffer.h" 24 XBMCCOMMONS_STANDARD_EXCEPTION(RenderCaptureException);
40 unsigned int m_captureId;
42 unsigned int m_height;
48 m_captureId = UINT_MAX;
55 auto& components = CServiceBroker::GetAppComponents();
57 appPlayer->RenderCaptureRelease(m_captureId);
61 #ifdef DOXYGEN_SHOULD_USE_THIS 74 inline int getWidth() {
return m_width; }
77 #ifdef DOXYGEN_SHOULD_USE_THIS 89 inline int getHeight() {
return m_height; }
92 #ifdef DOXYGEN_SHOULD_USE_THIS 103 inline float getAspectRatio()
105 const auto& components = CServiceBroker::GetAppComponents();
107 return appPlayer->GetRenderAspectRatio();
111 #ifdef DOXYGEN_SHOULD_USE_THIS 125 inline const char* getImageFormat()
131 #ifdef DOXYGEN_SHOULD_USE_THIS 152 if (!GetPixels(msecs))
155 size_t size = m_width * m_height * 4;
159 #ifdef DOXYGEN_SHOULD_USE_THIS 174 inline void capture(
int width,
int height)
177 auto& components = CServiceBroker::GetAppComponents();
182 appPlayer->RenderCaptureRelease(m_captureId);
185 m_captureId = appPlayer->RenderCaptureAlloc();
188 m_buffer =
new uint8_t[m_width*m_height*4];
189 appPlayer->RenderCapture(m_captureId, m_width, m_height, CAPTUREFLAG_CONTINUOUS);
194 inline bool GetPixels(
unsigned int msec)
196 auto& components = CServiceBroker::GetAppComponents();
198 return appPlayer->RenderCaptureGetPixels(m_captureId, msec, m_buffer,
199 m_width * m_height * 4);
Definition: ApplicationPlayer.h:33
Definition: RenderCapture.h:38
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
This class is based on the java java.nio.Buffer class however, it does not implement the 'mark' funct...
Definition: Buffer.h:79
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57