Ejemplo n.º 1
0
CodecStatus_t   Codec_MmeVideo_c::RegisterOutputBufferRing( Ring_t	  Ring )
{
CodecStatus_t	Status;

    //
    // Perform the standard operations
    //

    Status	= Codec_MmeBase_c::RegisterOutputBufferRing( Ring );
    if( Status != CodecNoError )
	return Status;

    //
    // Obtain from the manifestor, the surface parameters we will be dealing with
    //

    if( Manifestor != NULL )
    {
	Status	= Manifestor->GetSurfaceParameters( (void **)(&VideoOutputSurface) );
	if( Status != ManifestorNoError )
	{
	    report( severity_error, "Codec_MmeVideo_c::RegisterOutputBufferRing(%s) - Failed to get output surface parameters.\n", Configuration.CodecName );
	    SetComponentState(ComponentInError);
	    return Status;
	}
    }

//

    return CodecNoError;
}
Ejemplo n.º 2
0
FrameParserStatus_t   FrameParser_Audio_c::RegisterOutputBufferRing(
					Ring_t		Ring )
{
FrameParserStatus_t	Status;

    //
    // First allow the base class to perform it's operations, 
    // as we operate on the buffer pool obtained by it.
    //

    Status	= FrameParser_Base_c::RegisterOutputBufferRing( Ring );
    if( Status != FrameParserNoError )
	return Status;

    //
    // Attach the audio specific parsed frame parameters to every element of the pool
    //

    Status      = CodedFrameBufferPool->AttachMetaData( Player->MetaDataParsedAudioParametersType );
    if( Status != BufferNoError )
    {
	report( severity_error, "FrameParser_Audio_c::RegisterCodedFrameBufferPool - Failed to attach parsed audio parameters to all coded frame buffers.\n" );
	SetComponentState(ComponentInError);
        return Status;
    }

//

    return FrameParserNoError;
}
Ejemplo n.º 3
0
////////////////////////////////////////////////////////////////////////////
///
/// Allocate and initialize the decode buffer if required, and pass them to the caller.
/// 
/// \param Pool         Pointer to location for buffer pool pointer to hold
///                     details of the buffer pool holding the decode buffers.
/// \return             Succes or failure
///
ManifestorStatus_t      Manifestor_Audio_c::GetDecodeBufferPool         (class BufferPool_c**   Pool)
{
    unsigned int                        i;
    ManifestorStatus_t			Status;

    MANIFESTOR_DEBUG (">><<\n");

    // Only create the pool if it doesn't exist and buffers have been created
    if (DecodeBufferPool != NULL)
    {
	*Pool   = DecodeBufferPool;
	return ManifestorNoError;
    }

    Status      = Manifestor_Base_c::GetDecodeBufferPool( Pool );
    if( Status != ManifestorNoError )
    {
	MANIFESTOR_ERROR ("Failed to create a pool of decode buffers.\n");
	DecodeBufferPool        = NULL;
	return ManifestorError;
    }

    // Fill in surface descriptor details with our assumed defaults
    SurfaceDescriptor.BitsPerSample = 32;
    SurfaceDescriptor.ChannelCount = 8;
    SurfaceDescriptor.SampleRateHz = 0;

    for (i = 0; i < BufferConfiguration.MaxBufferCount; i++)
    {
	StreamBuffer[i].BufferIndex                     = i;
	StreamBuffer[i].QueueCount                      = 0;
	StreamBuffer[i].TimeOfGoingOnDisplay            = 0;
	StreamBuffer[i].BufferState                     = AudioBufferStateAvailable;
    }

    BufferQueueHead                     = INVALID_BUFFER_ID;
    BufferQueueTail                     = ANY_BUFFER_ID;
    QueuedBufferCount                   = 0;
    NotQueuedBufferCount                = 0;

    // Let outside world know about the created pool
    *Pool   = DecodeBufferPool;
    SetComponentState (ComponentRunning);

    return ManifestorNoError;
}
Ejemplo n.º 4
0
CodecStatus_t   Codec_DvpVideo_c::RegisterOutputBufferRing(Ring_t Ring)
{
	PlayerStatus_t          Status;
//
	OutputRing  = Ring;
	//
	// Obtain the buffer manager
	//
	Player->GetBufferManager(&BufferManager);
	if (Manifestor == NULL)
	{
		report(severity_error, "Codec_DvpVideo_c::RegisterOutputBufferRing - This implementation does not support no-output decoding.\n");
		return PlayerNotSupported;
	}
	//
	// Obtain the decode buffer pool
	//
	Player->GetDecodeBufferPool(Stream, &DecodeBufferPool);
	if (DecodeBufferPool == NULL)
	{
		report(severity_error, "Codec_DvpVideo_c::RegisterOutputBufferRing(DVP) - This implementation does not support no-output decoding.\n");
		return PlayerNotSupported;
	}
	//
	// Attach the stream specific (audio|video|data)
	// parsed frame parameters to the decode buffer pool.
	//
	Status      = DecodeBufferPool->AttachMetaData(Player->MetaDataParsedVideoParametersType);
	if (Status != BufferNoError)
	{
		report(severity_error, "Codec_DvpVideo_c::RegisterOutputBufferRing(DVP) - Failed to attach stream specific parsed parameters to all decode buffers.\n");
		return Status;
	}
	//
	// Go live
	//
	SetComponentState(ComponentRunning);
	return CodecNoError;
}
Ejemplo n.º 5
0
bool CVehicleEntity::Create()
{
	if (!m_pModelInfo)
		return false;

	// Is the vehicle already spawned?
	if(IsSpawned())
		return false;

	EFLC::CScript::RequestModel(m_pModelInfo->GetHash());

	while (!EFLC::CScript::HasModelLoaded(m_pModelInfo->GetHash()))
		EFLC::CScript::LoadAllObjectsNow(false);

	EFLC::IVehicle * pVehicle = pIVehicleFactory->Create(m_pModelInfo->GetIndex(), 1, 0, 0);
	if (pVehicle)
	{
		pVehicle->Function76(0);
		pVehicle->m_byteFlags1 |= 4u;
		pVehicle->m_dwFlags1 |= 8u; // set fixed wait for collision/

		CWorld__AddEntity(pVehicle, false);
		CVehicleModelInfo__AddReference(m_pModelInfo->GetModelInfo());
		// we dont want to turn on the engine
		// CVehicle__TurnEngineOn(pVehicle, true);
		pVehicle->m_byteFlags10 |= 8u;

		// This maybe cause pool overflow if much vehicles are created and destroyed [NEED TEST]
		// If this cause overflow try to delete the create physics before call or disable the call in VehicleFactory::Create
		// Using this above *(WORD*) (g_pCore->GetBase() + 0x4B48D5) = 0x9090; before call to vehiclefactory [TESTED => crash]
		// Can someone confirm if this cause pool overflow or not
		if (*(DWORD*) pVehicle != COffsets::VAR_CBoat__VFTable) // Otherwise client crash if boat is on ground (not in water)
		{
			pVehicle->CreatePhysics();
			pVehicle->ProcessInput();
		}
		
		EFLC::CScript::MarkModelAsNoLongerNeeded(m_pModelInfo->GetHash());

		m_pVehicle = new EFLC::CVehicle(pVehicle);

		//set the vehicle's color
		SetColors(m_dwColor[0], m_dwColor[1], m_dwColor[2], m_dwColor[3], m_dwColor[4]);

		//fix: no more random components
		for (int i = 0; i < 9; ++i)
			SetComponentState(i, false);

		// Mark as spawned
		m_bSpawned = true;

		// Reset the vehicle
		Reset();

		SetPosition(m_vecSpawnPosition, true);

		CLogFile::Printf("Created vehicle! (Id: %d, Handle: %X)", m_vehicleId, g_pCore->GetGame()->GetPools()->GetVehiclePool()->HandleOf(pVehicle));
		return true;
	}
	else
	{
		CLogFile::Printf("Created vehicle failed!");
		return false;
	}
}
Ejemplo n.º 6
0
FrameParserStatus_t   FrameParser_Base_c::RegisterOutputBufferRing(Ring_t        Ring)
{
	PlayerStatus_t  Status;
//
	OutputRing  = Ring;
	//
	// Obtain the class list, and the coded frame buffer pool
	//
	Player->GetCodedFrameBufferPool(Stream, &CodedFrameBufferPool, NULL);
	Player->GetDecodeBufferPool(Stream, &DecodeBufferPool);
	//
	// Obtain Buffer counts
	//
	CodedFrameBufferPool->GetPoolUsage(&FrameBufferCount, NULL, NULL, NULL, NULL);
	if (DecodeBufferPool != NULL)
		Manifestor->GetDecodeBufferCount(&DecodeBufferCount);
	else
		DecodeBufferCount       = DEFAULT_DECODE_BUFFER_COUNT;
	//
	// Attach the generic parsed frame parameters to every element of the pool.
	//
	Status      = CodedFrameBufferPool->AttachMetaData(Player->MetaDataParsedFrameParametersType);
	if (Status != BufferNoError)
	{
		report(severity_error, "FrameParser_Base_c::RegisterOutputBufferRing - Failed to attach parsed frame parameters to all coded frame buffers.\n");
		SetComponentState(ComponentInError);
		return Status;
	}
	//
	// Now create the frame and stream parameter buffers
	//
	Status  = RegisterStreamAndFrameDescriptors();
	if (Status != FrameParserNoError)
	{
		report(severity_error, "FrameParser_Base_c::RegisterOutputBufferRing - Failed to register the parameter buffer types.\n");
		SetComponentState(ComponentInError);
		return Status;
	}
//
	Status      = BufferManager->CreatePool(&StreamParametersPool, StreamParametersType, Configuration.StreamParametersCount);
	if (Status != BufferNoError)
	{
		report(severity_error, "FrameParser_Base_c::RegisterOutputBufferRing - Failed to create a pool of stream parameter buffers.\n");
		SetComponentState(ComponentInError);
		return Status;
	}
	Status      = BufferManager->CreatePool(&FrameParametersPool, FrameParametersType, Configuration.FrameParametersCount);
	if (Status != BufferNoError)
	{
		report(severity_error, "FrameParser_Base_c::RegisterOutputBufferRing - Failed to create a pool of frame parameter buffers.\n");
		SetComponentState(ComponentInError);
		return Status;
	}
//
	StreamParametersBuffer      = NULL;
	FrameParametersBuffer       = NULL;
	//
	// Go live
	//
//    report (severity_error, "Setting component state to running\n");
	SetComponentState(ComponentRunning);
	return FrameParserNoError;
}