Consolidate playback APIs and add standalone OSD bitmap rendering
- move public PCM, image and presentation types into gvfg_playback.h and remove the separate backend headers from source and installation - keep WASAPI and D3D backends private while preserving the existing public type names, fields and static backend integration - move detailed preview delivery counters into a private header and expose their playback query only through the Debug diagnostics API - retain public preview information and basic presentation statistics, mark EQUEUE_FULL as reserved, and document capacity limits as advanced settings with recommended defaults - refresh customer guides, API reference and error handling for the single-header interface, presentation counter limits and EAUDIO handle-recreation policy - add SDK-owned standalone premultiplied BGRA text rendering with transparent backgrounds, measured dimensions, thread-local snapshot lifetime and validated output bounds Validation: git diff --cached --check passed. Release gvfg_playback and Customer Sample builds, standalone C/C++ header checks, Debug playback syntax checks and Release export inspection passed earlier in this session. Final follow-up changes affect comments and documentation only. No runtime or hardware playback validation was performed. The existing Release gvfg target was also checked and was up to date. OSD rendering changes were source-reviewed; no new bitmap or hardware test was run in this commit pass. Capture debug exports are unchanged.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
# Internal WASAPI backend. Only gvfg_playback is installed as a playback DLL.
|
||||
add_library(gvfg_audio_playback STATIC
|
||||
include/gvfg_audio_playback.h
|
||||
src/audio_backend_internal.h
|
||||
src/gvfg_audio_playback.cpp
|
||||
src/audio_output_internal.h
|
||||
)
|
||||
set_target_properties(gvfg_audio_playback PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF)
|
||||
target_include_directories(gvfg_audio_playback PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(gvfg_audio_playback PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../gvfg_playback/include)
|
||||
target_link_libraries(gvfg_audio_playback PRIVATE ole32)
|
||||
if(MSVC)
|
||||
target_compile_options(gvfg_audio_playback PRIVATE /utf-8 /EHsc)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/* Public PCM format types used by gvfg_playback.h. */
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t sample_rate;
|
||||
uint16_t channels;
|
||||
uint16_t bits_per_sample; /* Signed interleaved PCM; must be 16. */
|
||||
} gvfg_audio_playback_format_t;
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
/* Private static backend; not part of the customer API. */
|
||||
#include "gvfg_audio_playback.h"
|
||||
#include "gvfg_playback.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -86,6 +86,14 @@ gvfg_osd_status_t gvfg_osd_render(
|
||||
const gvfg_osd_config_t *config,
|
||||
const gvfg_osd_output_t *output);
|
||||
|
||||
/* Caller-owned, top-down BGRA8888 with premultiplied alpha. Ignores pixel_format.
|
||||
* Unlike YUV output, width may be odd. No RGB/YUV conversion is performed.
|
||||
*/
|
||||
gvfg_osd_status_t gvfg_osd_render_bgra(
|
||||
gvfg_osd_handle handle,
|
||||
const gvfg_osd_config_t *config,
|
||||
void *data, uint64_t data_size, uint32_t stride);
|
||||
|
||||
const char *gvfg_osd_strerror(
|
||||
gvfg_osd_status_t status);
|
||||
|
||||
|
||||
@@ -225,10 +225,11 @@ gvfg_osd_status_t createTextLayout(OsdContext &context, const char *text,
|
||||
return GVFG_OSD_OK;
|
||||
}
|
||||
|
||||
gvfg_osd_status_t renderMask(OsdContext &context,
|
||||
const gvfg_osd_config_t &config,
|
||||
uint8_t *destination,
|
||||
uint32_t destinationStride)
|
||||
gvfg_osd_status_t renderBitmap(OsdContext &context,
|
||||
const gvfg_osd_config_t &config,
|
||||
uint8_t *destination,
|
||||
uint32_t destinationStride,
|
||||
bool bgra = false)
|
||||
{
|
||||
MeasuredTextLayout textLayout;
|
||||
const gvfg_osd_status_t layoutStatus = createTextLayout(
|
||||
@@ -242,14 +243,14 @@ gvfg_osd_status_t renderMask(OsdContext &context,
|
||||
|
||||
ComPtr<IWICBitmap> bitmap;
|
||||
HRESULT hr = context.wic->CreateBitmap(config.width, config.height,
|
||||
GUID_WICPixelFormat8bppAlpha,
|
||||
bgra ? GUID_WICPixelFormat32bppPBGRA : GUID_WICPixelFormat8bppAlpha,
|
||||
WICBitmapCacheOnLoad, &bitmap);
|
||||
if (FAILED(hr))
|
||||
return GVFG_OSD_ERENDER;
|
||||
|
||||
D2D1_RENDER_TARGET_PROPERTIES properties = D2D1::RenderTargetProperties(
|
||||
D2D1_RENDER_TARGET_TYPE_SOFTWARE,
|
||||
D2D1::PixelFormat(DXGI_FORMAT_A8_UNORM,
|
||||
D2D1::PixelFormat(bgra ? DXGI_FORMAT_B8G8R8A8_UNORM : DXGI_FORMAT_A8_UNORM,
|
||||
D2D1_ALPHA_MODE_PREMULTIPLIED),
|
||||
96.0f, 96.0f);
|
||||
ComPtr<ID2D1RenderTarget> target;
|
||||
@@ -258,7 +259,8 @@ gvfg_osd_status_t renderMask(OsdContext &context,
|
||||
return GVFG_OSD_ERENDER;
|
||||
|
||||
ComPtr<ID2D1SolidColorBrush> brush;
|
||||
hr = target->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f), &brush);
|
||||
hr = target->CreateSolidColorBrush(
|
||||
D2D1::ColorF(bgra ? (config.color_rgb & 0xffffffu) : 0xffffffu, 1.0f), &brush);
|
||||
if (FAILED(hr))
|
||||
return GVFG_OSD_ERENDER;
|
||||
|
||||
@@ -285,12 +287,16 @@ gvfg_osd_status_t renderMask(OsdContext &context,
|
||||
FAILED(lock->GetDataPointer(&sourceSize, &source)) || !source)
|
||||
return GVFG_OSD_ERENDER;
|
||||
|
||||
const uint32_t rowBytes = config.width * (bgra ? 4u : 1u);
|
||||
if (sourceStride < rowBytes ||
|
||||
static_cast<uint64_t>(sourceStride) * (config.height - 1u) + rowBytes > sourceSize)
|
||||
return GVFG_OSD_ERENDER;
|
||||
for (uint32_t y = 0; y < config.height; ++y)
|
||||
{
|
||||
const uint8_t *sourceRow = source + static_cast<size_t>(y) * sourceStride;
|
||||
uint8_t *destinationRow = destination + static_cast<size_t>(y) * destinationStride;
|
||||
// The A8 bitmap already contains one coverage byte per pixel.
|
||||
std::memcpy(destinationRow, sourceRow, config.width);
|
||||
// Copy native WIC pixels without changing channels or alpha.
|
||||
std::memcpy(destinationRow, sourceRow, rowBytes);
|
||||
}
|
||||
return GVFG_OSD_OK;
|
||||
}
|
||||
@@ -534,7 +540,7 @@ gvfg_osd_status_t gvfg_osd_render(gvfg_osd_handle handle,
|
||||
try
|
||||
{
|
||||
std::memset(output->mask_data, 0, static_cast<size_t>(requiredMask));
|
||||
const gvfg_osd_status_t maskStatus = renderMask(
|
||||
const gvfg_osd_status_t maskStatus = renderBitmap(
|
||||
*static_cast<OsdContext *>(handle), *config,
|
||||
static_cast<uint8_t *>(output->mask_data), output->mask_stride);
|
||||
if (maskStatus != GVFG_OSD_OK)
|
||||
@@ -557,6 +563,33 @@ gvfg_osd_status_t gvfg_osd_render(gvfg_osd_handle handle,
|
||||
}
|
||||
}
|
||||
|
||||
gvfg_osd_status_t gvfg_osd_render_bgra(gvfg_osd_handle handle,
|
||||
const gvfg_osd_config_t *config,
|
||||
void *data, uint64_t data_size, uint32_t stride)
|
||||
{
|
||||
if (!handle || !config || !data ||
|
||||
config->struct_size != sizeof(gvfg_osd_config_t) ||
|
||||
!validAscii(config->text, config->text_length) || config->font_size_px == 0 ||
|
||||
config->width == 0 || config->height == 0 ||
|
||||
config->width > static_cast<uint32_t>((std::numeric_limits<INT>::max)()) ||
|
||||
config->height > static_cast<uint32_t>((std::numeric_limits<INT>::max)()) ||
|
||||
static_cast<uint64_t>(config->width) * 4u > stride)
|
||||
return GVFG_OSD_EINVAL;
|
||||
uint64_t bytes = 0;
|
||||
if (!checkedImageBytes(stride, config->height, bytes) || data_size < bytes ||
|
||||
bytes > (std::numeric_limits<UINT>::max)() ||
|
||||
bytes > (std::numeric_limits<size_t>::max)())
|
||||
return GVFG_OSD_EINVAL;
|
||||
try
|
||||
{
|
||||
std::memset(data, 0, static_cast<size_t>(bytes));
|
||||
return renderBitmap(*static_cast<OsdContext *>(handle), *config,
|
||||
static_cast<uint8_t *>(data), stride, true);
|
||||
}
|
||||
catch (const std::bad_alloc &) { return GVFG_OSD_ENOMEM; }
|
||||
catch (...) { return GVFG_OSD_ERENDER; }
|
||||
}
|
||||
|
||||
const char *gvfg_osd_strerror(gvfg_osd_status_t status)
|
||||
{
|
||||
switch (status)
|
||||
|
||||
@@ -14,8 +14,6 @@ set_target_properties(gvfg_playback PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC O
|
||||
target_include_directories(gvfg_playback
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../gvfg_preview/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../gvfg_audio_playback/include
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../gvfg_audio_playback/src
|
||||
@@ -42,10 +40,8 @@ endif()
|
||||
install(TARGETS gvfg_playback
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
# Backend headers supply the frame/format/stat types used by the public API.
|
||||
# The unified public header contains all playback types and declarations.
|
||||
install(FILES include/gvfg_playback.h
|
||||
../gvfg_audio_playback/include/gvfg_audio_playback.h
|
||||
../gvfg_preview/include/gvfg_preview.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
# This README describes private internals. Customer guides are installed by
|
||||
# the SDK root with the same relative layout as docs/.
|
||||
|
||||
@@ -147,7 +147,8 @@ stop/reset 取消 queue,不是無損 drain。reset 沿用舊 config,音訊
|
||||
呼叫端先停止/join read producers、release token,再停止 Playback 與 Capture。
|
||||
|
||||
詳細統計位於私有 `src/playback_debug.h`,不安裝到客戶套件。核心保留診斷計數與同步狀態。
|
||||
僅 Debug DLL 匯出 `gvfg_playback_debug_get_stats()`;內部工具須定義
|
||||
詳細 Preview delivery 計數型別位於私有 `../gvfg_preview/src/preview_delivery_stats.h`。
|
||||
僅 Debug DLL 匯出 `gvfg_playback_debug_get_stats()` 與 `gvfg_playback_debug_get_delivery_stats()`;內部工具須定義
|
||||
`GVFG_INTERNAL_DIAGNOSTICS=1` 並使用同一版私有標頭與 MSVC Debug 匯入庫。
|
||||
診斷結構不提供穩定 ABI 或舊大小相容;Release DLL 不匯出診斷查詢。
|
||||
config 仍要求目前完整的 struct_size。
|
||||
|
||||
@@ -15,5 +15,4 @@ EXPORTS
|
||||
gvfg_playback_destroy
|
||||
gvfg_playback_get_preview_info
|
||||
gvfg_playback_get_preview_stats
|
||||
gvfg_playback_get_delivery_stats
|
||||
gvfg_playback_strerror
|
||||
|
||||
@@ -7,8 +7,67 @@
|
||||
* Control calls (start/stop/reset/attach/destroy) must be serialized by the
|
||||
* caller; one video producer and one audio producer may submit concurrently.
|
||||
*/
|
||||
#include "gvfg_audio_playback.h"
|
||||
#include "gvfg_preview.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/* Public audio, image and presentation types. Backends remain private. */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t sample_rate;
|
||||
uint16_t channels;
|
||||
uint16_t bits_per_sample; /* Signed interleaved PCM; must be 16. */
|
||||
} gvfg_audio_playback_format_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GVFG_PREVIEW_PIXFMT_YUY2 = 1,
|
||||
GVFG_PREVIEW_PIXFMT_Y210 = 2,
|
||||
GVFG_PREVIEW_PIXFMT_GRAY16 = 4,
|
||||
|
||||
/* Four interleaved 16-bit UNORM components per pixel: R, G, B, A. */
|
||||
GVFG_PREVIEW_PIXFMT_RGBA16 = 5,
|
||||
|
||||
/* DICOM native YBR_FULL_422: four 16-bit words per pixel pair,
|
||||
* ordered Y0, Y1, Cb, Cr. Values are right-aligned to bit_depth. */
|
||||
GVFG_PREVIEW_PIXFMT_DICOM_YBR_FULL_422 = 6
|
||||
} gvfg_preview_pixel_format_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const void *data;
|
||||
uint64_t data_size;
|
||||
int width;
|
||||
int height;
|
||||
int pixel_format; /* gvfg_preview_pixel_format_t */
|
||||
int bit_depth;
|
||||
int row_bytes;
|
||||
uint64_t frame_id;
|
||||
} gvfg_preview_frame_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int active;
|
||||
int width;
|
||||
int height;
|
||||
int bit_depth;
|
||||
char pixel_format[32];
|
||||
char adapter_name[160];
|
||||
int adapter_index;
|
||||
} gvfg_preview_info_t;
|
||||
|
||||
/*
|
||||
* Preview presentation statistics.
|
||||
*
|
||||
* present_fps counts only frames accepted by DXGI Present, not physical
|
||||
* scanout. The rate uses successful presents from the most recent five
|
||||
* seconds. Pending preview replacements are excluded from this rate.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
double present_fps;
|
||||
uint64_t presented_frames;
|
||||
uint64_t skipped_presents;
|
||||
} gvfg_preview_stats_t;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef GVFG_PLAYBACK_BUILD
|
||||
@@ -30,7 +89,7 @@ typedef enum {
|
||||
GVFG_PLAYBACK_EINVAL = -1,
|
||||
GVFG_PLAYBACK_ESTATE = -2,
|
||||
GVFG_PLAYBACK_EOUTPUT = -3,
|
||||
GVFG_PLAYBACK_EQUEUE_FULL = -4,
|
||||
GVFG_PLAYBACK_EQUEUE_FULL = -4, /* Reserved; current APIs do not return this value. */
|
||||
GVFG_PLAYBACK_EDISCONTINUITY = -5,
|
||||
GVFG_PLAYBACK_EAUDIO = -6 /* A/V audio output disabled; video remains running. */
|
||||
} gvfg_playback_status_t;
|
||||
@@ -51,6 +110,7 @@ typedef struct {
|
||||
gvfg_playback_master_t master;
|
||||
gvfg_audio_playback_format_t audio_format;
|
||||
uint32_t preroll_ms; /* Default 100; required coverage of both streams. */
|
||||
/* Advanced capacity limits; normally keep the values from default_config. */
|
||||
uint32_t max_video_frames; /* Default 32; late preview frames are retired and counted. */
|
||||
uint32_t max_audio_ms; /* Default 1000. */
|
||||
uint64_t max_video_bytes; /* Default 256 MiB, including in-flight copy. */
|
||||
@@ -105,7 +165,6 @@ GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_stop(gvfg_playback p);
|
||||
GVFG_PLAYBACK_API void gvfg_playback_destroy(gvfg_playback p);
|
||||
GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_get_preview_info(gvfg_playback p, gvfg_preview_info_t *info);
|
||||
GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_get_preview_stats(gvfg_playback p, gvfg_preview_stats_t *stats);
|
||||
GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_get_delivery_stats(gvfg_playback p, gvfg_preview_delivery_stats_t *stats);
|
||||
GVFG_PLAYBACK_API const char *gvfg_playback_strerror(gvfg_playback_status_t status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -606,11 +606,13 @@ gvfg_playback_status_t gvfg_playback_get_preview_stats(gvfg_playback p, gvfg_pre
|
||||
*s = {}; return !p->preview || gvfg_preview_get_stats(p->preview, s) == GVFG_PREVIEW_OK ? GVFG_PLAYBACK_OK : GVFG_PLAYBACK_EOUTPUT;
|
||||
}
|
||||
|
||||
gvfg_playback_status_t gvfg_playback_get_delivery_stats(gvfg_playback p, gvfg_preview_delivery_stats_t *s) {
|
||||
#if GVFG_INTERNAL_DIAGNOSTICS
|
||||
gvfg_playback_status_t gvfg_playback_debug_get_delivery_stats(gvfg_playback p, gvfg_preview_delivery_stats_t *s) {
|
||||
if (!p || !s) return GVFG_PLAYBACK_EINVAL;
|
||||
std::lock_guard<std::mutex> lock(p->mutex);
|
||||
*s = {}; return !p->preview || gvfg_preview_get_delivery_stats(p->preview, s) == GVFG_PREVIEW_OK ? GVFG_PLAYBACK_OK : GVFG_PLAYBACK_EOUTPUT;
|
||||
}
|
||||
#endif
|
||||
const char *gvfg_playback_strerror(gvfg_playback_status_t s) {
|
||||
switch (s) {
|
||||
case GVFG_PLAYBACK_OK: return "ok";
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/* Internal playback diagnostics. Do not install or ship this header.
|
||||
* The query is exported only by Debug builds. No stable diagnostic ABI. */
|
||||
#include "gvfg_playback.h"
|
||||
#include "../../gvfg_preview/src/preview_delivery_stats.h"
|
||||
|
||||
typedef struct {
|
||||
int running;
|
||||
@@ -32,6 +33,8 @@ extern "C" {
|
||||
#endif
|
||||
GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_debug_get_stats(
|
||||
gvfg_playback p, gvfg_playback_debug_stats_t *stats);
|
||||
GVFG_PLAYBACK_API gvfg_playback_status_t gvfg_playback_debug_get_delivery_stats(
|
||||
gvfg_playback p, gvfg_preview_delivery_stats_t *stats);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
add_library(gvfg_preview STATIC
|
||||
include/gvfg_preview.h
|
||||
src/preview_delivery_stats.h
|
||||
src/preview_output_internal.h
|
||||
../../sdk/gvfg/src/gpu/d3d_conversion_pipeline.cpp
|
||||
../../sdk/gvfg/src/gpu/d3d_conversion_pipeline.h
|
||||
@@ -13,9 +13,8 @@ set_target_properties(gvfg_preview PROPERTIES
|
||||
)
|
||||
|
||||
target_include_directories(gvfg_preview
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../gvfg_playback/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/gvfg/src/gpu
|
||||
)
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
/* Public image and presentation types used by gvfg_playback.h. */
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GVFG_PREVIEW_PIXFMT_YUY2 = 1,
|
||||
GVFG_PREVIEW_PIXFMT_Y210 = 2,
|
||||
GVFG_PREVIEW_PIXFMT_GRAY16 = 4,
|
||||
|
||||
/* Four interleaved 16-bit UNORM components per pixel: R, G, B, A. */
|
||||
GVFG_PREVIEW_PIXFMT_RGBA16 = 5,
|
||||
|
||||
/* DICOM native YBR_FULL_422: four 16-bit words per pixel pair,
|
||||
* ordered Y0, Y1, Cb, Cr. Values are right-aligned to bit_depth. */
|
||||
GVFG_PREVIEW_PIXFMT_DICOM_YBR_FULL_422 = 6
|
||||
} gvfg_preview_pixel_format_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const void *data;
|
||||
uint64_t data_size;
|
||||
int width;
|
||||
int height;
|
||||
int pixel_format; /* gvfg_preview_pixel_format_t */
|
||||
int bit_depth;
|
||||
int row_bytes;
|
||||
uint64_t frame_id;
|
||||
} gvfg_preview_frame_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int active;
|
||||
int width;
|
||||
int height;
|
||||
int bit_depth;
|
||||
char pixel_format[32];
|
||||
char adapter_name[160];
|
||||
int adapter_index;
|
||||
} gvfg_preview_info_t;
|
||||
|
||||
/*
|
||||
* Preview presentation statistics.
|
||||
*
|
||||
* present_fps counts only frames accepted by DXGI Present, not physical
|
||||
* scanout. The rate uses successful presents from the most recent five
|
||||
* seconds. Pending preview replacements are excluded from this rate.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
double present_fps;
|
||||
uint64_t presented_frames;
|
||||
uint64_t skipped_presents;
|
||||
} gvfg_preview_stats_t;
|
||||
|
||||
/* Lifetime counters (until shutdown); configure/clear do not reset them.
|
||||
* submitted = presented + replaced + busy + failed + cancelled + in_flight.
|
||||
* Presented means DXGI accepted Present, not proof of physical scanout.
|
||||
* Failed render API calls are counted by the caller, not in submitted.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint64_t submitted;
|
||||
uint64_t presented;
|
||||
uint64_t replaced; /* Queued frames discarded after the 50 ms age limit. */
|
||||
uint64_t busy;
|
||||
uint64_t failed;
|
||||
uint64_t cancelled;
|
||||
uint64_t in_flight;
|
||||
uint64_t last_presented_id;
|
||||
uint64_t present_busy;
|
||||
uint64_t slots_busy;
|
||||
uint64_t last_busy_id;
|
||||
} gvfg_preview_delivery_stats_t;
|
||||
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
/* Private preview diagnostics; never install this header. */
|
||||
#include <stdint.h>
|
||||
|
||||
/* Lifetime counters (until shutdown); configure/clear do not reset them.
|
||||
* submitted = presented + replaced + busy + failed + cancelled + in_flight.
|
||||
* Presented means DXGI accepted Present, not proof of physical scanout.
|
||||
* Failed render API calls are counted by the caller, not in submitted.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint64_t submitted;
|
||||
uint64_t presented;
|
||||
uint64_t replaced; /* Queued frames discarded after the 50 ms age limit. */
|
||||
uint64_t busy;
|
||||
uint64_t failed;
|
||||
uint64_t cancelled;
|
||||
uint64_t in_flight;
|
||||
uint64_t last_presented_id;
|
||||
uint64_t present_busy;
|
||||
uint64_t slots_busy;
|
||||
uint64_t last_busy_id;
|
||||
} gvfg_preview_delivery_stats_t;
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
/* Private static backend; not part of the customer API. */
|
||||
#include "gvfg_preview.h"
|
||||
#include "gvfg_playback.h"
|
||||
#include "preview_delivery_stats.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user