本文整理汇总了C++中GST_PLUGIN_FEATURE函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_PLUGIN_FEATURE函数的具体用法?C++ GST_PLUGIN_FEATURE怎么用?C++ GST_PLUGIN_FEATURE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_PLUGIN_FEATURE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gst_caps_from_string
static const char *Gstreamer_FindMatch(const char *strcaps)
{
struct typeinfo data;
GList *list, *copy;
guint bestrank = 0;
GstElementFactory *bestfactory = NULL;
GstCaps *caps = gst_caps_from_string(strcaps);
TRACE("%s\n", strcaps);
data.caps = caps;
data.type = "Decoder";
copy = gst_registry_feature_filter(gst_registry_get(), match_element, 0, &data);
for (list = copy; list; list = list->next) {
GstElementFactory *factory = (GstElementFactory*)list->data;
guint rank;
rank = gst_plugin_feature_get_rank(GST_PLUGIN_FEATURE(factory));
if (rank > bestrank || !bestrank) {
bestrank = rank;
bestfactory = factory;
}
}
gst_caps_unref(caps);
g_list_free(copy);
if (!bestfactory) {
FIXME("Could not find plugin for %s\n", strcaps);
return NULL;
}
return gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(bestfactory));
}
示例2: print_element_info
static int
print_element_info (GstElementFactory * factory, gboolean print_names)
{
GstElement *element;
gint maxlevel = 0;
factory =
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
(factory)));
if (!factory) {
g_print ("element plugin couldn't be loaded\n");
return -1;
}
element = gst_element_factory_create (factory, NULL);
if (!element) {
g_print ("couldn't construct element for some reason\n");
return -1;
}
if (print_names)
_name = g_strdup_printf ("%s: ", GST_PLUGIN_FEATURE (factory)->name);
else
_name = NULL;
print_factory_details_info (factory);
if (GST_PLUGIN_FEATURE (factory)->plugin_name) {
GstPlugin *plugin;
plugin = gst_registry_find_plugin (gst_registry_get_default (),
GST_PLUGIN_FEATURE (factory)->plugin_name);
if (plugin) {
print_plugin_info (plugin);
}
}
print_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
print_interfaces (G_OBJECT_TYPE (element));
print_pad_templates_info (element, factory);
print_element_flag_info (element);
print_implementation_info (element);
print_clocking_info (element);
print_index_info (element);
print_uri_handler_info (element);
print_pad_info (element);
print_element_properties_info (element);
print_signal_info (element);
print_children_info (element);
gst_object_unref (element);
gst_object_unref (factory);
g_free (_name);
return 0;
}
示例3: gstsharp_gst_index_factory_set_plugin
void
gstsharp_gst_index_factory_set_plugin (GstIndexFactory * factory,
GstPlugin * plugin)
{
if (!plugin)
return;
GST_PLUGIN_FEATURE (factory)->plugin_name = g_strdup (plugin->desc.name);
GST_PLUGIN_FEATURE (factory)->loaded = TRUE;
}
示例4: print_factory_details_info
static void
print_factory_details_info (GstElementFactory * factory)
{
n_print ("Factory Details:\n");
n_print (" Long name:\t%s\n", factory->details.longname);
n_print (" Class:\t%s\n", factory->details.klass);
n_print (" Description:\t%s\n", factory->details.description);
n_print (" Author(s):\t%s\n", factory->details.author);
n_print (" Rank:\t\t%s (%d)\n",
get_rank_name (GST_PLUGIN_FEATURE (factory)->rank),
GST_PLUGIN_FEATURE (factory)->rank);
n_print ("\n");
}
示例5: rb_gst_registry_get_features
/*
* Method: get_features(feature_type_or_plugin_name)
* feature_type_or_plugin_name: a feature type or plugin name.
*
* Gets a list of all plugin features of the given type in the pool.
*
* Valid features types are Gst::AutoplugFactory, Gst::ElementFactory,
* Gst::IndexFactory, Gst::SchedulerFactory and Gst::TypeFactory.
*
* Returns: an array of Gst::PluginFeature objects.
*/
static VALUE
rb_gst_registry_get_features(VALUE self, VALUE type_or_plugin_name)
{
GList *list, *node;
GType gtype;
VALUE arr;
if (RVAL2CBOOL(rb_obj_is_kind_of(type_or_plugin_name, rb_cString))) {
list = gst_registry_get_feature_list_by_plugin(RGST_REGISTRY(self),
RVAL2CSTR(type_or_plugin_name));
} else {
gtype = CLASS2GTYPE(type_or_plugin_name);
if (!is_valid_pluginfeature_type(gtype))
rb_raise (rb_eArgError, "Invalid feature type.");
list = gst_registry_get_feature_list(RGST_REGISTRY(self), gtype);
}
arr = rb_ary_new();
for (node = list; node != NULL; node = g_list_next(node)) {
rb_ary_push(arr, instanciate_pluginfeature(GST_PLUGIN_FEATURE(node->data)));
}
g_list_free (list);
return arr;
}
示例6: test_registry
void test_registry()
{
GList *g;
GstRegistry *registry;
//xmlfile = "test_registry";
std_log(LOG_FILENAME_LINE, "Test Started test_registry");
registry = gst_registry_get_default ();
for (g = registry->plugins; g; g = g->next) {
GstPlugin *plugin = GST_PLUGIN (g->data);
ASSERT_OBJECT_REFCOUNT (plugin, "plugin in registry", 1);
GST_DEBUG ("refcount %d %s", GST_OBJECT_REFCOUNT_VALUE (plugin),
plugin->desc.name);
}
for (g = registry->features; g; g = g->next) {
GstPluginFeature *feature = GST_PLUGIN_FEATURE (g->data);
fail_if (GST_OBJECT_REFCOUNT_VALUE (feature) != 1,
"Feature in registry should have refcount of 1");
GST_DEBUG ("refcount %d %s", GST_OBJECT_REFCOUNT_VALUE (feature),
feature->name);
}
std_log(LOG_FILENAME_LINE, "Test Successful");
create_xml(0);
}
示例7: get_parser_caps_filter
/* Get the intersection of parser caps and available (sorted) decoders */
static GstCaps *
get_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
{
GList *tmp;
GstCaps *filter_caps = gst_caps_new_empty ();
g_mutex_lock (&dbin->factories_lock);
gst_decode_bin_update_factories_list (dbin);
for (tmp = dbin->decoder_factories; tmp; tmp = tmp->next) {
GstElementFactory *factory = (GstElementFactory *) tmp->data;
GstCaps *tcaps, *intersection;
const GList *tmps;
GST_LOG ("Trying factory %s",
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
for (tmps = gst_element_factory_get_static_pad_templates (factory); tmps;
tmps = tmps->next) {
GstStaticPadTemplate *st = (GstStaticPadTemplate *) tmps->data;
if (st->direction != GST_PAD_SINK || st->presence != GST_PAD_ALWAYS)
continue;
tcaps = gst_static_pad_template_get_caps (st);
intersection =
gst_caps_intersect_full (tcaps, caps, GST_CAPS_INTERSECT_FIRST);
filter_caps = gst_caps_merge (filter_caps, intersection);
gst_caps_unref (tcaps);
}
}
g_mutex_unlock (&dbin->factories_lock);
GST_DEBUG_OBJECT (dbin, "Got filter caps %" GST_PTR_FORMAT, filter_caps);
return filter_caps;
}
示例8: print_plugin_automatic_install_info
static void
print_plugin_automatic_install_info (GstPlugin * plugin)
{
GList *features, *l;
/* not interested in typefind factories, only element factories */
features = gst_registry_get_feature_list (gst_registry_get (),
GST_TYPE_ELEMENT_FACTORY);
for (l = features; l != NULL; l = l->next) {
GstPluginFeature *feature;
GstPlugin *feature_plugin;
feature = GST_PLUGIN_FEATURE (l->data);
/* only interested in the ones that are in the plugin we just loaded */
feature_plugin = gst_plugin_feature_get_plugin (feature);
if (feature_plugin == plugin) {
GstElementFactory *factory;
g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
factory = GST_ELEMENT_FACTORY (feature);
print_plugin_automatic_install_info_protocols (factory);
print_plugin_automatic_install_info_codecs (factory);
}
if (feature_plugin)
gst_object_unref (feature_plugin);
}
g_list_foreach (features, (GFunc) gst_object_unref, NULL);
g_list_free (features);
}
示例9: check_parser_caps_filter
static gboolean
check_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
{
GList *tmp;
gboolean res = FALSE;
g_mutex_lock (&dbin->factories_lock);
gst_decode_bin_update_factories_list (dbin);
for (tmp = dbin->decoder_factories; tmp; tmp = tmp->next) {
GstElementFactory *factory = (GstElementFactory *) tmp->data;
GstCaps *tcaps;
const GList *tmps;
GST_LOG ("Trying factory %s",
gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
for (tmps = gst_element_factory_get_static_pad_templates (factory); tmps;
tmps = tmps->next) {
GstStaticPadTemplate *st = (GstStaticPadTemplate *) tmps->data;
if (st->direction != GST_PAD_SINK || st->presence != GST_PAD_ALWAYS)
continue;
tcaps = gst_static_pad_template_get_caps (st);
if (gst_caps_can_intersect (tcaps, caps)) {
res = TRUE;
gst_caps_unref (tcaps);
goto beach;
}
gst_caps_unref (tcaps);
}
}
beach:
g_mutex_unlock (&dbin->factories_lock);
GST_DEBUG_OBJECT (dbin, "Can intersect : %d", res);
return res;
}
示例10: conference_element_added
static void
conference_element_added (FsElementAddedNotifier *notifier,
GstBin *bin,
GstElement *element,
gpointer user_data)
{
GstElementFactory *factory;
const gchar *name;
factory = gst_element_get_factory (element);
name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory));
if (!tp_strdiff (name, "x264enc"))
{
/* Ensure that the encoder creates the baseline profile */
g_object_set (element,
"byte-stream", TRUE,
"bframes", 0,
"b-adapt", FALSE,
"cabac", FALSE,
"dct8x8", FALSE,
NULL);
}
else if (!tp_strdiff (name, "gstrtpbin"))
{
/* Lower the jitterbuffer latency to make it more suitable for video
* conferencing */
g_object_set (element, "latency", 100, NULL);
}
}
示例11: print_factory_details_info
static void
print_factory_details_info (GstElementFactory * factory)
{
gchar **keys, **k;
GstRank rank;
char s[20];
rank = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory));
n_print ("Factory Details:\n");
n_print (" %-25s%s (%d)\n", "Rank", get_rank_name (s, rank), rank);
keys = gst_element_factory_get_metadata_keys (factory);
if (keys != NULL) {
for (k = keys; *k != NULL; ++k) {
const gchar *val;
gchar *key = *k;
val = gst_element_factory_get_metadata (factory, key);
key[0] = g_ascii_toupper (key[0]);
n_print (" %-25s%s\n", key, val);
}
g_strfreev (keys);
}
n_print ("\n");
}
示例12: iterate_plugins_elements
int
iterate_plugins_elements (GstElementFactory *factory, GHashTable *hashtable)
{
GstElement *element;
const GList *pads;
GstStaticPadTemplate *padtemplate;
const GstCaps * caps;
int i;
factory =
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
(factory)));
if (!factory)
{
g_error ("element plugin couldn't be loaded");
return -1;
}
element = gst_element_factory_create (factory, NULL);
if (!element)
{
g_error ("couldn't construct element for some reason");
return -1;
}
if (factory->numpadtemplates)
{
pads = factory->staticpadtemplates;
while (pads)
{
padtemplate = (GstStaticPadTemplate *) (pads->data);
pads = g_list_next (pads);
if (padtemplate->direction == GST_PAD_SINK
&& padtemplate->presence == GST_PAD_ALWAYS
&& padtemplate->static_caps.string) {
caps = gst_static_caps_get (&padtemplate->static_caps);
if (caps != NULL && !gst_caps_is_any (caps) && !gst_caps_is_empty (caps))
{
for (i = 0; i < gst_caps_get_size (caps); i++)
{
GstStructure *structure = gst_caps_get_structure (caps, i);
const gchar *mime = gst_structure_get_name (structure);
if (g_str_has_prefix (mime, "audio"))
{
g_hash_table_insert(hashtable, (gpointer)mime, (gpointer)&ONE);
}
}
}
}
}
}
gst_object_unref (element);
gst_object_unref (factory);
return 0;
}
示例13: try_codecs
static GstElement * try_codecs(GList *codecs, const gchar *name_prefix)
{
GList *l;
gchar *element_name;
for (l = codecs; l; l = l->next) {
GstElementFactory *f = l->data;
GstElement *e;
element_name = g_strdup_printf("%s_%s_%u", name_prefix,
gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(f)),
get_unique_id());
e = gst_element_factory_create(f, element_name);
g_free(element_name);
if (!e)
continue;
/* Try setting to READY. If this fails the codec does not work, for
* example because the hardware codec is currently busy
*/
if (gst_element_set_state (e, GST_STATE_READY) != GST_STATE_CHANGE_SUCCESS) {
gst_element_set_state (e, GST_STATE_NULL);
gst_object_unref(e);
continue;
}
return e;
}
return NULL;
}
示例14: element_factory_rank_compare_func
static gint
element_factory_rank_compare_func (gconstpointer a, gconstpointer b)
{
gint rank_a = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (a));
gint rank_b = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (b));
/* make order chosen in the end more determinable */
if (rank_a == rank_b) {
const gchar *name_a = GST_PLUGIN_FEATURE_NAME (GST_PLUGIN_FEATURE (a));
const gchar *name_b = GST_PLUGIN_FEATURE_NAME (GST_PLUGIN_FEATURE (b));
return g_ascii_strcasecmp (name_a, name_b);
}
return rank_b - rank_a;
}
示例15: mutate_playbin
static void
mutate_playbin (RBVisualizerPlugin *plugin, GstElement *playbin)
{
GstElement *current_vis_plugin;
GstElement *current_video_sink;
int playbin_flags;
if (playbin == plugin->playbin)
return;
rb_debug ("mutating playbin");
/* check no one has already set the playbin properties we're interested in */
g_object_get (playbin,
"vis-plugin", ¤t_vis_plugin,
"video-sink", ¤t_video_sink,
"flags", &playbin_flags,
NULL);
/* ignore fakesinks */
if (current_video_sink != NULL) {
const char *factoryname;
GstElementFactory *factory;
factory = gst_element_get_factory (current_video_sink);
factoryname = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory));
if (strcmp (factoryname, "fakesink") == 0) {
g_object_unref (current_video_sink);
current_video_sink = NULL;
}
}
if ((current_vis_plugin != NULL) || (current_video_sink != NULL)) {
g_warning ("sink and/or vis plugin already set on playbin");
if (current_vis_plugin)
g_object_unref (current_vis_plugin);
if (current_video_sink)
g_object_unref (current_video_sink);
return;
}
/* detach from old playbin (this should never really happen) */
if (plugin->playbin) {
g_object_unref (plugin->playbin);
}
/* attach to new playbin */
plugin->playbin = g_object_ref (playbin);
g_object_set (plugin->playbin, "video-sink", plugin->sink, NULL);
/* start visualizer if it's supposed to be running */
if (plugin->visualizer != NULL) {
playbin_flags |= PLAYBIN2_FLAG_VIS;
g_object_set (plugin->playbin,
"flags", playbin_flags,
"vis-plugin", plugin->visualizer,
NULL);
}
}