/*
 *  ======== VIDDEC2_processAsync ========
 */
XDAS_Int32 VIDDEC2BACK_processAsync(VIDDEC2FRONT_Handle handle,
        XDM_Context *context, VIDDEC2_OutArgs *outArgs)
{
    XDAS_Int32 retVal = VIDDEC2_EFAIL;

    /*
     * Note, we do this because someday we may allow dynamically changing
     * the global 'VISA_isChecked()' value on the fly.  If we allow that,
     * we need to ensure the value stays consistent in the context of this call.
     */
    Bool checked = VISA_isChecked();

    Log_print4(Diags_ENTRY, "[+E] VIDDEC2BACK_processAsync> "
            "Enter (handle=0x%x, context=0x%x outArgs=0x%x (size=0x%x))",
            (IArg)handle, (IArg)context, (IArg)outArgs,
            (IArg)(outArgs->size));

    if (handle) {
        IVIDDEC2BACK_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {
                /* validate context */
            }

            retVal = processAsync(alg, context, outArgs);
        }
    }

    Log_print2(Diags_EXIT, "[+X] VIDDEC2BACK_processAsync> "
            "Exit (handle=0x%x, retVal=0x%x)", (IArg)handle, (IArg)retVal);

    return (retVal);
}
/*
 *  ======== UNIVERSAL_processAsync ========
 */
XDAS_Int32 UNIVERSAL_processAsync(UNIVERSAL_Handle handle,
        XDM1_BufDesc *inBufs, XDM1_BufDesc *outBufs, XDM1_BufDesc *inOutBufs,
        IUNIVERSAL_InArgs *inArgs, IUNIVERSAL_OutArgs *outArgs)
{
    XDAS_Int32 retVal = UNIVERSAL_EFAIL;

    /*
     * Note, we assign "VISA_isChecked()" results to a local variable
     * rather than repeatedly query it throughout this fxn because
     * someday we may allow dynamically changing the global
     * 'VISA_isChecked()' value on the fly.  If we allow that, we need
     * to ensure the value stays consistent in the context of this
     * call.
     */
    Bool checked = VISA_isChecked();

    Log_print5(Diags_ENTRY, "[+E] UNIVERSAL_processAsync> "
            "Enter (handle=0x%x, inBufs=0x%x, outBufs=0x%x, inArgs=0x%x, "
            "outArgs=0x%x)",
            (IArg)handle, (IArg)inBufs, (IArg)outBufs, (IArg)inArgs,
            (IArg)outArgs);

    if (handle) {
        IUNIVERSAL_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {

                /* validate inArgs and outArgs */
                XdmUtils_validateExtendedStruct(inArgs, sizeof(inArgs),
                        "inArgs");
                XdmUtils_validateExtendedStruct(outArgs, sizeof(outArgs),
                        "outArgs");

                /* Validate inBufs and outBufs. */
                XdmUtils_validateSparseBufDesc1(inBufs, "inBufs");
                XdmUtils_validateSparseBufDesc1(outBufs, "outBufs");

                /*
                 * Zero out the outArgs struct (except for .size field);
                 * it's write-only to the codec, so the app shouldn't pass
                 * values through it, nor should the codec expect to
                 * receive values through it.
                 */
                memset((void *)((XDAS_Int32)(outArgs) + sizeof(outArgs->size)),
                        0, (sizeof(*outArgs) - sizeof(outArgs->size)));
            }

            retVal = processAsync(alg, inBufs, outBufs, inOutBufs, inArgs,
                    outArgs);
        }
    }

    Log_print2(Diags_EXIT, "[+X] UNIVERSAL_processAsync> "
            "Exit (handle=0x%x, retVal=0x%x)", (IArg)handle, (IArg)retVal);

    return (retVal);
}
示例#3
0
文件: Viewer.cpp 项目: mmyros/Oat
Viewer<T>::Viewer(const std::string &source_address)
: name_("viewer[" + source_address + "]")
, source_address_(source_address)
{
    // Initialize GUI update timer
    tock_ = Clock::now();

    // Start display thread
    display_thread_ = std::thread( [this] {processAsync();} );
}
示例#4
0
/*
 *  ======== VIDDEC2_processAsync ========
 */
