Help with Getting Pointer to Objects from Anywhere

This forum is about all development around libVLC.
GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Help with Getting Pointer to Objects from Anywhere

Postby GEFORCEXTREME » 15 Sep 2010 06:38

Hi, I would like to collect statistics from VLC and use those statistics for a purpose.
You can get what I mean by going to Tools -> Codec Information -> Statistics tab.

How do I get the values of these statistics and use it in a module, for etc, x264 (/vlc/modules/codecs/x264.c)?

I tried to edit the stats (/vlc/src/misc/stats.c) file such that every time the stats changes, the values are assigned to global variables that I defined in stat.c. Then I tried to access the values from x264.c (inside a separate thread that I created that runs whenever the x264 module is open).

However when I try to do the above, the x264 module simply would not open. I've tried using the global variables from other modules that vlc loads by default (for etc, hotkeys) but the same thing happened, the module hotkey simply would not load/can't be open when I did that.

Since vlc contains lots of objects and/or modules, how do I do what I want to do above? I found a thread in this forum regarding global variables and I should use var_Get / var_Set but how do I use these?

LIBVLC_USED
static inline int var_GetInteger( vlc_object_t *p_obj, const char *psz_name )
{
vlc_value_t val;
if( !var_GetChecked( p_obj, psz_name, VLC_VAR_INTEGER, &val ) )
return val.i_int;
else
return 0;
}

An example use of is
psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "deblock" );

Notice the p_enc, in source files that didn't really have p_enc declared, how or where do I get it? How do I link all these? Thanks!

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Help with Getting Pointer to Objects from Anywhere

Postby Rémi Denis-Courmont » 16 Sep 2010 03:04

You don't. You can't access random objects at random memory locations from random threads.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Re: Help with Getting Pointer to Objects from Anywhere

Postby GEFORCEXTREME » 16 Sep 2010 04:13

Thanks, is there anyway out of this?

GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Re: Help with Getting Pointer to Objects from Anywhere

Postby GEFORCEXTREME » 16 Sep 2010 04:15

viewtopic.php?f=32&t=54675&p=180887

Would this work? Thanks.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 18 guests