List All Properties of an Element

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

List All Properties of an Element

Wes Miller
Administrator
Hi All,

Is there a way to list all the readable, writeable or both properties for a specific element?  For example, a call that returns something like a GParamSpec that lists the type and name for all the properties of ffenc_aac?

I assume this requires a call to either g_object_class_list_properties () or  g_object_interface_list_properties().  What is not completely clear is whether gst elements, i.e. ffenc_aac or filesrc or whatever, are object class names as defined by these two calls and whether the gst properties are class or interface properties.  Do I need something (what?) to get the object class from an instance of a gst element?

GParamSpec**    g_object_class_list_properties( GObjectClass *oclass, guint *n_properties );

Thanks for any help.  This is for a debug routine that I'll happily share if I get it working.

Wes
Reply | Threaded
Open this post in threaded view
|

Re: List All Properties of an Element

Thiago Sousa Santos-2


On Tue, Nov 30, 2010 at 11:02 AM, Wes Miller <[hidden email]> wrote:

Hi All,

Is there a way to list all the readable, writeable or both properties for a
specific element?  For example, a call that returns something like a
GParamSpec that lists the type and name for all the properties of ffenc_aac?

I assume this requires a call to either g_object_class_list_properties () or
g_object_interface_list_properties().  What is not completely clear is
whether gst elements, i.e. ffenc_aac or filesrc or whatever, are object
class names as defined by these two calls and whether the gst properties are
class or interface properties.  Do I need something (what?) to get the
object class from an instance of a gst element?

GParamSpec**    g_object_class_list_properties( GObjectClass *oclass, guint
*n_properties );

Thanks for any help.  This is for a debug routine that I'll happily share if
I get it working.

I haven't done this myself, but I suppose gst-inspect in gstreamer/tools should have code to do this. You could start checking it.
 

Wes

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/List-All-Properties-of-an-Element-tp3065421p3065421.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: List All Properties of an Element

Wes Miller
Administrator
Thiago,

I thought of gst-inspect right after i posted the note. ( Don't you always think of the answer right after you press sned?).

Gst-inspect has exactly what I was after.  (I thnk, not tested yet).  I'm copying the code for print-element_properties_info() and n_print().  I suspect some changes to reduce output verbosity will be made.  And then I'll fix K&R into something readable.

Thanks,

Wes
Reply | Threaded
Open this post in threaded view
|

Re: List All Properties of an Element

Wes Miller
Administrator
Ok, drum roll, I got this working and made it "pretty" so I could share.  

The attached files are for gst_element_print_properties().  It is more or less a rework of the print_element_properties_info() in gst-inspect intended for in-line use. It's LGPL since that's what gst-inspect was.  

Comments and suggestions to me at wmiller<at>sdr.com.  

Happy Hanukkah,

Wes Miller

gst_element_print_properties.cgst_element_print_properties.h

p.s. I've never uploaded files with this tool before.  If they don't show up or aren't accessible, I'll post them to pastebin,com and update this forum.   wjm


Reply | Threaded
Open this post in threaded view
|

Re: List All Properties of an Element

Wes Miller
Administrator
Hey, I forgot to advertise...

   a call to

            gst_element_print_properties( GstElement *element );

returns something like the following example output for a gstrtpbin element.  The output is about 110 columns wide.  Not great for viewing in vi* unless you turn line wrap off.

(if your viewer happens to use proportional fonts, try cut-n-pasting into another editor)


<-->|<--- property name --->|<-- current value -->|<-------- type --------->|<----- range and default ----->
    | ELEMENT CLASS NAME    | GstRtpBin           |                         |
    | ELEMENT FACTORY NAME  | gstrtpbin           | RTP Bin                 |
rw- | name                  | "rtpbin"            | G_TYPE_STRING           | null
rw- | async-handling        | false               | G_TYPE_BOOLEAN          | false
rw- | latency               | 1000                | G_TYPE_UINT             | (0 - 4294967295)   200
rw- | sdes                  | GstStructure        | Boxed pointer of type "GstStructure"
rw- | do-lost               | false               | G_TYPE_BOOLEAN          | false
rw- | ignore-pt             | false               | G_TYPE_BOOLEAN          | false
rw- | autoremove            | false               | G_TYPE_BOOLEAN          | false
rw- | buffer-mode           | 1, "slave"          | Enum "RTPJitterBufferMode" : 1, "slave"


In the function, the topmost three variable declarations are for c2w, c3w and c4w which control the width of columns 2, 3 and 4, respectively.  The function header gives details on how the output is ordered and formatted.

Wes