In IRIX, if we could not find a matching DMIC converter, list all available converters in the log.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2359 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/IrixDMIC_RawToJpeg.cxx b/common/rfb/IrixDMIC_RawToJpeg.cxx
index 0c0a596..afa0d18 100644
--- a/common/rfb/IrixDMIC_RawToJpeg.cxx
+++ b/common/rfb/IrixDMIC_RawToJpeg.cxx
@@ -8,7 +8,7 @@
using namespace rfb;
-static LogWriter vlog("IrixDMIC_RawToJpeg");
+static LogWriter vlog("IrixDMIC");
//
// Constructor. Find a converter and create a context. Also, create
@@ -57,6 +57,7 @@
}
if (n < 0) {
vlog.error("Error: No matching JPEG encoder found");
+ debugListConverters();
return;
}
if (dmICCreate(n, &m_ic) != DM_SUCCESS) {
@@ -84,6 +85,45 @@
dmParamsDestroy(m_srcParams);
}
+void
+IrixDMIC_RawToJpeg::debugListConverters()
+{
+ int n = dmICGetNum();
+ vlog.debug("IRIX DMIC converters available (%d):", n);
+ for (int i = 0; i < n; i++) {
+ DMparams *p;
+ if (dmParamsCreate(&p) != DM_SUCCESS) {
+ return;
+ }
+ if (dmICGetDescription(i, p) != DM_SUCCESS) {
+ vlog.debug(" continue");
+ continue;
+ }
+ union {
+ int id;
+ char label[5];
+ } id;
+ id.id = dmParamsGetInt(p, DM_IC_ID);
+ id.label[4] = '\0';
+ int direction = dmParamsGetEnum(p, DM_IC_CODE_DIRECTION);
+ const char *directionLabel = "converter";
+ if (direction == DM_IC_CODE_DIRECTION_ENCODE) {
+ directionLabel = "encoder";
+ } else if (direction == DM_IC_CODE_DIRECTION_DECODE) {
+ directionLabel = "decoder";
+ }
+ int speed = dmParamsGetEnum(p, DM_IC_SPEED);
+ const char *speedLabel = "";
+ if (speed == DM_IC_SPEED_REALTIME) {
+ speedLabel = "realtime ";
+ }
+ const char *engine = dmParamsGetString(p, DM_IC_ENGINE);
+ vlog.debug(" converter %d: '%s' %s%s (%s)",
+ i, id.label, speedLabel, directionLabel, engine);
+ dmParamsDestroy(p);
+ }
+}
+
//
// Configure the source and destination formats.
//
diff --git a/common/rfb/IrixDMIC_RawToJpeg.h b/common/rfb/IrixDMIC_RawToJpeg.h
index b067e13..704682b 100644
--- a/common/rfb/IrixDMIC_RawToJpeg.h
+++ b/common/rfb/IrixDMIC_RawToJpeg.h
@@ -17,6 +17,8 @@
IrixDMIC_RawToJpeg(bool needRealtime = true);
virtual ~IrixDMIC_RawToJpeg();
+ void debugListConverters();
+
bool isValid() const { return m_valid_ic; }
bool setImageParams(int w, int h);