summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrever Fischer <wm161@wm161.net>2011-03-01 18:36:07 -0500
committerTrever Fischer <wm161@wm161.net>2011-03-01 18:36:07 -0500
commit8b60054843d0c7f4106d0558c59906a0c33df6da (patch)
tree857657505ac0570d0c1916b071e6a1d028e44c3f
parent68c4353c1b0513e2efaa42abc804309cb3ed3430 (diff)
downloadcamstream-master.zip
camstream-master.tar.gz
camstream-master.tar.xz
Add --version flagHEADv0.0.1master
-rw-r--r--src/anchorman.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/anchorman.c b/src/anchorman.c
index 6ed979b..db4e8a5 100644
--- a/src/anchorman.c
+++ b/src/anchorman.c
@@ -23,6 +23,23 @@
#include <gudev/gudev.h>
#include <string.h>
+#define ANCHORMAN_VERSION_MAJOR 0
+#define ANCHORMAN_VERSION_MINOR 0
+#define ANCHORMAN_VERSION_MICRO 1
+
+#define ANCHORMAN_VERSION \
+ ((ANCHORMAN_VERSION_MAJOR << 8) | \
+ (ANCHORMAN_VERSION_MINOR << 4) | \
+ (ANCHORMAN_VERSION_MICRO))
+
+#define STRINGIZE2(s) #s
+#define STRINGIZE(s) STRINGIZE2(s)
+
+#define ANCHORMAN_VERSION_STRING \
+ STRINGIZE(ANCHORMAN_VERSION_MAJOR) "." \
+ STRINGIZE(ANCHORMAN_VERSION_MINOR) "." \
+ STRINGIZE(ANCHORMAN_VERSION_MICRO)
+
// Original gst-launch command:
// gst-launch v4l2src device=/dev/video0 ! ffmpegcolorspace ! videorate ! videoscale ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=64 ! queue leaky=1 ! oggmux name=mux alsasrc device=hw:1 ! audioconvert ! vorbisenc ! queue leaky=1 ! mux. mux. ! queue ! shout2send ip=acm.cs.uakron.edu mount=lab.ogg
@@ -32,6 +49,7 @@ static gchar *videoDevice = 0;
static gchar *audioDevice = 0;
static gchar *icecastServer = 0;
static gchar *icecastMount = 0;
+static gboolean printVersion = FALSE;
static GOptionEntry entries[] =
{
@@ -39,6 +57,7 @@ static GOptionEntry entries[] =
{ "audio-device", 'a', 0, G_OPTION_ARG_STRING, &audioDevice, "Audio device to use", "device" },
{ "server", 's', 0, G_OPTION_ARG_STRING, &icecastServer, "Icecast server to stream to", "server" },
{ "mount", 'm', 0, G_OPTION_ARG_STRING, &icecastMount, "Icecast mount to stream to on the server", "mount" },
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Display version", NULL },
{ NULL }
};
@@ -223,6 +242,11 @@ int main(int argc, char* argv[])
exit(1);
}
+ if (printVersion) {
+ g_print("anchorman version %s\n", ANCHORMAN_VERSION_STRING);
+ exit(0);
+ }
+
if (!videoDevice) {
videoDevice = strdup("/dev/video0");
}