예제 #1
0
파일: main.c 프로젝트: nsteele/TestOOC
int main(int argc, const char * argv[])
{
	ooc_init_class(Exception);
	ooc_init_class(Parent);
	
	//AS3_GoAsync();
	
	//ooc_finalize_all();
	
	
    Parent par = Parent_new(15);
    int parData = ParentVirtual(par)->par_get_data(par);
    printf("Parent's Data: %i", parData);
	
	return 0;
}
예제 #2
0
SoftDrink
softdrink_new( void )
{
	ooc_init_class( SoftDrink );
		
	return (SoftDrink) ooc_new( SoftDrink, NULL );
}
static OMX_ERRORTYPE localSetupComponent(
    OMX_IN  OMX_HANDLETYPE hComponent) {
    MagOmxPort_DispTest dispInPort;
    MagOmxPort dispInPortRoot;
    MagOmxPort_Constructor_Param_t param;
    MagOmxComponentImpl dispCompImpl;
    MagOmxComponent     dispComp;

    AGILE_LOGV("enter!");

    gDisplayFile = fopen("./output.stream","wb+");
    if (gDisplayFile == NULL) {
        AGILE_LOGE("Failed to open the file: ./output.stream");
    }

    param.portIndex    = START_PORT_INDEX;
    param.isInput      = OMX_TRUE;
    param.bufSupplier  = OMX_BufferSupplyUnspecified;
    param.formatStruct = 0;
    sprintf((char *)param.name, "%s-In", DISP_PORT_NAME);

    ooc_init_class(MagOmxPort_DispTest);
    dispInPort = ooc_new(MagOmxPort_DispTest, &param);
    MAG_ASSERT(dispInPort);
    dispInPortRoot = ooc_cast(dispInPort, MagOmxPort);

    dispCompImpl = ooc_cast(hComponent, MagOmxComponentImpl);
    dispComp = ooc_cast(hComponent, MagOmxComponent);

    dispComp->setName(dispComp, (OMX_U8 *)COMPONENT_NAME);
    dispCompImpl->addPort(dispCompImpl, 0, dispInPort);
    dispCompImpl->setupPortDataFlow(dispCompImpl, dispInPort, NULL);

    return OMX_ErrorNone;
}
static OMX_ERRORTYPE localSetupComponent(
                    OMX_IN  OMX_HANDLETYPE hComponent){
	MagOmxPort_VdecTest vdecInPort;
	MagOmxPort_DispTest dispOutPort;
	MagOmxPort_Constructor_Param_t param;
	MagOmxComponentImpl vdecCompImpl;
	MagOmxComponent     vdecComp;

	AGILE_LOGV("enter!");

	param.portIndex    = START_PORT_INDEX + 0;
	param.isInput      = OMX_TRUE;
	param.bufSupplier  = OMX_BufferSupplyUnspecified;
	param.formatStruct = 0;
	sprintf((char *)param.name, "%s-In", VDEC_PORT_NAME);

	ooc_init_class(MagOmxPort_VdecTest);
	vdecInPort = ooc_new(MagOmxPort_VdecTest, &param);
	MAG_ASSERT(vdecInPort);

	param.portIndex    = START_PORT_INDEX + 1;
	param.isInput      = OMX_FALSE;
	param.bufSupplier  = OMX_BufferSupplyOutput;
	param.formatStruct = 0;
	sprintf((char *)param.name, "%s-Out", DISP_PORT_NAME);

	ooc_init_class(MagOmxPort_DispTest);
	dispOutPort = ooc_new(MagOmxPort_DispTest, &param);
	MAG_ASSERT(dispOutPort);

	vdecCompImpl = ooc_cast(hComponent, MagOmxComponentImpl);
	vdecComp = ooc_cast(hComponent, MagOmxComponent);
	
	vdecComp->setName(vdecComp, (OMX_U8 *)COMPONENT_NAME);
	vdecCompImpl->addPort(vdecCompImpl, START_PORT_INDEX + 0, vdecInPort);
	vdecCompImpl->addPort(vdecCompImpl, START_PORT_INDEX + 1, dispOutPort);

	vdecCompImpl->setupPortDataFlow(vdecCompImpl, vdecInPort, dispOutPort);

	return OMX_ErrorNone;
}
예제 #5
0
파일: main.c 프로젝트: haifenghuang/ooc-2
int
main( int argc, char * argv[] )
{
	Desktop	desktop;

	ooc_init_class( Exception );

	srand ( time(NULL) ); /* initialize random seed */

	desktop = desktop_new();
	{
		ooc_manage_object( desktop );

		ooc_get_interface_must_have( desktop, Serializable )->serialize( (Object) desktop, 0 );

		ooc_delete( (Object) ooc_pass( desktop ) );
	}

	ooc_finalize_all();

	return 0;
}