示例#1
0
static void
gst_ks_video_src_base_init (gpointer gclass)
{
  GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);

  gst_element_class_set_details (element_class, "KsVideoSrc",
      "Source/Video",
      "Stream data from a video capture device through Windows kernel streaming",
      "Ole André Vadla Ravnås <*****@*****.**>, "
      "Haakon Sporsheim <*****@*****.**>");

  gst_element_class_add_pad_template (element_class,
      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
          ks_video_get_all_caps ()));
}
示例#2
0
static void
gst_ks_video_src_class_init (GstKsVideoSrcClass * klass)
{
    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
    GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
    GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass);
    GstPushSrcClass *gstpushsrc_class = GST_PUSH_SRC_CLASS (klass);

    g_type_class_add_private (klass, sizeof (GstKsVideoSrcPrivate));

    parent_class = g_type_class_peek_parent (klass);

    gst_element_class_set_static_metadata (gstelement_class, "KsVideoSrc",
                                           "Source/Video",
                                           "Stream data from a video capture device through Windows kernel streaming",
                                           "Ole André Vadla Ravnås <*****@*****.**>\n"
                                           "Haakon Sporsheim <*****@*****.**>\n"
                                           "Andres Colubri <*****@*****.**>");

    gst_element_class_add_pad_template (gstelement_class,
                                        gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
                                                ks_video_get_all_caps ()));

    gobject_class->finalize = gst_ks_video_src_finalize;
    gobject_class->get_property = gst_ks_video_src_get_property;
    gobject_class->set_property = gst_ks_video_src_set_property;

    gstelement_class->change_state =
        GST_DEBUG_FUNCPTR (gst_ks_video_src_change_state);
    gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_ks_video_src_set_clock);

    gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_ks_video_src_get_caps);
    gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_ks_video_src_set_caps);
    gstbasesrc_class->fixate = GST_DEBUG_FUNCPTR (gst_ks_video_src_fixate);
    gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_ks_video_src_query);
    gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_ks_video_src_unlock);
    gstbasesrc_class->unlock_stop =
        GST_DEBUG_FUNCPTR (gst_ks_video_src_unlock_stop);

    gstpushsrc_class->create = GST_DEBUG_FUNCPTR (gst_ks_video_src_create);

    g_object_class_install_property (gobject_class, PROP_DEVICE_PATH,
                                     g_param_spec_string ("device-path", "Device Path",
                                             "The device path", DEFAULT_DEVICE_PATH,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
                                     g_param_spec_string ("device-name", "Device Name",
                                             "The human-readable device name", DEFAULT_DEVICE_NAME,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_DEVICE_INDEX,
                                     g_param_spec_int ("device-index", "Device Index",
                                             "The zero-based device index", -1, G_MAXINT, DEFAULT_DEVICE_INDEX,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_DO_STATS,
                                     g_param_spec_boolean ("do-stats", "Enable statistics",
                                             "Enable logging of statistics", DEFAULT_DO_STATS,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_FPS,
                                     g_param_spec_int ("fps", "Frames per second",
                                             "Last measured framerate, if statistics are enabled",
                                             -1, G_MAXINT, -1, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_ENABLE_QUIRKS,
                                     g_param_spec_boolean ("enable-quirks", "Enable quirks",
                                             "Enable driver-specific quirks", DEFAULT_ENABLE_QUIRKS,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}