MME_ERROR acc_MME_GetTransformerCapability(const char *TransformerName, MME_TransformerCapability_t *TransformerInfo_p) { if (log_enable == ACC_TRUE) { FILE *fcmd = cmd_log_lock(); FWRITE(cmd_str[CMD_GETCAPABILITY], strlen(cmd_str[CMD_GETCAPABILITY]) + 1, 1, fcmd); FWRITE((char *)TransformerName, strlen((char *)TransformerName) + 1, 1, fcmd); cmd_log_release(fcmd); } return MME_GetTransformerCapability(TransformerName, TransformerInfo_p); }
//}}} //{{{ InitializeMMETransformer /////////////////////////////////////////////////////////////////////////// /// /// Verify that the transformer exists /// CodecStatus_t Codec_MmeVideoFlv1_c::InitializeMMETransformer(void) { MME_ERROR MMEStatus; MME_TransformerCapability_t Capability; memset(&Capability, 0, sizeof(MME_TransformerCapability_t)); memset(Configuration.TransformCapabilityStructurePointer, 0x00, Configuration.SizeOfTransformCapabilityStructure); Capability.StructSize = sizeof(MME_TransformerCapability_t); Capability.TransformerInfoSize = Configuration.SizeOfTransformCapabilityStructure; Capability.TransformerInfo_p = Configuration.TransformCapabilityStructurePointer; MMEStatus = MME_GetTransformerCapability(Configuration.TransformName[SelectedTransformer], &Capability); if (MMEStatus != MME_SUCCESS) { if (MMEStatus == MME_UNKNOWN_TRANSFORMER) CODEC_ERROR("(%s) - Transformer %s not found.\n", Configuration.CodecName, Configuration.TransformName[SelectedTransformer]); else CODEC_ERROR("(%s:%s) - Unable to read capabilities (%08x).\n", Configuration.CodecName, Configuration.TransformName[SelectedTransformer], MMEStatus); return CodecError; } return HandleCapabilities(); }
/*{{{ VerifyCapabilities*/ static int VerifyCapabilities(struct MMEContext_s *Context) { EVENT_LOG_TransformerCapability_t EventLogCapability = {0}; MME_TransformerCapability_t MMECapability = {0}; MME_ERROR MMEStatus; MMECapability.StructSize = sizeof(MME_TransformerCapability_t); MMECapability.TransformerInfoSize = sizeof(EVENT_LOG_TransformerCapability_t); MMECapability.TransformerInfo_p = &EventLogCapability; MMEStatus = MME_GetTransformerCapability(Context->TransformerName, &MMECapability); if (MMEStatus == MME_UNKNOWN_TRANSFORMER) { MONITOR_DEBUG("%s: Transformer not found. This event source will not be monitored.\n", Context->TransformerName); return -EFAULT; } if (MMEStatus != MME_SUCCESS) { MONITOR_ERROR("%s: Failed to retrieve transformer capabilities - Error 0x%08x.\n", Context->TransformerName, MMEStatus); return -EFAULT; } MONITOR_TRACE("Found %s transformer (version %x)\n", Context->TransformerName, MMECapability.Version); return 0; }