if (!strcmp(propnode->name, "name")) {
element->name = xmlNodeGetContent(propnode);
-//fprintf(stderr,element->name);
+/* fprintf(stderr,element->name); */
} else if (!strcmp(propnode->name, "srcpad")) {
element->srcpads = g_slist_prepend(element->srcpads, xmlNodeGetContent(propnode));
-//fprintf(stderr,".");
+/* fprintf(stderr,"."); */
} else if (!strcmp(propnode->name, "sinkpad")) {
element->sinkpads = g_slist_prepend(element->sinkpads, xmlNodeGetContent(propnode));
} else if (!strcmp(propnode->name, "srcpadtemplate")) {
element->srcpadtemplates = g_slist_prepend(element->srcpadtemplates, xmlNodeGetContent(propnode));
-//fprintf(stderr,".");
+/* fprintf(stderr,"."); */
} else if (!strcmp(propnode->name, "sinkpad")) {
element->sinkpadtemplates = g_slist_prepend(element->sinkpadtemplates, xmlNodeGetContent(propnode));
} else if (!strcmp(propnode->name, "argument")) {
argument->name = xmlNodeGetContent(propnode);
argument->type = ARG_INT;
- // walk through the values data
+ /* walk through the values data */
argnode = propnode->xmlChildrenNode;
while (argnode) {
if (!strcmp(argnode->name, "filename")) {
/* The bulk of the work is in deciding exactly which words are an option. */
- // if we're right at the beginning, with -launch in the first word
+ /* if we're right at the beginning, with -launch in the first word */
if (strstr(prev_word,"-launch")) {
- // print out only elements with no sink pad or padtemplate
+ /* print out only elements with no sink pad or padtemplate */
elements = element_list;
while (elements) {
element = (comp_element *)(elements->data);
}
}
- // if the previous word is a connection
+ /* if the previous word is a connection */
if (strchr(prev_word, '!')) {
- // print out oly elements with a sink pad or template
+ /* print out oly elements with a sink pad or template */
elements = element_list;
while (elements) {
element = (comp_element *)(elements->data);
}
}
- // if the partial word is an argument, and it's an enum
+ /* if the partial word is an argument, and it's an enum */
if (strchr(prev_word,'=')) {
fprintf(stderr,"it's an arg, but dunno what element yet\n");
}
- // if the previous word is an element, we need to list both pads and arguments
+ /* if the previous word is an element, we need to list both pads and arguments*/
if ((elements = g_list_find_custom(element_list, prev_word, (GCompareFunc)match_element))) {
element = elements->data;
- // zero the numpads list so we can count them
+ /* zero the numpads list so we can count them */
num_pads = 0;
- // pads
+ /* pads */
pads = element->srcpads;
while (pads) {
num_pads++;
pads = g_slist_next (pads);
}
- // padtemplates
+ /* padtemplates */
pads = element->srcpadtemplates;
while (pads) {
num_pads++;
pads = g_slist_next (pads);
}
- // if there is only one pad, add '!' to the list of completions
+ /* if there is only one pad, add '!' to the list of completions */
if (num_pads == 1) {
words = g_slist_prepend (words, "!");
}
- // arguments
+ /* arguments */
args = element->arguments;
while (args) {
argument = (comp_argument *)(args->data);
return 1;
}
- // write out the padtemplates
+ /* write out the padtemplates */
padtemplates = factory->padtemplates;
while (padtemplates) {
padtemplate = (GstPadTemplate *)(padtemplates->data);
padnode = xmlNewChild (factorynode, NULL, "sinkpad", GST_PAD_NAME(pad));
}
- // write out the args
+ /* write out the args */
property_specs = g_object_class_list_properties(G_OBJECT_GET_CLASS (element), &num_properties);
for (i=0;i<num_properties;i++) {
GParamSpec *param = property_specs[i];
fstat(history_fd, &statbuf);
map = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, history_fd, 0);
- // scan it once to find out how many entries there are
+ /* scan it once to find out how many entries there are */
current = map;
while (current){
if ((next = strstr(current, "\n"))){
g_free(entry);
}
else{
- // show entries_limit of the newest entries
+ /* show entries_limit of the newest entries */
if (num_entries-- < entries_limit){
entry = g_strndup(current, next - current);
last_entry = entry;
prop_object = GTK_OBJECT(gtk_menu_new());
gtk_option_menu_set_menu(GTK_OPTION_MENU(prop_attach_widget), GTK_WIDGET(prop_object));
signal_name = "selection-done";
- //FIXME when the shim is dead
+ /* FIXME when the shim is dead */
values = gtk_type_enum_get_values (property_specs[i]->value_type);
while (values[j].value_name) {
gtk_tree_item_expand(GTK_TREE_ITEM(tree_root_item));
prop_box = gtk_vbox_new(FALSE, 0);
- //dparam_box = gtk_vbox_new(FALSE, 0);
+ /* dparam_box = gtk_vbox_new(FALSE, 0); */
notebook = gtk_notebook_new();
#include <gst/gst.h>
#include <string.h>
-// this must be built within the gstreamer dir, else this will fail
+/* this must be built within the gstreamer dir, else this will fail */
#include <gst/gstpropsprivate.h>
static void
printf("\n (%d): \t%s", values[j].value, values[j].value_nick);
j++;
}
- //g_type_class_unref (ec);
+ /* g_type_class_unref (ec); */
}
else
printf("unknown %d", param->value_type);
}
- // for compound elements
+ /* for compound elements */
if (GST_IS_BIN(element)) {
printf("\nChildren:\n");
children = gst_bin_get_list(GST_BIN(element));
gst_init(&argc,&argv);
- // if no arguments, print out list of elements
+ /* if no arguments, print out list of elements */
if (argc == 1) {
print_element_list();
- // else we try to get a factory
+ /* else we try to get a factory */
} else {
- // first check for help
+ /* first check for help */
if (strstr(argv[1],"-help")) {
printf("Usage: %s\t\t\tList all registered elements\n",argv[0]);
printf(" %s element-name\tShow element details\n",argv[0]);
return 0;
}
- // only search for a factory if there's not a '.so'
+ /* only search for a factory if there's not a '.so' */
if (! strstr(argv[1],".so")) {
factory = gst_elementfactory_find (argv[1]);
- // if there's a factory, print out the info
+ /* if there's a factory, print out the info */
if (factory)
return print_element_info(factory);
} else {
- // strip the .so
+ /* strip the .so */
so = strstr(argv[1],".so");
so[0] = '\0';
}
- // otherwise assume it's a plugin
+ /* otherwise assume it's a plugin */
plugin = gst_plugin_find (argv[1]);
- // if there is such a plugin, print out info
+ /* if there is such a plugin, print out info */
+
if (plugin) {
print_plugin_info(plugin);
pipeline = gst_pipeline_new ("launch");
- // make a null-terminated version of argv
+ /* make a null-terminated version of argv */
argvn = g_new0 (char *,argc);
memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
- // escape spaces
+ /* escape spaces */
for (i=0; i<argc-1; i++) {
gchar **split;
argvn[i] = g_strjoinv ("\\ ", split);
g_strfreev (split);
}
- // join the argvs together
+ /* join the argvs together */
cmdline = g_strjoinv (" ", argvn);
- // free the null-terminated argv
+ /* free the null-terminated argv */
g_free (argvn);
- // fail if there are no pipes in it (needs pipes for a pipeline
+ /* fail if there are no pipes in it (needs pipes for a pipeline */
if (!strchr(cmdline,'!')) {
fprintf(stderr,"ERROR: no pipeline description found on commandline\n");
exit(1);
g_print("Cannot move `%s' to `%s'", nameold, namenew);
error_perm();
}
- // set mode again, to make this public
+ /* set mode again, to make this public */
set_filemode(namenew, *newmode);
}
g_print("Cannot fopen `%s' to save new registry to.", destfile);
error_perm();
}
- // set mode to make this private
+ /* set mode to make this private */
set_filemode(destfile, tmpmode);
- // FIXME: no way to check success of xmlDocDump, which is why
- // this piece of code is ifdefed out.
- // The version of libxml currently (Jan 2001) in their CVS tree fixes
- // this problem.
+ /* FIXME: no way to check success of xmlDocDump, which is why
+ this piece of code is ifdefed out.
+ The version of libxml currently (Jan 2001) in their CVS tree fixes
+ this problem. */
+
xmlDocDump(fp, *doc);
if (!fclose(fp)) {
{
xmlDocPtr doc;
- // Mode of the file we're saving the repository to;
+ /* Mode of the file we're saving the repository to; */
mode_t newmode;
- // Get mode of old repository, or a default.
+ /* Get mode of old repository, or a default. */
if (!get_filemode(GLOBAL_REGISTRY_FILE, &newmode)) {
mode_t theumask = umask(0);
umask(theumask);
newmode = REGISTRY_FILE_PERMS & ~ theumask;
}
- // remove the old registry file first
- // If this fails, we simply ignore it since we'll overwrite it later
- // anyway.
+ /* remove the old registry file first
+ If this fails, we simply ignore it since we'll overwrite it later
+ anyway. */
unlink(GLOBAL_REGISTRY_FILE);
- // Init gst
+ /* Init gst /*
_gst_plugin_spew = TRUE;
_gst_warn_old_registry = FALSE;
gst_info_enable_category(GST_CAT_PLUGIN_LOADING);
gst_init(&argc,&argv);
- // Check args
+ /* Check args /*
if (argc != 1) usage(argv[0]);
- // Check that directory for config exists
+ /* Check that directory for config exists */
check_dir(GLOBAL_REGISTRY_DIR);
- // Read the plugins
+ /* Read the plugins */
doc = xmlNewDoc("1.0");
doc->xmlRootNode = xmlNewDocNode(doc, NULL, "GST-PluginRegistry", NULL);
gst_plugin_save_thyself(doc->xmlRootNode);
- // Save the registry to a tmp file.
+ /* Save the registry to a tmp file. */
save_registry(GLOBAL_REGISTRY_FILE_TMP, &doc);
- // Make the tmp file live.
+ /* Make the tmp file live. */
move_file(GLOBAL_REGISTRY_FILE_TMP, GLOBAL_REGISTRY_FILE, &newmode);
return(0);