commiting deskshare app
git-svn-id: http://svn.bigbluebutton.org/project-bbb/trunk@3 6ac8b576-4aa1-4e98-a958-8badfeb98c9d
This commit is contained in:
parent
bee6ba317f
commit
013b6ea7df
22
bbb-apps-deskshare/.classpath
Normal file
22
bbb-apps-deskshare/.classpath
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="src" path="src/test/java"/>
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="lib/log4j-over-slf4j-1.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/logback-classic-0.9.14.jar"/>
|
||||
<classpathentry kind="lib" path="lib/logback-core-0.9.14.jar"/>
|
||||
<classpathentry kind="lib" path="lib/slf4j-api-1.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-aop-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-beans-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-context-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-core-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-web-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/spring-webmvc-2.5.6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/servlet-api-2.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/mina-core-2.0.0-M6.jar"/>
|
||||
<classpathentry kind="lib" path="lib/red5-0.8.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xuggle-xuggler-3.0.660.jar"/>
|
||||
<classpathentry kind="lib" path="lib/xuggle-xuggler-red5-3.0.662.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
17
bbb-apps-deskshare/.project
Normal file
17
bbb-apps-deskshare/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>deskshare-app</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
12
bbb-apps-deskshare/.settings/org.eclipse.jdt.core.prefs
Normal file
12
bbb-apps-deskshare/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,12 @@
|
||||
#Mon Jul 20 12:24:39 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
2
bbb-apps-deskshare/INSTALL
Normal file
2
bbb-apps-deskshare/INSTALL
Normal file
@ -0,0 +1,2 @@
|
||||
TODO:
|
||||
- create install instructions
|
2
bbb-apps-deskshare/README
Normal file
2
bbb-apps-deskshare/README
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
BigBlueButton DeskShare is licensed as AGPL to comply with Xuggler 3.0 license.
|
661
bbb-apps-deskshare/agpl.txt
Normal file
661
bbb-apps-deskshare/agpl.txt
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
60
bbb-apps-deskshare/build.properties
Normal file
60
bbb-apps-deskshare/build.properties
Normal file
@ -0,0 +1,60 @@
|
||||
# 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 = /path/to/where/you/installed/red5
|
||||
|
||||
# General
|
||||
project.name=BigBlueButton Desk Share Application
|
||||
project.url=http://code.google.com/p/bigbluebutton
|
||||
project.age=2008-2009
|
||||
project.fullname=${project.name}
|
||||
|
||||
# Release
|
||||
release.filename=bbb-app-deskshare
|
||||
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}
|
||||
|
||||
|
348
bbb-apps-deskshare/build.xml
Normal file
348
bbb-apps-deskshare/build.xml
Normal file
@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" ?>
|
||||
<project name="bbb-app-deskshare" 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}/.deskshare-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="deskshare"/>
|
||||
</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-deskshare.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="deskshare"/>
|
||||
</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 deskshare into red5" depends="dist">
|
||||
<delete dir="${red5.home}/webapps/deskshare"/>
|
||||
<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/deskshare/**"/>
|
||||
</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>
|
||||
|
||||
<macrodef name="deskshare-lib">
|
||||
<attribute name="webapp"/>
|
||||
<sequential>
|
||||
<copy todir="${dist.webapps.dir}/@{webapp}/WEB-INF/lib/">
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="xuggle-xuggler-*.jar"/>
|
||||
<include name="xuggle-xuggler-red5-*.jar"/>
|
||||
<include name="jetm-1.2.3.jar"/>
|
||||
<include name="jetm-optional-1.2.3.jar"/>
|
||||
<include name="spring-webmvc-2.5.6.jar"/>
|
||||
<include name="commons-fileupload-1.2.1.jar"/>
|
||||
<include name="commons-io-1.4.jar"/>
|
||||
<include name="mina-integration-spring-1.1.7.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="dist" description="Make Binary distribution" depends="jar">
|
||||
<copy-app name="deskshare">
|
||||
<copy-assets>
|
||||
<logback webapp="deskshare"/>
|
||||
<deskshare-lib webapp="deskshare"/>
|
||||
</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>
|
40
bbb-apps-deskshare/ivy.xml
Normal file
40
bbb-apps-deskshare/ivy.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<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.6" />
|
||||
<dependency name="logback-core" rev="0.9.14" />
|
||||
<dependency name="logback-classic" rev="0.9.14" />
|
||||
<dependency name="slf4j-api" rev="1.5.6" />
|
||||
|
||||
<!-- Red5 -->
|
||||
<dependency org="org/red5" name="red5" rev="0.8"/>
|
||||
|
||||
<!-- Spring -->
|
||||
<dependency org="spring" name="spring-aop" rev="2.5.6" />
|
||||
<dependency org="spring" name="spring-beans" rev="2.5.6" />
|
||||
<dependency org="spring" name="spring-context" rev="2.5.6" />
|
||||
<dependency org="spring" name="spring-core" rev="2.5.6" />
|
||||
<dependency org="spring" name="spring-web" rev="2.5.6" />
|
||||
<dependency org="spring" name="spring-webmvc" rev="2.5.6" />
|
||||
|
||||
<dependency org="javax.servlet" name="servlet-api" rev="2.5" />
|
||||
<dependency org="org.apache.mina" name="mina-core" rev="2.0.0-M6" />
|
||||
<dependency org="org.apache.mina" name="mina-integration-spring" rev="1.1.7" />
|
||||
|
||||
<!-- File upload -->
|
||||
<dependency org="commons-fileupload" name="commons-fileupload" rev="1.2.1" />
|
||||
<dependency org="commons-io" name="commons-io" rev="1.4" />
|
||||
|
||||
<!-- Xuggler -->
|
||||
<dependency org="com/xuggle" name="xuggle-xuggler" rev="3.0.660" />
|
||||
<dependency org="com/xuggle" name="xuggle-xuggler-red5" rev="3.0.662" />
|
||||
<dependency org="fm/void/jetm" name="jetm" rev="1.2.3" />
|
||||
<dependency org="fm/void/jetm" name="jetm-optional" rev="1.2.3" />
|
||||
</dependencies>
|
||||
</ivy-module>
|
36
bbb-apps-deskshare/ivysettings.xml
Normal file
36
bbb-apps-deskshare/ivysettings.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<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="com/xuggle" name="*" resolver="blindside-repos"/>
|
||||
<module organisation="spring" name="*" resolver="googlecode"/>
|
||||
<module organisation=".*" name="*" resolver="remote"/>
|
||||
</modules>
|
||||
</ivysettings>
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
public class CaptureEndEvent implements ICaptureEvent {
|
||||
|
||||
private String room;
|
||||
|
||||
public CaptureEndEvent(String room) {
|
||||
this.room = room;
|
||||
}
|
||||
|
||||
public String getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaptureMessage getMessageType() {
|
||||
return CaptureMessage.CAPTURE_END;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
public enum CaptureEvents {
|
||||
CAPTURE_START(0), CAPTURE_UPDATE(1), CAPTURE_END(2);
|
||||
|
||||
private final int event;
|
||||
|
||||
CaptureEvents(int event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public int getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (event) {
|
||||
case 0:
|
||||
return "Capture Start Event";
|
||||
case 1:
|
||||
return "Capture Update Event";
|
||||
case 2:
|
||||
return "Capture End Event";
|
||||
}
|
||||
|
||||
return "Unknown Capture Event";
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
public enum CaptureMessage {
|
||||
CAPTURE_START,
|
||||
CAPTURE_UPDATE,
|
||||
CAPTURE_END
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
public class CaptureStartEvent implements ICaptureEvent {
|
||||
|
||||
private final int width;
|
||||
private final int height;
|
||||
private final int frameRate;
|
||||
private final String room;
|
||||
|
||||
public CaptureStartEvent(String room, int width, int height, int frameRate) {
|
||||
this.room = room;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.frameRate = frameRate;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getFrameRate() {
|
||||
return frameRate;
|
||||
}
|
||||
|
||||
public String getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaptureMessage getMessageType() {
|
||||
return CaptureMessage.CAPTURE_START;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class CaptureUpdateEvent implements ICaptureEvent {
|
||||
|
||||
private final BufferedImage tile;
|
||||
private final String room;
|
||||
|
||||
private final int width;
|
||||
private final int height;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int position;
|
||||
|
||||
public CaptureUpdateEvent(BufferedImage screen, String room, int width,
|
||||
int height, int x, int y, int position) {
|
||||
|
||||
this.tile = screen;
|
||||
this.room = room;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public BufferedImage getTile() {
|
||||
return tile;
|
||||
}
|
||||
|
||||
public String getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaptureMessage getMessageType() {
|
||||
return CaptureMessage.CAPTURE_UPDATE;
|
||||
}
|
||||
|
||||
public static CaptureUpdateEvent copy(CaptureUpdateEvent event) {
|
||||
return new CaptureUpdateEvent(event.getTile(), event.getRoom(),
|
||||
event.getWidth(), event.getHeight(),
|
||||
event.getX(), event.getY(), event.getPosition());
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class CapturedScreen {
|
||||
|
||||
private BufferedImage screen;
|
||||
private String room;
|
||||
|
||||
private int width;
|
||||
private int height;
|
||||
private int frameRate;
|
||||
|
||||
public CapturedScreen(BufferedImage screen, String room, int width,
|
||||
int height, int frameRate) {
|
||||
super();
|
||||
this.screen = screen;
|
||||
this.room = room;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.frameRate = frameRate;
|
||||
}
|
||||
|
||||
|
||||
public BufferedImage getScreen() {
|
||||
return screen;
|
||||
}
|
||||
|
||||
public String getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getFrameRate() {
|
||||
return frameRate;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class ChangedTileProcessor {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(ChangedTileProcessor.class, "deskshare");
|
||||
|
||||
private final Executor exec = Executors.newSingleThreadExecutor();
|
||||
private BlockingQueue<CaptureUpdateEvent> queue = new LinkedBlockingQueue<CaptureUpdateEvent>();
|
||||
private Runnable eventHandler;
|
||||
private volatile boolean handleEvent = false;
|
||||
|
||||
private Set<NewScreenListener> listeners = new HashSet<NewScreenListener>();
|
||||
private long lastUpdate;
|
||||
|
||||
private BufferedImage capturedScreen;
|
||||
private Graphics2D graphics;
|
||||
|
||||
public ChangedTileProcessor(int width, int height){
|
||||
this.capturedScreen = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
|
||||
this.graphics = this.capturedScreen.createGraphics();
|
||||
|
||||
lastUpdate = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void appendTile(BufferedImage tile, int x, int y){
|
||||
graphics.drawImage(tile, x, y, null);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
handleEvent = false;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
handleEvent = true;
|
||||
eventHandler = new Runnable() {
|
||||
public void run() {
|
||||
while (handleEvent) {
|
||||
try {
|
||||
CaptureUpdateEvent event = queue.take();
|
||||
handleCaptureEvent(event);
|
||||
} catch (InterruptedException e) {
|
||||
log.warn("InterruptedExeption while taking event.");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exec.execute(eventHandler);
|
||||
}
|
||||
|
||||
private void handleCaptureEvent(CaptureUpdateEvent event) {
|
||||
BufferedImage image = event.getTile();
|
||||
appendTile(image, event.getX(), event.getY());
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if ((now - lastUpdate) > 500) {
|
||||
log.debug("Creating new screen");
|
||||
notifyNewScreenListener(getNewScreen());
|
||||
lastUpdate = now;
|
||||
}
|
||||
}
|
||||
|
||||
private BufferedImage getNewScreen() {
|
||||
/**
|
||||
* Some kind of double-buffering (richard - aug 20, 2009)
|
||||
* Make a true copy of the captured screen. BufferedImage.getSubImage just returns
|
||||
* a reference to the capturedScreen, so when the tiles get updated we see the tiling
|
||||
* on the client. Creating a copy prevents this and provides a cleaner experience.
|
||||
*/
|
||||
WritableRaster raster = capturedScreen.copyData( null );
|
||||
BufferedImage copy = new BufferedImage( capturedScreen.getColorModel(), raster, capturedScreen.isAlphaPremultiplied(), null );
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void accept(CaptureUpdateEvent event) {
|
||||
try {
|
||||
// Make a copy so we can process safely on our own thread.
|
||||
CaptureUpdateEvent copy = CaptureUpdateEvent.copy(event);
|
||||
queue.put(copy);
|
||||
} catch (InterruptedException e) {
|
||||
log.warn("InterruptedException while putting event into queue.");
|
||||
}
|
||||
}
|
||||
|
||||
public void addNewScreenListener(NewScreenListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
|
||||
public void removeListener(NewScreenListener listener) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
private void notifyNewScreenListener(BufferedImage newScreen) {
|
||||
for (NewScreenListener ctl : listeners) {
|
||||
ctl.onNewScreen(newScreen);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bigbluebutton.deskshare.socket.DeskShareServer;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.adapter.MultiThreadedApplicationAdapter;
|
||||
import org.red5.server.api.IBandwidthConfigure;
|
||||
import org.red5.server.api.IConnection;
|
||||
import org.red5.server.api.IScope;
|
||||
import org.red5.server.api.Red5;
|
||||
import org.red5.server.api.stream.IServerStream;
|
||||
import org.red5.server.api.stream.IStreamCapableConnection;
|
||||
import org.red5.server.api.stream.support.SimpleConnectionBWConfig;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* The Application class is the main class of the deskShare server side
|
||||
* @author Snap
|
||||
*
|
||||
*/
|
||||
public class DeskShareApplication extends MultiThreadedApplicationAdapter {
|
||||
private static Logger log = Red5LoggerFactory.getLogger(DeskShareApplication.class, "deskshare");
|
||||
|
||||
private IScope appScope;
|
||||
private IServerStream serverStream;
|
||||
|
||||
private DeskShareServer deskShareServer;
|
||||
|
||||
/**
|
||||
* Runs when the application is first started. Sets up relevant objects to listen to the deskShare client
|
||||
* and publish the stream on red5
|
||||
*/
|
||||
public boolean appStart(IScope app){
|
||||
log.info("deskShare appStart");
|
||||
System.out.println("deskShare appStart");
|
||||
this.appScope = app;
|
||||
|
||||
deskShareServer.start();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean appConnect(IConnection conn, Object[] params){
|
||||
log.info("deskShare appConnect to scope " + conn.getScope().getContext().toString());
|
||||
System.out.println("deskShare appConnect to scope " + conn.getScope().getContextPath());
|
||||
measureBandwidth(conn);
|
||||
|
||||
if (conn instanceof IStreamCapableConnection){
|
||||
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
|
||||
SimpleConnectionBWConfig bwConfig = new SimpleConnectionBWConfig();
|
||||
bwConfig.getChannelBandwidth()[IBandwidthConfigure.OVERALL_CHANNEL] =
|
||||
1024*1024;
|
||||
bwConfig.getChannelInitialBurst()[IBandwidthConfigure.OVERALL_CHANNEL] =
|
||||
128*1024;
|
||||
streamConn.setBandwidthConfigure(bwConfig);
|
||||
}
|
||||
|
||||
return super.appConnect(conn, params);
|
||||
}
|
||||
|
||||
public void appDisconnect(IConnection conn){
|
||||
log.info("deskShare appDisconnect");
|
||||
if (getAppScope() == conn.getScope() && serverStream != null){
|
||||
serverStream.close();
|
||||
}
|
||||
super.appDisconnect(conn);
|
||||
}
|
||||
|
||||
public List<String> getStreams(){
|
||||
IConnection conn = Red5.getConnectionLocal();
|
||||
return getBroadcastStreamNames(conn.getScope());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the appScope
|
||||
*/
|
||||
public IScope getAppScope() {
|
||||
return appScope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the application is stopped
|
||||
*/
|
||||
public void appStop(){
|
||||
deskShareServer.stop();
|
||||
}
|
||||
|
||||
public void setDeskShareServer(DeskShareServer deskShareServer) {
|
||||
this.deskShareServer = deskShareServer;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
/**
|
||||
* The constants for this application
|
||||
* @author Snap
|
||||
*
|
||||
*/
|
||||
public class DeskShareConstants {
|
||||
public static final int PORT = 1026;
|
||||
|
||||
public static final int BIT_RATE = 25000;
|
||||
public static final int BIT_RATE_TOLERANCE = 50000;
|
||||
public static final int NUM_PICTURES_IN_GROUP = 1;
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.Red5;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class DeskShareService {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(DeskShareService.class, "deskshare");
|
||||
|
||||
private StreamerGateway sg;
|
||||
|
||||
public boolean checkIfStreamIsPublishing(){
|
||||
String roomName = Red5.getConnectionLocal().getScope().getName();
|
||||
log.debug("Checking if {} is streaming.", roomName);
|
||||
return sg.isStreaming(roomName);
|
||||
}
|
||||
|
||||
public int getVideoWidth(){
|
||||
String roomName = Red5.getConnectionLocal().getScope().getName();
|
||||
log.debug("Getting video width for {}.", roomName);
|
||||
return sg.getRoomVideoWidth(roomName);
|
||||
}
|
||||
|
||||
public int getVideoHeight(){
|
||||
String roomName = Red5.getConnectionLocal().getScope().getName();
|
||||
log.debug("Getting video height for {}.", roomName);
|
||||
return sg.getRoomVideoHeight(roomName);
|
||||
}
|
||||
|
||||
public void setStreamerGateway(StreamerGateway sg) {
|
||||
this.sg = sg;
|
||||
}
|
||||
}
|
@ -0,0 +1,355 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.IContext;
|
||||
import org.red5.server.api.IScope;
|
||||
import org.red5.server.net.rtmp.event.IRTMPEvent;
|
||||
import org.red5.server.stream.BroadcastScope;
|
||||
import org.red5.server.stream.IBroadcastScope;
|
||||
import org.red5.server.stream.IProviderService;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.xuggle.red5.io.BroadcastStream;
|
||||
import com.xuggle.red5.io.IRTMPEventIOHandler;
|
||||
import com.xuggle.red5.io.Red5HandlerFactory;
|
||||
import com.xuggle.red5.io.Red5Message;
|
||||
import com.xuggle.xuggler.ICodec;
|
||||
import com.xuggle.xuggler.IContainer;
|
||||
import com.xuggle.xuggler.IContainerFormat;
|
||||
import com.xuggle.xuggler.IPacket;
|
||||
import com.xuggle.xuggler.IPixelFormat;
|
||||
import com.xuggle.xuggler.IRational;
|
||||
import com.xuggle.xuggler.ISimpleMediaFile;
|
||||
import com.xuggle.xuggler.IStream;
|
||||
import com.xuggle.xuggler.IStreamCoder;
|
||||
import com.xuggle.xuggler.IVideoPicture;
|
||||
import com.xuggle.xuggler.IVideoResampler;
|
||||
import com.xuggle.xuggler.SimpleMediaFile;
|
||||
import com.xuggle.xuggler.video.ConverterFactory;
|
||||
import com.xuggle.xuggler.video.IConverter;
|
||||
|
||||
/**
|
||||
* The DeskShareStream class publishes captured video to a red5 stream.
|
||||
* @author Snap
|
||||
*
|
||||
*/
|
||||
public class DeskShareStream implements NewScreenListener {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(DeskShareStream.class, "deskshare");
|
||||
|
||||
private BlockingQueue<BufferedImage> screenQueue = new LinkedBlockingQueue<BufferedImage>();
|
||||
private final Executor exec = Executors.newSingleThreadExecutor();
|
||||
private Runnable capturedScreenSender;
|
||||
private volatile boolean sendCapturedScreen = false;
|
||||
|
||||
private IStreamCoder outStreamCoder;
|
||||
private BroadcastStream broadcastStream;
|
||||
private IContainer outContainer;
|
||||
private IStream outStream;
|
||||
private ChangedTileProcessor changedTileProcessor;
|
||||
|
||||
private static final Red5HandlerFactory factory = Red5HandlerFactory.getFactory();
|
||||
private final IRTMPEventIOHandler outputHandler;
|
||||
|
||||
private long timestamp = 0, frameNumber = 0;
|
||||
private int width, height, frameRate, timestampBase;
|
||||
private int encodingWidth, encodingHeight;
|
||||
private String outStreamName;
|
||||
private IScope scope;
|
||||
|
||||
public static final int LARGER_DIMENSION = 1280;
|
||||
|
||||
|
||||
/**
|
||||
* The default constructor
|
||||
* The stream which gets published by the streamer has the same name as the scope. One stream allowed per room
|
||||
*/
|
||||
public DeskShareStream(IScope scope, String streamName, int width, int height, int frameRate) {
|
||||
this.scope = scope;
|
||||
scope.setName(streamName);
|
||||
this.outStreamName = streamName;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.frameRate = frameRate;
|
||||
this.timestampBase = 1000000 / this.frameRate;
|
||||
this.changedTileProcessor = new ChangedTileProcessor(width, height);
|
||||
//encodingHeight = 500;
|
||||
//encodingWidth = 800;
|
||||
calculateEncodingDimensions();
|
||||
|
||||
changedTileProcessor.addNewScreenListener(this);
|
||||
changedTileProcessor.start();
|
||||
|
||||
outputHandler = new IRTMPEventIOHandler(){
|
||||
public Red5Message read() throws InterruptedException{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void write(Red5Message message) throws InterruptedException{
|
||||
log.debug("Handler writing message to stream " + outStreamName);
|
||||
try{
|
||||
IRTMPEvent event = message.getData();
|
||||
if (event != null){
|
||||
broadcastStream.dispatchEvent(event);
|
||||
event.release();
|
||||
}
|
||||
} finally{
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the dimensions of the encoded video, in case the video is too large and needs to be scaled
|
||||
*/
|
||||
public void calculateEncodingDimensions(){
|
||||
if (width < LARGER_DIMENSION && height< LARGER_DIMENSION){
|
||||
encodingHeight = height;
|
||||
encodingWidth = width;
|
||||
return;
|
||||
}
|
||||
|
||||
int biggerDimension, smallerDimension;
|
||||
double ratio;
|
||||
if (width > height){
|
||||
biggerDimension = width;
|
||||
smallerDimension = height;
|
||||
} else{
|
||||
biggerDimension = height;
|
||||
smallerDimension = width;
|
||||
}
|
||||
ratio = (double)biggerDimension/(double)smallerDimension;
|
||||
System.out.println("ration = " + ratio);
|
||||
|
||||
if (width > height){
|
||||
encodingWidth = LARGER_DIMENSION;
|
||||
encodingHeight = (int) Math.round(LARGER_DIMENSION/ratio);
|
||||
} else{
|
||||
encodingHeight = LARGER_DIMENSION;
|
||||
encodingWidth = (int) Math.round(LARGER_DIMENSION/ratio);
|
||||
}
|
||||
//System.out.println("widht: " + encodingWidth + " ,height: " + encodingHeight);
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
sendCapturedScreen = false;
|
||||
streamEnded();
|
||||
changedTileProcessor.stop();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
startPublishing(scope);
|
||||
setupStreams();
|
||||
sendCapturedScreen = true;
|
||||
log.debug("Starting stream {}", outStreamName);
|
||||
capturedScreenSender = new Runnable() {
|
||||
public void run() {
|
||||
while (sendCapturedScreen) {
|
||||
try {
|
||||
log.debug("ScreenQueue size " + screenQueue.size());
|
||||
BufferedImage newScreen = screenQueue.take();
|
||||
sendCapturedScreen(newScreen);
|
||||
} catch (InterruptedException e) {
|
||||
log.warn("InterruptedExeption while taking event.");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
exec.execute(capturedScreenSender);
|
||||
}
|
||||
|
||||
public void accept(CaptureUpdateEvent event) {
|
||||
changedTileProcessor.accept(event);
|
||||
}
|
||||
|
||||
private void sendCapturedScreen(BufferedImage screen) {
|
||||
log.debug("Sending screen captured - built aug 20 12:39PM");
|
||||
// try {
|
||||
// ImageIO.write(screen, "jpg", new File("/tmp/partil.jpg"));
|
||||
// } catch (IOException e1) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
|
||||
IPacket packet = IPacket.make();
|
||||
|
||||
IConverter converter = null;
|
||||
IVideoResampler resampler = IVideoResampler.make(
|
||||
encodingWidth, encodingHeight, IPixelFormat.Type.YUV420P,
|
||||
width, height, IPixelFormat.Type.BGR24);
|
||||
try {
|
||||
converter = ConverterFactory.createConverter(screen, IPixelFormat.Type.BGR24);
|
||||
} catch(UnsupportedOperationException e){
|
||||
log.error("could not create converter");
|
||||
}
|
||||
|
||||
IVideoPicture inFrame = converter.toPicture(screen, timestamp);
|
||||
IVideoPicture outFrame = IVideoPicture.make(IPixelFormat.Type.YUV420P, encodingWidth, encodingHeight);
|
||||
resampler.resample(outFrame, inFrame);
|
||||
log.debug(outFrame.getPixelType().toString());
|
||||
timestamp += timestampBase;
|
||||
frameNumber ++;
|
||||
|
||||
outFrame.setQuality(0);
|
||||
int retval = outStreamCoder.encodeVideo(packet, outFrame, 0);
|
||||
if (retval < 0)
|
||||
throw new RuntimeException("could not encode video");
|
||||
if (packet.isComplete()){
|
||||
retval = outContainer.writePacket(packet, false);
|
||||
if (retval < 0)
|
||||
throw new RuntimeException("could not save packet to container");
|
||||
}
|
||||
outFrame.delete();
|
||||
outFrame = null;
|
||||
converter = null;
|
||||
}
|
||||
|
||||
private void streamEnded() {
|
||||
broadcastStream.stop();
|
||||
broadcastStream.close();
|
||||
int retval = outContainer.writeTrailer();
|
||||
if (retval < 0)
|
||||
throw new RuntimeException("Could not write trailer to output file");
|
||||
log.debug("stopping and closing stream {}", outStreamName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts outputting captured video to a red5 stream
|
||||
* @param aScope
|
||||
*/
|
||||
synchronized private void startPublishing(IScope aScope){
|
||||
log.debug("started publishing stream in " + aScope.getName());
|
||||
|
||||
broadcastStream = new BroadcastStream(outStreamName);
|
||||
broadcastStream.setPublishedName(outStreamName);
|
||||
broadcastStream.setScope(aScope);
|
||||
|
||||
IContext context = aScope.getContext();
|
||||
|
||||
IProviderService providerService = (IProviderService) context.getBean(IProviderService.BEAN_NAME);
|
||||
if (providerService.registerBroadcastStream(aScope, outStreamName, broadcastStream)){
|
||||
IBroadcastScope bScope = (BroadcastScope) providerService.getLiveProviderInput(aScope, outStreamName, true);
|
||||
|
||||
bScope.setAttribute(IBroadcastScope.STREAM_ATTRIBUTE, broadcastStream);
|
||||
} else{
|
||||
log.error("could not register broadcast stream");
|
||||
throw new RuntimeException("could not register broadcast stream");
|
||||
}
|
||||
|
||||
broadcastStream.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up Xuggler containers & streams
|
||||
*/
|
||||
private void setupStreams(){
|
||||
log.debug("Setting up streams: {}", broadcastStream.getName());
|
||||
String outputURL = Red5HandlerFactory.DEFAULT_PROTOCOL +":"+ broadcastStream.getName();
|
||||
|
||||
ICodec videoCodec = ICodec.findEncodingCodec(ICodec.ID.CODEC_ID_FLV1);
|
||||
|
||||
ISimpleMediaFile outInfo = new SimpleMediaFile();
|
||||
outInfo.setURL(outputURL);
|
||||
outInfo.setHasVideo(true);
|
||||
outInfo.setHasAudio(false);
|
||||
outInfo.setVideoWidth(encodingWidth);
|
||||
outInfo.setVideoHeight(encodingHeight);
|
||||
outInfo.setVideoBitRate(DeskShareConstants.BIT_RATE);
|
||||
outInfo.setVideoPixelFormat(IPixelFormat.Type.YUV420P);
|
||||
outInfo.setVideoNumPicturesInGroupOfPictures(DeskShareConstants.NUM_PICTURES_IN_GROUP);
|
||||
outInfo.setVideoCodec(ICodec.ID.CODEC_ID_FLV1);
|
||||
outInfo.setVideoGlobalQuality(0);
|
||||
|
||||
factory.registerStream(outputHandler, outInfo);
|
||||
|
||||
outContainer = IContainer.make();
|
||||
IContainerFormat outFormat = IContainerFormat.make();
|
||||
outFormat.setOutputFormat("flv", outputURL, null);
|
||||
int retval = outContainer.open(outputURL, IContainer.Type.WRITE, outFormat);
|
||||
if (retval <0){
|
||||
log.error("could not open output container");
|
||||
throw new RuntimeException("could not open output file");
|
||||
}
|
||||
log.debug("Output container is open.");
|
||||
outStream = outContainer.addNewStream(0);
|
||||
outStreamCoder = outStream.getStreamCoder();
|
||||
|
||||
outStreamCoder.setNumPicturesInGroupOfPictures(DeskShareConstants.NUM_PICTURES_IN_GROUP);
|
||||
outStreamCoder.setCodec(videoCodec);
|
||||
outStreamCoder.setBitRate(DeskShareConstants.BIT_RATE);
|
||||
outStreamCoder.setBitRateTolerance(DeskShareConstants.BIT_RATE_TOLERANCE);
|
||||
|
||||
outStreamCoder.setPixelType(IPixelFormat.Type.YUV420P);
|
||||
outStreamCoder.setHeight(encodingHeight);
|
||||
outStreamCoder.setWidth(encodingWidth);
|
||||
outStreamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, true);
|
||||
outStreamCoder.setGlobalQuality(0);
|
||||
|
||||
IRational frameRate = IRational.make(this.frameRate,1);
|
||||
outStreamCoder.setFrameRate(frameRate);
|
||||
IRational timeBase = IRational.make(frameRate.getDenominator(), frameRate.getNumerator());
|
||||
outStreamCoder.setTimeBase(timeBase);
|
||||
frameRate = null;
|
||||
|
||||
retval = outStreamCoder.open();
|
||||
if (retval <0)
|
||||
throw new RuntimeException("could not open input decoder");
|
||||
retval = outContainer.writeHeader();
|
||||
if (retval <0) {
|
||||
log.error("could not write file header");
|
||||
throw new RuntimeException("could not write file header");
|
||||
}
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return encodingWidth;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return encodingHeight;
|
||||
}
|
||||
|
||||
public IScope getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewScreen(BufferedImage newScreen) {
|
||||
try {
|
||||
screenQueue.put(newScreen);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
public interface ICaptureEvent {
|
||||
|
||||
public CaptureMessage getMessageType();
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public interface NewScreenListener {
|
||||
|
||||
public void onNewScreen(BufferedImage newScreen);
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.IScope;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class StreamFactory {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(StreamFactory.class, "deskshare");
|
||||
|
||||
private DeskShareApplication app;
|
||||
|
||||
public DeskShareStream createStream(CaptureStartEvent event) {
|
||||
String room = event.getRoom();
|
||||
int width = event.getWidth();
|
||||
int height = event.getHeight();
|
||||
int frameRate = event.getFrameRate();
|
||||
|
||||
IScope scope = app.getAppScope().getScope(room);
|
||||
|
||||
log.debug("Created stream {}", scope.getName());
|
||||
return new DeskShareStream(scope, room, width, height, frameRate);
|
||||
}
|
||||
|
||||
public void setDeskShareApplication(DeskShareApplication app) {
|
||||
this.app = app;
|
||||
if (app == null) {
|
||||
log.error("DeskShareApplication is NULL!!!");
|
||||
} else {
|
||||
log.debug("DeskShareApplication is NOT NULL!!!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.so.ISharedObject;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class StreamerGateway {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(StreamerGateway.class, "deskshare");
|
||||
|
||||
private final Map<String, DeskShareStream> streamsMap;
|
||||
private StreamFactory streamFactory;
|
||||
private DeskShareApplication deskShareApp;
|
||||
|
||||
public StreamerGateway() {
|
||||
streamsMap = new ConcurrentHashMap<String, DeskShareStream>();
|
||||
}
|
||||
|
||||
public void onCaptureStartEvent(CaptureStartEvent event) {
|
||||
log.debug("Creating stream " + event.getRoom());
|
||||
|
||||
DeskShareStream stream = streamFactory.createStream(event);
|
||||
|
||||
streamsMap.put(event.getRoom(), stream);
|
||||
stream.start();
|
||||
|
||||
//notify the clients in the room that the stream has now started broadcasting.
|
||||
ISharedObject deskSO = deskShareApp.getSharedObject(stream.getScope(), "deskSO");
|
||||
deskSO.sendMessage("appletStarted" , new ArrayList<Object>());
|
||||
|
||||
}
|
||||
|
||||
public void onCaptureEndEvent(CaptureEndEvent event) {
|
||||
DeskShareStream ds = streamsMap.remove(event.getRoom());
|
||||
if (ds != null) {
|
||||
ds.stop();
|
||||
ds = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void onCaptureEvent(CaptureUpdateEvent event) {
|
||||
DeskShareStream ds = streamsMap.get(event.getRoom());
|
||||
if (ds != null) {
|
||||
ds.accept(event);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isStreaming(String room){
|
||||
DeskShareStream ds = streamsMap.get(room);
|
||||
if (ds != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getRoomVideoWidth(String room){
|
||||
DeskShareStream ds = streamsMap.get(room);
|
||||
if (ds != null) {
|
||||
return ds.getWidth();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getRoomVideoHeight(String room){
|
||||
DeskShareStream ds = streamsMap.get(room);
|
||||
if (ds != null) {
|
||||
return ds.getHeight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setStreamFactory(StreamFactory sf) {
|
||||
this.streamFactory = sf;
|
||||
}
|
||||
|
||||
public void setDeskShareApplication(DeskShareApplication app) {
|
||||
this.deskShareApp = app;
|
||||
}
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.servlet;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.bigbluebutton.deskshare.CaptureEndEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureEvents;
|
||||
import org.bigbluebutton.deskshare.CaptureUpdateEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureStartEvent;
|
||||
import org.bigbluebutton.deskshare.CapturedScreen;
|
||||
import org.bigbluebutton.deskshare.StreamerGateway;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
|
||||
|
||||
public class TunnelController extends MultiActionController {
|
||||
private static Logger log = Red5LoggerFactory.getLogger(TunnelController.class, "deskshare");
|
||||
|
||||
private StreamerGateway streamerGateway;
|
||||
private boolean hasGateway = false;
|
||||
|
||||
public ModelAndView screenCaptureHandler(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
String event = request.getParameterValues("event")[0];
|
||||
System.out.println("Got screenCaptureStart request for event " + event);
|
||||
|
||||
int captureRequest = Integer.valueOf(request.getParameterValues("event")[0]).intValue();
|
||||
|
||||
if (CaptureEvents.CAPTURE_START.getEvent() == captureRequest) {
|
||||
handleCaptureStartRequest(request, response);
|
||||
} else if (CaptureEvents.CAPTURE_UPDATE.getEvent() == captureRequest) {
|
||||
handleCaptureUpdateRequest(request, response);
|
||||
} else if (CaptureEvents.CAPTURE_END.getEvent() == captureRequest) {
|
||||
handleCaptureEndRequest(request, response);
|
||||
} else {
|
||||
log.debug("Cannot handle screen capture event " + captureRequest);
|
||||
System.out.println("Cannot handle screen capture event " + captureRequest);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void handleCaptureStartRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String room = request.getParameterValues("room")[0];
|
||||
log.warn("Got screenCaptureStart request for room {}", room);
|
||||
|
||||
String videoInfo = request.getParameterValues("videoInfo")[0];
|
||||
log.warn("Received image from videoInfo {}", videoInfo);
|
||||
|
||||
String[] screenDimensions = videoInfo.split("x");
|
||||
int width = Integer.parseInt(screenDimensions[0]);
|
||||
int height = Integer.parseInt(screenDimensions[1]);
|
||||
int frameRate = Integer.parseInt(screenDimensions[2]);
|
||||
|
||||
if (! hasGateway) {
|
||||
streamerGateway = getStreamerGateway();
|
||||
hasGateway = true;
|
||||
}
|
||||
|
||||
CaptureStartEvent event = new CaptureStartEvent(room, width, height, frameRate);
|
||||
|
||||
streamerGateway.onCaptureStartEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void handleCaptureUpdateRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
// MultipartFile is a copy of file in memory, not in file system
|
||||
MultipartFile multipartFile = multipartRequest.getFile("tile");
|
||||
|
||||
byte[] tile = multipartFile.getBytes();
|
||||
|
||||
InputStream imageData = new ByteArrayInputStream(tile);
|
||||
//re-Create a BufferedImage we received over the network
|
||||
BufferedImage image = ImageIO.read(imageData);
|
||||
log.debug("Received tile size {}", tile.length);
|
||||
|
||||
String room = request.getParameterValues("room")[0];
|
||||
log.debug("Received image from room {}", room);
|
||||
String tileInfo = request.getParameterValues("tileInfo")[0];
|
||||
log.debug("Received image from tileInfo {}", tileInfo);
|
||||
|
||||
String[] tileDesc = tileInfo.split("x");
|
||||
int width = Integer.parseInt(tileDesc[0]);
|
||||
int height = Integer.parseInt(tileDesc[1]);
|
||||
int x = Integer.parseInt(tileDesc[2]);
|
||||
int y = Integer.parseInt(tileDesc[3]);
|
||||
int pos = Integer.parseInt(tileDesc[4]);
|
||||
|
||||
if (! hasGateway) {
|
||||
streamerGateway = getStreamerGateway();
|
||||
hasGateway = true;
|
||||
}
|
||||
|
||||
CaptureUpdateEvent event = new CaptureUpdateEvent(image, room, width, height, x, y, pos);
|
||||
|
||||
streamerGateway.onCaptureEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void handleCaptureEndRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
String room = request.getParameterValues("room")[0];
|
||||
log.warn("Got screenCaptureEnd request for room {}", room);
|
||||
|
||||
if (! hasGateway) {
|
||||
streamerGateway = getStreamerGateway();
|
||||
hasGateway = true;
|
||||
}
|
||||
|
||||
CaptureEndEvent event = new CaptureEndEvent(room);
|
||||
|
||||
streamerGateway.onCaptureEndEvent(event);
|
||||
|
||||
}
|
||||
|
||||
private void handleCaptureStartRequest() {
|
||||
|
||||
}
|
||||
|
||||
private void handleCaptureUpdateRequest() {
|
||||
|
||||
}
|
||||
|
||||
private void handleCaptureEndRequest() {
|
||||
|
||||
}
|
||||
|
||||
private void sendCaptureEndEvent(String room) {
|
||||
streamerGateway.onCaptureEndEvent(new CaptureEndEvent(room));
|
||||
}
|
||||
|
||||
private void sendCaptureEvent(CapturedScreen cs) {
|
||||
// streamerGateway.onCaptureEvent(new CaptureUpdateEvent(cs));
|
||||
}
|
||||
|
||||
private void sendCaptureStartEvent(CapturedScreen cs) {
|
||||
|
||||
// streamerGateway.onCaptureStartEvent(new CaptureStartEvent(cs));
|
||||
}
|
||||
|
||||
private StreamerGateway getStreamerGateway() {
|
||||
//Get the servlet context
|
||||
ServletContext ctx = getServletContext();
|
||||
log.info("Got the servlet context: {}", ctx);
|
||||
|
||||
//Grab a reference to the application context
|
||||
ApplicationContext appCtx = (ApplicationContext) ctx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
|
||||
log.info("Got the application context: {}", appCtx);
|
||||
|
||||
//Get the bean holding the parameter
|
||||
StreamerGateway streamerGateway = (StreamerGateway) appCtx.getBean("streamerGateway");
|
||||
if (streamerGateway != null) {
|
||||
log.info("Got the streamerGateway context: {}", appCtx);
|
||||
}
|
||||
return streamerGateway;
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import org.apache.mina.core.service.IoHandlerAdapter;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.bigbluebutton.deskshare.CaptureEndEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureUpdateEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureStartEvent;
|
||||
import org.bigbluebutton.deskshare.CapturedScreen;
|
||||
import org.bigbluebutton.deskshare.StreamerGateway;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class DebugScreenCaptureMessageHandler extends IoHandlerAdapter {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(DebugScreenCaptureMessageHandler.class, "deskshare");
|
||||
|
||||
|
||||
@Override
|
||||
public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
|
||||
{
|
||||
log.warn(cause.toString());
|
||||
cause.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceived( IoSession session, Object message ) throws Exception
|
||||
{
|
||||
log.debug("Message Received " + (String) message);
|
||||
/*
|
||||
CapturedScreen cs = (CapturedScreen) message;
|
||||
String room = cs.getRoom();
|
||||
log.debug("Got room {}", room);
|
||||
|
||||
if (session.containsAttribute("room")) {
|
||||
sendCaptureEvent(cs);
|
||||
} else {
|
||||
session.setAttribute("room", room);
|
||||
sendCaptureStartEvent(cs);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionIdle( IoSession session, IdleStatus status ) throws Exception
|
||||
{
|
||||
log.debug( "IDLE " + session.getIdleCount( status ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionCreated(IoSession session) throws Exception {
|
||||
log.debug("Session Created");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionOpened(IoSession session) throws Exception {
|
||||
log.debug("Session Opened.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionClosed(IoSession session) throws Exception {
|
||||
log.debug("Session Closed.");
|
||||
String room = (String) session.getAttribute("room");
|
||||
sendCaptureEndEvent(room);
|
||||
}
|
||||
|
||||
private void sendCaptureEndEvent(String room) {
|
||||
|
||||
}
|
||||
|
||||
private void sendCaptureEvent(CapturedScreen cs) {
|
||||
|
||||
}
|
||||
|
||||
private void sendCaptureStartEvent(CapturedScreen cs) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.apache.mina.core.service.IoAcceptor;
|
||||
import org.apache.mina.core.service.IoHandlerAdapter;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
import org.apache.mina.filter.codec.ProtocolCodecFilter;
|
||||
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
||||
public class DeskShareServer {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(DeskShareServer.class, "deskshare");
|
||||
|
||||
private static final int PORT = 9123;
|
||||
|
||||
private IoHandlerAdapter screenCaptureHandler;
|
||||
private IoAcceptor acceptor;
|
||||
|
||||
public void start()
|
||||
{
|
||||
acceptor = new NioSocketAcceptor();
|
||||
acceptor.getFilterChain().addLast( "codec", new ProtocolCodecFilter(new ScreenCaptureProtocolCodecFactory()));
|
||||
|
||||
acceptor.setHandler( screenCaptureHandler);
|
||||
acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE, 10 );
|
||||
try {
|
||||
acceptor.bind( new InetSocketAddress(PORT) );
|
||||
} catch (IOException e) {
|
||||
log.error("IOException while binding to port {}", PORT);
|
||||
}
|
||||
}
|
||||
|
||||
public void setScreenCaptureHandler(IoHandlerAdapter screenCaptureHandler) {
|
||||
this.screenCaptureHandler = screenCaptureHandler;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
acceptor.unbind();
|
||||
acceptor.dispose();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
public class DeskShareServerMain {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
DeskShareServer server = new DeskShareServer();
|
||||
|
||||
server.setScreenCaptureHandler(new DebugScreenCaptureMessageHandler());
|
||||
server.start();
|
||||
System.out.println("Server starting");
|
||||
while (true) {}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.apache.mina.filter.codec.ProtocolEncoder;
|
||||
import org.apache.mina.filter.codec.ProtocolEncoderOutput;
|
||||
|
||||
public class NullProtocolEncoder implements ProtocolEncoder {
|
||||
|
||||
public void dispose(IoSession in) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void encode(IoSession session, Object message, ProtocolEncoderOutput out)
|
||||
throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import org.apache.mina.core.service.IoHandlerAdapter;
|
||||
import org.apache.mina.core.session.IdleStatus;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.bigbluebutton.deskshare.CaptureEndEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureMessage;
|
||||
import org.bigbluebutton.deskshare.CaptureUpdateEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureStartEvent;
|
||||
import org.bigbluebutton.deskshare.ICaptureEvent;
|
||||
import org.bigbluebutton.deskshare.StreamerGateway;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class ScreenCaptureMessageHandler extends IoHandlerAdapter {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(ScreenCaptureMessageHandler.class, "deskshare");
|
||||
|
||||
private StreamerGateway streamerGateway;
|
||||
|
||||
@Override
|
||||
public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
|
||||
{
|
||||
log.warn(cause.toString() + " \n " + cause.getMessage());
|
||||
cause.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageReceived( IoSession session, Object message ) throws Exception
|
||||
{
|
||||
CaptureMessage msgType = ((ICaptureEvent) message).getMessageType();
|
||||
|
||||
if (msgType == CaptureMessage.CAPTURE_START) {
|
||||
log.debug("Received CAPTURE_START");
|
||||
sendCaptureStartEvent((CaptureStartEvent) message);
|
||||
} else if (msgType == CaptureMessage.CAPTURE_UPDATE) {
|
||||
// log.debug("Received CAPTURE_UPDATE");
|
||||
sendCaptureUpdateEvent((CaptureUpdateEvent) message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionIdle( IoSession session, IdleStatus status ) throws Exception
|
||||
{
|
||||
log.debug( "IDLE " + session.getIdleCount( status ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionCreated(IoSession session) throws Exception {
|
||||
log.debug("Session Created");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionOpened(IoSession session) throws Exception {
|
||||
log.debug("Session Opened.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sessionClosed(IoSession session) throws Exception {
|
||||
log.debug("Session Closed.");
|
||||
String room = (String) session.getAttribute("ROOM");
|
||||
sendCaptureEndEvent(room);
|
||||
}
|
||||
|
||||
private void sendCaptureEndEvent(String room) {
|
||||
streamerGateway.onCaptureEndEvent(new CaptureEndEvent(room));
|
||||
}
|
||||
|
||||
private void sendCaptureUpdateEvent(CaptureUpdateEvent event) {
|
||||
streamerGateway.onCaptureEvent(event);
|
||||
}
|
||||
|
||||
private void sendCaptureStartEvent(CaptureStartEvent event) {
|
||||
streamerGateway.onCaptureStartEvent(event);
|
||||
}
|
||||
|
||||
public void setStreamerGateway(StreamerGateway sg) {
|
||||
streamerGateway = sg;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.apache.mina.filter.codec.ProtocolCodecFactory;
|
||||
import org.apache.mina.filter.codec.ProtocolDecoder;
|
||||
import org.apache.mina.filter.codec.ProtocolEncoder;
|
||||
|
||||
public class ScreenCaptureProtocolCodecFactory implements ProtocolCodecFactory {
|
||||
private ProtocolEncoder encoder;
|
||||
private ProtocolDecoder decoder;
|
||||
|
||||
public ScreenCaptureProtocolCodecFactory() {
|
||||
encoder = new NullProtocolEncoder();
|
||||
decoder = new ScreenCaptureProtocolDecoder();
|
||||
}
|
||||
|
||||
public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {
|
||||
return encoder;
|
||||
}
|
||||
|
||||
public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception {
|
||||
return decoder;
|
||||
}
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Affero General Public License as published by the Free Software
|
||||
* Foundation; either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
package org.bigbluebutton.deskshare.socket;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
|
||||
import org.apache.mina.filter.codec.ProtocolDecoderOutput;
|
||||
import org.bigbluebutton.deskshare.CaptureStartEvent;
|
||||
import org.bigbluebutton.deskshare.CaptureUpdateEvent;
|
||||
import org.bigbluebutton.deskshare.CapturedScreen;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class ScreenCaptureProtocolDecoder extends CumulativeProtocolDecoder {
|
||||
final private Logger log = Red5LoggerFactory.getLogger(ScreenCaptureProtocolDecoder.class, "deskshare");
|
||||
|
||||
private static final String ROOM = "ROOM";
|
||||
private static final String VIDEO_INFO = "VIDEO_INFO";
|
||||
private static final String TILE_INFO = "TILE_INFO";
|
||||
private static final int CAPTURE_START = 0;
|
||||
private static final int CAPTURE_UPDATE = 1;
|
||||
private static final int CAPTURE_END = 2;
|
||||
|
||||
private static final String MESSAGE_TYPE = "MESSAGE_TYPE";
|
||||
|
||||
private static final String TILE_IMAGE = "TILE_IMAGE";
|
||||
|
||||
protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
|
||||
|
||||
if (session.containsAttribute(MESSAGE_TYPE)) {
|
||||
Integer messageType = (Integer) session.getAttribute(MESSAGE_TYPE);
|
||||
switch (messageType.intValue()) {
|
||||
case CAPTURE_START:
|
||||
return decodeCaptureStart(session, in, out);
|
||||
case CAPTURE_UPDATE:
|
||||
return decodeCaptureUpdate(session, in, out);
|
||||
case CAPTURE_END:
|
||||
// decodeCaptureEnd(session, in, out);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (in.remaining() < 20) return false;
|
||||
int message = in.getInt();
|
||||
// log.debug("Got message " + message);
|
||||
session.setAttribute(MESSAGE_TYPE, new Integer(message));
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean decodeCaptureStart(IoSession session, IoBuffer in, ProtocolDecoderOutput out) {
|
||||
if (session.containsAttribute(ROOM)) {
|
||||
if (decodeVideoInfo(session, in)) {
|
||||
sendCaptureStartMessage(session, out);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
decodeRoom(session, in);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void decodeRoom(IoSession session, IoBuffer in) {
|
||||
if (in.remaining() < 200) return;
|
||||
|
||||
int len = in.getInt();
|
||||
String room = decodeString(len, in);
|
||||
if (room != "") {
|
||||
session.setAttribute(ROOM, room);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean decodeVideoInfo(IoSession session, IoBuffer in) {
|
||||
if (in.remaining() < 200) return false;
|
||||
|
||||
int len = in.getInt();
|
||||
String videoInfo = decodeString(len, in);
|
||||
if (videoInfo != "") {
|
||||
session.setAttribute(VIDEO_INFO, videoInfo);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String decodeString(int length, IoBuffer in) {
|
||||
try {
|
||||
if (in.remaining() >= length) {
|
||||
return in.getString(length, Charset.forName( "UTF-8" ).newDecoder());
|
||||
}
|
||||
} catch (CharacterCodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
private void sendCaptureStartMessage(IoSession session, ProtocolDecoderOutput out) {
|
||||
String room = (String) session.getAttribute(ROOM);
|
||||
String videoInfo = (String) session.getAttribute(VIDEO_INFO);
|
||||
log.debug("Room " + room + " videoInfo " + videoInfo);
|
||||
|
||||
//Get the screen dimensions, i.e. the resolution of the video we need to create
|
||||
String[] screenDimensions = videoInfo.split("x");
|
||||
int width = Integer.parseInt(screenDimensions[0]);
|
||||
int height = Integer.parseInt(screenDimensions[1]);
|
||||
int frameRate = Integer.parseInt(screenDimensions[2]);
|
||||
|
||||
CaptureStartEvent cse = new CaptureStartEvent(room, width, height, frameRate);
|
||||
out.write(cse);
|
||||
clearMessage(session);
|
||||
}
|
||||
|
||||
private boolean decodeCaptureUpdate(IoSession session, IoBuffer in, ProtocolDecoderOutput out) {
|
||||
if (! session.containsAttribute(TILE_INFO)) {
|
||||
return decodeTileInfo(session, in);
|
||||
} else {
|
||||
if (decodeTile(session, in)) {
|
||||
sendCaptureUpdateMessage(session, out);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean decodeTileInfo(IoSession session, IoBuffer in) {
|
||||
if (in.remaining() < 200) return false;
|
||||
|
||||
int len = in.getInt();
|
||||
String tileInfo = decodeString(len, in);
|
||||
|
||||
if (tileInfo != "") {
|
||||
session.setAttribute(TILE_INFO, tileInfo);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean decodeTile(IoSession session, IoBuffer in) {
|
||||
if (in.remaining() < 40) return false;
|
||||
|
||||
int start = in.position();
|
||||
|
||||
int tileLength = in.getInt();
|
||||
|
||||
if (in.remaining() >= tileLength) {
|
||||
byte[] bytes = new byte[tileLength];
|
||||
// log.debug("Reading image with length {}", bytes.length);
|
||||
in.get(bytes);
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
|
||||
|
||||
try {
|
||||
BufferedImage image = ImageIO.read(bais);
|
||||
session.setAttribute(TILE_IMAGE, image);
|
||||
} catch (IOException e) {
|
||||
log.error("Failed to get captured screen for room ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// log.debug("Can't process image yet . " + tileLength);
|
||||
in.position(start);
|
||||
return false;
|
||||
}
|
||||
|
||||
private void sendCaptureUpdateMessage(IoSession session, ProtocolDecoderOutput out) {
|
||||
String room = (String) session.getAttribute(ROOM);
|
||||
String tileInfo = (String) session.getAttribute(TILE_INFO);
|
||||
// log.debug("TILE INFO " + tileInfo);
|
||||
|
||||
//Get the tile dimensions, i.e. the resolution of the video we need to create
|
||||
String[] tileDim = tileInfo.split("x");
|
||||
int width = Integer.parseInt(tileDim[0]);
|
||||
int height = Integer.parseInt(tileDim[1]);
|
||||
int x = Integer.parseInt(tileDim[2]);
|
||||
int y = Integer.parseInt(tileDim[3]);
|
||||
int pos = Integer.parseInt(tileDim[4]);
|
||||
|
||||
BufferedImage tile = (BufferedImage) session.getAttribute(TILE_IMAGE);
|
||||
CaptureUpdateEvent cse = new CaptureUpdateEvent(tile, room, width, height, x, y, pos);
|
||||
out.write(cse);
|
||||
reset(session);
|
||||
}
|
||||
|
||||
private void clearMessage(IoSession session) {
|
||||
session.removeAttribute(MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
private void reset(IoSession session) {
|
||||
session.removeAttribute(TILE_INFO);
|
||||
session.removeAttribute(TILE_IMAGE);
|
||||
clearMessage(session);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="DESKSHARE" class="ch.qos.logback.core.FileAppender">
|
||||
<File>log/deskshare.log</File>
|
||||
<Append>false</Append>
|
||||
<Encoding>UTF-8</Encoding>
|
||||
<BufferedIO>false</BufferedIO>
|
||||
<ImmediateFlush>true</ImmediateFlush>
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<Pattern>
|
||||
%date [%thread] %-5level %logger{35} - %msg%n
|
||||
</Pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="DESKSHARE" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,2 @@
|
||||
webapp.contextPath=/deskShare
|
||||
webapp.virtualHosts=*, localhost, localhost:8088, 127.0.0.1:8088
|
51
bbb-apps-deskshare/src/main/webapp/WEB-INF/red5-web.xml
Normal file
51
bbb-apps-deskshare/src/main/webapp/WEB-INF/red5-web.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:lang="http://www.springframework.org/schema/lang"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd">
|
||||
|
||||
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="/WEB-INF/red5-web.properties" />
|
||||
</bean>
|
||||
|
||||
<bean id="web.context" class="org.red5.server.Context"
|
||||
autowire="byType" />
|
||||
|
||||
<bean id="web.scope" class="org.red5.server.WebScope"
|
||||
init-method="register">
|
||||
<property name="server" ref="red5.server" />
|
||||
<property name="parent" ref="global.scope" />
|
||||
<property name="context" ref="web.context" />
|
||||
<property name="handler" ref="web.handler" />
|
||||
<property name="contextPath" value="${webapp.contextPath}" />
|
||||
<property name="virtualHosts" value="${webapp.virtualHosts}" />
|
||||
</bean>
|
||||
|
||||
<bean id="web.handler" class="org.bigbluebutton.deskshare.DeskShareApplication">
|
||||
<property name="deskShareServer" ref="deskShareServer"/>
|
||||
</bean>
|
||||
|
||||
<bean id="deskshare.service" class="org.bigbluebutton.deskshare.DeskShareService">
|
||||
<property name="streamerGateway" ref="streamerGateway"/>
|
||||
</bean>
|
||||
|
||||
<bean id="deskShareServer" class="org.bigbluebutton.deskshare.socket.DeskShareServer" >
|
||||
<property name="screenCaptureHandler" ref="screenCaptureHandler"/>
|
||||
</bean>
|
||||
|
||||
<!-- The IoHandler implementation -->
|
||||
<bean id="screenCaptureHandler" class="org.bigbluebutton.deskshare.socket.ScreenCaptureMessageHandler">
|
||||
<property name="streamerGateway" ref="streamerGateway"/>
|
||||
</bean>
|
||||
|
||||
<bean id="streamerGateway" class="org.bigbluebutton.deskshare.StreamerGateway">
|
||||
<property name="streamFactory" ref="streamFactory"/>
|
||||
<property name="deskShareApplication" ref="web.handler"/>
|
||||
</bean>
|
||||
|
||||
<bean id="streamFactory" class="org.bigbluebutton.deskshare.StreamFactory">
|
||||
<property name="deskShareApplication" ref="web.handler"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:lang="http://www.springframework.org/schema/lang"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd">
|
||||
|
||||
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
|
||||
|
||||
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="defaultHandler" ref="tunnelController"/>
|
||||
</bean>
|
||||
|
||||
<bean id="tunnelController" class="org.bigbluebutton.deskshare.servlet.TunnelController">
|
||||
<property name="methodNameResolver">
|
||||
<bean class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/screenCapture">screenCaptureHandler</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
53
bbb-apps-deskshare/src/main/webapp/WEB-INF/web.xml
Normal file
53
bbb-apps-deskshare/src/main/webapp/WEB-INF/web.xml
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<web-app
|
||||
xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<display-name>deskShare</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>webAppRootKey</param-name>
|
||||
<param-value>/deskshare</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.red5.logging.ContextLoggingListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<filter>
|
||||
<filter-name>LoggerContextFilter</filter-name>
|
||||
<filter-class>org.red5.logging.LoggerContextFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>LoggerContextFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener-->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>tunnel</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<!-- maps the sample dispatcher to *.form -->
|
||||
<servlet-mapping>
|
||||
<servlet-name>tunnel</servlet-name>
|
||||
<url-pattern>/tunnel/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Forbidden</web-resource-name>
|
||||
<url-pattern>/streams/*</url-pattern>
|
||||
</web-resource-collection>
|
||||
<auth-constraint/>
|
||||
</security-constraint>
|
||||
|
||||
</web-app>
|
Loading…
Reference in New Issue
Block a user