[girl] Add girl_player_main



commit 4774e0b810a78180405791c8fb2b0b0b3601a0b8
Author: Ole Aamot <oka oka no>
Date:   Mon Apr 10 23:15:42 2017 +0200

    Add girl_player_main

 configure         |   60 +++++++---------------------
 src/GIRL-PLAYER.c |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 src/GIRL.c        |    2 +-
 src/Makefile.am   |    2 +-
 4 files changed, 125 insertions(+), 50 deletions(-)
---
diff --git a/configure b/configure
index f41b255..4075036 100755
--- a/configure
+++ b/configure
@@ -817,7 +817,6 @@ infodir
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -919,7 +918,6 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1172,15 +1170,6 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1318,7 +1307,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir runstatedir
+               libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1471,7 +1460,6 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -5452,7 +5440,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd* | netbsdelf*-gnu)
+netbsd*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -9438,9 +9426,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
-    link_all_deplibs=no
-    ;;
   esac
 
   ld_shlibs=yes
@@ -9695,7 +9680,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
        wlarc=
@@ -10365,7 +10350,6 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
        if test yes = "$lt_cv_irix_exported_symbol"; then
           archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname 
`test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry 
$wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
        fi
-       link_all_deplibs=no
       else
        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && 
func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
        archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n 
"$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations 
-exports_file $export_symbols -o $lib'
@@ -10387,7 +10371,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       esac
       ;;
 
-    netbsd* | netbsdelf*-gnu)
+    netbsd*)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -11482,6 +11466,9 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
   # Ideally, we could use ldconfig to report *all* directores which are
   # searched for libraries, however this is still not possible.  Aside from not
   # being certain /sbin/ldconfig is available, command
@@ -11490,7 +11477,7 @@ fi
   # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if 
(!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      
]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -11502,18 +11489,6 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major 
${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -14036,7 +14011,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -14082,7 +14057,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -14106,7 +14081,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -14151,7 +14126,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -14175,7 +14150,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -17209,13 +17184,7 @@ install-help: $(_HELP_LC_FILES)
            elif test "x$$lc" != "xC"; then \
              if test "x$(YELP_LC_MEDIA_LINKS)" != "x"; then \
                echo "$(LN_S) -f $(HELP_DIR)/C/$(HELP_ID)/$$f $$helpdir$$f"; \
-               dname="$$f"; \
-               pars="../"; \
-               while test "$$dname" != "." -a "$$dname" != "/"; do \
-                 pars="../$$pars"; \
-                 dname=$$(dirname "$$dname"); \
-               done; \
-               $(LN_S) -f $$pars"C/$(HELP_ID)/$$f" "$$helpdir$$f" || exit 1; \
+               $(LN_S) -f "$(HELP_DIR)/C/$(HELP_ID)/$$f" "$$helpdir$$f" || exit 1; \
              fi; \
            fi; \
          done; \
@@ -19028,6 +18997,7 @@ $as_echo X"$file" |
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
 # Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 
 # Provide generalized library-building support services.
diff --git a/src/GIRL-PLAYER.c b/src/GIRL-PLAYER.c
index 5ba0394..8600cbb 100644
--- a/src/GIRL-PLAYER.c
+++ b/src/GIRL-PLAYER.c
@@ -29,7 +29,8 @@
 #include <string.h>
 #include <math.h>
 
-#include "GIRL-PLAYER-KB.h"
+#include "GIRL.h"
+#include "gst-play-kb.h"
 #include <gst/player/player.h>
 
 #define VOLUME_STEPS 20
@@ -56,6 +57,30 @@ static gboolean play_prev (GstPlay * play);
 static void play_reset (GstPlay * play);
 static void play_set_relative_volume (GstPlay * play, gdouble volume_step);
 
+void
+girl_player_main(gchar *streamuri, gchar *name)
+{
+ 
+       gchar *uri = g_strdup(streamuri);
+               
+       /* if (argc > 1) { */
+       /*   if (g_strrstr (argv[1],"rtsp://") || g_strrstr (argv[1],"http://";) || g_strrstr 
(argv[1],"file://")) */
+       /*     uri = g_strdup (argv[1]); */
+       /*   else */
+       /*     uri = g_strdup_printf ("file://%s", argv[1]); */
+       /* } */
+       /* else { */
+       /*   g_message ("Specify the media file name..<girl-playerplayer filename>"); */
+       /*   return 0; */
+       /* } */
+
+       girl->player_loop = g_main_loop_new (NULL, FALSE);
+       g_main_loop_run (girl->player_loop);
+       gst_deinit();
+       girl->player_status = GIRL_PLAYER_TRUE;
+       exit (0);
+}
+
 static void
 end_of_stream_cb (GstPlayer * player, GstPlay * play)
 {
@@ -633,8 +658,9 @@ keyboard_cb (const gchar * key_input, gpointer user_data)
   }
 }
 
+#if 0
 int
-girl_player_main (char *uri)
+main (int argc, char **argv)
 {
   GstPlay *play;
   GPtrArray *playlist;
@@ -649,17 +675,94 @@ girl_player_main (char *uri)
   GError *err = NULL;
   GOptionContext *ctx;
   gchar *playlist_file = NULL;
+  GOptionEntry options[] = {
+    {"version", 0, 0, G_OPTION_ARG_NONE, &print_version,
+        "Print version information and exit", NULL},
+    {"shuffle", 0, 0, G_OPTION_ARG_NONE, &shuffle,
+        "Shuffle playlist", NULL},
+    {"interactive", 0, 0, G_OPTION_ARG_NONE, &interactive,
+        "Interactive control via keyboard", NULL},
+    {"volume", 0, 0, G_OPTION_ARG_DOUBLE, &volume,
+        "Volume", NULL},
+    {"playlist", 0, 0, G_OPTION_ARG_FILENAME, &playlist_file,
+        "Playlist file containing input media files", NULL},
+    {"loop", 0, 0, G_OPTION_ARG_NONE, &repeat, "Repeat all", NULL},
+    {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL},
+    {NULL}
+  };
+
+  g_set_prgname ("gst-play");
+
+  ctx = g_option_context_new ("FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...");
+  g_option_context_add_main_entries (ctx, options, NULL);
+  g_option_context_add_group (ctx, gst_init_get_option_group ());
+  if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
+    g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
+    g_clear_error (&err);
+    g_option_context_free (ctx);
+    return 1;
+  }
+  g_option_context_free (ctx);
 
   GST_DEBUG_CATEGORY_INIT (play_debug, "play", 0, "gst-play");
 
+  if (print_version) {
+    gchar *version_str;
+
+    version_str = gst_version_string ();
+    g_print ("%s version %s\n", g_get_prgname (), "1.0");
+    g_print ("%s\n", version_str);
+    g_free (version_str);
+
+    g_free (playlist_file);
+
+    return 0;
+  }
+
   playlist = g_ptr_array_new ();
 
+  if (playlist_file != NULL) {
+    gchar *playlist_contents = NULL;
+    gchar **lines = NULL;
+
+    if (g_file_get_contents (playlist_file, &playlist_contents, NULL, &err)) {
+      lines = g_strsplit (playlist_contents, "\n", 0);
+      num = g_strv_length (lines);
+
+      for (i = 0; i < num; i++) {
+        if (lines[i][0] != '\0') {
+          GST_LOG ("Playlist[%d]: %s", i + 1, lines[i]);
+          add_to_playlist (playlist, lines[i]);
+        }
+      }
+      g_strfreev (lines);
+      g_free (playlist_contents);
+    } else {
+      g_printerr ("Could not read playlist: %s\n", err->message);
+      g_clear_error (&err);
+    }
+    g_free (playlist_file);
+    playlist_file = NULL;
+  }
+
+  if (playlist->len == 0 && (filenames == NULL || *filenames == NULL)) {
+    g_printerr ("Usage: %s FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...",
+        "gst-play");
+    g_printerr ("\n\n"),
+        g_printerr ("%s\n\n",
+        "You must provide at least one filename or URI to play.");
+    /* No input provided. Free array */
+    g_ptr_array_free (playlist, TRUE);
+
+    return 1;
+  }
+
   /* fill playlist */
   if (filenames != NULL && *filenames != NULL) {
     num = g_strv_length (filenames);
     for (i = 0; i < num; ++i) {
       GST_LOG ("command line argument: %s", filenames[i]);
-      add_to_playlist (playlist, uri);
+      add_to_playlist (playlist, filenames[i]);
     }
     g_strfreev (filenames);
   }
@@ -694,3 +797,5 @@ girl_player_main (char *uri)
   gst_deinit ();
   return 0;
 }
+
+#endif
diff --git a/src/GIRL.c b/src/GIRL.c
index 804e4ce..02db378 100644
--- a/src/GIRL.c
+++ b/src/GIRL.c
@@ -68,7 +68,7 @@ search_station(GSimpleAction *simple, GVariant *parameter, gpointer user_data) {
 
 static void
 listen_station(GSimpleAction *simple, GVariant *parameter, gpointer user_data) {
-  /* girl_player_main (")http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk";); */
+  girl_player_main (")http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk";);
   g_print("Listening to BBC World Service\n");
   return;
 }
diff --git a/src/Makefile.am b/src/Makefile.am
index 964c0f8..cf4cd4a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
 #AM_CPPFLAGS = $(GIRL_CFLAGS) $(GNOME_INTERNET_RADIO_LOCATOR_CFLAGS) \
-#      $(NULL)
+1#     $(NULL)
 
 #AM_CFLAGS = $(GIRL_CFLAGS) $(GNOME_INTERNET_RADIO_LOCATOR_CFLAGS) \
 #      -DGIRL_DATADIR="\"$(pkgdatadir)\"" \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]