Exemplo n.º 1
0
tResult Test::getManeuver(IMediaSample *mediaSample, cInputPin &pin, cObjectPtr<IMediaTypeDescription> &mediaType, tUInt16 &value)
{
	static tUInt16 tmpValue;
	static tUInt32 timeStamp;

	cObjectPtr<IMediaCoder> coder;
	RETURN_IF_FAILED_AND_LOG_ERROR_STR(mediaType->Lock(mediaSample, &coder), "Get UI16 failed to unlock");
	
	coder->Get("ui16Angle", (tVoid*) &tmpValue);
	coder->Get("ui32ArduinoTimestamp", (tVoid*) &timeStamp);
	value = tmpValue;

	RETURN_IF_FAILED_AND_LOG_ERROR_STR(mediaType->Unlock(coder), "Get UI16 failed to unlock");

	RETURN_NOERROR;
}
Exemplo n.º 2
0
tResult Test::getF32Value(IMediaSample *mediaSample, cObjectPtr<IMediaTypeDescription> &mediaType, tFloat32 &value)
{
	static tFloat32 tmpValue;
	static tTimeStamp timeStamp;

	cObjectPtr<IMediaCoder> coder;
	RETURN_IF_FAILED_AND_LOG_ERROR_STR(mediaType->Lock(mediaSample, &coder), "Get32 Failed to lock f32");
            
	coder->Get("f32Value", (tVoid*) &tmpValue);
	coder->Get("ui32ArduinoTimestamp", (tVoid*) &timeStamp);
	value = tmpValue;

	RETURN_IF_FAILED_AND_LOG_ERROR_STR(mediaType->Unlock(coder), "Get32 Failed to unlock f32");

	RETURN_NOERROR;
}