XElement internal variables.

Shader

New Member
Hi:

I'm trying to build a plugin to capture the globalsources.
I was analyzing the information stored in the XElement structure and something intrigued me.

In WINDOWSTUFF.CPP at OBS::EnsureCropValid the data "x", "y", "cx" and "cy" are treated as ints:
{
if(message == WM_LBUTTONUP) {
...
itemElement->SetInt(TEXT("x"), ...);

itemElement->SetFloat(TEXT("crop.left"), item->crop.x);
...
}

but in SCENE.CPP at Scene::InsertImageSource(UINT pos, XElement *sourceElement) they are treated as 'float'.
{
...
float x = sourceElement->GetFloat(TEXT("x"));
float y = sourceElement->GetFloat(TEXT("y"));
float cx = sourceElement->GetFloat(TEXT("cx"), 100);
float cy = sourceElement->GetFloat(TEXT("cy"), 100);
...
}

Probably, I'm confused and it's not a bug, i'm just trying to learn the internal structure, so I can built custom filters (ie, 'sepia', inverted, etc.)

Shader!
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
You are correct, it's not a bug. All data elements are treated as text internally, and converted on the fly, so you can use any of the functions on any of the items. Not the most efficient thing in the world, but it's generally just used for configuration purposes anyway.

Also, I wouldn't really recommend learning too much about it, as this will all be deprecated with obs-studio eventually.
 

Shader

New Member
Thanks Jim:

I'm also learning/playing/working with rtp streaming. It's in alpha state, but probably I will submit you the classes so I dont have to re-modify the code with every OBS release.
I've created MPEGTSpublisher (derived from NetworkStream) just to be used as the RTMPPublisher or the DelayedPublisher.

I think they could be usefull to stream to another servers or directly to VLC.

Shader
 
Top