Commit c1994697 authored by Wim Taymans's avatar Wim Taymans

Synced with the HEAD branch again... amazing how many changes we have in only a week time...

Original commit message from CVS:
Synced with the HEAD branch again... amazing how many changes we have in
only a week time...
parent 33f74711
Erik Walthinsen <omega@cse.ogi.edu>
Matt Howell <mhowell@users.sourceforge.net>
Brent Bradburn <bbradburn@users.sourceforge.net>
Wim Taymans <wim.taymans@tvd.be>
Richard Boulton <richard@tartarus.org>
Chris Emerson (PPC port)
David I. Lehn <dlehn@users.sourceforge.net>
- debian packaging
- various fixes
Chris Emerson <chris@tartarus.org>
- PPC port
- small libxml patches
Jens Thiele <karme@unforgettable.com>
- color conversion patches
Thomas Nyberg <thomas@codefactory.se>
- gstreamer.m4 macros
......@@ -9,7 +9,10 @@ Required libraries:
===================
glib v1.2.0 or better
gtk+ v1.2.0 or better
libxml
libxml (also called gnome-xml, available from http://xmlsoft.org/)
These libraries are all central parts of gnome, and are available from the
ftp.gnome.org or its mirrors, amongst other places.
Optional libraries:
===================
......
......@@ -19,6 +19,7 @@
#undef HAVE_CPU_PPC
#undef HAVE_CPU_ALPHA
#undef HAVE_CPU_ARM
#undef HAVE_CPU_SPARC
#undef HAVE_GDK_PIXBUF
#undef HAVE_LIBGHTTP
......@@ -29,6 +30,7 @@
#undef HAVE_VORBIS
#undef HAVE_LIBJPEG
#undef HAVE_NASM
#undef HAVE_MPEG2DEC
#undef HAVE_ATOMIC_H
......
......@@ -124,6 +124,8 @@ case "x${target_cpu}" in
AC_DEFINE(HAVE_CPU_ALPHA) ;;
xarm*) HAVE_CPU_ARM=yes ;
AC_DEFINE(HAVE_CPU_ARM) ;;
xsparc*) HAVE_CPU_SPARC=yes ;
AC_DEFINE(HAVE_CPU_SPARC) ;;
esac
dnl Determine endianness
......@@ -358,6 +360,11 @@ AC_MSG_CHECKING(Shout library)
AC_CHECK_LIB(shout, shout_init_connection, HAVE_LIBSHOUT=yes, HAVE_LIBSHOUT=no, )
AC_CHECK_HEADER(shout/shout.h, :, HAVE_LIBSHOUT=no)
dnl Check for mpeg2dec
AC_MSG_CHECKING(mpeg2dec library)
AC_CHECK_LIB(mpeg2, mpeg2_init, HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no, )
AC_CHECK_HEADER(mpeg2dec/mpeg2.h, :, HAVE_MPEG2DEC=no)
dnl check if css-auth.c exists (FIXME)
AC_MSG_CHECKING(DVD CSS code)
......@@ -564,6 +571,7 @@ AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes")
AM_CONDITIONAL(HAVE_CPU_PPC, test "x$HAVE_CPU_PPC" = "xyes")
AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes")
AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes")
AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes")
AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "x$USE_GDK_PIXBUF" = "xyes")
AM_CONDITIONAL(HAVE_LIBGHTTP, test "x$USE_LIBGHTTP" = "xyes")
AM_CONDITIONAL(HAVE_LIBMMX, test "x$USE_LIBMMX" = "xyes")
......@@ -588,6 +596,7 @@ AM_CONDITIONAL(HAVE_LIBLAME, test "x$HAVE_LIBLAME" = "xyes")
AM_CONDITIONAL(HAVE_LIBSHOUT, test "x$HAVE_LIBSHOUT" = "xyes")
AM_CONDITIONAL(HAVE_LIBESD, test "x$HAVE_LIBESD" = "xyes")
AM_CONDITIONAL(HAVE_LIBASOUND, test "x$HAVE_LIBASOUND" = "xyes")
AM_CONDITIONAL(HAVE_MPEG2DEC, test "x$HAVE_MPEG2DEC" = "xyes")
......@@ -738,6 +747,7 @@ plugins/capture/v4l/Makefile
plugins/cdparanoia/Makefile
plugins/esd/Makefile
plugins/esd/esdsink/Makefile
plugins/xmms/Makefile
gstplay/Makefile
dnl components/bonobo-gstmediaplay/Makefile
test/Makefile
......
......@@ -149,8 +149,6 @@ main(int argc, char *argv[])
gst_element_set_state (bin, GST_STATE_PLAYING);
playing = TRUE;
while (gst_bin_iterate(GST_BIN(bin)));
gst_element_set_state (bin, GST_STATE_NULL);
......
......@@ -28,7 +28,6 @@ int main(int argc,char *argv[])
pipeline = gst_pipeline_new("pipeline");
g_assert(pipeline != NULL);
gst_bin_add(GST_BIN(thread), pipeline);
/* create a disk reader */
disksrc = gst_elementfactory_make("disksrc", "disk_source");
......@@ -52,8 +51,11 @@ int main(int argc,char *argv[])
}
*/
/* make it ready */
gst_element_set_state(GST_ELEMENT(thread), GST_STATE_READY);
// hmmmm hack? FIXME
GST_FLAG_UNSET (pipeline, GST_BIN_FLAG_MANAGER);
gst_bin_add(GST_BIN(thread), pipeline);
/* start playing */
gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PLAYING);
......
#! /bin/sh
for loc in "$@"; do
gstreamer-launch disksrc "location=$loc" ! mp3parse ! mpg123 ! audiosink
../../tools/gstreamer-launch disksrc \""location=$loc"\" ! mp3parse ! mpg123 ! audiosink
done
......@@ -124,6 +124,7 @@ noinst_HEADERS = \
gstppc.h \
gstalpha.h \
gstarm.h \
gstsparc.h \
gstpropsprivate.h
CFLAGS = $(LIBGST_CFLAGS)
......
......@@ -268,6 +268,9 @@ cothread_switch (cothread_state *thread)
ctx->current = thread->threadnum;
/* save the current stack pointer, frame pointer, and pc */
#ifdef GST_ARCH_PRESETJMP
GST_ARCH_PRESETJMP();
#endif
enter = setjmp(current->jmp);
if (enter != 0) {
GST_DEBUG (0,"enter thread #%d %d %p<->%p (%d)\n",current->threadnum, enter,
......
......@@ -35,6 +35,8 @@
#include "gstalpha.h"
#elif defined(HAVE_CPU_ARM)
#include "gstarm.h"
#elif defined(HAVE_CPU_SPARC)
#include "gstsparc.h"
#else
#error Need to know about this architecture, or have a generic implementation
#endif
......
......@@ -818,14 +818,14 @@ gst_bin_iterate_func (GstBin *bin)
while (entries) {
entry = GST_ELEMENT (entries->data);
if (entry->threadstate)
if (entry->threadstate)
break;
entries = g_list_next (entries);
entries = g_list_next (entries);
}
// if we couldn't find one, bail out
if (entries == NULL)
GST_ERROR(GST_ELEMENT(bin),"no cothreaded elements found!");
GST_FLAG_SET (entry, GST_ELEMENT_COTHREAD_STOPPING);
GST_DEBUG (0,"set COTHREAD_STOPPING flag on \"%s\"(@%p)\n",
GST_ELEMENT_NAME (entry),entry);
......
......@@ -48,31 +48,46 @@ static gchar *stringcat (gchar *a,gchar *b) {
return c;
}
void
_gst_cpu_initialize (void)
{
gchar *featurelist = NULL;
gboolean AMD;
long eax=0, ebx=0, ecx=0, edx=0;
gst_cpuid(0, &eax, &ebx, &ecx, &edx);
AMD = (ebx == 0x68747541) && (ecx == 0x444d4163) && (edx == 0x69746e65);
gst_cpuid(1, &eax, &ebx, &ecx, &edx);
if (edx & (1<<23)) {
_gst_cpu_flags |= GST_CPU_FLAG_MMX;
featurelist = stringcat(featurelist,"MMX ");
}
if (edx & (1<<25)) {
_gst_cpu_flags |= GST_CPU_FLAG_SSE;
_gst_cpu_flags |= GST_CPU_FLAG_MMXEXT;
featurelist = stringcat(featurelist,"SSE ");
}
if (edx & (1<<24)) {
_gst_cpu_flags |= GST_CPU_FLAG_MMXEXT;
featurelist = stringcat(featurelist,"MMXEXT ");
}
if (edx & (1<<31)) {
_gst_cpu_flags |= GST_CPU_FLAG_3DNOW;
featurelist = stringcat(featurelist,"3DNOW ");
if (edx & (1<<25)) {
_gst_cpu_flags |= GST_CPU_FLAG_SSE;
_gst_cpu_flags |= GST_CPU_FLAG_MMXEXT;
featurelist = stringcat(featurelist,"SSE ");
}
gst_cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
if (eax >= 0x80000001) {
gst_cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
if (edx & (1<<31)) {
_gst_cpu_flags |= GST_CPU_FLAG_3DNOW;
featurelist = stringcat(featurelist,"3DNOW ");
}
if (AMD && (edx & (1<<22))) {
_gst_cpu_flags |= GST_CPU_FLAG_MMXEXT;
featurelist = stringcat(featurelist,"MMXEXT ");
}
}
}
if (!_gst_cpu_flags) {
......
......@@ -26,6 +26,7 @@
#include "gstelement.h"
#include "gstextratypes.h"
#include "gstbin.h"
#include "gstutils.h"
/* Element signals and args */
......@@ -974,78 +975,7 @@ gst_element_load_thyself (xmlNodePtr self, GstObject *parent)
}
child = child->next;
}
if (name && value) {
GtkType type = GTK_OBJECT_TYPE (element);
GtkArgInfo *info;
gchar *result;
result = gtk_object_arg_get_info (type, name, &info);
if (result) {
g_print("gstelement: %s\n", result);
}
else if (info->arg_flags & GTK_ARG_WRITABLE) {
switch (info->type) {
case GTK_TYPE_STRING:
gtk_object_set (GTK_OBJECT (element), name, value, NULL);
break;
case GTK_TYPE_INT: {
gint i;
sscanf (value, "%d", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_LONG: {
glong i;
sscanf (value, "%ld", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_ULONG: {
gulong i;
sscanf (value, "%lu", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_BOOL: {
gboolean i = FALSE;
if (!strcmp ("true", value)) i = TRUE;
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_CHAR: {
gchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_UCHAR: {
guchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_FLOAT: {
gfloat i;
sscanf (value, "%f", &i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
case GTK_TYPE_DOUBLE: {
gdouble i;
sscanf (value, "%g", (float *)&i);
gtk_object_set (GTK_OBJECT (element), name, i, NULL);
break;
}
default:
if (info->type == GST_TYPE_FILENAME) {
gtk_object_set (GTK_OBJECT (element), name, value, NULL);
}
break;
}
}
}
gst_util_set_object_arg (GTK_OBJECT (element), name, value);
}
children = children->next;
}
......
......@@ -1212,7 +1212,7 @@ gst_padtemplate_save_thyself (GstPadTemplate *templ, xmlNodePtr parent)
GstPadTemplate*
gst_padtemplate_load_thyself (xmlNodePtr parent)
{
xmlNodePtr field = parent->childs;
xmlNodePtr field = parent->xmlChildrenNode;
GstPadTemplate *factory;
gchar *name_template = NULL;
GstPadDirection direction = GST_PAD_UNKNOWN;
......
......@@ -30,6 +30,7 @@
#include "gstparse.h"
#include "gstpipeline.h"
#include "gstthread.h"
#include "gstutils.h"
typedef struct _gst_parse_priv gst_parse_priv;
struct _gst_parse_priv {
......@@ -180,7 +181,8 @@ if (GST_IS_GHOST_PAD(srcpad)) GST_DEBUG(0,"it's a ghost pad\n");
argval = pos+1;
DEBUG("attempting to set argument '%s' to '%s' on element '%s'\n",
argname,argval,GST_ELEMENT_NAME(previous));
gtk_object_set(GTK_OBJECT(previous),argname,argval,NULL);
//gtk_object_set(GTK_OBJECT(previous),argname,argval,NULL);
gst_util_set_object_arg (GTK_OBJECT(previous), argname, argval);
g_free(argname);
// element or argument, or beginning of bin or thread
......@@ -321,8 +323,9 @@ gst_parse_launch(const gchar *cmdline,GstBin *parent)
gst_parse_priv priv;
gchar **argvn;
gint newargc;
gint len;
int i,j,k;
gint i;
const gchar *cp, *start, *end;
GSList *string_list = NULL, *slist;
priv.bincount = 0;
priv.threadcount = 0;
......@@ -331,47 +334,65 @@ gst_parse_launch(const gchar *cmdline,GstBin *parent)
priv.verbose = FALSE;
priv.debug = FALSE;
// first walk through quickly and see how many more slots we need
len = strlen(cmdline);
newargc = 1;
for (i=0;i<len;i++) {
// if it's a space, it denotes a new arg
if (cmdline[i] == ' ') newargc++;
// if it's a brace and isn't followed by a space, give it an arg
if (strchr("([{}])",cmdline[i])) {
// not followed by space, gets one
if (cmdline[i+1] != ' ') newargc++;
end = cmdline + strlen(cmdline);
newargc = 0;
// Extract the arguments to a gslist in reverse order
for (cp = cmdline; cp < end; ) {
i = strcspn(cp, "([{}]) \"");
if (i > 0) {
// normal argument - copy and add to the list
string_list = g_slist_prepend(string_list, g_strndup(cp, i));
newargc++;
cp += i;
}
}
// now allocate the new argv array
argvn = g_new0(char *,newargc+1);
GST_DEBUG(0,"supposed to have %d args\n",newargc);
// now attempt to construct the new arg list
j = 0;k = 0;
for (i=0;i<len+1;i++) {
// if it's a delimiter
if (strchr("([{}]) ",cmdline[i]) || (cmdline[i] == '\0')) {
// extract the previous arg
if (i-k > 0) {
if (cmdline[k] == ' ') k++;
argvn[j] = g_new0(char,(i-k)+1);
memcpy(argvn[j],&cmdline[k],i-k);
// catch misparses
if (strlen(argvn[j]) > 0) j++;
}
k = i;
// skip spaces
while (cp < end && *cp == ' ')
cp++;
// handle quoted arguments
if (*cp == '"') {
start = ++cp;
// if this is a bracket, construct a word
if ((cmdline[i] != ' ') && (cmdline[i] != '\0')) {
argvn[j++] = g_strdup_printf("%c",cmdline[i]);
k++;
// find matching quote
while (cp < end && *cp != '"')
cp++;
// make sure we got it
if (cp == end) {
g_warning("gst_parse_launch: Unbalanced quote in command line");
// FIXME: The list leaks here
return 0;
}
// copy the string sans quotes
string_list = g_slist_prepend(string_list, g_strndup(start, cp - start));
newargc++;
cp += 2; // skip the quote aswell
}
// brackets exist in a separate argument slot
if (*cp && strchr("([{}])", *cp)) {
string_list = g_slist_prepend(string_list, g_strndup(cp, 1));
newargc++;
cp++;
}
}
// now allocate the new argv array
argvn = g_new0(char *,newargc);
GST_DEBUG(0,"got %d args\n",newargc);
// reverse the list and put the strings in the new array
i = newargc;
for (slist = string_list; slist; slist = slist->next)
argvn[--i] = slist->data;
g_slist_free(string_list);
// print them out
for (i=0;i<newargc;i++) {
GST_DEBUG(0,"arg %d is: %s\n",i,argvn[i]);
......@@ -380,5 +401,11 @@ gst_parse_launch(const gchar *cmdline,GstBin *parent)
// set up the elementcounts hash
priv.elementcounts = g_hash_table_new(g_str_hash,g_str_equal);
return gst_parse_launch_cmdline(newargc,argvn,parent,&priv);
// do it!
i = gst_parse_launch_cmdline(newargc,argvn,parent,&priv);
// GST_DEBUG(0, "Finished - freeing temporary argument array");
// g_strfreev(argvn);
return i;
}
......@@ -91,7 +91,7 @@ _gst_plugin_initialize (void)
if (!doc || strcmp (doc->xmlRootNode->name, "GST-PluginRegistry") ||
!plugin_times_older_than(get_time(GST_CONFIG_DIR"/reg.xml"))) {
if (_gst_warn_old_registry)
g_warning ("gstplugin: registry needs rebuild\n");
g_warning ("gstplugin: registry needs rebuild: run gstreamer-register\n");
gst_plugin_load_all ();
return;
}
......
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstsparc.h: Header for Sparc-specific architecture issues
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_GSTSPARC_H__
#define __GST_GSTSPARC_H__
#define GST_ARCH_SET_SP(stackpointer) \
__asm__( "ta 3\n\t"
"mov %0, %%sp" : : "r"(stackpointer));
#define GST_ARCH_CALL(target) \
__asm__( "call %0,0\n\t"
"nop" : : "r"(target) );
#define GST_ARCH_PRESETJMP() \
__asm__( "ta 3" );
// Need to get more information about the stackframe format
// and get the fields more correct. Check GDB sources maybe?
#define GST_ARCH_SETUP_STACK(sp) sp -= 4
#endif /* __GST_GSTSPARC_H__ */
......@@ -20,6 +20,9 @@
* Boston, MA 02111-1307, USA.
*/
#include <stdio.h>
#include "gstextratypes.h"
#include "gstutils.h"
......@@ -183,3 +186,78 @@ void gst_util_dump_mem(guchar *mem, guint size) {
}
g_print("\n");
}
void gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value)
{
if (name && value) {
GtkType type = GTK_OBJECT_TYPE (object);
GtkArgInfo *info;
gchar *result;
result = gtk_object_arg_get_info (type, name, &info);
if (result) {
g_print("gstutil: %s\n", result);
}
else if (info->arg_flags & GTK_ARG_WRITABLE) {
switch (info->type) {
case GTK_TYPE_STRING:
gtk_object_set (GTK_OBJECT (object), name, value, NULL);
break;
case GTK_TYPE_INT: {
gint i;
sscanf (value, "%d", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_LONG: {
glong i;
sscanf (value, "%ld", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_ULONG: {
gulong i;
sscanf (value, "%lu", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_BOOL: {
gboolean i = FALSE;
if (!strcmp ("true", value)) i = TRUE;
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_CHAR: {
gchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_UCHAR: {
guchar i;
sscanf (value, "%c", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_FLOAT: {
gfloat i;
sscanf (value, "%f", &i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
case GTK_TYPE_DOUBLE: {
gdouble i;
sscanf (value, "%g", (float *)&i);
gtk_object_set (GTK_OBJECT (object), name, i, NULL);
break;
}
default:
if (info->type == GST_TYPE_FILENAME) {
gtk_object_set (GTK_OBJECT (object), name, value, NULL);
}
break;
}
}
}
}
......@@ -39,6 +39,8 @@ guchar* gst_util_get_string_arg (GtkObject *object, guchar *argname);
gpointer gst_util_get_pointer_arg (GtkObject *object, guchar *argname);
GtkWidget* gst_util_get_widget_arg (GtkObject *object, guchar *argname);
void gst_util_set_object_arg (GtkObject *object, guchar *name, gchar *value);