Could tell me how string type can be casting automatically object type?

HoonHee Lee hoonh83.lee at gmail.com
Wed Sep 25 06:20:50 PDT 2013


I mean, gstplaybin2.c has a PROP_AUDIO_SINK property such as PROP_VIDEO_SINK
and PROP_TEXT_SINK.

source code is like this.

static void
gst_play_bin_class_init (GstPlayBinClass * klass)
{
  ...
  g_object_class_install_property (gobject_klass, PROP_AUDIO_SINK,
      *g_param_spec_object* ("audio-sink", "Audio Sink",
          "the audio output element to use (NULL = default sink)",
          *GST_TYPE_ELEMENT*, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  ...
}

static void
gst_play_bin_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  ...
  case PROP_AUDIO_SINK:
      gst_play_bin_set_sink (playbin, &playbin->audio_sink, "audio",
          *g_value_get_object* (value));
  ...
}

static void
gst_play_bin_set_sink (GstPlayBin * playbin, GstElement ** elem,
    const gchar * dbg, *GstElement* * sink)
{
  ...
}


When I use gst-launch playbin uri="xxx" audio-sink="fakesink",
I am just wondering that how "fakesink" string can be casting automatically
GstElement Type by g_value_get_object().
And I think PROP_ACTIVE_PAD property of gstinputselector.c is same
mechanism.

I just want to know which function is making to be possible this mechanism.
Because I want that string type can be casting automatically my customized
object such as GstElement or GstPad Type.

I am not sure, but g_value_transform () or g_value_register_transform_func
() is right?

Please tell me how string type can be casting automatically object type.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Could-tell-me-how-string-type-can-be-casting-automatically-object-type-tp4662191.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list