mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
ok, death to all // GCC only comments, we are going portable
Original commit message from CVS: ok, death to all // GCC only comments, we are going portable
This commit is contained in:
parent
91881fb4ed
commit
08e95cee03
6 changed files with 56 additions and 54 deletions
|
@ -80,15 +80,15 @@ int main(int argc,char *argv[]) {
|
|||
|
||||
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")) {
|
||||
|
@ -96,7 +96,7 @@ int main(int argc,char *argv[]) {
|
|||
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")) {
|
||||
|
@ -127,9 +127,9 @@ int main(int argc,char *argv[]) {
|
|||
|
||||
/* 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);
|
||||
|
@ -139,9 +139,9 @@ int main(int argc,char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
@ -151,18 +151,18 @@ int main(int argc,char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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++;
|
||||
|
@ -170,7 +170,7 @@ int main(int argc,char *argv[]) {
|
|||
pads = g_slist_next (pads);
|
||||
}
|
||||
|
||||
// padtemplates
|
||||
/* padtemplates */
|
||||
pads = element->srcpadtemplates;
|
||||
while (pads) {
|
||||
num_pads++;
|
||||
|
@ -180,12 +180,12 @@ int main(int argc,char *argv[]) {
|
|||
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);
|
||||
|
|
|
@ -48,7 +48,7 @@ int main(int argc,char *argv[]) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
// write out the padtemplates
|
||||
/* write out the padtemplates */
|
||||
padtemplates = factory->padtemplates;
|
||||
while (padtemplates) {
|
||||
padtemplate = (GstPadTemplate *)(padtemplates->data);
|
||||
|
@ -71,7 +71,7 @@ int main(int argc,char *argv[]) {
|
|||
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];
|
||||
|
|
|
@ -54,7 +54,7 @@ load_history(GtkWidget *pipe_combo)
|
|||
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"))){
|
||||
|
@ -75,7 +75,7 @@ load_history(GtkWidget *pipe_combo)
|
|||
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;
|
||||
|
@ -414,7 +414,7 @@ build_props_box(GstElement *element)
|
|||
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) {
|
||||
|
@ -670,7 +670,7 @@ main (int argc, char *argv[])
|
|||
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();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#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
|
||||
|
@ -323,7 +323,7 @@ print_element_info (GstElementFactory *factory)
|
|||
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);
|
||||
|
@ -381,7 +381,7 @@ print_element_info (GstElementFactory *factory)
|
|||
}
|
||||
|
||||
|
||||
// for compound elements
|
||||
/* for compound elements */
|
||||
if (GST_IS_BIN(element)) {
|
||||
printf("\nChildren:\n");
|
||||
children = gst_bin_get_list(GST_BIN(element));
|
||||
|
@ -522,13 +522,13 @@ main (int argc, char *argv[])
|
|||
|
||||
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]);
|
||||
|
@ -536,23 +536,24 @@ main (int argc, char *argv[])
|
|||
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);
|
||||
|
||||
|
|
|
@ -129,11 +129,11 @@ main(int argc, char *argv[])
|
|||
|
||||
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;
|
||||
|
||||
|
@ -142,12 +142,12 @@ main(int argc, char *argv[])
|
|||
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);
|
||||
|
|
|
@ -109,7 +109,7 @@ static void move_file(const char * nameold,
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -151,13 +151,14 @@ static void save_registry(const char *destfile,
|
|||
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)) {
|
||||
|
@ -178,42 +179,42 @@ int main(int argc,char *argv[])
|
|||
{
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue