diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2007-10-10 06:22:34 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2007-10-10 06:22:34 +0000 |
commit | 9964c782b6e45b2112da8072c66f0aa2ee1243dd (patch) | |
tree | bc12acaea2b2c738cdb1d61333eefe6964a9c32f /common | |
parent | 4803946f8cbf04e0aadcd6beebf4ce9d0453fef9 (diff) | |
download | tigervnc-9964c782b6e45b2112da8072c66f0aa2ee1243dd.tar.gz tigervnc-9964c782b6e45b2112da8072c66f0aa2ee1243dd.zip |
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
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/IrixDMIC_RawToJpeg.cxx | 42 | ||||
-rw-r--r-- | common/rfb/IrixDMIC_RawToJpeg.h | 2 |
2 files changed, 43 insertions, 1 deletions
diff --git a/common/rfb/IrixDMIC_RawToJpeg.cxx b/common/rfb/IrixDMIC_RawToJpeg.cxx index 0c0a596c..afa0d18b 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 @@ IrixDMIC_RawToJpeg::IrixDMIC_RawToJpeg(bool needRealtime) } if (n < 0) { vlog.error("Error: No matching JPEG encoder found"); + debugListConverters(); return; } if (dmICCreate(n, &m_ic) != DM_SUCCESS) { @@ -84,6 +85,45 @@ IrixDMIC_RawToJpeg::~IrixDMIC_RawToJpeg() 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 b067e135..704682b9 100644 --- a/common/rfb/IrixDMIC_RawToJpeg.h +++ b/common/rfb/IrixDMIC_RawToJpeg.h @@ -17,6 +17,8 @@ namespace rfb { IrixDMIC_RawToJpeg(bool needRealtime = true); virtual ~IrixDMIC_RawToJpeg(); + void debugListConverters(); + bool isValid() const { return m_valid_ic; } bool setImageParams(int w, int h); |