Refine signal status API layout
This commit is contained in:
+46
-30
@@ -269,6 +269,16 @@ typedef struct
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
int video_format_code;
|
||||
char video_format[16];
|
||||
int frame_rate_code;
|
||||
char frame_rate_bits[5];
|
||||
char frame_rate_name[16];
|
||||
int bit_depth;
|
||||
int sdi_locked;
|
||||
int sdi_ddr_ok;
|
||||
int hdmi_locked;
|
||||
int hdmi_ddr_ok;
|
||||
gvfg_fpga_signal_status_t fpga;
|
||||
} gvfg_signal_status_t;
|
||||
```
|
||||
@@ -277,7 +287,11 @@ typedef struct
|
||||
| --- | --- |
|
||||
| `width` | input 寬度 |
|
||||
| `height` | input 高度 |
|
||||
| `fpga` | FPGA raw/decoded signal metadata |
|
||||
| `video_format` | decoded FPGA signal format name |
|
||||
| `frame_rate_name` | decoded FPGA frame-rate name |
|
||||
| `bit_depth` | decoded FPGA signal bit depth |
|
||||
| `sdi_locked` / `hdmi_locked` | decoded signal lock status |
|
||||
| `fpga` | FPGA raw register values and read-valid mask |
|
||||
|
||||
|
||||
### Customer buffer vs FPGA signal
|
||||
@@ -286,45 +300,47 @@ The customer API separates the delivered buffer format from the FPGA signal
|
||||
register values.
|
||||
|
||||
```c
|
||||
typedef enum
|
||||
{
|
||||
GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT = 1u << 0, /* FPGA 0x0c read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_FRAME_RATE = 1u << 1, /* FPGA 0x18 read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_BIT_DEPTH = 1u << 2, /* FPGA 0x1c read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_STATUS = 1u << 3 /* FPGA 0x180 read succeeded. */
|
||||
} gvfg_fpga_signal_valid_mask_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t valid_mask; /* FPGA register read-valid mask: bit0=0x0c, bit1=0x18, bit2=0x1c, bit3=0x180. */
|
||||
uint32_t valid_mask; /* Combination of gvfg_fpga_signal_valid_mask_t flags. */
|
||||
int width_valid; /* Non-zero when FPGA 0x10 read succeeded. */
|
||||
int height_valid; /* Non-zero when FPGA 0x14 read succeeded. */
|
||||
uint32_t width_raw; /* Raw FPGA 0x10 width register. */
|
||||
uint32_t height_raw; /* Raw FPGA 0x14 height register. */
|
||||
uint32_t video_format_raw; /* Raw FPGA 0x0c value. */
|
||||
int video_format_valid;
|
||||
int video_format_code; /* 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420 */
|
||||
char video_format[16];
|
||||
|
||||
uint32_t frame_rate_raw; /* Raw FPGA 0x18 value. */
|
||||
int frame_rate_valid;
|
||||
int frame_rate_code; /* FPGA 0x18 low nibble. */
|
||||
char frame_rate_bits[5]; /* 4-bit binary text, for example "0110". */
|
||||
char frame_rate_name[16]; /* None, 23.98, 24, 47.95, ..., or "--" for unsupported codes. */
|
||||
|
||||
uint32_t bit_depth_raw; /* Raw FPGA 0x1c value. */
|
||||
int bit_depth_valid;
|
||||
int bit_depth; /* FPGA signal bit depth: 8 or 10 when valid. */
|
||||
|
||||
uint32_t status_raw; /* Raw FPGA 0x180 value. */
|
||||
int status_valid;
|
||||
int sdi_locked; /* FPGA 0x180 bit0 */
|
||||
int sdi_ddr_ok; /* FPGA 0x180 bit1 */
|
||||
int hdmi_locked; /* FPGA 0x180 bit2 */
|
||||
int hdmi_ddr_ok; /* FPGA 0x180 bit3 */
|
||||
} gvfg_fpga_signal_status_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width; /* Signal width in pixels, from FPGA when available. */
|
||||
int height; /* Signal height in pixels, from FPGA when available. */
|
||||
gvfg_fpga_signal_status_t fpga; /* Raw/decoded FPGA signal metadata. */
|
||||
int video_format_code; /* 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420. */
|
||||
char video_format[16]; /* Decoded FPGA signal format name. */
|
||||
int frame_rate_code; /* FPGA frame-rate code from 0x18 low nibble. */
|
||||
char frame_rate_bits[5]; /* 4-bit binary text, for example "0110". */
|
||||
char frame_rate_name[16]; /* None, 23.98, 24, 47.95, ..., or "--" for unsupported codes. */
|
||||
int bit_depth; /* FPGA signal bit depth: 8 or 10 when valid. */
|
||||
int sdi_locked; /* FPGA 0x180 bit0. */
|
||||
int sdi_ddr_ok; /* FPGA 0x180 bit1. */
|
||||
int hdmi_locked; /* FPGA 0x180 bit2. */
|
||||
int hdmi_ddr_ok; /* FPGA 0x180 bit3. */
|
||||
gvfg_fpga_signal_status_t fpga; /* Raw FPGA register values and read-valid mask. */
|
||||
} gvfg_signal_status_t;
|
||||
```
|
||||
|
||||
Use `gvfg_signal_status_t::fpga` for FPGA-reported raw/decoded signal data.
|
||||
Use `gvfg_signal_status_t` fields for display-ready signal data.
|
||||
Use `gvfg_signal_status_t::fpga` for FPGA raw register values and read-valid flags.
|
||||
For delivered frame format, prefer `gvfg_runtime_info_t::delivered_frame`.
|
||||
|
||||
For example, if FPGA reports `video_format=YUV422` and `bit_depth=10`, the
|
||||
@@ -915,17 +931,17 @@ if (st == GVFG_OK) {
|
||||
sig.fpga.bit_depth_raw,
|
||||
sig.fpga.status_raw);
|
||||
|
||||
if (sig.fpga.video_format_valid) {
|
||||
if (sig.fpga.valid_mask & GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT) {
|
||||
printf("FPGA format=%d (%s) bitdepth=%d\n",
|
||||
sig.fpga.video_format_code,
|
||||
sig.fpga.video_format,
|
||||
sig.fpga.bit_depth);
|
||||
sig.video_format_code,
|
||||
sig.video_format,
|
||||
sig.bit_depth);
|
||||
}
|
||||
|
||||
if (sig.fpga.frame_rate_valid) {
|
||||
if (sig.fpga.valid_mask & GVFG_FPGA_SIGNAL_VALID_FRAME_RATE) {
|
||||
printf("FPGA fps code=%s (%s)\n",
|
||||
sig.fpga.frame_rate_bits,
|
||||
sig.fpga.frame_rate_name);
|
||||
sig.frame_rate_bits,
|
||||
sig.frame_rate_name);
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1259,5 +1275,5 @@ wait_frame: deliver
|
||||
|
||||
- The current XDMA path exposes decoded FPGA signal metadata through `sig.fpga`.
|
||||
- The delivered customer callback buffer is reported by `gvfg_runtime_info_t::delivered_frame`.
|
||||
- `sig.fpga.bit_depth=10` does not by itself mean the delivered callback buffer is `Y210`; the current callback path reports BGRA8.
|
||||
- `sig.fpga.frame_rate_bits=0001` is not in the supported table, so the UI/API reports it as `--`.
|
||||
- `sig.bit_depth=10` does not by itself mean the delivered callback buffer is `Y210`; the current callback path reports BGRA8.
|
||||
- `sig.frame_rate_bits=0001` is not in the supported table, so the UI/API reports it as `--`.
|
||||
|
||||
@@ -38,9 +38,19 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
bool fpgaMaskValid(uint32_t mask, uint32_t flag)
|
||||
{
|
||||
return (mask & flag) != 0;
|
||||
}
|
||||
|
||||
QString fpgaRawLogLine(const gvfg_runtime_info_t &info)
|
||||
{
|
||||
const auto &signal = info.input_signal;
|
||||
const auto &fpga = info.input_signal.fpga;
|
||||
const bool videoFormatValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT);
|
||||
const bool frameRateValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_FRAME_RATE);
|
||||
const bool bitDepthValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_BIT_DEPTH);
|
||||
const bool statusValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_STATUS);
|
||||
return QStringLiteral("fpga_raw\n"
|
||||
" valid_mask=%1\n"
|
||||
" resolution: width_valid=%2 width_raw=%3 height_valid=%4 height_raw=%5\n"
|
||||
@@ -53,53 +63,58 @@ namespace
|
||||
.arg(fpga.width_raw)
|
||||
.arg(fpga.height_valid)
|
||||
.arg(fpga.height_raw)
|
||||
.arg(fpga.video_format_valid)
|
||||
.arg(videoFormatValid ? 1 : 0)
|
||||
.arg(hex32(fpga.video_format_raw))
|
||||
.arg(fpga.video_format_code)
|
||||
.arg(QString::fromLatin1(fpga.video_format))
|
||||
.arg(fpga.frame_rate_valid)
|
||||
.arg(signal.video_format_code)
|
||||
.arg(QString::fromLatin1(signal.video_format))
|
||||
.arg(frameRateValid ? 1 : 0)
|
||||
.arg(hex32(fpga.frame_rate_raw))
|
||||
.arg(fpga.frame_rate_code)
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_name))
|
||||
.arg(fpga.bit_depth_valid)
|
||||
.arg(signal.frame_rate_code)
|
||||
.arg(QString::fromLatin1(signal.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(signal.frame_rate_name))
|
||||
.arg(bitDepthValid ? 1 : 0)
|
||||
.arg(hex32(fpga.bit_depth_raw))
|
||||
.arg(fpga.bit_depth)
|
||||
.arg(fpga.status_valid)
|
||||
.arg(signal.bit_depth)
|
||||
.arg(statusValid ? 1 : 0)
|
||||
.arg(hex32(fpga.status_raw))
|
||||
.arg(fpga.sdi_locked)
|
||||
.arg(fpga.sdi_ddr_ok)
|
||||
.arg(fpga.hdmi_locked)
|
||||
.arg(fpga.hdmi_ddr_ok);
|
||||
.arg(signal.sdi_locked)
|
||||
.arg(signal.sdi_ddr_ok)
|
||||
.arg(signal.hdmi_locked)
|
||||
.arg(signal.hdmi_ddr_ok);
|
||||
}
|
||||
|
||||
QString fpgaRawStateKey(const gvfg_runtime_info_t &info)
|
||||
{
|
||||
const auto &signal = info.input_signal;
|
||||
const auto &fpga = info.input_signal.fpga;
|
||||
const bool videoFormatValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT);
|
||||
const bool frameRateValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_FRAME_RATE);
|
||||
const bool bitDepthValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_BIT_DEPTH);
|
||||
const bool statusValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_STATUS);
|
||||
return QStringLiteral("%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|%11|%12|%13|%14|%15|%16|%17|%18|%19|%20|%21|%22|%23")
|
||||
.arg(fpga.valid_mask)
|
||||
.arg(fpga.width_valid)
|
||||
.arg(fpga.width_raw)
|
||||
.arg(fpga.height_valid)
|
||||
.arg(fpga.height_raw)
|
||||
.arg(fpga.video_format_valid)
|
||||
.arg(videoFormatValid ? 1 : 0)
|
||||
.arg(fpga.video_format_raw)
|
||||
.arg(fpga.video_format_code)
|
||||
.arg(QString::fromLatin1(fpga.video_format))
|
||||
.arg(fpga.frame_rate_valid)
|
||||
.arg(signal.video_format_code)
|
||||
.arg(QString::fromLatin1(signal.video_format))
|
||||
.arg(frameRateValid ? 1 : 0)
|
||||
.arg(fpga.frame_rate_raw)
|
||||
.arg(fpga.frame_rate_code)
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_name))
|
||||
.arg(fpga.bit_depth_valid)
|
||||
.arg(signal.frame_rate_code)
|
||||
.arg(QString::fromLatin1(signal.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(signal.frame_rate_name))
|
||||
.arg(bitDepthValid ? 1 : 0)
|
||||
.arg(fpga.bit_depth_raw)
|
||||
.arg(fpga.bit_depth)
|
||||
.arg(fpga.status_valid)
|
||||
.arg(signal.bit_depth)
|
||||
.arg(statusValid ? 1 : 0)
|
||||
.arg(fpga.status_raw)
|
||||
.arg(fpga.sdi_locked)
|
||||
.arg(fpga.sdi_ddr_ok)
|
||||
.arg(fpga.hdmi_locked)
|
||||
.arg(fpga.hdmi_ddr_ok);
|
||||
.arg(signal.sdi_locked)
|
||||
.arg(signal.sdi_ddr_ok)
|
||||
.arg(signal.hdmi_locked)
|
||||
.arg(signal.hdmi_ddr_ok);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,29 +332,34 @@ void MainWindow::updateSignalStatus(bool writeLog)
|
||||
if (gvfg_get_runtime_info(handle_, &info) != GVFG_OK)
|
||||
return;
|
||||
|
||||
const auto &fpga = info.input_signal.fpga;
|
||||
const auto &signal = info.input_signal;
|
||||
const auto &fpga = signal.fpga;
|
||||
const auto &delivered = info.delivered_frame;
|
||||
const bool frameRateValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_FRAME_RATE);
|
||||
const bool videoFormatValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT);
|
||||
const bool bitDepthValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_BIT_DEPTH);
|
||||
const bool statusValid = fpgaMaskValid(fpga.valid_mask, GVFG_FPGA_SIGNAL_VALID_STATUS);
|
||||
|
||||
const QString fpgaResolution = (fpga.width_valid && fpga.height_valid)
|
||||
? QStringLiteral("%1x%2").arg(fpga.width_raw).arg(fpga.height_raw)
|
||||
? QStringLiteral("%1x%2").arg(signal.width).arg(signal.height)
|
||||
: QStringLiteral("--");
|
||||
const QString line0 = QStringLiteral("FPGA reported | signal=%1 fps=%2 format=%3 bitdepth=%4")
|
||||
.arg(fpgaResolution)
|
||||
.arg(fpgaFieldText(fpga.frame_rate_valid != 0,
|
||||
.arg(fpgaFieldText(frameRateValid,
|
||||
QStringLiteral("%1 (%2)")
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(fpga.frame_rate_name))))
|
||||
.arg(fpgaFieldText(fpga.video_format_valid != 0,
|
||||
.arg(QString::fromLatin1(signal.frame_rate_bits))
|
||||
.arg(QString::fromLatin1(signal.frame_rate_name))))
|
||||
.arg(fpgaFieldText(videoFormatValid,
|
||||
QStringLiteral("%1 (%2)")
|
||||
.arg(fpga.video_format_code)
|
||||
.arg(QString::fromLatin1(fpga.video_format))))
|
||||
.arg(fpgaFieldText(fpga.bit_depth_valid != 0,
|
||||
QStringLiteral("%1").arg(fpga.bit_depth)));
|
||||
.arg(signal.video_format_code)
|
||||
.arg(QString::fromLatin1(signal.video_format))))
|
||||
.arg(fpgaFieldText(bitDepthValid,
|
||||
QStringLiteral("%1").arg(signal.bit_depth)));
|
||||
const QString line2 = QStringLiteral("FPGA status | SDI lock=%1 SDI DDR=%2 HDMI lock=%3 HDMI DDR=%4")
|
||||
.arg(fpgaFieldText(fpga.status_valid != 0, QString::number(fpga.sdi_locked)))
|
||||
.arg(fpgaFieldText(fpga.status_valid != 0, QString::number(fpga.sdi_ddr_ok)))
|
||||
.arg(fpgaFieldText(fpga.status_valid != 0, QString::number(fpga.hdmi_locked)))
|
||||
.arg(fpgaFieldText(fpga.status_valid != 0, QString::number(fpga.hdmi_ddr_ok)));
|
||||
.arg(fpgaFieldText(statusValid, QString::number(signal.sdi_locked)))
|
||||
.arg(fpgaFieldText(statusValid, QString::number(signal.sdi_ddr_ok)))
|
||||
.arg(fpgaFieldText(statusValid, QString::number(signal.hdmi_locked)))
|
||||
.arg(fpgaFieldText(statusValid, QString::number(signal.hdmi_ddr_ok)));
|
||||
const QString line3 = delivered.valid
|
||||
? QStringLiteral("Delivered frame | frame=%1x%2 format=%3 bitdepth=%4")
|
||||
.arg(delivered.width)
|
||||
|
||||
@@ -93,41 +93,42 @@ typedef struct
|
||||
int swapchain_bitdepth; /* gvfg_preview_bitdepth_t value. */
|
||||
} gvfg_preview_desc_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GVFG_FPGA_SIGNAL_VALID_VIDEO_FORMAT = 1u << 0, /* FPGA 0x0c read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_FRAME_RATE = 1u << 1, /* FPGA 0x18 read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_BIT_DEPTH = 1u << 2, /* FPGA 0x1c read succeeded. */
|
||||
GVFG_FPGA_SIGNAL_VALID_STATUS = 1u << 3 /* FPGA 0x180 read succeeded. */
|
||||
} gvfg_fpga_signal_valid_mask_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t valid_mask; /* FPGA register read-valid mask: bit0=0x0c, bit1=0x18, bit2=0x1c, bit3=0x180. */
|
||||
uint32_t valid_mask; /* Combination of gvfg_fpga_signal_valid_mask_t flags. */
|
||||
int width_valid; /* Non-zero when FPGA 0x10 read succeeded. */
|
||||
int height_valid; /* Non-zero when FPGA 0x14 read succeeded. */
|
||||
uint32_t width_raw; /* Raw FPGA 0x10 width register. */
|
||||
uint32_t height_raw; /* Raw FPGA 0x14 height register. */
|
||||
uint32_t video_format_raw; /* Raw FPGA 0x0c value. */
|
||||
int video_format_valid;
|
||||
int video_format_code; /* 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420 */
|
||||
char video_format[16];
|
||||
|
||||
uint32_t frame_rate_raw; /* Raw FPGA 0x18 value. */
|
||||
int frame_rate_valid;
|
||||
int frame_rate_code; /* FPGA frame-rate code from 0x18 low nibble. */
|
||||
char frame_rate_bits[5]; /* 4-bit binary text, for example "0110". */
|
||||
char frame_rate_name[16]; /* None, 23.98, 24, 47.95, ..., or "--" for unsupported codes. */
|
||||
|
||||
uint32_t bit_depth_raw; /* Raw FPGA 0x1c value. */
|
||||
int bit_depth_valid;
|
||||
int bit_depth; /* 8 or 10 when valid. */
|
||||
|
||||
uint32_t status_raw; /* Raw FPGA 0x180 value. */
|
||||
int status_valid;
|
||||
int sdi_locked; /* FPGA 0x180 bit0 */
|
||||
int sdi_ddr_ok; /* FPGA 0x180 bit1 */
|
||||
int hdmi_locked; /* FPGA 0x180 bit2 */
|
||||
int hdmi_ddr_ok; /* FPGA 0x180 bit3 */
|
||||
} gvfg_fpga_signal_status_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width; /* Signal width in pixels, from FPGA when available. */
|
||||
int height; /* Signal height in pixels, from FPGA when available. */
|
||||
gvfg_fpga_signal_status_t fpga; /* Raw/decoded FPGA signal metadata. */
|
||||
int video_format_code; /* 0=yuv422, 1=rgb, 2=yuv444, 3=yuv420. */
|
||||
char video_format[16]; /* Decoded FPGA signal format name. */
|
||||
int frame_rate_code; /* FPGA frame-rate code from 0x18 low nibble. */
|
||||
char frame_rate_bits[5]; /* 4-bit binary text, for example "0110". */
|
||||
char frame_rate_name[16]; /* None, 23.98, 24, 47.95, ..., or "--" for unsupported codes. */
|
||||
int bit_depth; /* FPGA signal bit depth: 8 or 10 when valid. */
|
||||
int sdi_locked; /* FPGA 0x180 bit0. */
|
||||
int sdi_ddr_ok; /* FPGA 0x180 bit1. */
|
||||
int hdmi_locked; /* FPGA 0x180 bit2. */
|
||||
int hdmi_ddr_ok; /* FPGA 0x180 bit3. */
|
||||
gvfg_fpga_signal_status_t fpga; /* Raw FPGA register values and read-valid mask. */
|
||||
} gvfg_signal_status_t;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -359,29 +359,25 @@ struct gvfg_handle_t
|
||||
haveSignalSize = fpgaWidthValid && fpgaHeightValid && fpgaWidthRaw != 0 && fpgaHeightRaw != 0;
|
||||
out.width = haveSignalSize ? static_cast<int>(fpgaWidthRaw) : 0;
|
||||
out.height = haveSignalSize ? static_cast<int>(fpgaHeightRaw) : 0;
|
||||
out.video_format_code = static_cast<int>(fpgaVideoFormatRaw & 0x3u);
|
||||
copy_cstr(out.video_format, sizeof(out.video_format), fpga_video_format_name(fpgaVideoFormatRaw));
|
||||
out.frame_rate_code = static_cast<int>(fpgaFrameRateRaw & 0x0fu);
|
||||
copy_binary4(out.frame_rate_bits, sizeof(out.frame_rate_bits), fpgaFrameRateRaw);
|
||||
copy_cstr(out.frame_rate_name, sizeof(out.frame_rate_name), fpga_frame_rate_name(fpgaFrameRateRaw));
|
||||
out.bit_depth = static_cast<int>(fpgaBitDepthRaw);
|
||||
out.sdi_locked = (fpgaStatusRaw & (1u << 0)) ? 1 : 0;
|
||||
out.sdi_ddr_ok = (fpgaStatusRaw & (1u << 1)) ? 1 : 0;
|
||||
out.hdmi_locked = (fpgaStatusRaw & (1u << 2)) ? 1 : 0;
|
||||
out.hdmi_ddr_ok = (fpgaStatusRaw & (1u << 3)) ? 1 : 0;
|
||||
out.fpga.valid_mask = fpgaValidMask;
|
||||
out.fpga.width_valid = fpgaWidthValid ? 1 : 0;
|
||||
out.fpga.height_valid = fpgaHeightValid ? 1 : 0;
|
||||
out.fpga.width_raw = fpgaWidthRaw;
|
||||
out.fpga.height_raw = fpgaHeightRaw;
|
||||
out.fpga.video_format_raw = fpgaVideoFormatRaw;
|
||||
out.fpga.video_format_valid = fpga_field_valid(fpgaValidMask, 0) ? 1 : 0;
|
||||
out.fpga.video_format_code = static_cast<int>(fpgaVideoFormatRaw & 0x3u);
|
||||
copy_cstr(out.fpga.video_format, sizeof(out.fpga.video_format), fpga_video_format_name(fpgaVideoFormatRaw));
|
||||
out.fpga.frame_rate_raw = fpgaFrameRateRaw;
|
||||
out.fpga.frame_rate_valid = fpga_field_valid(fpgaValidMask, 1) ? 1 : 0;
|
||||
out.fpga.frame_rate_code = static_cast<int>(fpgaFrameRateRaw & 0x0fu);
|
||||
copy_binary4(out.fpga.frame_rate_bits, sizeof(out.fpga.frame_rate_bits), fpgaFrameRateRaw);
|
||||
copy_cstr(out.fpga.frame_rate_name, sizeof(out.fpga.frame_rate_name), fpga_frame_rate_name(fpgaFrameRateRaw));
|
||||
out.fpga.bit_depth_raw = fpgaBitDepthRaw;
|
||||
out.fpga.bit_depth_valid = fpga_field_valid(fpgaValidMask, 2) ? 1 : 0;
|
||||
out.fpga.bit_depth = static_cast<int>(fpgaBitDepthRaw);
|
||||
out.fpga.status_raw = fpgaStatusRaw;
|
||||
out.fpga.status_valid = fpga_field_valid(fpgaValidMask, 3) ? 1 : 0;
|
||||
out.fpga.sdi_locked = (fpgaStatusRaw & (1u << 0)) ? 1 : 0;
|
||||
out.fpga.sdi_ddr_ok = (fpgaStatusRaw & (1u << 1)) ? 1 : 0;
|
||||
out.fpga.hdmi_locked = (fpgaStatusRaw & (1u << 2)) ? 1 : 0;
|
||||
out.fpga.hdmi_ddr_ok = (fpgaStatusRaw & (1u << 3)) ? 1 : 0;
|
||||
}
|
||||
return haveSignalSize ? GVFG_OK : GVFG_ENODEV;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user