XDAS_Int32 VIDDEC2FRONT_processAsync(VIDDEC2_Handle handle,
        VIDDEC2_InArgs *inArgs, XDM_Context *context,
        VIDDEC2FRONT_OutArgs *outArgs)
{
    XDAS_Int32 retVal = VIDDEC2_EFAIL;

    /*
     * Note, we do this because someday we may allow dynamically changing
     * the global 'VISA_isChecked()' value on the fly.  If we allow that,
     * we need to ensure the value stays consistent in the context of this call.
     */
    Bool checked = VISA_isChecked();

    Log_print4(Diags_ENTRY, "[+E] VIDDEC2_processAsync> "
            "Enter (handle=0x%x, inArgs=0x%x, context=0x%x, outArgs=0x%x)",
            (IArg)handle, (IArg)inArgs, (IArg)context, (IArg)outArgs);

    if (handle) {
        IVIDDEC2FRONT_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {
                /* validate inArgs with ranges. */
                if (inArgs->inputID == 0) {

                    Log_print2(Diags_USER7,
                            "[+7] ERROR> app provided codec (0x%x) with out of range "
                            "inArgs->inputID field (0x%x)",
                            (IArg)alg, (IArg)(inArgs->inputID));
                }
#if 0
                /*
                 * Validate inBufs and outBufs.
                 */
                XdmUtils_validateSparseBufDesc1(inBufs, "inBufs");
                XdmUtils_validateSparseBufDesc(outBufs, "outBufs");
#endif
            }

            retVal = processAsync(alg, inArgs, context, outArgs);
        }
    }

    Log_print2(Diags_EXIT, "[+X] VIDDEC2FRONT_processAsync> "
            "Exit (handle=0x%x, retVal=0x%x)", (IArg)handle, (IArg)retVal);

    return (retVal);
}
示例#5
0
/*
 *  ======== AUDDEC1_processAsync ========
 */
XDAS_Int32 AUDDEC1_processAsync(AUDDEC1_Handle handle, XDM1_BufDesc *inBufs,
    XDM1_BufDesc *outBufs, AUDDEC1_InArgs *inArgs, AUDDEC1_OutArgs *outArgs)
{
    XDAS_Int32 retVal = AUDDEC1_EFAIL;

    /*
     * Note, we do this because someday we may allow dynamically changing
     * the global 'VISA_isChecked()' value on the fly.  If we allow that,
     * we need to ensure the value stays consistent in the context of this call.
     */
    Bool checked = VISA_isChecked();

    Log_print5(Diags_ENTRY, "[+E] AUDDEC1_processAsync> "
            "Enter (handle=0x%x, inBufs=0x%x, outBufs=0x%x, inArgs=0x%x, "
            "outArgs=0x%x)",
            (IArg)handle, (IArg)inBufs, (IArg)outBufs, (IArg)inArgs,
            (IArg)outArgs);

    if (handle) {
        IAUDDEC1_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {
                /*
                 * Validate inBufs and outBufs.
                 */
                XdmUtils_validateSparseBufDesc1(inBufs, "inBufs");
                XdmUtils_validateSparseBufDesc1(outBufs, "outBufs");

                /*
                 * Zero out the outArgs struct (except for .size field);
                 * it's write-only to the codec, so the app shouldn't pass
                 * values through it, nor should the codec expect to
                 * receive values through it.
                 */
                memset((void *)((XDAS_Int32)(outArgs) + sizeof(outArgs->size)),
                    0, (sizeof(*outArgs) - sizeof(outArgs->size)));
            }

            retVal = processAsync(alg, inBufs, outBufs, inArgs, outArgs);
        }
    }

    Log_print2(Diags_EXIT, "[+X] AUDDEC1_processAsync> "
            "Exit (handle=0x%x, retVal=0x%x)", (IArg)handle, (IArg)retVal);

    return (retVal);
}
示例#6
0
/*
 *  ======== VIDENC1_processAsync ========
 */
