예제 #1
0
tResult cXtionCamera::Init(tInitStage eStage, __exception )
{
    RETURN_IF_FAILED(cFilter::Init(eStage, __exception_ptr));
    if (eStage == StageFirst)
    {
        //create the output pins of the filter
        RETURN_IF_FAILED(m_oRGBVideo.Create("Video_RGB", adtf::IPin::PD_Output, static_cast<IPinEventSink*> (this)));
        RETURN_IF_FAILED(RegisterPin(&m_oRGBVideo));

        RETURN_IF_FAILED(m_oDepthImage.Create("Depth_Image", adtf::IPin::PD_Output, static_cast<IPinEventSink*> (this)));
        RETURN_IF_FAILED(RegisterPin(&m_oDepthImage));
    }
    else if (eStage == StageNormal)
    {
        //load the configuration file for the settings of xtion camera    
        tResult nResult;
        nResult = LoadConfiguration(); 
        if (IS_FAILED(nResult))
            THROW_ERROR_DESC(nResult,"Failed to load the configuration file for the xtion");          
        
        //set the videoformat of the rgb video pin
        m_sBitmapFormat.nWidth = m_nWidthVideo;
        m_sBitmapFormat.nHeight = m_nHeightVideo;
        m_sBitmapFormat.nBitsPerPixel = 24;
        m_sBitmapFormat.nPixelFormat = cImage::PF_RGB_888;
        m_sBitmapFormat.nBytesPerLine = m_nWidthVideo * 3;
        m_sBitmapFormat.nSize = m_sBitmapFormat.nBytesPerLine * m_nHeightVideo;
        m_sBitmapFormat.nPaletteSize = 0;
        m_oRGBVideo.SetFormat(&m_sBitmapFormat, NULL);
        
        //set the videoformat of the depth video pin
        m_sBitmapFormatDepth.nWidth = m_nWidthDepth;
        m_sBitmapFormatDepth.nHeight = m_nHeightDepth;
        m_sBitmapFormatDepth.nBitsPerPixel = 16;
        m_sBitmapFormatDepth.nPixelFormat = cImage::PF_GREYSCALE_16;
        m_sBitmapFormatDepth.nBytesPerLine = m_nWidthDepth * 2;
        m_sBitmapFormatDepth.nSize = m_sBitmapFormatDepth.nBytesPerLine * m_nHeightDepth;
        m_sBitmapFormatDepth.nPaletteSize = 0;
        m_oDepthImage.SetFormat(&m_sBitmapFormatDepth, NULL);    
    }
    else if (eStage == StageGraphReady)    
    {        
        //check which streams has to be enabled in th xtion
        tBool videoEnabled = m_oRGBVideo.IsConnected();        
        tBool depthEnabled = m_oDepthImage.IsConnected();

        // if no output pin is connected the depth image is enabled because one stream must be set to tTrue;
        if (videoEnabled==tFalse && depthEnabled==tFalse) depthEnabled = tTrue;
            
        // initialize the grabber with the videoformats, which streams has the be enabled, the framerates and some more options
        if (!(m_xtionGrabber.initialize(m_nWidthDepth,m_nHeightDepth,m_FPSDepth,m_nWidthVideo,m_nHeightVideo,m_FPSVideo,depthEnabled,videoEnabled,m_setDepthInMillimeter,m_setRegistration,m_setDepthColorSync,m_setAutoExposure,m_setAutoWhiteBalance)))
            THROW_ERROR_DESC(ERR_DEVICE_NOT_READY,"Failed to initialize Xtion!")
        else
            LOG_INFO(cString::Format("Xtion Capture Device: Grabber is now initialized. Depth mode: %d Video mode: %d",depthEnabled,videoEnabled));
        // creates the thread for the reading of data from the xtion
        tResult nResult;
        nResult = m_oWorker.Create(cKernelThread::TF_Suspended, static_cast<adtf::IKernelThreadFunc*>(this));
        if (IS_FAILED(nResult))
            THROW_ERROR_DESC(nResult,"Failed to create thread for xtion");
        }
예제 #2
0
tResult LaneFollower::CreateInputPins(__exception)
{
    RETURN_IF_FAILED(m_inputPin_LF_enable.Create("lf_enable", new cMediaType(0, 0, 0, "tSignalValue")  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_LF_enable));

    RETURN_IF_FAILED(m_inputPin_LaneInfo.Create("laneInfo", new cMediaType(0, 0, 0, "tLaneInfo")  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_LaneInfo));

    RETURN_IF_FAILED(m_inputPin_CD_enable.Create("cd_enable", new cMediaType(0, 0, 0, "tSignalValue")  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_CD_enable));

    RETURN_IF_FAILED(m_inputPin_PS_enable.Create("ps_enable", new cMediaType(0, 0, 0, "tSignalValue")  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_PS_enable));

    cObjectPtr<IMediaDescriptionManager> pDescManager;
    RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,IID_ADTF_MEDIA_DESCRIPTION_MANAGER,(tVoid**)&pDescManager,__exception_ptr));

    tChar const * strDesc = pDescManager->GetMediaDescription("tCrossingInfo");
    RETURN_IF_POINTER_NULL(strDesc);
    cObjectPtr<IMediaType> pType = new cMediaType(0, 0, 0, "tCrossingInfo", strDesc, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
    RETURN_IF_FAILED(pType->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pCoderDescCrossingInfo));

    RETURN_IF_FAILED(m_inputPin_CrossingInfo.Create("CrossingInfo", pType , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_CrossingInfo));

	RETURN_NOERROR;
}
예제 #3
0
tResult UltrasonicACC::CreateInputPins(__exception)
{

	/* Create input pin for targetSpeed */
	RETURN_IF_FAILED(targetSpeed_input.Create("Target_Speed", tSignalValueSpeedInput_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&targetSpeed_input));

	/* Create input pin for original targetSpeed */
	RETURN_IF_FAILED(originalTargetSpeed_input.Create("Orig_Target_Speed", tSignalValueOriginalSpeedInput_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&originalTargetSpeed_input));

	/* Create of the input pin for steeringAngle */
	RETURN_IF_FAILED(steeringAngle_input.Create("Steering_Angle", tSignalValueSteeringInput_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&steeringAngle_input));

	/* Create input pin for ultrasonic sensor */
	RETURN_IF_FAILED(ultrasonicStruct_input.Create("Ultrasonic_Struct", tUltrasonicStructInput_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&ultrasonicStruct_input));

	/* Create action input for SCM communication */
	RETURN_IF_FAILED(actionInput.Create("action", tActionStruct_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&actionInput));

	RETURN_NOERROR;
}
예제 #4
0
tResult cJuryModule::Init(tInitStage eStage, __exception)
{
    RETURN_IF_FAILED(cBaseQtFilter::Init(eStage, __exception_ptr));

    // pins need to be created at StageFirst
    if (eStage == StageFirst)
    {

        cObjectPtr<IMediaDescriptionManager> pDescManager;
        RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,
            IID_ADTF_MEDIA_DESCRIPTION_MANAGER,
            (tVoid**)&pDescManager,
            __exception_ptr));
        /*
        * the MediaDescription for <struct name="tJuryNotAusFlag" .../> has to exist in a description file (e.g. in $ADTF_DIR\description\ or $ADTF_DIR\src\examples\src\description
        * before (!) you start adtf_devenv !! if not: the Filter-Plugin will not loaded because cPin.Create() and so ::Init() failes !
        */
        // Select Output
        tChar const * strDesc2 = pDescManager->GetMediaDescription("tJuryStruct");
        RETURN_IF_POINTER_NULL(strDesc2);
        cObjectPtr<IMediaType> pType2 = new cMediaType(0, 0, 0, "tJuryStruct", strDesc2, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_JuryStructOutputPin.Create("Jury_Struct", pType2, this));
        RETURN_IF_FAILED(RegisterPin(&m_JuryStructOutputPin));
        RETURN_IF_FAILED(pType2->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescJuryStruct));

        // NotAus Output
        tChar const * strDesc1 = pDescManager->GetMediaDescription("tJuryEmergencyStop");
        RETURN_IF_POINTER_NULL(strDesc1);
        cObjectPtr<IMediaType> pType1 = new cMediaType(0, 0, 0, "tJuryEmergencyStop", strDesc1,IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_NotAusOutputPin.Create("Emergency_Stop", pType1, this));
        RETURN_IF_FAILED(RegisterPin(&m_NotAusOutputPin));
        RETURN_IF_FAILED(pType1->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescNotAus));      

        // input Pin
        tChar const * strDesc4 = pDescManager->GetMediaDescription("tDriverStruct");
        RETURN_IF_POINTER_NULL(strDesc4);
        cObjectPtr<IMediaType> pType4 = new cMediaType(0, 0, 0, "tDriverStruct", strDesc4, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_DriverStructInputPin.Create("Driver_Struct", pType4, this));
        RETURN_IF_FAILED(RegisterPin(&m_DriverStructInputPin));
        RETURN_IF_FAILED(pType4->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescDriverStruct));      

        m_bDebugModeEnabled = GetPropertyBool("Debug Output to Console");
    }
    else if(eStage == StageNormal)
    {

    }
    else if(eStage == StageGraphReady)
    {
        loadManeuverList();
        m_pWidget->SetManeuverList(m_sectorList);
        m_pWidget->FillComboBox();
        m_bIDNotAusSet = tFalse;
        m_bIDsJuryStructSet = tFalse;
        m_bIDsDriverStructSet = tFalse;
    }
    RETURN_NOERROR;
}
tResult ROI::CreateInputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(rgbVideoInputPin.Create("Video_RGB_In", IPin::PD_Input, static_cast<IPinEventSink *>(this)));
    RETURN_IF_FAILED(RegisterPin(&rgbVideoInputPin));

    RETURN_IF_FAILED(depthVideoInputPin.Create("Grayscale_Video_Depth_In", IPin::PD_Input, static_cast<IPinEventSink *>(this)));
    RETURN_IF_FAILED(RegisterPin(&depthVideoInputPin));

    RETURN_NOERROR;
}
tResult MarkerEvaluator::CreateInputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(roadSignInput.Create("RoadSignAnalysis_Input", roadSignMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&roadSignInput));

    RETURN_IF_FAILED(getReadyInput.Create("Reset_Input", enumMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&getReadyInput));

    RETURN_NOERROR;
}
예제 #7
0
tResult PIDController::CreateInputPins(__exception)
{

	RETURN_IF_FAILED(m_measured_speed_input.Create("meas_speed", measuredSpeedIn.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_measured_speed_input));

	RETURN_IF_FAILED(m_set_point_input.Create("set_speed", setPointIn.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_set_point_input));

    RETURN_NOERROR;
}
// -------------------------------------------------------------------------------------------------
tResult EmergencyFilter::Init(tInitStage stage, __exception) {
// -------------------------------------------------------------------------------------------------
  RETURN_IF_FAILED(cFilter::Init(stage, __exception_ptr));
  
	if (stage == StageFirst) {
	  // Create and register the input pin
    cObjectPtr<IMediaDescriptionManager> description_manager;
    RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,
      IID_ADTF_MEDIA_DESCRIPTION_MANAGER,(tVoid**)&description_manager,__exception_ptr));
    
    // Create the output pin description
    tChar const * package_description = description_manager->GetMediaDescription("SensorPackage");
    RETURN_IF_POINTER_NULL(package_description);        
    cObjectPtr<IMediaType> package_type = new cMediaType(0, 0, 0, "SensorPackage", package_description, IMediaDescription::MDF_DDL_DEFAULT_VERSION);	
    RETURN_IF_FAILED(package_type->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&sensor_package_description_));
    
    // Create the input pin
    RETURN_IF_FAILED(sensor_package_input_.Create("sensorPackage", package_type, static_cast<IPinEventSink*>(this)));
    RETURN_IF_FAILED(RegisterPin(&sensor_package_input_));
    
    // Create the suppression input description
    tChar const * suppression_description = description_manager->GetMediaDescription("tBoolSignalValue");
    RETURN_IF_POINTER_NULL(suppression_description);        
    cObjectPtr<IMediaType> suppression_type = new cMediaType(0, 0, 0, "tBoolSignalValue", suppression_description, IMediaDescription::MDF_DDL_DEFAULT_VERSION);	
		RETURN_IF_FAILED(suppression_type->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&suppression_data_description_));
		
		// Create the input pin
    RETURN_IF_FAILED(suppress_input_.Create("suppress_warnings", suppression_type, static_cast<IPinEventSink*>(this)));
    RETURN_IF_FAILED(RegisterPin(&suppress_input_));
    
    // Create the bool output description
    tChar const * bool_description = description_manager->GetMediaDescription("tBoolSignalValue");
    RETURN_IF_POINTER_NULL(bool_description);        
    cObjectPtr<IMediaType> bool_type = new cMediaType(0, 0, 0, "tBoolSignalValue", bool_description, IMediaDescription::MDF_DDL_DEFAULT_VERSION);	
		RETURN_IF_FAILED(bool_type->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&bool_data_description_));
    
    // Create the output pins
    RETURN_IF_FAILED(wheel_active_output_.Create("wheelActive", bool_type, NULL));
    RETURN_IF_FAILED(RegisterPin(&wheel_active_output_));
    
    RETURN_IF_FAILED(hazard_light_output_.Create("hazardLightsEnabled", bool_type, NULL));
    RETURN_IF_FAILED(RegisterPin(&hazard_light_output_));
	}
	
	else if (stage == StageGraphReady) {
	  debug_ = GetPropertyBool("debug");
	  
	  suppressed_ = false;
	}
	
	RETURN_NOERROR;
}
tResult YawToSteer::CreateInputPins(IException **__exception_ptr)
{
    // Sender Yaw
    RETURN_IF_FAILED(senderCarYawInPin.Create("senderYaw", typeSignalValue, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&senderCarYawInPin));
    // Local Yaw
    RETURN_IF_FAILED(localCarYawInPin.Create("localYaw", typeSignalValue, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&localCarYawInPin));
    // Sender speed
    RETURN_IF_FAILED(senderCarSpeedInPin.Create("senderSpeed", typeSignalValue, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&senderCarSpeedInPin));
    RETURN_NOERROR;
}
예제 #10
0
tResult UltrasonicACC::CreateOutputPins(__exception)
{

	/* create output pin for speed controller */
	RETURN_IF_FAILED(targetSpeed_output.Create("Target_Speed_acc", tSignalValueOutput_object.GetMediaType(), NULL));
	RETURN_IF_FAILED(RegisterPin(&targetSpeed_output));

	// create output pin for statemachine
	RETURN_IF_FAILED(feedbackOutput.Create("feedback", tFeedbackStruct_object.GetMediaType(), NULL));
	RETURN_IF_FAILED(RegisterPin(&feedbackOutput));

	RETURN_NOERROR;
}
tResult MarkerEvaluator::CreateOutputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(markerOutput.Create("Marker_Output", enumMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&markerOutput));

    RETURN_IF_FAILED(noOvertakingOutput.Create("NoOvertaking_Output", boolMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&noOvertakingOutput));

    RETURN_IF_FAILED(readyOutput.Create("Ready_Output", enumMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&readyOutput));

    RETURN_NOERROR;
}
예제 #12
0
tResult cDriverModule::Init(tInitStage eStage, __exception)
{
    RETURN_IF_FAILED(cBaseQtFilter::Init(eStage, __exception_ptr));

    // pins need to be created at StageFirst
    if (eStage == StageFirst)    {

        cObjectPtr<IMediaDescriptionManager> pDescManager;
        RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,
            IID_ADTF_MEDIA_DESCRIPTION_MANAGER,
            (tVoid**)&pDescManager,
            __exception_ptr));

        // input jury struct
        tChar const * strDesc1 = pDescManager->GetMediaDescription("tJuryStruct");
        RETURN_IF_POINTER_NULL(strDesc1);
        cObjectPtr<IMediaType> pType1 = new cMediaType(0, 0, 0, "tJuryStruct", strDesc1, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_JuryStructInputPin.Create("Jury_Struct", pType1, this));
        RETURN_IF_FAILED(RegisterPin(&m_JuryStructInputPin));
        RETURN_IF_FAILED(pType1->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescJuryStruct));

        // input maneuver list
        tChar const * strDesc3 = pDescManager->GetMediaDescription("tManeuverList");
        RETURN_IF_POINTER_NULL(strDesc3);
        cObjectPtr<IMediaType> pType3 = new cMediaType(0, 0, 0, "tManeuverList", strDesc3, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_ManeuverListInputPin.Create("Maneuver_List", pType3, this));
        RETURN_IF_FAILED(RegisterPin(&m_ManeuverListInputPin));
        RETURN_IF_FAILED(pType3->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescManeuverList));

        // output driver struct
        tChar const * strDesc2 = pDescManager->GetMediaDescription("tDriverStruct");
        RETURN_IF_POINTER_NULL(strDesc2);
        cObjectPtr<IMediaType> pType2 = new cMediaType(0, 0, 0, "tDriverStruct", strDesc2, IMediaDescription::MDF_DDL_DEFAULT_VERSION);
        RETURN_IF_FAILED(m_DriverStructOutputPin.Create("Driver_Struct", pType2, this));
        RETURN_IF_FAILED(RegisterPin(&m_DriverStructOutputPin));
        RETURN_IF_FAILED(pType2->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescDriverStruct));

        m_bDebugModeEnabled = GetPropertyBool("Debug Output to Console");
    }
    else if(eStage == StageGraphReady)
    {
        // disable maneuver group box until receiving maneuver list
        m_pWidget->EnableManeuverGroupBox(false);
        // no ids were set so far
        m_bIDsJuryStructSet = tFalse;
        m_bIDsDriverStructSet = tFalse;
    }
    RETURN_NOERROR;
}
예제 #13
0
tResult pylonDetection::CreateInputPins(__exception)
{	
    cObjectPtr<IMediaDescriptionManager> pDescManager;
    RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,IID_ADTF_MEDIA_DESCRIPTION_MANAGER,(tVoid**)&pDescManager,__exception_ptr));
    tChar const * strDescMotion = pDescManager->GetMediaDescription("tMotionDataExt");
    RETURN_IF_POINTER_NULL(strDescMotion);
    cObjectPtr<IMediaType> pTypeMotion = new cMediaType(0, 0, 0, "tMotionDataExt", strDescMotion,IMediaDescription::MDF_DDL_DEFAULT_VERSION);
    RETURN_IF_FAILED(pTypeMotion->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pCoderDescMotion));

    //rgb image input pin
    RETURN_IF_FAILED(m_inputPin_colorImage.Create("rgb_image", adtf::IPin::PD_Input  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_colorImage));

    //depth image input pin
    RETURN_IF_FAILED(m_inputPin_depthImage.Create("depth_image_in", adtf::IPin::PD_Input  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_depthImage));

    //motion data input pin
    RETURN_IF_FAILED(m_inputPin_motion.Create("motion_data", pTypeMotion, static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_motion));

    //sign data input pin
    tChar const * strMarkerInfoValue = pDescManager->GetMediaDescription("tRoadSign");
    RETURN_IF_POINTER_NULL(strMarkerInfoValue);
    cObjectPtr<IMediaType> pTypeSignInfoValue = new cMediaType(0, 0, 0, "tRoadSign", strMarkerInfoValue,IMediaDescription::MDF_DDL_DEFAULT_VERSION);
    RETURN_IF_FAILED(pTypeSignInfoValue->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pCoderDescSign));
    RETURN_IF_FAILED(m_inputPin_signLocation.Create("RoadSign", pTypeSignInfoValue  , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_signLocation));

    //Color calib input pins
    tChar const * strDescSignalValue = pDescManager->GetMediaDescription("tSignalValue");
    RETURN_IF_POINTER_NULL(strDescSignalValue);
    cObjectPtr<IMediaType> pTypeSignalValue = new cMediaType(0, 0, 0, "tSignalValue", strDescSignalValue,IMediaDescription::MDF_DDL_DEFAULT_VERSION);
    RETURN_IF_FAILED(pTypeSignalValue->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pCoderDescSignal));
    RETURN_IF_FAILED(m_inputPin_0.Create("hlow", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_0));
    RETURN_IF_FAILED(m_inputPin_1.Create("hhigh", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_1));
    RETURN_IF_FAILED(m_inputPin_2.Create("slow", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_2));
    RETURN_IF_FAILED(m_inputPin_3.Create("shigh", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_3));
    RETURN_IF_FAILED(m_inputPin_4.Create("vlow", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_4));
    RETURN_IF_FAILED(m_inputPin_5.Create("vhigh", new cMediaType(0, 0, 0, "tSignalValue") , static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_inputPin_5));

	RETURN_NOERROR;
}
tResult StateControllerNew::CreateOutputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(driveStructOutput.Create("Driver_Struct", driveStructMediaType, this));
    RETURN_IF_FAILED(RegisterPin(&driveStructOutput));

    RETURN_IF_FAILED(maneuverOutput.Create("Maneuver_Enum", enumMediaType, this));
    RETURN_IF_FAILED(RegisterPin(&maneuverOutput));

    RETURN_IF_FAILED(carStateOutput.Create("CarState_Enum", enumMediaType, this));
    RETURN_IF_FAILED(RegisterPin(&carStateOutput));

    RETURN_IF_FAILED(resetOutput.Create("Reset_Output", enumMediaType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&resetOutput));

    RETURN_NOERROR;
}
tResult CurveDetector::createVideoOutputPin(const tChar *pinName, cVideoPin &pin)
{
    pin.Create(pinName, IPin::PD_Output, static_cast<IPinEventSink*>(this));
    RETURN_IF_FAILED(RegisterPin(&pin));

    RETURN_NOERROR;
}
tResult cUSSSensorBundle::CreateInputPins(__exception)
{
    RETURN_IF_FAILED(m_oInput.Create("ultrasonic_sensors", new cMediaType(0, 0, 0, "tUsData"), static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_oInput));

    RETURN_NOERROR;
}
tResult ImageCutter::createInputPin(const tChar *pinName, cVideoPin &pin)
{
	pin.Create(pinName, IPin::PD_Input, static_cast<IPinEventSink*>(this));
	RETURN_IF_FAILED(RegisterPin(&pin));
	
	RETURN_NOERROR;
}
tResult cSimpleFusion::createInputPinUSRight(const tChar *pinName)
{
    RETURN_IF_FAILED(m_us_right_in.Create(pinName, pTypeSignalValue, static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_us_right_in));

    RETURN_NOERROR;
}
tResult cSimpleFusion::createInputPinIRShortRange2(const tChar *pinName)
{
    RETURN_IF_FAILED(m_ir_short_in2.Create(pinName, pTypeSignalValue, static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_ir_short_in2));

    RETURN_NOERROR;
}
tResult cSimpleFusion::createInputPinIRLongeRange(const tChar *pinNameShort)
{
    RETURN_IF_FAILED(m_ir_long_in.Create(pinNameShort, pTypeSignalValue, static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&m_ir_long_in));

    RETURN_NOERROR;
}
tResult cBoolValueGenerator::Init(tInitStage eStage, __exception)
{
    RETURN_IF_FAILED(cBaseQtFilter::Init(eStage, __exception_ptr));

    // pins need to be created at StageFirst
    if (eStage == StageFirst)    {

	    cObjectPtr<IMediaDescriptionManager> pDescManager;
        RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,IID_ADTF_MEDIA_DESCRIPTION_MANAGER,(tVoid**)&pDescManager,__exception_ptr));
    
	    tChar const * strDescignalValue = pDescManager->GetMediaDescription("tBoolSignalValue");
	
        RETURN_IF_POINTER_NULL(strDescignalValue);        
        cObjectPtr<IMediaType> pTypeSignalValue = new cMediaType(0, 0, 0, "tBoolSignalValue", strDescignalValue,IMediaDescription::MDF_DDL_DEFAULT_VERSION);	
        RETURN_IF_FAILED(pTypeSignalValue->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pCoderDescBool)); 
	
	    RETURN_IF_FAILED(m_oBoolValuePin.Create("BoolValue",pTypeSignalValue, static_cast<IPinEventSink*> (this)));
        RETURN_IF_FAILED(RegisterPin(&m_oBoolValuePin));

        RETURN_NOERROR;
    }
    else if(eStage == StageGraphReady)
    {

    }
    RETURN_NOERROR;
}
tResult TemporalImage::CreateOutputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(videoOutputPin.Create("Greyscale_Video_Output", IPin::PD_Output, static_cast<IPinEventSink *>(this)));
    RETURN_IF_FAILED(RegisterPin(&videoOutputPin));

    RETURN_NOERROR;
}
//****************************
tResult cUserAttitudeFilter::CreateInputPins(__exception)
{
    RETURN_IF_FAILED(m_oInput_qW.Create("quaternion_gyro_w", new cMediaType(0, 0, 0, "tSignalValue"), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_oInput_qW));

	RETURN_IF_FAILED(m_oInput_qX.Create("quaternion_gyro_x", new cMediaType(0, 0, 0, "tSignalValue"), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_oInput_qX));

	RETURN_IF_FAILED(m_oInput_qY.Create("quaternion_gyro_y", new cMediaType(0, 0, 0, "tSignalValue"), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_oInput_qY));

	RETURN_IF_FAILED(m_oInput_qZ.Create("quaternion_gyro_z", new cMediaType(0, 0, 0, "tSignalValue"), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&m_oInput_qZ));

	 RETURN_NOERROR;
}
예제 #24
0
tResult cBoolValueGenerator::Init(tInitStage eStage, __exception)
{
    RETURN_IF_FAILED(cBaseQtFilter::Init(eStage, __exception_ptr));

    if (eStage == StageFirst)    
    {        
        //get the media description manager for this filter
        cObjectPtr<IMediaDescriptionManager> pDescManager;
        RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,IID_ADTF_MEDIA_DESCRIPTION_MANAGER,(tVoid**)&pDescManager,__exception_ptr));
        //get description
        tChar const * strDescignalValue = pDescManager->GetMediaDescription("tBoolSignalValue");
        
        // checks if exists
        RETURN_IF_POINTER_NULL(strDescignalValue);        
        
        //get mediatype
        cObjectPtr<IMediaType> pTypeSignalValue = new cMediaType(0, 0, 0, "tBoolSignalValue", strDescignalValue,IMediaDescription::MDF_DDL_DEFAULT_VERSION);	
        
        //get mediatype description
        RETURN_IF_FAILED(pTypeSignalValue->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescriptionBool)); 

        //create pin for output
        RETURN_IF_FAILED(m_oBoolValuePin.Create("BoolValue",pTypeSignalValue, static_cast<IPinEventSink*> (this)));
        RETURN_IF_FAILED(RegisterPin(&m_oBoolValuePin));

        RETURN_NOERROR;
    }
    else if(eStage == StageGraphReady)
    {
        // media descriptions ids not set by now
        m_bIDsBoolValueOutput = tFalse;
    }
    RETURN_NOERROR;
}
tResult Emergency::createOutputPin(const char *pinName, cOutputPin &pin, cObjectPtr<IMediaType> &typeSignal)
{
    RETURN_IF_FAILED(pin.Create(pinName, typeSignal));
    RETURN_IF_FAILED(RegisterPin(&pin));

    RETURN_NOERROR;
}
tResult Emergency::createInputPin(const char *pinName, cInputPin &pin, cObjectPtr<IMediaType> &typeSignal)
{
    RETURN_IF_FAILED(pin.Create(pinName, typeSignal, static_cast<IPinEventSink*> (this)));
    RETURN_IF_FAILED(RegisterPin(&pin));

    RETURN_NOERROR;
}
예제 #27
0
tResult YawToSteer::CreateOutputPins(IException **__exception_ptr)
{
    // Steering Pin, connect to SteeringController of Basic_Config
    RETURN_IF_FAILED(steerOutPin.Create("steer", typeSignalValue, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&steerOutPin));
    RETURN_NOERROR;
}
tResult cSimpleFusion::createOutputPin()
{
    RETURN_IF_FAILED(m_ir_fusion_out.Create("ir_fusion_out", pTypeSignalValue, NULL));
    RETURN_IF_FAILED(RegisterPin(&m_ir_fusion_out));

    RETURN_NOERROR;
}
tResult ROI::CreateOutputPins(IException **__exception_ptr)
{
    RETURN_IF_FAILED(rgbRoiOutputPin.Create("Rect_RGB_Out", tRectType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&rgbRoiOutputPin));

    RETURN_IF_FAILED(depthRoiOutputPin.Create("Rect_Depth_Out", tRectType, static_cast<IPinEventSink *> (this)));
    RETURN_IF_FAILED(RegisterPin(&depthRoiOutputPin));

    RETURN_IF_FAILED(rgbVideoOutputPin.Create("Video_RGB_Out", IPin::PD_Output, static_cast<IPinEventSink *>(this)));
    RETURN_IF_FAILED(RegisterPin(&rgbVideoOutputPin));

    RETURN_IF_FAILED(depthVideoOutputPin.Create("Grayscale_Video_Depth_Out", IPin::PD_Output, static_cast<IPinEventSink *>(this)));
    RETURN_IF_FAILED(RegisterPin(&depthVideoOutputPin));

    RETURN_NOERROR;
}
예제 #30
0
tResult LightMessageLogger::CreateInputPins(__exception)
{
	RETURN_IF_FAILED(actionInput.Create("action", tActionStruct_object.GetMediaType(), static_cast<IPinEventSink*> (this)));
	RETURN_IF_FAILED(RegisterPin(&actionInput));

	RETURN_NOERROR;
}