Commit e09474e4 authored by hark's avatar hark
Browse files

deploygstreamer

parent a5211e14
......@@ -7,6 +7,9 @@
# http://cgit.freedesktop.org/libva/tree/test/encode/h264encode.c
#
#should we install debian packages?
checkdeps="true"
#plugins-bad
DEPS_BAD="ladspa-sdk libass-dev libbz2-dev libcdaudio-dev libcdaudio1 libchromaprint-dev libcurl4-gnutls-dev libcv-dev libcvaux-dev libdc1394-22-dev libdca-dev libdirectfb-dev libdirectfb-extra libdjvulibre-dev libdvdnav-dev libdvdread-dev libegl1-mesa-dev libenca-dev libexempi-dev libexempi3 libexif-dev libfaad-dev libflac-dev libfluidsynth-dev libfluidsynth1 libfribidi-dev libgles2-mesa-dev libglib2.0-doc libgme-dev libgme0 libgraphviz-dev libgsm1-dev libgtkglext1 libhighgui-dev libilmbase-dev libiptcdata0 libiptcdata0-dev libjasper-dev libkate-dev liblavfile-2.1-0 liblavjpeg-2.1-0 liblavplay-2.1-0 liblcms2-dev liblqr-1-0-dev libmagick++-6-headers libmagick++-6.q16-5 libmagick++-6.q16-dev libmagick++-dev libmagickcore-6-arch-config libmagickcore-6-headers libmagickcore-6.q16-2 libmagickcore-6.q16-2-extra libmagickcore-6.q16-dev libmagickwand-6-headers libmagickwand-6.q16-2 libmagickwand-6.q16-dev libmimic-dev libmimic0 libmjpegtools-dev libmjpegutils-2.1-0 libmms-dev libmms0 libmodplug-dev libmpcdec-dev libmpeg2encpp-2.1-0 libmpg123-dev libmplex2-2.1-0 libofa0 libofa0-dev libopenal-data libopenal-dev libopenal1 libopencv-calib3d-dev libopencv-calib3d2.4 libopencv-contrib-dev libopencv-contrib2.4 libopencv-core-dev libopencv-dev libopencv-features2d-dev libopencv-features2d2.4 libopencv-flann-dev libopencv-flann2.4 libopencv-gpu-dev libopencv-gpu2.4 libopencv-highgui-dev libopencv-highgui2.4 libopencv-imgproc-dev libopencv-legacy-dev libopencv-legacy2.4 libopencv-ml-dev libopencv-ml2.4 libopencv-objdetect-dev libopencv-objdetect2.4 libopencv-ocl-dev libopencv-ocl2.4 libopencv-photo-dev libopencv-photo2.4 libopencv-stitching-dev libopencv-stitching2.4 libopencv-superres-dev libopencv-superres2.4 libopencv-ts-dev libopencv-ts2.4 libopencv-video-dev libopencv-video2.4 libopencv-videostab-dev libopencv-videostab2.4 libopencv2.4-java libopencv2.4-jni libopenexr-dev libopenjpeg-dev libopus-dev liborc-0.4-dev libquicktime2 libraw1394-dev librsvg2-dev librtmp-dev libsbc-dev libsbc1 libschroedinger-dev libsndfile1-dev libsoundtouch-dev libspandsp-dev libsrtp0-dev libswscale-dev libvo-aacenc-dev libvo-aacenc0 libvo-amrwbenc-dev libvo-amrwbenc0 libwebp-dev libwildmidi-config libwildmidi-dev libwildmidi1 libwmf-dev libxvidcore-dev libzbar-dev libzbar0 libzvbi-dev"
......@@ -23,7 +26,7 @@ DEPS_BASE="libcdparanoia-dev libffi-dev libgirepository1.0-dev liborc-0.4-dev li
DEPS_GOOD="libaa1-dev libavc1394-dev libbz2-dev libcaca-dev libdv4-dev libflac-dev libglib2.0-doc libiec61883-dev liborc-0.4-dev libpopt-dev libraw1394-dev libslang2-dev libtag1-dev libv4l-dev libv4l2rds0 libvpx-dev libwavpack-dev libxv-dev x11proto-video-dev"
#ugly
DEPS_UGLY="liba52-0.7.4-dev libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev libsidplay1 libsidplay1-dev libtwolame-dev"
DEPS_UGLY="liba52-0.7.4-dev libcdio-dev libdvdread-dev libmad0-dev libmp3lame0 libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev libsidplay1 libsidplay1-dev libtwolame-dev"
MAKE_FLAGS="-j4"
......@@ -31,7 +34,7 @@ DEPS="libxv-dev liborc-0.4-dev librtmp-dev libsrtp0-dev libswscale-dev libcaca-
DEPS="$DEPS $DEPS_GOOD $DEPS_BASE $DEPS_UGLY $DEPS_BAD"
GIT_URL="git://anongit.freedesktop.org/gstreamer/"
MODULES="gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server"
MODULES="orc gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-rtsp-server"
if [[ -z $1 ]];
then
......@@ -44,20 +47,24 @@ then
exit
fi
export DEBIAN_FRONTEND=noninteractive
for dep in $DEPS
do
printf "checking for $dep "
available=$(dpkg -s $dep | grep installed)
if [[ -z $available ]]
then
echo "$dep not found, installing it (but you need sudo)"
sudo apt-get -y install $dep
else
echo "found."
fi
done
if [ checkdeps == "true" ]
then
export DEBIAN_FRONTEND=noninteractive
for dep in $DEPS
do
printf "checking for $dep "
available=$(dpkg -s $dep | grep installed)
if [[ -z $available ]]
then
echo "$dep not found, installing it (but you need sudo)"
sudo apt-get -y install $dep
else
echo "found."
fi
done
else
echo "Not checking for packages (because checkdeps == false)"
fi
for module in $MODULES
do
......@@ -68,14 +75,22 @@ do
echo "$module found. "
echo "checking if git for $module is up to date..."
cd $module
GIT_UP_TO_DATE=$(git status | grep behind)
if [[ -z $GIT_UP_TO_DATE ]]
then
echo"git for module $module is up to date."
cd ..
else
git pull && ./configure && make $MAKE_FLAGS && sudo make install && cd ..
fi
# disabled this for now, it doesnt check if stuff was build properly
# GIT_UP_TO_DATE=$(git status | grep behind)
# if [[ -z $GIT_UP_TO_DATE ]]
# then
# echo "git for module $module is up to date."
# cd ..
# else
if git pull && ./configure && make $MAKE_FLAGS && sudo make install && sudo ldconfig
then
echo "Building $module was successfull"
else
echo "Building $module failed, no idea why"
fi
cd ..
read -p "PRESS key to continue"
# fi
else
echo "$module not found, pulling from git..."
git clone git://anongit.freedesktop.org/gstreamer/$module && cd $module && ./autogen.sh && ./configure && make $MAKE_FLAGS && sudo make install && cd ..
......
......@@ -44,7 +44,7 @@ c-player-ns : main.c c-player.c snowbin.c teebin.c wraps.c common.h c-player.h s
c-player-cli : main.c c-player.c wraps.c snowbin.c teebin.c common.h
$(CC) -DGST1 -g main.c c-player.c wraps.c snowbin.c teebin.c -o c-player-cli `pkg-config --cflags --libs gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
$(CC) -DGETOPTS_LONG -DSNOWBIN -DGST1 -g main.c c-player.c wraps.c snowbin.c teebin.c -o c-player-cli `pkg-config --cflags --libs gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0` $(CFLAGS)
......
......@@ -44,8 +44,6 @@ static gchar *sink = "snowbin";
//Gtk things
#ifdef GTK
GtkWidget *main_window;
/*
static GtkWidget *feed_label;
static GtkWidget *clock_label;
......@@ -219,15 +217,7 @@ preview_cb (GtkCheckButton * preview_check, PlayerData * data)
}
#endif
/* This function is called when the main window is closed */
#ifdef GTK
static void
delete_event_cb (GtkWidget * widget, GdkEvent * event, PlayerData * data)
{
stop_cb (NULL, data);
player_cleanup (data);
}
/* This function is called everytime the video window needs to be redrawn (due to damage/exposure,
* rescaling, etc). GStreamer takes care of this in the PAUSED and PLAYING states, otherwise,
* we simply draw a black rectangle to avoid garbage showing up. */
......@@ -295,10 +285,6 @@ player_create_ui (PlayerData * data)
data->gui = (PlayerGui*)malloc(sizeof(struct PlayerGui));
gui = data->gui;
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (main_window), "delete-event",
G_CALLBACK (delete_event_cb), data);
gui->video_window = gtk_drawing_area_new ();
gtk_widget_set_size_request (gui->video_window, 250, 350);
gtk_widget_set_double_buffered (gui->video_window, FALSE);
......@@ -409,11 +395,7 @@ thread_time = g_thread_create( thread_time_func, (gpointer)label_time, FALSE, &e
player_load_uri (playlist_get_current (), data);
#endif
gtk_container_add (GTK_CONTAINER (main_window), gui->main_box);
gtk_window_set_default_size (GTK_WINDOW (main_window), 640, 480);
gtk_widget_show_all (main_window);
gtk_widget_hide(gui->main_hbox);
//return gui->main_box;
}
#endif
......
......@@ -8,6 +8,47 @@
#endif
#endif
#ifdef GTK
// create gui that has to contain everything
GtkWidget *main_window;
/* This function is called when the main window is closed */
static void
delete_event_cb (GtkWidget * widget, GdkEvent * event, PlayerData * data)
{
//stop_cb (NULL, data);
player_cleanup (data);
}
static void create_main_window()
{
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (main_window), "delete-event",
G_CALLBACK (delete_event_cb), pData);
// init player
player_create_ui (pData);
gtk_container_add (GTK_CONTAINER (main_window), pData->gui->main_box);
gtk_window_set_default_size (GTK_WINDOW (main_window), 640, 480);
gtk_widget_show_all (main_window);
gtk_widget_hide(pData->gui->main_hbox);
}
#endif
static int signal_handler(PlayerData * data) {
......@@ -15,6 +56,21 @@ static int signal_handler(PlayerData * data) {
player_cleanup(data);
}
void print_version()
{
printf("This is the version: ???");
exit(0);
}
void opthelp(char * argv_blaat)
{
printf("This is the help");
printf
(" \n -a audiosink [snowmix|jack|auto|fake] \n -i playuri \n -f feedid \n -s sink (not working) \n");
exit(0);
}
int
main (int argc, char *argv[])
......@@ -36,71 +92,89 @@ main (int argc, char *argv[])
snowbin_init_snowData(pData);
#endif
while ((opt = getopt (argc, argv, "i:f:a:s:")) != -1)
{
switch (opt)
{
// this only gets loaded without playlist
#ifndef PL
// stuff for getopts long
static const struct option opts[] = {
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"uri", required_argument, 0, 'i'},
{"feed", required_argument, 0, 'f'},
{"sink", required_argument, 0, 's'},
{"audiosink", required_argument, 0, 'a'},
{0, 0, 0, 0 } /* Sentiel */
};
int optidx;
char c;
/* <option> and a ':' means it's marked as required_argument, make sure to do that.
* or optional_argument if it's optional.
* You can pass NULL as the last argument if it's not needed. */
while ((c = getopt_long(argc, argv, "vhi:f:s:ua", opts, &optidx)) != -1) {
switch (c) {
case 'v': print_version(); break;
case 'h': opthelp(argv[0]); break;
// this only gets loaded without playlist
#ifndef PL
case 'i':
pData->playuri = optarg;
break;
#endif
pData->playuri = optarg;
break;
#endif
case 'f':
pData->feedid = atoi(optarg);
break;
pData->feedid = atoi(optarg);
break;
case 's':
if (strcmp(optarg,"snowmix") == 0)
{
pData->sink = SNOWMIX;
} else if (strcmp(optarg,"rtmp") == 0)
{
pData->sink = RTMP;
} else if (strcmp(optarg,"fake") == 0)
{
pData->sink = FAKE;
}
break;
if (strcmp(optarg,"snowmix") == 0)
{
pData->sink = SNOWMIX;
} else if (strcmp(optarg,"rtmp") == 0)
{
pData->sink = RTMP;
} else if (strcmp(optarg,"fake") == 0)
{
pData->sink = FAKE;
}
break;
#ifdef SNOWBIN
case 'a':
if (strcmp(optarg,"snowmix") == 0)
{
pData->snow->audiosink = SNOWMIX;
} else if (strcmp(optarg,"jack") == 0)
{
pData->snow->audiosink = JACK;
} else if (strcmp(optarg,"auto") == 0)
{
pData->snow->audiosink = AUTO;
} else if (strcmp(optarg,"fake") == 0)
{
pData->snow->audiosink = FAKE;
}
break;
if (strcmp(optarg,"snowmix") == 0)
{
pData->snow->audiosink = SNOWMIX;
} else if (strcmp(optarg,"jack") == 0)
{
pData->snow->audiosink = JACK;
} else if (strcmp(optarg,"auto") == 0)
{
pData->snow->audiosink = AUTO;
} else if (strcmp(optarg,"fake") == 0)
{
pData->snow->audiosink = FAKE;
}
break;
#endif
case '?':
/* Case when user enters the command as
* $ ./cmd_exe -i
*/
if (optopt == 'u')
{
printf ("\nMissing mandatory input option \n");
exit(1);
}
else
{
printf
("\nInvalid option received possible options: \n -a audiosink [snowmix|jack|auto|fake] \n -i playuri \n -f feedid \n -s sink (not working) \n");
exit(1);
}
break;
} //switch
} //while
case '?': opthelp(argv[0]); return 1; /* getopt already thrown an error */
default:
if (optopt == 'a' | optopt == 'f' | optopt == 's' | optopt == 'i')
fprintf(stderr, "Option -%c requires an argument.\n",
optopt);
else if (isprint(optopt))
fprintf(stderr, "Unknown option -%c.\n", optopt);
else
fprintf(stderr, "Unknown option character '\\x%x'.\n",
optopt);
return 1;
}
}
/* Loop through other arguments ("leftovers"). */
while (optind < argc) {
/* whatever */;
++optind;
}
#ifdef GTK
#ifdef TT
......@@ -121,8 +195,12 @@ player_init_media(pData);
/* Create the GUI */
#ifdef GTK
player_create_ui (pData);
create_main_window();
#endif
#ifndef PL
//load url
player_load_uri(pData->playuri, pData);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment