Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CScreenShot Class Reference

#include <Screenshot.h>

Classes

struct  ScreenshotDeletion
 What a delete removed. More...
 
struct  ScreenshotFiles
 What a screenshot wrote, as paths under special://screenshots. More...
 

Public Types

enum class  ScreenshotError {
  NONE , NO_FOLDER , BAD_TARGET , NOT_FOUND ,
  FAILED
}
 Why a screenshot did not happen, so a caller can say which. More...
 

Static Public Member Functions

static void Register (const std::function< std::unique_ptr< IScreenshotSurface >()> &createFunc)
 
static std::unique_ptr< IScreenshotSurface > CreateSurface ()
 Create the platform's capture readback surface, null when none registered.
 
static void TakeScreenshot ()
 
static void TakeScreenshot (KODI::RENDERING::CAPTURE::CaptureContent content)
 Screenshot of the given content into the configured folder.
 
static void TakeScreenshot (const std::string &filename, KODI::RENDERING::CAPTURE::CaptureContent content=KODI::RENDERING::CAPTURE::CaptureContent::COMPOSITE)
 
static void TakeScreenshotBoth ()
 Capture the video-only image and the full composite from the same rendered frame into two files in the configured folder (screenshotNNNNN.png and screenshotNNNNN-video.png).
 
static ScreenshotFiles TakeScreenshotSync (KODI::RENDERING::CAPTURE::CaptureContent content, const std::string &target="")
 Screenshot of the given content, written before this returns; an unset folder is NO_FOLDER, never a prompt. A call made while another is in flight takes none of its own: it waits for that one and answers its result, whatever it asked for.
 
static int JoinedScreenshotCalls ()
 How many TakeScreenshotSync() calls are waiting for another call's screenshot.
 
static void SetMoveHook (std::function< void()> hook)
 Have hook called as a synchronous screenshot starts moving its files into place.
 
static bool IsScreenshotPath (const std::string &path)
 Whether a path names a screenshot: the special://screenshots folder and a plain .png name. None does while no screenshot folder is configured.
 
static ScreenshotDeletion DeleteScreenshots (const std::string &file="")
 Delete screenshots from the configured folder.
 

Member Enumeration Documentation

◆ ScreenshotError

enum class CScreenShot::ScreenshotError
strong

Why a screenshot did not happen, so a caller can say which.

Enumerator
NONE 
NO_FOLDER 

no screenshot folder is configured

BAD_TARGET 

the requested name is not a plain .png file name

NOT_FOUND 

the named screenshot is not in the folder

FAILED 

the frame did not arrive, or a file could not be written

Member Function Documentation

◆ CreateSurface()

std::unique_ptr< IScreenshotSurface > CScreenShot::CreateSurface ( )
static

Create the platform's capture readback surface, null when none registered.

◆ DeleteScreenshots()

CScreenShot::ScreenshotDeletion CScreenShot::DeleteScreenshots ( const std::string & file = "")
static

Delete screenshots from the configured folder.

Parameters
fileone screenshot, named as TakeScreenshotSync answers or as a bare name; every .png in the folder when empty

◆ IsScreenshotPath()

bool CScreenShot::IsScreenshotPath ( const std::string & path)
static

Whether a path names a screenshot: the special://screenshots folder and a plain .png name. None does while no screenshot folder is configured.

◆ JoinedScreenshotCalls()

int CScreenShot::JoinedScreenshotCalls ( )
static

How many TakeScreenshotSync() calls are waiting for another call's screenshot.

◆ Register()

void CScreenShot::Register ( const std::function< std::unique_ptr< IScreenshotSurface >()> & createFunc)
static

◆ SetMoveHook()

void CScreenShot::SetMoveHook ( std::function< void()> hook)
static

Have hook called as a synchronous screenshot starts moving its files into place.

◆ TakeScreenshot() [1/3]

void CScreenShot::TakeScreenshot ( )
static

◆ TakeScreenshot() [2/3]

void CScreenShot::TakeScreenshot ( const std::string & filename,
KODI::RENDERING::CAPTURE::CaptureContent content = KODI::RENDERING::CAPTURE::CaptureContent::COMPOSITE )
static

◆ TakeScreenshot() [3/3]

void CScreenShot::TakeScreenshot ( KODI::RENDERING::CAPTURE::CaptureContent content)
static

Screenshot of the given content into the configured folder.

◆ TakeScreenshotBoth()

void CScreenShot::TakeScreenshotBoth ( )
static

Capture the video-only image and the full composite from the same rendered frame into two files in the configured folder (screenshotNNNNN.png and screenshotNNNNN-video.png).

◆ TakeScreenshotSync()

CScreenShot::ScreenshotFiles CScreenShot::TakeScreenshotSync ( KODI::RENDERING::CAPTURE::CaptureContent content,
const std::string & target = "" )
static

Screenshot of the given content, written before this returns; an unset folder is NO_FOLDER, never a prompt. A call made while another is in flight takes none of its own: it waits for that one and answers its result, whatever it asked for.

Parameters
contentwhat to capture
targetfile name under the configured folder, auto-numbered when empty; the video frame takes the matching "-video" name

The documentation for this class was generated from the following files: