mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. APP_ROOT_DIR=`pwd`
  3. # enable logging (n=verbosity)
  4. export GST_DEBUG=4
  5. # comment this to log to screen
  6. export GST_DEBUG_NO_COLOR=1 && export GST_DEBUG_FILE=debug.log # log to file
  7. # enable graphviz
  8. export DOT_DIR=/code/dot
  9. export GST_DEBUG_DUMP_DOT_DIR=$DOT_DIR
  10. # validate specified build configuration
  11. if [ "$CONFIG" == "Release" ] ; then BINARY=./build/av-caster
  12. elif [ "$CONFIG" == "Debug" ] ; then BINARY=./build/av-caster-dbg
  13. elif [ "$CONFIG" == "" ] ; then BINARY=./build/av-caster-dbg
  14. else echo "invlaid CONFIG" ; exit ;
  15. fi
  16. # build project
  17. cd Builds/Makefile && make && $BINARY $*
  18. # convert dot graphs to images
  19. cd $DOT_DIR
  20. rm $DOT_DIR/*.png 2> /dev/null
  21. for graph_dot_file in `ls *.dot`
  22. do echo "found dot graph $graph_dot_file"
  23. graph_png_file=${graph_dot_file%%.dot}.png
  24. dot -Tpng $graph_dot_file > $graph_png_file && rm $DOT_DIR/$graph_dot_file
  25. [ -f $graph_png_file ] && echo "created graph image $graph_png_file"
  26. done
  27. # playback file output
  28. cd $APP_ROOT_DIR
  29. OUTPUT_NAME=~/AvCaster
  30. OUTPUT_FILE=$OUTPUT_NAME.flv
  31. if [ -f $OUTPUT_FILE ]
  32. then filesize=`ls -s $OUTPUT_FILE`
  33. echo "output file exists $filesize"
  34. ((${filesize:0:1})) && mplayer $OUTPUT_FILE 2&> /dev/null
  35. rm $OUTPUT_NAME*
  36. fi