XDAS_Int32 VIDENC1_processAsync(VIDENC1_Handle handle,
                                IVIDEO1_BufDescIn *inBufs, XDM_BufDesc *outBufs,
                                IVIDENC1_InArgs *inArgs, IVIDENC1_OutArgs *outArgs)
{
    XDAS_Int32 retVal = VIDENC1_EFAIL;

    /*
     * Note, we do this because someday we may allow dynamically changing
     * the global 'VISA_isChecked()' value on the fly.  If we allow that,
     * we need to ensure the value stays consistent in the context of this call.
     */
    Bool checked = VISA_isChecked();

    GT_5trace(CURTRACE, GT_ENTER, "VIDENC1_processAsync> "
              "Enter (handle=0x%x, inBufs=0x%x, outBufs=0x%x, inArgs=0x%x, "
              "outArgs=0x%x)\n", handle, inBufs, outBufs, inArgs, outArgs);

    if (handle) {
        IVIDENC1_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {

                /* validate inArgs with ranges. */
                if (inArgs->inputID == 0) {
                    GT_2trace(CURTRACE, GT_7CLASS,
                              "ERROR> app provided codec (0x%x) with out of range "
                              "inArgs->inputID field (0x%x)\n", alg, inArgs->inputID);
                }

                /*
                 * Validate inBufs and outBufs.
                 */
                /* TBD             XdmUtils_validateVideoBufDesc1(inBufs, "inBufs"); */
                XdmUtils_validateSparseBufDesc(outBufs, "outBufs");
            }

            retVal = processAsync(alg, inBufs, outBufs, inArgs, outArgs);
        }
    }

    GT_2trace(CURTRACE, GT_ENTER, "VIDENC1_processAsync> "
              "Exit (handle=0x%x, retVal=0x%x)\n", handle, retVal);

    return (retVal);
}
示例#7
0
Message *ServerComponent::doCall(Message *msg_in, Message *msg_out, bool sync, int timeout)
{
	if (respondTo(msg_in->destination)) {
		if (msg_in->answer) {
			processAnswer(msg_in);
			return NULL;
		}
		else
		{
			if(!msg_out) {
				msg_out = new Message();
			} else {
				msg_out->clear();
			}
			msg_out->uid = msg_in->uid;
			msg_out->destination = msg_in->source;
			msg_out->source = msg_in->destination;
			msg_out->command = msg_in->command;
			msg_out->answer = true;

			if(isAsync(msg_in))
			{
				 processAsync(msg_in);
				 return NULL;
			}
			else
			{
				Message * answer = process(msg_in, msg_out, true, timeout);
				if (answer)
					answer->write_header();
				return answer;
			}

		}
	} else if (hub) {
		if (sync) {
			return hub->callSync(msg_in, msg_out, timeout);
		} else {
			return hub->call(msg_in, msg_out);
		}
	} else {
		throw string("Cannot route message to destination ") + my_itoa(msg_in->destination);
	}
};
示例#8
0
/*
 *  ======== SPHDEC_processAsync ========
 */
XDAS_Int32 SPHDEC_processAsync(SPHDEC_Handle handle, XDM_BufDesc *inBufs,
    XDM_BufDesc *outBufs, SPHDEC_InArgs *inArgs, SPHDEC_OutArgs *outArgs)
{
    XDAS_Int32 retVal = SPHDEC_EFAIL;

    /*
     * Note, we do this because someday we may allow dynamically changing
     * the global 'VISA_isChecked()' value on the fly.  If we allow that,
     * we need to ensure the value stays consistent in the context of this call.
     */
    Bool checked = VISA_isChecked();

    GT_5trace(CURTRACE, GT_ENTER, "SPHDEC_processAsync> "
        "Enter (handle=0x%x, inBufs=0x%x, outBufs=0x%x, inArgs=0x%x, "
        "outArgs=0x%x)\n", handle, inBufs, outBufs, inArgs, outArgs);

    if (handle) {
        ISPHDEC_Handle alg = VISA_getAlgHandle((VISA_Handle)handle);

        if (alg != NULL) {
            if (checked) {
                /*
                 * Zero out the outArgs struct (except for .size field);
                 * it's write-only to the codec, so the app shouldn't pass
                 * values through it, nor should the codec expect to
                 * receive values through it.
                 */
                memset((void *)((XDAS_Int32)(outArgs) + sizeof(outArgs->size)),
                    0, (sizeof(*outArgs) - sizeof(outArgs->size)));
            }

            retVal = processAsync(alg, inBufs, outBufs, inArgs, outArgs);
        }
    }

    GT_2trace(CURTRACE, GT_ENTER, "SPHDEC_processAsync> "
        "Exit (handle=0x%x, retVal=0x%x)\n", handle, retVal);

    return (retVal);
}