From 69da70736ba480522dde63d78a3dd97bed261968 Mon Sep 17 00:00:00 2001 From: Richard Alam <ritzalam@gmail.com> Date: Mon, 13 Jun 2011 12:25:18 -0400 Subject: [PATCH] - change build using gradle - need to add jedis plugin so we can store the start/stop broadcast event as the webcam status event is unreliable and can introduce sync issues. --- bbb-video/.gitignore | 2 +- bbb-video/build.gradle | 91 +++++ bbb-video/build.properties | 60 ---- bbb-video/build.xml | 329 ------------------ bbb-video/ivy.xml | 25 -- bbb-video/ivysettings.xml | 35 -- .../bigbluebutton/app/video/DemoService.java | 105 ------ .../app/video/DemoServiceImpl.java | 47 --- .../bigbluebutton/app/video/IDemoService.java | 34 -- .../app/video/VideoApplication.java | 17 +- bbb-video/vm-build.sh | 2 +- 11 files changed, 108 insertions(+), 639 deletions(-) create mode 100755 bbb-video/build.gradle delete mode 100644 bbb-video/build.properties delete mode 100644 bbb-video/build.xml delete mode 100644 bbb-video/ivy.xml delete mode 100644 bbb-video/ivysettings.xml delete mode 100755 bbb-video/src/main/java/org/bigbluebutton/app/video/DemoService.java delete mode 100755 bbb-video/src/main/java/org/bigbluebutton/app/video/DemoServiceImpl.java delete mode 100755 bbb-video/src/main/java/org/bigbluebutton/app/video/IDemoService.java mode change 100644 => 100755 bbb-video/vm-build.sh diff --git a/bbb-video/.gitignore b/bbb-video/.gitignore index ba077a4031..378eac25d3 100644 --- a/bbb-video/.gitignore +++ b/bbb-video/.gitignore @@ -1 +1 @@ -bin +build diff --git a/bbb-video/build.gradle b/bbb-video/build.gradle new file mode 100755 index 0000000000..2df73ba83a --- /dev/null +++ b/bbb-video/build.gradle @@ -0,0 +1,91 @@ +usePlugin 'java' +usePlugin 'war' +usePlugin 'eclipse' + +version = '0.7' +jar.enabled = true +archivesBaseName = 'video' + +task dependencies(type: Copy) { + into('lib') + from configurations.default + from configurations.default.allArtifacts*.file +} + +task resolveDeps(dependsOn: configurations.default.buildArtifacts, type: Copy) { + into('lib') + from configurations.default + from configurations.default.allArtifacts*.file +} + +task resolveDependencies(dependsOn: configurations.default.buildArtifacts, type: Copy) { + into('lib') + from configurations.default + from configurations.default.allArtifacts*.file +} + +repositories { + add(new org.apache.ivy.plugins.resolver.ChainResolver()) { + name = 'remote' + returnFirst = true + add(new org.apache.ivy.plugins.resolver.URLResolver()) { + name = "googlecode" + addArtifactPattern "http://red5.googlecode.com/svn/repository/[artifact](-[revision]).[ext]" + addArtifactPattern "http://red5.googlecode.com/svn/repository/[organisation]/[artifact](-[revision]).[ext]" + } + add(new org.apache.ivy.plugins.resolver.URLResolver()) { + name = "blindside-repos" + addArtifactPattern "http://blindside.googlecode.com/svn/repository/[artifact](-[revision]).[ext]" + addArtifactPattern "http://blindside.googlecode.com/svn/repository/[organisation]/[artifact](-[revision]).[ext]" + } + add(new org.apache.ivy.plugins.resolver.URLResolver()) { + name = "maven2-central" + m2compatible = true + addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]" + addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]" + } + add(new org.apache.ivy.plugins.resolver.URLResolver()) { + name = "testng_ibiblio_maven2" + m2compatible = true + addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision])-jdk15.[ext]" + addArtifactPattern "http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision])-jdk15.[ext]" + } + } +} + +dependencies { + providedCompile 'javax.servlet:servlet-api:2.5@jar', 'org.apache.mina:mina-core:2.0.0-RC1@jar' + providedCompile 'spring:spring-web:3.0.0@jar', 'spring:spring-core:3.0.0@jar' + providedCompile 'spring:spring-aop:3.0.0@jar', 'spring:spring-beans:3.0.0@jar', 'spring:spring-context:3.0.0@jar' + providedCompile 'org/red5:red5:1.0rc1@jar' + providedCompile ':log4j-over-slf4j:1.5.6@jar',':logback-core:0.9.14@jar', ':logback-classic:0.9.14@jar', ':slf4j-api:1.5.6@jar' + + // Testing + compile 'org.testng:testng:5.8@jar' + compile 'org.easymock:easymock:2.4@jar' + + //redis + compile 'redis.clients:jedis:1.5.1' + compile 'commons-pool:commons-pool:1.5.5' +} + +test { + useTestNG() +} + +war.doLast { + ant.unzip(src: war.archivePath, dest: "$buildDir/video") + ant.copy(file: "$buildDir/video/WEB-INF/logback-video.xml", todir: "$buildDir/video/WEB-INF/classes") +} + + +task deploy() << { + def red5AppsDir = '/usr/share/red5/webapps' + def videoDir = new File("${red5AppsDir}/video") + if (videoDir.exists()) ant.delete(dir: videoDir) + ant.mkdir(dir: videoDir) + ant.copy(todir: videoDir) { + fileset(dir: "$buildDir/video") + } +} + diff --git a/bbb-video/build.properties b/bbb-video/build.properties deleted file mode 100644 index 79f6e0c738..0000000000 --- a/bbb-video/build.properties +++ /dev/null @@ -1,60 +0,0 @@ -# NOTE: -# Copy build.properties to your home directory. This way -# you have a custom copy configured for your own environment. -# -# Replace red5_home with the directory where you installed Red5 -# -red5.home = /usr/share/red5 - -# General -project.name=BigBlueButton Video Application -project.url=http://code.google.com/p/bigbluebutton -project.age=2008-2009 -project.fullname=${project.name} - -# Release -release.filename=bbb-app-video -release.archive=${release.filename}.tar.gz - -# Ivy -ivy.version=ivy-2.0.0-beta1 - -# javac options -# http://ant.apache.org/manual/CoreTasks/javac.html -# -# sun javac -build.compiler=modern -# jikes -#build.compiler=jikes - -# generic compiler options -build.verbose=false -build.fork=true -build.deprecation=false -build.nowarn=true - -# optimize only works with a few compilers -build.optimize=false - - -# Change this var to build to a different Java version -# Defaults to current version. Valid options are 1.6, or 1.5. Note 1.4 is not supported. -java.target_version=${java.specification.version} - -# jikes options -build.compiler.emacs=false -build.compiler.fulldepend=false -build.compiler.pedantic=false - -build.debug=true -debug.state=true - -junit.fork=false -junit.forkmode=once - -target.version=0.1 - -environment=env -java.home=${env.JDK_HOME} - - diff --git a/bbb-video/build.xml b/bbb-video/build.xml deleted file mode 100644 index b498603a2e..0000000000 --- a/bbb-video/build.xml +++ /dev/null @@ -1,329 +0,0 @@ -<?xml version="1.0" ?> -<project name="bbb-app-video" basedir="." default="echoall" xmlns:ivy="antlib:org.apache.ivy.ant"> - - <!-- This build file requires Apache Ant >= 1.7 --> - <condition property="ant-at-least-7"> - <antversion atleast="1.7.0"/> - </condition> - - <!-- project properties --> - - <!-- user overides for project properties --> - <!-- Should be first as properties are immutable.--> - <!-- This allows user to override default properties--> - <property file="${user.home}/.bbb-app-video-build.properties"/> - - <!-- base project properties --> - <property file="build.properties"/> - <property environment="env"/> - <property name="dist.dir" value="dist"/> - <property name="build.dir" value="build"/> - <property name="lib.dir" value="lib"/> - <property name="build.classes.dir" value="${build.dir}/classes"/> - <property name="test.dir" value="${build.dir}/test"/> - <property name="test.classes.dir" value="${test.dir}/classes"/> - <property name="test.data.dir" value="${test.dir}/data"/> - <property name="test.reports.dir" value="${test.dir}/reports"/> - <property name="fitnesse.test.classes.dir" value="${test.dir}/fitnesse/classes"/> - <property name="dist.webapps.dir" value="${dist.dir}/webapps"/> - - <property name="target.extension" value="jar"/> - <property name="project.name-ver" value="${project.name}-${target.version}"/> - <property name="target.name" value="${project.name-ver}.${target.extension}"/> - <property name="target.jar" value="${dist.dir}/${target.name}"/> - <property name="target.zip" value="${dist.dir}/${project.name-ver}.zip"/> - <property name="target.tar" value="${dist.dir}/${project.name-ver}.tar"/> - <property name="target.tar.gz" value="${target.tar}.gz"/> - <property name="src.dir" value="src/main/java"/> - <property name="test.src.dir" value="src/test/java"/> - <property name="webapp.dir" value="src/main/webapp"/> - - <tstamp prefix="build"> - <format property="TODAY" pattern="d-MMMM-yyyy" locale="en"/> - </tstamp> - - <path id="project.classpath"> - <fileset dir="${lib.dir}"/> - </path> - - <path id="full.classpath"> - <fileset dir="${lib.dir}"/> - </path> - - <path id="compile.classpath"> - <fileset dir="${lib.dir}"> - <include name="*.jar"/> - </fileset> - </path> - - <path id="compiled.classes.dir"> - <fileset dir="${build.dir}"> - <include name="*.jar"/> - </fileset> - </path> - - <path id="test.compile.classpath"> - <path refid="compile.classpath"/> - <path refid="compiled.classes.dir"/> - </path> - - <path id="test.classpath"> - <path refid="test.compile.classpath"/> - <pathelement location="${test.classes.dir}"/> - </path> - - <path id="test.forking.classpath"> - <path refid="test.classpath"/> - <pathelement path="${java.class.path}"/> - </path> - - <!-- Build Targets --> - <target name="prepare" depends="clean" description="Setup directories for build"> - <mkdir dir="${build.dir}"/> - <mkdir dir="${dist.dir}"/> - <mkdir dir="${test.classes.dir}"/> - <mkdir dir="${test.reports.dir}"/> - <mkdir dir="${test.data.dir}"/> - </target> - - <!-- here is the version of ivy we will use. change this property to try a newer - version if you want --> - <property name="ivy.install.version" value="2.0.0-beta1" /> - <property name="ivy.jar.dir" value="${user.home}/.ivy2/jars" /> - <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> - - <target name="download-ivy" unless="skip.download"> - <mkdir dir="${ivy.jar.dir}"/> - <!-- download Ivy from web site so that it can be used even without any special installation --> - <echo message="installing ivy..."/> - <get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" - dest="${ivy.jar.file}" usetimestamp="true"/> - </target> - - <!-- ================================= - target: install-ivy - this target is not necessary if you put ivy.jar in your ant lib directory - if you already have ivy in your ant lib, you can simply remove this - target and the dependency the 'go' target has on it - ================================= --> - <target name="install-ivy" depends="download-ivy" description="--> install ivy"> - <!-- try to load ivy here from local ivy dir, in case the user has not already dropped - it into ant's lib dir (note that the latter copy will always take precedence). - We will not fail as long as local lib dir exists (it may be empty) and - ivy is in at least one of ant's lib dir or the local lib dir. --> - <path id="ivy.lib.path"> - <fileset dir="${ivy.jar.dir}" includes="*.jar"/> - </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" - uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> - </target> - - <!-- ================================= - target: clean-ivy - ================================= --> - <target name="clean-ivy" description="--> clean the ivy installation"> - <delete dir="${ivy.jar.dir}"/> - </target> - - <target name="resolve" depends="install-ivy" description="--> retrieve dependencies with ivy"> - <!-- Ivy configuration --> - <ivy:settings file="ivysettings.xml" id="ivy.instance"/> - <condition property="ivy.conf.name" value="default"> - <not> - <isset property="ivy.conf.name"/> - </not> - </condition> - <echo message="Ivy conf name: ${ivy.conf.name}"/> - <echo message="ivy.local.default.root: ${ivy.local.default.root}"/> - <ivy:resolve conf="${ivy.conf.name}"/> - <ivy:retrieve conf="${ivy.conf.name}"/> - </target> - - <target name="clean" description="Clean directories for build"> - <delete dir="${build.dir}"/> - <delete dir="${dist.dir}"/> - </target> - - <target name="compile" depends="prepare" description="Compiles Desk Share"> - <antcall target="compile_apps" inheritAll="true" inheritRefs="true"/> - </target> - - <macrodef name="build-app"> - <attribute name="name"/> - <element name="copy-assets" optional="yes"/> - <sequential> - <mkdir dir="${build.dir}/@{name}"/> - <javac sourcepath="" srcdir="${src.dir}" destdir="${build.dir}/@{name}" - classpathref="full.classpath" optimize="${build.optimize}" verbose="${build.verbose}" - fork="${build.fork}" nowarn="${build.nowarn}" deprecation="${build.deprecation}" - debug="${debug.state}" compiler="${build.compiler}" source="${java.target_version}" target="${java.target_version}"/> - - <copy-assets/> - </sequential> - </macrodef> - - <target name="compile_apps" description="Build bigbluebutton apps"> - <build-app name="video"/> - </target> - - <macrodef name="compile-jarapp"> - <attribute name="name"/> - <element name="copy-assets" optional="yes"/> - <sequential> - <copy todir="${build.dir}/@{name}" file="${webapp.dir}/WEB-INF/logback-video.xml" overwrite="true"/> - - <jar destfile="${build.dir}/@{name}.jar"> - <fileset dir="${build.dir}/@{name}"> - <include name="**"/> - </fileset> - </jar> - </sequential> - </macrodef> - - <target name="jar" description="Make Archive" depends="compile"> - <compile-jarapp name="video"/> - </target> - - <macrodef name="deploy-app"> - <attribute name="webapp"/> - <sequential> - <copy todir="${red5.home}/webapps"> - <fileset dir="${dist.webapps.dir}"/> - </copy> - </sequential> - </macrodef> - - <target name="deploy" description="Deploy video into red5" depends="dist"> - <delete dir="${red5.home}/webapps/video"/> - <copy todir="${red5.home}/webapps"> - <fileset dir="${dist.webapps.dir}"/> - </copy> - </target> - - <target name="dist-archive" depends="dist" description="Create archive file for distribution"> - <touch> - <fileset dir="${dist.dir}"/> - </touch> - <tar destfile="${target.tar.gz}" basedir="${dist.dir}" compression="gzip" - longfile="gnu"> - <tarfileset dir="${dist.dir}" mode="755"> - <include name="${dist.dir}/webapps/video/**"/> - </tarfileset> - </tar> - </target> - - <macrodef name="copy-app"> - <attribute name="name"/> - <element name="copy-assets" optional="yes"/> - <sequential> - <mkdir dir="${dist.webapps.dir}/@{name}/WEB-INF/lib/"/> - <copy todir="${dist.webapps.dir}/@{name}/WEB-INF/lib/" file="${build.dir}/@{name}.jar" overwrite="true"/> - - <copy todir="${dist.webapps.dir}/@{name}" filtering="true"> - <fileset dir="${webapp.dir}"> - <exclude name="**/src/**"/> - <exclude name="**/test/**"/> - <exclude name="**/lib/**"/> - </fileset> - </copy> - <!-- copy files (optional) --> - <copy-assets/> - </sequential> - </macrodef> - - <macrodef name="logback"> - <attribute name="webapp"/> - <sequential> - <!-- copy the logback config per webapp and associated jars --> - <!--copy todir="${dist.webapps.dir}/@{webapp}/WEB-INF/lib/"> - <fileset dir="${lib.dir}"> - <include name="slf4j-api-1.5.6.jar"/> - <include name="logback-core-0.9.14.jar"/> - <include name="logback-classic-0.9.14.jar"/> - </fileset> - </copy--> - </sequential> - </macrodef> - - <target name="dist" description="Make Binary distribution" depends="jar"> - <copy-app name="video"> - <copy-assets> - <logback webapp="video"/> - </copy-assets> - </copy-app> - </target> - - <target name="test-compile" depends="jar"> - <javac destdir="${test.classes.dir}" - debug="true" - includeAntRuntime="yes" - srcdir="${test.src.dir}"> - <classpath refid="test.compile.classpath"/> - </javac> - <taskdef name="testng" classpathref="compile.classpath" - classname="org.testng.TestNGAntTask" /> - </target> - - <target name="test-ng" depends="test-compile"> - <echo message="running tests"/> - <testng classpathref="test.classpath" outputDir="${test.data.dir}"> - <xmlfileset dir="." includes="testng.xml"/> - <jvmarg value="-ea" /> - </testng> - </target> - - <target name="testng-reports" depends="test-ng"> - <junitreport todir="${test.data.dir}"> - <fileset dir="${test.data.dir}"> - <include name="*/*.xml"/> - </fileset> - - <report format="frames" todir="${test.reports.dir}"/> - </junitreport> - </target> - - <target name="test" depends="test-compile"> - <junit printsummary="false" - errorProperty="test.failed" - failureProperty="test.failed" - fork="${junit.fork}" - forkmode="${junit.forkmode}"> - <classpath refid="test.forking.classpath" /> - <formatter type="brief" usefile="false"/> - <formatter type="xml"/> - <test name="${testcase}" todir="${test.data.dir}" if="testcase"/> - <batchtest todir="${test.data.dir}" unless="testcase"> - <fileset dir="${test.classes.dir}" > - <include name="**/*Test.class"/> - </fileset> - </batchtest> - </junit> - - <junitreport todir="${test.data.dir}"> - <fileset dir="${test.data.dir}"> - <include name="TEST-*.xml"/> - </fileset> - <report format="frames" todir="${test.reports.dir}"/> - </junitreport> - - <!--conditional failure --> - <fail if="test.failed"> - Tests failed. Check ${test.reports.dir} - </fail> - </target> - - <target name="all" depends="clean, prepare, compile, jar" description="Run all server tasks"/> - - <target name="usage"> - <echo message="Type ant -p for available targets"/> - </target> - - <target name="diagnostics" - description="diagnostics"> - <diagnostics/> - </target> - - <target name="echoall"> - <echoproperties/> - </target> -</project> diff --git a/bbb-video/ivy.xml b/bbb-video/ivy.xml deleted file mode 100644 index fd38d42b31..0000000000 --- a/bbb-video/ivy.xml +++ /dev/null @@ -1,25 +0,0 @@ -<ivy-module version="1.0"> - <info organisation="org.red5" module="sip" /> - <configurations> - <conf name="default"/> - <conf name="java5" extends="default" description="Java 5 dependencies"/> - <conf name="test" extends="default" description="Unit testing dependencies"/> - </configurations> - <dependencies> - <!-- Logging --> - <dependency name="log4j-over-slf4j" rev="1.5.10" /> - <dependency name="logback-core" rev="0.9.18" /> - <dependency name="logback-classic" rev="0.9.18" /> - <dependency name="slf4j-api" rev="1.5.10" /> - - <!-- Red5 --> - <dependency org="org/red5" name="red5" rev="1.0rc1"/> - - <!-- Spring --> - <dependency org="spring" name="spring-beans" rev="3.0.0" /> - <dependency org="spring" name="spring-context" rev="3.0.0" /> - <dependency org="spring" name="spring-core" rev="3.0.0" /> - - <dependency org="javax.servlet" name="servlet-api" rev="2.5" /> - </dependencies> -</ivy-module> diff --git a/bbb-video/ivysettings.xml b/bbb-video/ivysettings.xml deleted file mode 100644 index aa8245ca37..0000000000 --- a/bbb-video/ivysettings.xml +++ /dev/null @@ -1,35 +0,0 @@ -<ivysettings> - <settings defaultResolver="project_lib"/> - <!--include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/--> - <!--include url="${ivy.default.settings.dir}/ivysettings-local.xml"/--> - <resolvers> - <filesystem name="local_lib"> - <artifact pattern="${user.home}/.ivy2/local/[organisation]/[artifact](-[revision]).[ext]" /> - <artifact pattern="${user.home}/.ivy2/local/[artifact](-[revision]).[ext]" /> - </filesystem> - <chain name="project_lib" returnFirst="true"> - <filesystem name="lib_dir"> - <artifact pattern="${ivy.lib.dir}/[artifact](-[revision]).[type]" /> - <artifact pattern="${ivy.lib.dir}/[artifact](-[revision]).[ext]" /> - </filesystem> - </chain> - <chain name="remote" returnFirst="true"> - <url name="googlecode"> - <artifact pattern="http://red5.googlecode.com/svn/repository/[artifact](-[revision]).[ext]" /> - <artifact pattern="http://red5.googlecode.com/svn/repository/[organisation]/[artifact](-[revision]).[ext]" /> - </url> - <url name="blindside-repos"> - <artifact pattern="http://blindside.googlecode.com/svn/repository/[artifact](-[revision]).[ext]" /> - <artifact pattern="http://blindside.googlecode.com/svn/repository/[organisation]/[artifact](-[revision]).[ext]" /> - </url> - <url name="maven2-central" m2compatible="true"> - <artifact pattern="http://repo1.maven.org/maven2/[organisation]/[module]/[revision]/[artifact](-[revision]).[ext]" /> - <artifact pattern="http://repo1.maven.org/maven2/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]" /> - </url> - </chain> - </resolvers> - <modules> - <module organisation="spring" name="*" resolver="googlecode"/> - <module organisation=".*" name="*" resolver="remote"/> - </modules> -</ivysettings> diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoService.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoService.java deleted file mode 100755 index 7cd6fd69b3..0000000000 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoService.java +++ /dev/null @@ -1,105 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 2.1 of the License, or (at your option) any later -* version. -* -* BigBlueButton 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. -* -*/ -package org.bigbluebutton.app.video; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -import org.red5.logging.Red5LoggerFactory; -import org.red5.server.api.IScope; -import org.red5.server.api.Red5; -import org.slf4j.Logger; -import org.springframework.core.io.Resource; - -public class DemoService { - - private static Logger log = Red5LoggerFactory.getLogger(DemoService.class, "video"); - - { - log.info("oflaDemo DemoService created"); - } - - private String formatDate(Date date) { - SimpleDateFormat formatter; - String pattern = "dd/MM/yy H:mm:ss"; - Locale locale = new Locale("en", "US"); - formatter = new SimpleDateFormat(pattern, locale); - return formatter.format(date); - } - - /** - * Getter for property 'listOfAvailableFLVs'. - * - * @return Value for property 'listOfAvailableFLVs'. - */ - public Map<String, Map<String, Object>> getListOfAvailableFLVs() { - IScope scope = Red5.getConnectionLocal().getScope(); - Map<String, Map<String, Object>> filesMap = new HashMap<String, Map<String, Object>>(); - try { - log.debug("getting the FLV files"); - addToMap(filesMap, scope.getResources("streams/*.flv")); - - addToMap(filesMap, scope.getResources("streams/*.f4v")); - - addToMap(filesMap, scope.getResources("streams/*.mp3")); - - addToMap(filesMap, scope.getResources("streams/*.mp4")); - - addToMap(filesMap, scope.getResources("streams/*.m4a")); - - addToMap(filesMap, scope.getResources("streams/*.3g2")); - - addToMap(filesMap, scope.getResources("streams/*.3gp")); - - } catch (IOException e) { - log.error("", e); - } - return filesMap; - } - - private void addToMap(Map<String, Map<String, Object>> filesMap, Resource[] files) - throws IOException { - if (files != null) { - for (Resource flv : files) { - File file = flv.getFile(); - Date lastModifiedDate = new Date(file.lastModified()); - String lastModified = formatDate(lastModifiedDate); - String flvName = flv.getFile().getName(); - String flvBytes = Long.toString(file.length()); - if (log.isDebugEnabled()) { - log.debug("flvName: {}", flvName); - log.debug("lastModified date: {}", lastModified); - log.debug("flvBytes: {}", flvBytes); - log.debug("-------"); - } - Map<String, Object> fileInfo = new HashMap<String, Object>(); - fileInfo.put("name", flvName); - fileInfo.put("lastModified", lastModified); - fileInfo.put("size", flvBytes); - filesMap.put(flvName, fileInfo); - } - } - } - -} diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoServiceImpl.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoServiceImpl.java deleted file mode 100755 index 1fdfc32b75..0000000000 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/DemoServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 2.1 of the License, or (at your option) any later -* version. -* -* BigBlueButton 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. -* -*/ -package org.bigbluebutton.app.video; - -import java.util.HashMap; -import java.util.Map; - -import org.red5.logging.Red5LoggerFactory; -import org.slf4j.Logger; - -public class DemoServiceImpl implements IDemoService { - - private static Logger log = Red5LoggerFactory.getLogger(DemoServiceImpl.class, "video"); - - /** - * Getter for property 'listOfAvailableFLVs'. - * - * @return Value for property 'listOfAvailableFLVs'. - */ - public Map<String, Map<String, Object>> getListOfAvailableFLVs() { - log.debug("getListOfAvailableFLVs empty"); - return new HashMap<String, Map<String, Object>>(1); - } - - public Map<String, Map<String, Object>> getListOfAvailableFLVs(String string) { - log.debug("getListOfAvailableFLVs, Got a string: {}", string); - return getListOfAvailableFLVs(); - } - -} - diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/IDemoService.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/IDemoService.java deleted file mode 100755 index eb9a1ce3a9..0000000000 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/IDemoService.java +++ /dev/null @@ -1,34 +0,0 @@ -/** -* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ -* -* Copyright (c) 2010 BigBlueButton Inc. and by respective authors (see below). -* -* This program is free software; you can redistribute it and/or modify it under the -* terms of the GNU Lesser General Public License as published by the Free Software -* Foundation; either version 2.1 of the License, or (at your option) any later -* version. -* -* BigBlueButton 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 Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License along -* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. -* -*/ -package org.bigbluebutton.app.video; - -import java.util.Map; - -public interface IDemoService { - - /** - * Getter for property 'listOfAvailableFLVs'. - * - * @return Value for property 'listOfAvailableFLVs'. - */ - public Map<String, Map<String, Object>> getListOfAvailableFLVs(); - - public Map<String, Map<String, Object>> getListOfAvailableFLVs(String string); - -} diff --git a/bbb-video/src/main/java/org/bigbluebutton/app/video/VideoApplication.java b/bbb-video/src/main/java/org/bigbluebutton/app/video/VideoApplication.java index bd615a7287..730bfad86c 100755 --- a/bbb-video/src/main/java/org/bigbluebutton/app/video/VideoApplication.java +++ b/bbb-video/src/main/java/org/bigbluebutton/app/video/VideoApplication.java @@ -64,13 +64,26 @@ public class VideoApplication extends MultiThreadedApplicationAdapter { @Override public void streamPublishStart(IBroadcastStream stream) { + super.streamPublishStart(stream); if (recordVideoStream) { recordStream(stream); } } + @Override + public void streamBroadcastStart(IBroadcastStream stream) { + super.streamBroadcastStart(stream); + log.info("streamBroadcastStart " + stream.getPublishedName() + " " + System.currentTimeMillis()); + } + + @Override + public void streamBroadcastClose(IBroadcastStream stream) { + super.streamBroadcastClose(stream); + log.info("streamBroadcastClose " + stream.getPublishedName() + " " + System.currentTimeMillis()); + } + /** - * A hook to record a sample stream. A file is written in webapps/video/streams/ + * A hook to record a stream. A file is written in webapps/video/streams/ * @param stream */ private void recordStream(IBroadcastStream stream) { @@ -78,7 +91,7 @@ public class VideoApplication extends MultiThreadedApplicationAdapter { String streamName = stream.getPublishedName(); try { - log.info("Recording stream " + streamName); + log.info("Recording stream " + streamName + " " + System.currentTimeMillis()); ClientBroadcastStream cstream = (ClientBroadcastStream) this.getBroadcastStream(conn.getScope(), stream.getPublishedName() ); cstream.saveAs(streamName, false); } catch(Exception e) { diff --git a/bbb-video/vm-build.sh b/bbb-video/vm-build.sh old mode 100644 new mode 100755 index 48050639ce..1afa868aed --- a/bbb-video/vm-build.sh +++ b/bbb-video/vm-build.sh @@ -1 +1 @@ -ant resolve deploy +gradle resolveDeps deploy -- GitLab