├── .gitignore ├── LICENCE ├── README.md ├── android_streaming_client ├── .gitignore ├── build.gradle ├── doc │ ├── allclasses-frame.html │ ├── allclasses-noframe.html │ ├── com │ │ └── c77 │ │ │ └── androidstreamingclient │ │ │ └── lib │ │ │ ├── exceptions │ │ │ ├── RtpPlayerException.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── rtp │ │ │ ├── DataPacketTracer.html │ │ │ ├── H264DataPacket.NalType.html │ │ │ ├── H264DataPacket.html │ │ │ ├── H264Frame.html │ │ │ ├── MediaExtractor.html │ │ │ ├── NoDelayRtpMediaBuffer.html │ │ │ ├── OriginalRtpMediaExtractor.html │ │ │ ├── RtpMediaBuffer.State.html │ │ │ ├── RtpMediaBuffer.html │ │ │ ├── RtpMediaBufferWithJitterAvoidance.html │ │ │ ├── RtpMediaDecoder.html │ │ │ ├── RtpMediaExtractor.html │ │ │ ├── RtpMediaJitterBuffer.html │ │ │ ├── buffer │ │ │ │ ├── MinDelayRtpMediaBuffer.html │ │ │ │ ├── RtpMediaBuffer.State.html │ │ │ │ ├── RtpMediaBuffer.html │ │ │ │ ├── TimeWindowRtpMediaBuffer.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── tests │ │ │ ├── RtpMediaBufferWithJitterAvoidanceTest.html │ │ │ ├── RtpMediaJitterBufferTest.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ └── video │ │ │ ├── BufferedSample.html │ │ │ ├── Decoder.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── help-doc.html │ ├── index-files │ │ ├── index-1.html │ │ ├── index-10.html │ │ ├── index-11.html │ │ ├── index-12.html │ │ ├── index-13.html │ │ ├── index-14.html │ │ ├── index-15.html │ │ ├── index-16.html │ │ ├── index-17.html │ │ ├── index-2.html │ │ ├── index-3.html │ │ ├── index-4.html │ │ ├── index-5.html │ │ ├── index-6.html │ │ ├── index-7.html │ │ ├── index-8.html │ │ └── index-9.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── overview-tree.html │ ├── package-list │ ├── resources │ │ ├── background.gif │ │ ├── tab.gif │ │ ├── titlebar.gif │ │ └── titlebar_end.gif │ ├── serialized-form.html │ └── stylesheet.css ├── gradle.properties ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── c77 │ └── androidstreamingclient │ └── lib │ ├── exceptions │ └── RtpPlayerException.java │ ├── rtp │ ├── DataPacketTracer.java │ ├── MediaExtractor.java │ ├── RtpMediaDecoder.java │ ├── RtpMediaExtractor.java │ └── buffer │ │ ├── MinDelayRtpMediaBuffer.java │ │ ├── RtpMediaBuffer.java │ │ └── TimeWindowRtpMediaBuffer.java │ ├── tests │ └── RtpMediaJitterBufferTest.java │ └── video │ ├── BufferedSample.java │ └── Decoder.java ├── build.gradle ├── efflux ├── .gitignore ├── build.gradle ├── doc │ ├── allclasses-frame.html │ ├── allclasses-noframe.html │ ├── com │ │ └── biasedbit │ │ │ └── efflux │ │ │ ├── SsrcListener.html │ │ │ ├── logging │ │ │ ├── Logger.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── network │ │ │ ├── ControlHandler.html │ │ │ ├── ControlPacketDecoder.html │ │ │ ├── ControlPacketEncoder.html │ │ │ ├── ControlPacketReceiver.html │ │ │ ├── DataHandler.html │ │ │ ├── DataPacketDecoder.html │ │ │ ├── DataPacketEncoder.html │ │ │ ├── DataPacketReceiver.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── packet │ │ │ ├── AbstractReportPacket.html │ │ │ ├── AppDataPacket.html │ │ │ ├── ByePacket.html │ │ │ ├── CompoundControlPacket.html │ │ │ ├── ControlPacket.Type.html │ │ │ ├── ControlPacket.html │ │ │ ├── DataPacket.html │ │ │ ├── ReceiverReportPacket.html │ │ │ ├── ReceptionReport.html │ │ │ ├── RtpVersion.html │ │ │ ├── SdesChunk.html │ │ │ ├── SdesChunkItem.Type.html │ │ │ ├── SdesChunkItem.html │ │ │ ├── SdesChunkItems.html │ │ │ ├── SdesChunkPrivItem.html │ │ │ ├── SenderReportPacket.html │ │ │ ├── SourceDescriptionPacket.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── participant │ │ │ ├── DefaultParticipantDatabase.html │ │ │ ├── ParticipantDatabase.html │ │ │ ├── ParticipantEventListener.html │ │ │ ├── ParticipantOperation.html │ │ │ ├── RtpParticipant.html │ │ │ ├── RtpParticipantInfo.html │ │ │ ├── SingleParticipantDatabase.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ ├── session │ │ │ ├── AbstractRtpSession.html │ │ │ ├── MultiParticipantSession.html │ │ │ ├── RtpSession.html │ │ │ ├── RtpSessionControlListener.html │ │ │ ├── RtpSessionDataListener.html │ │ │ ├── RtpSessionEventListener.html │ │ │ ├── SingleParticipantSession.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ │ └── util │ │ │ ├── ByteUtils.html │ │ │ ├── TimeUtils.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── help-doc.html │ ├── index-files │ │ ├── index-1.html │ │ ├── index-10.html │ │ ├── index-11.html │ │ ├── index-12.html │ │ ├── index-13.html │ │ ├── index-14.html │ │ ├── index-15.html │ │ ├── index-16.html │ │ ├── index-17.html │ │ ├── index-18.html │ │ ├── index-19.html │ │ ├── index-2.html │ │ ├── index-20.html │ │ ├── index-21.html │ │ ├── index-3.html │ │ ├── index-4.html │ │ ├── index-5.html │ │ ├── index-6.html │ │ ├── index-7.html │ │ ├── index-8.html │ │ └── index-9.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── overview-tree.html │ ├── package-list │ ├── resources │ │ ├── background.gif │ │ ├── tab.gif │ │ ├── titlebar.gif │ │ └── titlebar_end.gif │ └── stylesheet.css ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── biasedbit │ └── efflux │ ├── SsrcListener.java │ ├── logging │ └── Logger.java │ ├── network │ ├── ControlHandler.java │ ├── ControlPacketDecoder.java │ ├── ControlPacketEncoder.java │ ├── ControlPacketReceiver.java │ ├── DataHandler.java │ ├── DataPacketDecoder.java │ ├── DataPacketEncoder.java │ └── DataPacketReceiver.java │ ├── packet │ ├── AbstractReportPacket.java │ ├── AppDataPacket.java │ ├── ByePacket.java │ ├── CompoundControlPacket.java │ ├── ControlPacket.java │ ├── DataPacket.java │ ├── ReceiverReportPacket.java │ ├── ReceptionReport.java │ ├── RtpVersion.java │ ├── SdesChunk.java │ ├── SdesChunkItem.java │ ├── SdesChunkItems.java │ ├── SdesChunkPrivItem.java │ ├── SenderReportPacket.java │ └── SourceDescriptionPacket.java │ ├── participant │ ├── DefaultParticipantDatabase.java │ ├── ParticipantDatabase.java │ ├── ParticipantEventListener.java │ ├── ParticipantOperation.java │ ├── RtpParticipant.java │ ├── RtpParticipantInfo.java │ └── SingleParticipantDatabase.java │ ├── session │ ├── AbstractRtpSession.java │ ├── MultiParticipantSession.java │ ├── RtpSession.java │ ├── RtpSessionControlListener.java │ ├── RtpSessionDataListener.java │ ├── RtpSessionEventListener.java │ └── SingleParticipantSession.java │ └── util │ ├── ByteUtils.java │ └── TimeUtils.java ├── example ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── configuration.ini │ ├── java │ └── com │ │ └── c77 │ │ └── androidstreamingclient │ │ └── example │ │ └── DecoderMainActivity.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ └── activity_main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── license_script ├── apply_license.bash └── license ├── maven_push.gradle └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .gradle 3 | .project 4 | .settings 5 | bin 6 | build 7 | build.xml 8 | gen 9 | local.properties 10 | gradle.properties 11 | proguard-project.txt 12 | drone_main/src/main/obj 13 | 14 | # These are Android Studio files, might be worth including these later. 15 | .idea 16 | *.iml 17 | build.log 18 | build-log.xml 19 | docs.iml 20 | .*.swp 21 | *.apk 22 | 23 | # Developer-specific system configuration defaults 24 | custom_defaults.ini 25 | -------------------------------------------------------------------------------- /android_streaming_client/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android_streaming_client/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | minSdkVersion 17 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | packagingOptions { 22 | exclude 'META-INF/LICENSE.txt' 23 | exclude 'META-INF/NOTICE.txt' 24 | } 25 | 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | 31 | dependencies { 32 | // compile 'Group:Artifact:Version' 33 | compile 'org.apache.directory.studio:org.apache.commons.codec:1.6' 34 | compile 'org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1' 35 | compile('com.creativa77:efflux:1.0.1') 36 | } 37 | 38 | task androidJavadocs(type: Javadoc) { 39 | source = android.sourceSets.main.java.srcDirs 40 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 41 | } 42 | 43 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { 44 | classifier = 'javadoc' 45 | from androidJavadocs.destinationDir 46 | } 47 | 48 | artifacts { 49 | archives androidJavadocsJar 50 | } 51 | 52 | apply from: '../maven_push.gradle' -------------------------------------------------------------------------------- /android_streaming_client/doc/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /android_streaming_client/doc/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 |

All Classes

12 |
13 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/exceptions/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.exceptions 7 | 8 | 9 | 10 | 11 |

com.c77.androidstreamingclient.lib.exceptions

12 |
13 |

Exceptions

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/exceptions/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.exceptions 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Package com.c77.androidstreamingclient.lib.exceptions

66 |
67 |
68 | 87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | 103 |
104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/exceptions/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.exceptions Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.c77.androidstreamingclient.lib.exceptions

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 88 |
89 | 90 |
91 | 92 | 93 | 94 | 95 | 104 |
105 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/rtp/buffer/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.rtp.buffer 7 | 8 | 9 | 10 | 11 |

com.c77.androidstreamingclient.lib.rtp.buffer

12 |
13 |

Interfaces

14 | 17 |

Classes

18 | 22 |

Enums

23 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/rtp/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.rtp 7 | 8 | 9 | 10 | 11 |

com.c77.androidstreamingclient.lib.rtp

12 |
13 |

Interfaces

14 | 17 |

Classes

18 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/tests/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.tests 7 | 8 | 9 | 10 | 11 |

com.c77.androidstreamingclient.lib.tests

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/tests/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.tests Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.c77.androidstreamingclient.lib.tests

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/video/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.video 7 | 8 | 9 | 10 | 11 |

com.c77.androidstreamingclient.lib.video

12 |
13 |

Interfaces

14 | 17 |

Classes

18 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /android_streaming_client/doc/com/c77/androidstreamingclient/lib/video/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.c77.androidstreamingclient.lib.video Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.c77.androidstreamingclient.lib.video

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 80 |

Interface Hierarchy

81 | 84 |
85 | 86 |
87 | 88 | 89 | 90 | 91 | 100 |
101 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /android_streaming_client/doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Deprecated API

66 |

Contents

67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /android_streaming_client/doc/index-files/index-11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
B C D F G L M R S T U V  65 | 66 | 67 |

U

68 |
69 |
useNio - Variable in class com.c77.androidstreamingclient.lib.rtp.RtpMediaDecoder
70 |
 
71 |
72 | B C D F G L M R S T U V 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /android_streaming_client/doc/index-files/index-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | U-Index 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
B C D G M R S T U V  65 | 66 | 67 |

U

68 |
69 |
useNio - Variable in class com.c77.androidstreamingclient.lib.rtp.RtpMediaDecoder
70 |
 
71 |
72 | B C D G M R S T U V 
73 | 74 |
75 | 76 | 77 | 78 | 79 | 88 |
89 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /android_streaming_client/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | <noscript> 68 | <div>JavaScript is disabled on your browser.</div> 69 | </noscript> 70 | <h2>Frame Alert</h2> 71 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /android_streaming_client/doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview List 7 | 8 | 9 | 10 | 11 |
All Classes
12 |
13 |

Packages

14 | 21 |
22 |

 

23 | 24 | 25 | -------------------------------------------------------------------------------- /android_streaming_client/doc/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 |
Packages 
PackageDescription
com.c77.androidstreamingclient.lib.exceptions 
com.c77.androidstreamingclient.lib.rtp 
com.c77.androidstreamingclient.lib.rtp.buffer 
com.c77.androidstreamingclient.lib.tests 
com.c77.androidstreamingclient.lib.video 
94 |
95 | 96 |
97 | 98 | 99 | 100 | 101 | 110 |
111 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /android_streaming_client/doc/package-list: -------------------------------------------------------------------------------- 1 | com.c77.androidstreamingclient.lib.exceptions 2 | com.c77.androidstreamingclient.lib.rtp 3 | com.c77.androidstreamingclient.lib.rtp.buffer 4 | com.c77.androidstreamingclient.lib.tests 5 | com.c77.androidstreamingclient.lib.video 6 | -------------------------------------------------------------------------------- /android_streaming_client/doc/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/android_streaming_client/doc/resources/background.gif -------------------------------------------------------------------------------- /android_streaming_client/doc/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/android_streaming_client/doc/resources/tab.gif -------------------------------------------------------------------------------- /android_streaming_client/doc/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/android_streaming_client/doc/resources/titlebar.gif -------------------------------------------------------------------------------- /android_streaming_client/doc/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/android_streaming_client/doc/resources/titlebar_end.gif -------------------------------------------------------------------------------- /android_streaming_client/doc/serialized-form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Serialized Form 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Serialized Form

66 |
67 |
68 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /android_streaming_client/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=AndroidStreamingClient Library 2 | POM_ARTIFACT_ID=android_streaming_client 3 | POM_PACKAGING=aar 4 | VERSION_NAME=1.0.6 5 | VERSION_CODE=7 -------------------------------------------------------------------------------- /android_streaming_client/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /opt/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/exceptions/RtpPlayerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.exceptions; 24 | 25 | /** 26 | * Exception thrown when an RTP player error occurs. 27 | * 28 | * @author Julian Cerruti 29 | */ 30 | public class RtpPlayerException extends Exception { 31 | public RtpPlayerException(String s) { 32 | super(s); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/rtp/DataPacketTracer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.rtp; 24 | 25 | import com.biasedbit.efflux.packet.DataPacket; 26 | import com.biasedbit.efflux.participant.RtpParticipantInfo; 27 | import com.biasedbit.efflux.session.RtpSession; 28 | import com.biasedbit.efflux.session.RtpSessionDataListener; 29 | 30 | import java.io.OutputStream; 31 | import java.io.PrintWriter; 32 | 33 | /** 34 | * Traces packages' data into a file while they arrive. 35 | * 36 | * @author Julian Cerruti 37 | */ 38 | public class DataPacketTracer implements RtpSessionDataListener { 39 | private final PrintWriter traceWriter; 40 | 41 | /** 42 | * Creates a tracer initializing the object where packet's data will be written 43 | * 44 | * @param out 45 | */ 46 | public DataPacketTracer(OutputStream out) { 47 | traceWriter = new PrintWriter(out); 48 | } 49 | 50 | /** 51 | * Writes packet's data when it arrives 52 | * 53 | * @param session 54 | * @param participant 55 | * @param packet 56 | */ 57 | @Override 58 | public void dataPacketReceived(RtpSession session, RtpParticipantInfo participant, DataPacket packet) { 59 | traceWriter.write(System.currentTimeMillis() + "," + packet.getSequenceNumber() + "," + packet.getTimestamp() + "\n"); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/rtp/MediaExtractor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.rtp; 24 | 25 | import android.media.MediaFormat; 26 | 27 | /** 28 | * Interface that defines basic behavior of a extractor. 29 | * 30 | * @author Julian Cerruti 31 | */ 32 | public interface MediaExtractor { 33 | // Think how to get CSD-0/CSD-1 codec-specific data chunks 34 | 35 | /** 36 | * Returns Android MediaFormat used to properly configure Android API decoder. 37 | * It depends on the codec configuration. 38 | * 39 | * @return Android MediaFormat for a given codec. 40 | */ 41 | MediaFormat getMediaFormat(); 42 | } 43 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/rtp/buffer/RtpMediaBuffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.rtp.buffer; 24 | 25 | import com.biasedbit.efflux.session.RtpSessionDataListener; 26 | 27 | /** 28 | * Interface that adds up a stop method to the RTP Session Data Listeners to assure the buffers 29 | * are closed properly. 30 | * 31 | * @author Julian Cerruti 32 | */ 33 | public interface RtpMediaBuffer extends RtpSessionDataListener { 34 | enum State { 35 | IDLE, // Just started. Didn't receive any packets yet 36 | WAITING, // Wait until there are enough frames 37 | STREAMING // Receiving packets 38 | } 39 | 40 | void stop(); 41 | } 42 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/video/BufferedSample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.video; 24 | 25 | import org.apache.commons.codec.binary.Hex; 26 | 27 | import java.nio.ByteBuffer; 28 | 29 | /** 30 | * Buffer wrapper that keeps timestamp and index of the RTP buffer. 31 | * 32 | * @author Julian Cerruti 33 | */ 34 | public class BufferedSample { 35 | private final ByteBuffer buffer; 36 | private final int index; 37 | 38 | private int sampleSize; 39 | private long rtpTimestamp; 40 | 41 | /** 42 | * Constructs a buffered sample given a buffer and an index. 43 | * 44 | * @param buffer 45 | * @param index 46 | */ 47 | public BufferedSample(ByteBuffer buffer, int index) { 48 | this.buffer = buffer; 49 | this.index = index; 50 | } 51 | 52 | /** 53 | * Retrieves the byte buffer. 54 | * 55 | * @return 56 | */ 57 | public ByteBuffer getBuffer() { 58 | return buffer; 59 | } 60 | 61 | /** 62 | * Retrieves the index corresponding to this one buffered sample 63 | * 64 | * @return 65 | */ 66 | public int getIndex() { 67 | return index; 68 | } 69 | 70 | /** 71 | * Retrieves the sample's size 72 | * 73 | * @return 74 | */ 75 | public int getSampleSize() { 76 | return sampleSize; 77 | } 78 | 79 | /** 80 | * Sets the sample buffer's size 81 | * 82 | * @param sampleSize 83 | */ 84 | public void setSampleSize(int sampleSize) { 85 | this.sampleSize = sampleSize; 86 | } 87 | 88 | /** 89 | * Retrieves presentation timestamp in microseconds. 90 | * 91 | * @return 92 | */ 93 | public long getPresentationTimeUs() { 94 | // NOTE: We need to convert from RTP timestamp to sampleTime as expected by MediaCodec 95 | return rtpTimestamp * 1000L / 90L; 96 | } 97 | 98 | /** 99 | * Retrieves RTP timestamp 100 | * 101 | * @return 102 | */ 103 | public long getRtpTimestamp() { 104 | return rtpTimestamp; 105 | } 106 | 107 | /** 108 | * Sets the sample buffer's timestamp 109 | * 110 | * @param rtpTimestamp 111 | */ 112 | public void setRtpTimestamp(long rtpTimestamp) { 113 | this.rtpTimestamp = rtpTimestamp; 114 | } 115 | 116 | /** 117 | * Retrieves a string with sample buffer's data 118 | * 119 | * @return 120 | */ 121 | @Override 122 | public String toString() { 123 | String res = "["; 124 | 125 | byte[] initialChunk = new byte[Math.min(16, sampleSize)]; 126 | 127 | int oldpos = buffer.position(); 128 | buffer.position(0); 129 | buffer.get(initialChunk); 130 | buffer.position(oldpos); 131 | res += new String(Hex.encodeHex(initialChunk)); 132 | 133 | res += "], size: " + sampleSize + ", pt: " + getPresentationTimeUs(); 134 | return res; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /android_streaming_client/src/main/java/com/c77/androidstreamingclient/lib/video/Decoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | package com.c77.androidstreamingclient.lib.video; 24 | 25 | import com.c77.androidstreamingclient.lib.exceptions.RtpPlayerException; 26 | 27 | /** 28 | * @author Julian Cerruti 29 | * 30 | * The Decoder interface defines the basic behavior expected from a Video Decoder 31 | */ 32 | public interface Decoder { 33 | /** 34 | * Retrieves a buffer from the decoder to be filled with data 35 | * @return a buffer from the decoder 36 | * @throws RtpPlayerException 37 | */ 38 | public BufferedSample getSampleBuffer() throws RtpPlayerException; 39 | 40 | /** 41 | * Makes the needed operations to decode a given frame 42 | * @param frame a new frame to be decoded 43 | * @throws Exception 44 | */ 45 | public void decodeFrame(BufferedSample frame) throws Exception; 46 | } 47 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | mavenCentral() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:1.0.0' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | mavenCentral() 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /efflux/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /efflux/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | minSdkVersion 17 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | dependencies { 27 | compile 'org.jboss.netty:netty:3.2.10.Final' 28 | compile 'eu.lp0.slf4j:slf4j-android:1.7.10-0' 29 | } 30 | 31 | apply from: '../maven_push.gradle' -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/logging/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.logging 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.logging

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/logging/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.logging 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Package com.biasedbit.efflux.logging

66 |
67 |
68 | 87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | 103 |
104 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/logging/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.logging Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.biasedbit.efflux.logging

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 96 |
97 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/network/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.network 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.network

12 |
13 |

Interfaces

14 | 18 |

Classes

19 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux

12 |
13 |

Interfaces

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Package com.biasedbit.efflux

66 |
67 |
68 | 85 |
86 | 87 |
88 | 89 | 90 | 91 | 92 | 101 |
102 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.biasedbit.efflux

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Interface Hierarchy

73 | 76 |
77 | 78 |
79 | 80 | 81 | 82 | 83 | 92 |
93 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/packet/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.packet 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.packet

12 |
13 |

Classes

14 | 30 |

Enums

31 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/participant/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.participant 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.participant

12 |
13 |

Interfaces

14 | 19 |

Classes

20 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/session/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.session 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.session

12 |
13 |

Interfaces

14 | 20 |

Classes

21 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/util/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.util 7 | 8 | 9 | 10 | 11 |

com.biasedbit.efflux.util

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/util/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.util 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Package com.biasedbit.efflux.util

66 |
67 |
68 | 89 |
90 | 91 |
92 | 93 | 94 | 95 | 96 | 105 |
106 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /efflux/doc/com/biasedbit/efflux/util/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | com.biasedbit.efflux.util Class Hierarchy 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Hierarchy For Package com.biasedbit.efflux.util

66 | Package Hierarchies: 67 | 70 |
71 |
72 |

Class Hierarchy

73 | 81 |
82 | 83 |
84 | 85 | 86 | 87 | 88 | 97 |
98 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /efflux/doc/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 |

Deprecated API

66 |

Contents

67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 83 |
84 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /efflux/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | <noscript> 68 | <div>JavaScript is disabled on your browser.</div> 69 | </noscript> 70 | <h2>Frame Alert</h2> 71 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /efflux/doc/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview List 7 | 8 | 9 | 10 | 11 |
All Classes
12 |
13 |

Packages

14 | 23 |
24 |

 

25 | 26 | 27 | -------------------------------------------------------------------------------- /efflux/doc/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview 7 | 8 | 9 | 10 | 11 | 17 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 35 |
36 | 63 | 64 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
Packages 
PackageDescription
com.biasedbit.efflux 
com.biasedbit.efflux.logging 
com.biasedbit.efflux.network 
com.biasedbit.efflux.packet 
com.biasedbit.efflux.participant 
com.biasedbit.efflux.session 
com.biasedbit.efflux.util 
102 |
103 | 104 |
105 | 106 | 107 | 108 | 109 | 118 |
119 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /efflux/doc/package-list: -------------------------------------------------------------------------------- 1 | com.biasedbit.efflux 2 | com.biasedbit.efflux.logging 3 | com.biasedbit.efflux.network 4 | com.biasedbit.efflux.packet 5 | com.biasedbit.efflux.participant 6 | com.biasedbit.efflux.session 7 | com.biasedbit.efflux.util 8 | -------------------------------------------------------------------------------- /efflux/doc/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/efflux/doc/resources/background.gif -------------------------------------------------------------------------------- /efflux/doc/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/efflux/doc/resources/tab.gif -------------------------------------------------------------------------------- /efflux/doc/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/efflux/doc/resources/titlebar.gif -------------------------------------------------------------------------------- /efflux/doc/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/efflux/doc/resources/titlebar_end.gif -------------------------------------------------------------------------------- /efflux/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /opt/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /efflux/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/SsrcListener.java: -------------------------------------------------------------------------------- 1 | package com.biasedbit.efflux; 2 | 3 | public interface SsrcListener { 4 | public void onSsrcChanged(); 5 | } 6 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/ControlHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.CompoundControlPacket; 21 | import org.jboss.netty.channel.ChannelHandlerContext; 22 | import org.jboss.netty.channel.ExceptionEvent; 23 | import org.jboss.netty.channel.MessageEvent; 24 | import org.jboss.netty.channel.SimpleChannelUpstreamHandler; 25 | 26 | import java.util.concurrent.atomic.AtomicInteger; 27 | 28 | /** 29 | * @author Bruno de Carvalho 30 | */ 31 | public class ControlHandler extends SimpleChannelUpstreamHandler { 32 | 33 | // constants ------------------------------------------------------------------------------------------------------ 34 | 35 | private static final Logger LOG = Logger.getLogger(ControlHandler.class); 36 | 37 | // internal vars -------------------------------------------------------------------------------------------------- 38 | 39 | private final AtomicInteger counter; 40 | private final ControlPacketReceiver receiver; 41 | 42 | // constructors --------------------------------------------------------------------------------------------------- 43 | 44 | public ControlHandler(ControlPacketReceiver receiver) { 45 | this.receiver = receiver; 46 | this.counter = new AtomicInteger(); 47 | } 48 | 49 | // SimpleChannelUpstreamHandler ----------------------------------------------------------------------------------- 50 | 51 | @Override 52 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 53 | if (e.getMessage() instanceof CompoundControlPacket) { 54 | this.receiver.controlPacketReceived(e.getRemoteAddress(), (CompoundControlPacket) e.getMessage()); 55 | } 56 | } 57 | 58 | @Override 59 | public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { 60 | // Just log and proceed... 61 | LOG.error("Caught exception on channel {}.", e.getCause(), e.getChannel()); 62 | } 63 | 64 | // public methods ------------------------------------------------------------------------------------------------- 65 | 66 | public int getPacketsReceived() { 67 | return this.counter.get(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/ControlPacketDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.CompoundControlPacket; 21 | import com.biasedbit.efflux.packet.ControlPacket; 22 | import org.jboss.netty.buffer.ChannelBuffer; 23 | import org.jboss.netty.channel.ChannelEvent; 24 | import org.jboss.netty.channel.ChannelHandlerContext; 25 | import org.jboss.netty.channel.ChannelUpstreamHandler; 26 | import org.jboss.netty.channel.Channels; 27 | import org.jboss.netty.channel.MessageEvent; 28 | 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | 32 | /** 33 | * @author Bruno de Carvalho 34 | */ 35 | public class ControlPacketDecoder implements ChannelUpstreamHandler { 36 | 37 | // constants ------------------------------------------------------------------------------------------------------ 38 | 39 | protected static final Logger LOG = Logger.getLogger(ControlPacketDecoder.class); 40 | 41 | // ChannelUpstreamHandler ----------------------------------------------------------------------------------------- 42 | 43 | public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { 44 | // Only handle MessageEvent. 45 | if (!(evt instanceof MessageEvent)) { 46 | ctx.sendUpstream(evt); 47 | return; 48 | } 49 | 50 | // Only decode if it's a ChannelBuffer. 51 | MessageEvent e = (MessageEvent) evt; 52 | if (!(e.getMessage() instanceof ChannelBuffer)) { 53 | return; 54 | } 55 | 56 | ChannelBuffer buffer = (ChannelBuffer) e.getMessage(); 57 | if ((buffer.readableBytes() % 4) != 0) { 58 | LOG.debug("Invalid RTCP packet received: total length should be multiple of 4 but is {}", 59 | buffer.readableBytes()); 60 | return; 61 | } 62 | 63 | // Usually 2 packets per UDP frame... 64 | List controlPacketList = new ArrayList(2); 65 | 66 | // While there's data to read, keep on decoding. 67 | while (buffer.readableBytes() > 0) { 68 | try { 69 | controlPacketList.add(ControlPacket.decode(buffer)); 70 | } catch (Exception e1) { 71 | LOG.debug("Exception caught while decoding RTCP packet.", e1); 72 | } 73 | } 74 | 75 | if (!controlPacketList.isEmpty()) { 76 | // Only send upwards when there were more than one valid decoded packets. 77 | // TODO shouldn't the whole compound packet be discarded when one of them has errors?! 78 | Channels.fireMessageReceived(ctx, new CompoundControlPacket(controlPacketList), e.getRemoteAddress()); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/ControlPacketEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.CompoundControlPacket; 21 | import com.biasedbit.efflux.packet.ControlPacket; 22 | import org.jboss.netty.buffer.ChannelBuffer; 23 | import org.jboss.netty.buffer.ChannelBuffers; 24 | import org.jboss.netty.channel.ChannelDownstreamHandler; 25 | import org.jboss.netty.channel.ChannelEvent; 26 | import org.jboss.netty.channel.ChannelHandler; 27 | import org.jboss.netty.channel.ChannelHandlerContext; 28 | import org.jboss.netty.channel.Channels; 29 | import org.jboss.netty.channel.MessageEvent; 30 | 31 | import java.util.List; 32 | 33 | /** 34 | * @author Bruno de Carvalho 35 | */ 36 | @ChannelHandler.Sharable 37 | public class ControlPacketEncoder implements ChannelDownstreamHandler { 38 | 39 | // constants ------------------------------------------------------------------------------------------------------ 40 | 41 | protected static final Logger LOG = Logger.getLogger(ControlPacketEncoder.class); 42 | 43 | // constructors --------------------------------------------------------------------------------------------------- 44 | 45 | private ControlPacketEncoder() { 46 | } 47 | 48 | // public static methods ------------------------------------------------------------------------------------------ 49 | 50 | public static ControlPacketEncoder getInstance() { 51 | return InstanceHolder.INSTANCE; 52 | } 53 | 54 | // ChannelDownstreamHandler --------------------------------------------------------------------------------------- 55 | 56 | @Override 57 | public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { 58 | if (!(evt instanceof MessageEvent)) { 59 | ctx.sendDownstream(evt); 60 | return; 61 | } 62 | 63 | MessageEvent e = (MessageEvent) evt; 64 | try { 65 | if (e.getMessage() instanceof ControlPacket) { 66 | Channels.write(ctx, e.getFuture(), ((ControlPacket) e.getMessage()).encode(), e.getRemoteAddress()); 67 | } else if (e.getMessage() instanceof CompoundControlPacket) { 68 | List packets = ((CompoundControlPacket) e.getMessage()).getControlPackets(); 69 | ChannelBuffer[] buffers = new ChannelBuffer[packets.size()]; 70 | for (int i = 0; i < buffers.length; i++) { 71 | buffers[i] = packets.get(i).encode(); 72 | } 73 | ChannelBuffer compoundBuffer = ChannelBuffers.wrappedBuffer(buffers); 74 | Channels.write(ctx, e.getFuture(), compoundBuffer, e.getRemoteAddress()); 75 | } 76 | } catch (Exception e1) { 77 | LOG.error("Failed to encode compound RTCP packet to send.", e1); 78 | } 79 | 80 | // Otherwise do nothing. 81 | } 82 | 83 | // private classes ------------------------------------------------------------------------------------------------ 84 | 85 | private static final class InstanceHolder { 86 | private static final ControlPacketEncoder INSTANCE = new ControlPacketEncoder(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/ControlPacketReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.packet.CompoundControlPacket; 20 | 21 | import java.net.SocketAddress; 22 | 23 | /** 24 | * @author Bruno de Carvalho 25 | */ 26 | public interface ControlPacketReceiver { 27 | 28 | void controlPacketReceived(SocketAddress origin, CompoundControlPacket packet); 29 | } 30 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/DataHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.DataPacket; 21 | import org.jboss.netty.channel.ChannelHandlerContext; 22 | import org.jboss.netty.channel.ExceptionEvent; 23 | import org.jboss.netty.channel.MessageEvent; 24 | import org.jboss.netty.channel.SimpleChannelUpstreamHandler; 25 | 26 | import java.util.concurrent.atomic.AtomicInteger; 27 | 28 | /** 29 | * @author Bruno de Carvalho 30 | */ 31 | public class DataHandler extends SimpleChannelUpstreamHandler { 32 | 33 | // constants ------------------------------------------------------------------------------------------------------ 34 | 35 | private static final Logger LOG = Logger.getLogger(DataHandler.class); 36 | 37 | // internal vars -------------------------------------------------------------------------------------------------- 38 | 39 | private final AtomicInteger counter; 40 | private final DataPacketReceiver receiver; 41 | 42 | // constructors --------------------------------------------------------------------------------------------------- 43 | 44 | public DataHandler(DataPacketReceiver receiver) { 45 | this.receiver = receiver; 46 | this.counter = new AtomicInteger(); 47 | } 48 | 49 | // SimpleChannelUpstreamHandler ----------------------------------------------------------------------------------- 50 | 51 | @Override 52 | public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { 53 | if (e.getMessage() instanceof DataPacket) { 54 | this.receiver.dataPacketReceived(e.getRemoteAddress(), (DataPacket) e.getMessage()); 55 | } 56 | } 57 | 58 | @Override 59 | public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { 60 | // Just log and proceed... 61 | LOG.error("Caught exception on channel {}.", e.getCause(), e.getChannel()); 62 | } 63 | 64 | // public methods ------------------------------------------------------------------------------------------------- 65 | 66 | public int getPacketsReceived() { 67 | return this.counter.get(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/DataPacketDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.DataPacket; 21 | import org.jboss.netty.buffer.ChannelBuffer; 22 | import org.jboss.netty.channel.Channel; 23 | import org.jboss.netty.channel.ChannelHandlerContext; 24 | import org.jboss.netty.handler.codec.oneone.OneToOneDecoder; 25 | 26 | /** 27 | * @author Bruno de Carvalho 28 | */ 29 | public class DataPacketDecoder extends OneToOneDecoder { 30 | 31 | // constants ------------------------------------------------------------------------------------------------------ 32 | 33 | protected static final Logger LOG = Logger.getLogger(OneToOneDecoder.class); 34 | 35 | // OneToOneDecoder ------------------------------------------------------------------------------------------------ 36 | 37 | @Override 38 | protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { 39 | if (!(msg instanceof ChannelBuffer)) { 40 | return null; 41 | } 42 | 43 | try { 44 | return DataPacket.decode((ChannelBuffer) msg); 45 | } catch (Exception e) { 46 | LOG.debug("Failed to decode RTP packet.", e); 47 | return null; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/DataPacketEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.packet.DataPacket; 20 | import org.jboss.netty.buffer.ChannelBuffers; 21 | import org.jboss.netty.channel.Channel; 22 | import org.jboss.netty.channel.ChannelHandler; 23 | import org.jboss.netty.channel.ChannelHandlerContext; 24 | import org.jboss.netty.handler.codec.oneone.OneToOneEncoder; 25 | 26 | /** 27 | * @author Bruno de Carvalho 28 | */ 29 | @ChannelHandler.Sharable 30 | public class DataPacketEncoder extends OneToOneEncoder { 31 | 32 | // constructors --------------------------------------------------------------------------------------------------- 33 | 34 | private DataPacketEncoder() { 35 | } 36 | 37 | // public static methods ------------------------------------------------------------------------------------------ 38 | 39 | public static DataPacketEncoder getInstance() { 40 | return InstanceHolder.INSTANCE; 41 | } 42 | 43 | // OneToOneEncoder ------------------------------------------------------------------------------------------------ 44 | 45 | @Override 46 | protected Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { 47 | if (!(msg instanceof DataPacket)) { 48 | return ChannelBuffers.EMPTY_BUFFER; 49 | } 50 | 51 | DataPacket packet = (DataPacket) msg; 52 | if (packet.getDataSize() == 0) { 53 | return ChannelBuffers.EMPTY_BUFFER; 54 | } 55 | return packet.encode(); 56 | } 57 | 58 | // private classes ------------------------------------------------------------------------------------------------ 59 | 60 | private static final class InstanceHolder { 61 | private static final DataPacketEncoder INSTANCE = new DataPacketEncoder(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/network/DataPacketReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.network; 18 | 19 | import com.biasedbit.efflux.packet.DataPacket; 20 | 21 | import java.net.SocketAddress; 22 | 23 | /** 24 | * @author Bruno de Carvalho 25 | */ 26 | public interface DataPacketReceiver { 27 | 28 | void dataPacketReceived(SocketAddress origin, DataPacket packet); 29 | } 30 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/AbstractReportPacket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | /** 24 | * @author Bruno de Carvalho 25 | */ 26 | public abstract class AbstractReportPacket extends ControlPacket { 27 | 28 | // internal vars -------------------------------------------------------------------------------------------------- 29 | 30 | protected long senderSsrc; 31 | protected List receptionReports; 32 | 33 | // constructors --------------------------------------------------------------------------------------------------- 34 | 35 | protected AbstractReportPacket(Type type) { 36 | super(type); 37 | } 38 | 39 | // public methods ------------------------------------------------------------------------------------------------- 40 | 41 | public boolean addReceptionReportBlock(ReceptionReport block) { 42 | if (this.receptionReports == null) { 43 | this.receptionReports = new ArrayList(); 44 | return this.receptionReports.add(block); 45 | } 46 | 47 | // 5 bits is the limit 48 | return (this.receptionReports.size() < 31) && this.receptionReports.add(block); 49 | } 50 | 51 | public byte getReceptionReportCount() { 52 | if (this.receptionReports == null) { 53 | return 0; 54 | } 55 | 56 | return (byte) this.receptionReports.size(); 57 | } 58 | 59 | // getters & setters ---------------------------------------------------------------------------------------------- 60 | 61 | public long getSenderSsrc() { 62 | return senderSsrc; 63 | } 64 | 65 | public void setSenderSsrc(long senderSsrc) { 66 | if ((senderSsrc < 0) || (senderSsrc > 0xffffffffL)) { 67 | throw new IllegalArgumentException("Valid range for SSRC is [0;0xffffffff]"); 68 | } 69 | this.senderSsrc = senderSsrc; 70 | } 71 | 72 | public List getReceptionReports() { 73 | if (this.receptionReports == null) { 74 | return null; 75 | } 76 | return Collections.unmodifiableList(this.receptionReports); 77 | } 78 | 79 | public void setReceptionReports(List receptionReports) { 80 | if (receptionReports.size() >= 31) { 81 | throw new IllegalArgumentException("At most 31 report blocks can be sent in a *ReportPacket"); 82 | } 83 | this.receptionReports = receptionReports; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/AppDataPacket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | import org.jboss.netty.buffer.ChannelBuffer; 20 | 21 | /** 22 | * @author Bruno de Carvalho 23 | */ 24 | public class AppDataPacket extends ControlPacket { 25 | 26 | // constructors --------------------------------------------------------------------------------------------------- 27 | 28 | public AppDataPacket(Type type) { 29 | super(type); 30 | } 31 | 32 | // public static methods ------------------------------------------------------------------------------------------ 33 | 34 | public static ChannelBuffer encode(int currentCompoundLength, int fixedBlockSize, AppDataPacket packet) { 35 | return null; 36 | } 37 | 38 | // ControlPacket -------------------------------------------------------------------------------------------------- 39 | 40 | @Override 41 | public ChannelBuffer encode(int currentCompoundLength, int fixedBlockSize) { 42 | return encode(currentCompoundLength, fixedBlockSize, this); 43 | } 44 | 45 | @Override 46 | public ChannelBuffer encode() { 47 | return encode(0, 0, this); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/CompoundControlPacket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | import java.util.Arrays; 20 | import java.util.List; 21 | 22 | /** 23 | * @author Bruno de Carvalho 24 | */ 25 | public class CompoundControlPacket { 26 | 27 | // internal vars -------------------------------------------------------------------------------------------------- 28 | 29 | private final List controlPackets; 30 | 31 | // constructors --------------------------------------------------------------------------------------------------- 32 | 33 | public CompoundControlPacket(ControlPacket... controlPackets) { 34 | if (controlPackets.length == 0) { 35 | throw new IllegalArgumentException("At least one RTCP packet must be provided"); 36 | } 37 | this.controlPackets = Arrays.asList(controlPackets); 38 | } 39 | 40 | public CompoundControlPacket(List controlPackets) { 41 | if ((controlPackets == null) || controlPackets.isEmpty()) { 42 | throw new IllegalArgumentException("ControlPacket list cannot be null or empty"); 43 | } 44 | this.controlPackets = controlPackets; 45 | } 46 | 47 | // public methods ------------------------------------------------------------------------------------------------- 48 | 49 | public int getPacketCount() { 50 | return this.controlPackets.size(); 51 | } 52 | 53 | // getters & setters ---------------------------------------------------------------------------------------------- 54 | 55 | public List getControlPackets() { 56 | return this.controlPackets; 57 | } 58 | 59 | // low level overrides -------------------------------------------------------------------------------------------- 60 | 61 | @Override 62 | public String toString() { 63 | StringBuilder builder = new StringBuilder(); 64 | builder.append("CompoundControlPacket{\n"); 65 | for (ControlPacket packet : this.controlPackets) { 66 | builder.append(" ").append(packet.toString()).append('\n'); 67 | } 68 | return builder.append('}').toString(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/RtpVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | /** 20 | * @author Bruno de Carvalho 21 | */ 22 | public enum RtpVersion { 23 | 24 | // constants ------------------------------------------------------------------------------------------------------ 25 | 26 | V2((byte) 0x80), 27 | V1((byte) 0x40), 28 | V0((byte) 0x00); 29 | 30 | // internal vars -------------------------------------------------------------------------------------------------- 31 | 32 | private final byte b; 33 | 34 | // constructors --------------------------------------------------------------------------------------------------- 35 | 36 | private RtpVersion(byte b) { 37 | this.b = b; 38 | } 39 | 40 | // public static methods ------------------------------------------------------------------------------------------ 41 | 42 | public static RtpVersion fromByte(byte b) throws IllegalArgumentException { 43 | byte tmp = (byte) (b & 0xc0); 44 | // Starts from version 2, which is the most common. 45 | for (RtpVersion version : values()) { 46 | if (version.getByte() == tmp) { 47 | return version; 48 | } 49 | } 50 | 51 | throw new IllegalArgumentException("Unknown version for byte: " + b); 52 | } 53 | 54 | // getters & setters ---------------------------------------------------------------------------------------------- 55 | 56 | public byte getByte() { 57 | return b; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/SdesChunkItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | import org.jboss.netty.buffer.ChannelBuffer; 20 | import org.jboss.netty.util.CharsetUtil; 21 | 22 | /** 23 | * @author Bruno de Carvalho 24 | */ 25 | public class SdesChunkItems { 26 | 27 | // constants ------------------------------------------------------------------------------------------------------ 28 | 29 | public static final SdesChunkItem NULL_ITEM = new SdesChunkItem(SdesChunkItem.Type.NULL, null); 30 | 31 | // public static methods ------------------------------------------------------------------------------------------ 32 | 33 | public static SdesChunkItem createNullItem() { 34 | return NULL_ITEM; 35 | } 36 | 37 | public static SdesChunkItem createCnameItem(String cname) { 38 | return new SdesChunkItem(SdesChunkItem.Type.CNAME, cname); 39 | } 40 | 41 | public static SdesChunkItem createNameItem(String name) { 42 | return new SdesChunkItem(SdesChunkItem.Type.NAME, name); 43 | } 44 | 45 | public static SdesChunkItem createEmailItem(String email) { 46 | return new SdesChunkItem(SdesChunkItem.Type.EMAIL, email); 47 | } 48 | 49 | public static SdesChunkItem createPhoneItem(String phone) { 50 | return new SdesChunkItem(SdesChunkItem.Type.PHONE, phone); 51 | } 52 | 53 | public static SdesChunkItem createLocationItem(String location) { 54 | return new SdesChunkItem(SdesChunkItem.Type.LOCATION, location); 55 | } 56 | 57 | public static SdesChunkItem createToolItem(String tool) { 58 | return new SdesChunkItem(SdesChunkItem.Type.TOOL, tool); 59 | } 60 | 61 | public static SdesChunkItem createNoteItem(String note) { 62 | return new SdesChunkItem(SdesChunkItem.Type.NOTE, note); 63 | } 64 | 65 | public static SdesChunkPrivItem createPrivItem(String prefix, String value) { 66 | return new SdesChunkPrivItem(prefix, value); 67 | } 68 | 69 | public static SdesChunkItem decode(ChannelBuffer buffer) { 70 | SdesChunkItem.Type type = SdesChunkItem.Type.fromByte(buffer.readByte()); 71 | switch (type) { 72 | case NULL: 73 | return NULL_ITEM; 74 | case CNAME: 75 | case NAME: 76 | case EMAIL: 77 | case PHONE: 78 | case LOCATION: 79 | case TOOL: 80 | case NOTE: 81 | byte[] value = new byte[buffer.readUnsignedByte()]; 82 | buffer.readBytes(value); 83 | return new SdesChunkItem(type, new String(value, CharsetUtil.UTF_8)); 84 | case PRIV: 85 | short valueLength = buffer.readUnsignedByte(); 86 | short prefixLength = buffer.readUnsignedByte(); 87 | // Value length field indicates the length of all that follows this field: 88 | // Prefix length (1b), Prefix (xb) and Value itself (xb). Thus, the actual value length is equal to 89 | // the length indicated by this field - 1b (prefix length) and - xb (prefix value). 90 | value = new byte[valueLength - prefixLength - 1]; 91 | byte[] prefix = new byte[prefixLength]; 92 | buffer.readBytes(prefix); 93 | buffer.readBytes(value); 94 | return new SdesChunkPrivItem(new String(prefix, CharsetUtil.UTF_8), 95 | new String(value, CharsetUtil.UTF_8)); 96 | default: 97 | throw new IllegalArgumentException("Unknown type of SDES chunk: " + type); 98 | } 99 | } 100 | 101 | public static ChannelBuffer encode(SdesChunkItem item) { 102 | return item.encode(); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/packet/SdesChunkPrivItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.packet; 18 | 19 | import org.jboss.netty.buffer.ChannelBuffer; 20 | import org.jboss.netty.buffer.ChannelBuffers; 21 | import org.jboss.netty.util.CharsetUtil; 22 | 23 | /** 24 | * @author Bruno de Carvalho 25 | */ 26 | public class SdesChunkPrivItem extends SdesChunkItem { 27 | 28 | // internal vars -------------------------------------------------------------------------------------------------- 29 | 30 | private final String prefix; 31 | 32 | // constructors --------------------------------------------------------------------------------------------------- 33 | 34 | protected SdesChunkPrivItem(String prefix, String value) { 35 | super(SdesChunkItem.Type.PRIV, value); 36 | this.prefix = prefix; 37 | } 38 | 39 | // public methods ------------------------------------------------------------------------------------------------- 40 | 41 | @Override 42 | public ChannelBuffer encode() { 43 | byte[] prefixBytes; 44 | if (this.prefix != null) { 45 | // RFC section 6.5 mandates that this must be UTF8 46 | // http://tools.ietf.org/html/rfc3550#section-6.5 47 | prefixBytes = this.prefix.getBytes(CharsetUtil.UTF_8); 48 | } else { 49 | prefixBytes = new byte[]{}; 50 | } 51 | 52 | byte[] valueBytes; 53 | if (this.value != null) { 54 | // RFC section 6.5 mandates that this must be UTF8 55 | // http://tools.ietf.org/html/rfc3550#section-6.5 56 | valueBytes = this.value.getBytes(CharsetUtil.UTF_8); 57 | } else { 58 | valueBytes = new byte[]{}; 59 | } 60 | 61 | if ((prefixBytes.length + valueBytes.length) > 254) { 62 | throw new IllegalArgumentException("Content (prefix + text) can be no longer than 255 bytes and this has " + 63 | valueBytes.length); 64 | } 65 | 66 | // Type (1b), total item length (1b), prefix length (1b), prefix (xb), text (xb) 67 | ChannelBuffer buffer = ChannelBuffers.buffer(2 + 1 + prefixBytes.length + valueBytes.length); 68 | buffer.writeByte(this.type.getByte()); 69 | buffer.writeByte(1 + prefixBytes.length + valueBytes.length); 70 | buffer.writeByte(prefixBytes.length); 71 | buffer.writeBytes(prefixBytes); 72 | buffer.writeBytes(valueBytes); 73 | 74 | return buffer; 75 | } 76 | 77 | // getters & setters ---------------------------------------------------------------------------------------------- 78 | 79 | public String getPrefix() { 80 | return prefix; 81 | } 82 | 83 | // low level overrides -------------------------------------------------------------------------------------------- 84 | 85 | @Override 86 | public String toString() { 87 | return new StringBuilder() 88 | .append("SdesChunkPrivItem{") 89 | .append("prefix='").append(this.prefix).append('\'') 90 | .append(", value='").append(this.value).append('\'') 91 | .append('}').toString(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/participant/ParticipantDatabase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.participant; 18 | 19 | import com.biasedbit.efflux.packet.DataPacket; 20 | import com.biasedbit.efflux.packet.SdesChunk; 21 | 22 | import java.net.SocketAddress; 23 | import java.util.Collection; 24 | import java.util.Map; 25 | 26 | /** 27 | * @author Bruno de Carvalho 28 | */ 29 | public interface ParticipantDatabase { 30 | 31 | String getId(); 32 | 33 | Collection getReceivers(); 34 | 35 | Map getMembers(); 36 | 37 | void doWithReceivers(ParticipantOperation operation); 38 | 39 | void doWithParticipants(ParticipantOperation operation); 40 | 41 | boolean addReceiver(RtpParticipant remoteParticipant); 42 | 43 | boolean removeReceiver(RtpParticipant remoteParticipant); 44 | 45 | RtpParticipant getParticipant(long ssrc); 46 | 47 | RtpParticipant getOrCreateParticipantFromDataPacket(SocketAddress origin, DataPacket packet); 48 | 49 | RtpParticipant getOrCreateParticipantFromSdesChunk(SocketAddress origin, SdesChunk chunk); 50 | 51 | int getReceiverCount(); 52 | 53 | int getParticipantCount(); 54 | 55 | void cleanup(); 56 | } 57 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/participant/ParticipantEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.participant; 18 | 19 | /** 20 | * @author Bruno de Carvalho 21 | */ 22 | public interface ParticipantEventListener { 23 | 24 | void participantCreatedFromSdesChunk(RtpParticipant participant); 25 | 26 | void participantCreatedFromDataPacket(RtpParticipant participant); 27 | 28 | void participantDeleted(RtpParticipant participant); 29 | } 30 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/participant/ParticipantOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.participant; 18 | 19 | /** 20 | * @author Bruno de Carvalho 21 | */ 22 | public interface ParticipantOperation { 23 | 24 | void doWithParticipant(RtpParticipant participant) throws Exception; 25 | } 26 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/participant/SingleParticipantDatabase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.participant; 18 | 19 | import com.biasedbit.efflux.logging.Logger; 20 | import com.biasedbit.efflux.packet.DataPacket; 21 | import com.biasedbit.efflux.packet.SdesChunk; 22 | 23 | import java.net.SocketAddress; 24 | import java.util.Arrays; 25 | import java.util.Collection; 26 | import java.util.HashMap; 27 | import java.util.Map; 28 | 29 | /** 30 | * @author Bruno de Carvalho 31 | */ 32 | public class SingleParticipantDatabase implements ParticipantDatabase { 33 | 34 | // constants ------------------------------------------------------------------------------------------------------ 35 | 36 | private static final Logger LOG = Logger.getLogger(SingleParticipantDatabase.class); 37 | 38 | // configuration -------------------------------------------------------------------------------------------------- 39 | 40 | private String id; 41 | private RtpParticipant participant; 42 | 43 | // constructors --------------------------------------------------------------------------------------------------- 44 | 45 | public SingleParticipantDatabase(String id) { 46 | this.id = id; 47 | } 48 | 49 | // ParticipantDatabase -------------------------------------------------------------------------------------------- 50 | 51 | @Override 52 | public String getId() { 53 | return this.id; 54 | } 55 | 56 | @Override 57 | public Collection getReceivers() { 58 | return Arrays.asList(this.participant); 59 | } 60 | 61 | @Override 62 | public Map getMembers() { 63 | // Could be optimised, but then again this'll be used so little... 64 | Map map = new HashMap(1); 65 | map.put(this.participant.getSsrc(), this.participant); 66 | return map; 67 | } 68 | 69 | @Override 70 | public void doWithReceivers(ParticipantOperation operation) { 71 | try { 72 | operation.doWithParticipant(this.participant); 73 | } catch (Exception e) { 74 | LOG.error("Failed to perform operation {} on remote participant {}.", e, operation, this.participant); 75 | } 76 | } 77 | 78 | @Override 79 | public void doWithParticipants(ParticipantOperation operation) { 80 | try { 81 | operation.doWithParticipant(this.participant); 82 | } catch (Exception e) { 83 | LOG.error("Failed to perform operation {} on remote participant {}.", e, operation, this.participant); 84 | } 85 | } 86 | 87 | @Override 88 | public boolean addReceiver(RtpParticipant remoteParticipant) { 89 | return remoteParticipant == this.participant; 90 | } 91 | 92 | @Override 93 | public boolean removeReceiver(RtpParticipant remoteParticipant) { 94 | return false; 95 | } 96 | 97 | @Override 98 | public RtpParticipant getParticipant(long ssrc) { 99 | if (ssrc == this.participant.getSsrc()) { 100 | return this.participant; 101 | } 102 | 103 | return null; 104 | } 105 | 106 | @Override 107 | public RtpParticipant getOrCreateParticipantFromDataPacket(SocketAddress origin, DataPacket packet) { 108 | if (packet.getSsrc() == this.participant.getSsrc()) { 109 | return this.participant; 110 | } 111 | 112 | return null; 113 | } 114 | 115 | @Override 116 | public RtpParticipant getOrCreateParticipantFromSdesChunk(SocketAddress origin, SdesChunk chunk) { 117 | if (chunk.getSsrc() == this.participant.getSsrc()) { 118 | return this.participant; 119 | } 120 | 121 | return null; 122 | } 123 | 124 | @Override 125 | public int getReceiverCount() { 126 | return 1; 127 | } 128 | 129 | @Override 130 | public int getParticipantCount() { 131 | return 1; 132 | } 133 | 134 | @Override 135 | public void cleanup() { 136 | // Nothing to do here. 137 | } 138 | 139 | // getters & setters ---------------------------------------------------------------------------------------------- 140 | 141 | public void setParticipant(RtpParticipant remoteParticipant) { 142 | this.participant = remoteParticipant; 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/session/MultiParticipantSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.session; 18 | 19 | import com.biasedbit.efflux.participant.DefaultParticipantDatabase; 20 | import com.biasedbit.efflux.participant.ParticipantDatabase; 21 | import com.biasedbit.efflux.participant.ParticipantEventListener; 22 | import com.biasedbit.efflux.participant.RtpParticipant; 23 | import org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor; 24 | import org.jboss.netty.util.HashedWheelTimer; 25 | import java.util.Collection; 26 | 27 | /** 28 | * A regular RTP session, as described in RFC3550. 29 | * 30 | * Unlike {@link SingleParticipantSession}, this session starts off with 0 remote participants. 31 | * 32 | * @author Bruno de Carvalho 33 | */ 34 | public class MultiParticipantSession extends AbstractRtpSession implements ParticipantEventListener { 35 | 36 | // constructors --------------------------------------------------------------------------------------------------- 37 | 38 | public MultiParticipantSession(String id, int payloadType, RtpParticipant localParticipant) { 39 | super(id, payloadType, localParticipant, null, null); 40 | } 41 | 42 | public MultiParticipantSession(String id, int payloadType, RtpParticipant localParticipant, 43 | HashedWheelTimer timer) { 44 | super(id, payloadType, localParticipant, timer, null); 45 | } 46 | 47 | public MultiParticipantSession(String id, int payloadType, RtpParticipant localParticipant, 48 | OrderedMemoryAwareThreadPoolExecutor executor) { 49 | super(id, payloadType, localParticipant, null, executor); 50 | } 51 | 52 | public MultiParticipantSession(String id, int payloadType, RtpParticipant localParticipant, 53 | HashedWheelTimer timer, OrderedMemoryAwareThreadPoolExecutor executor) { 54 | super(id, payloadType, localParticipant, timer, executor); 55 | } 56 | 57 | public MultiParticipantSession(String id, Collection payloadTypes, RtpParticipant localParticipant, 58 | HashedWheelTimer timer, OrderedMemoryAwareThreadPoolExecutor executor) { 59 | super(id, payloadTypes, localParticipant, timer, executor); 60 | } 61 | 62 | // AbstractRtpSession --------------------------------------------------------------------------------------------- 63 | 64 | @Override 65 | protected ParticipantDatabase createDatabase() { 66 | return new DefaultParticipantDatabase(this.id, this); 67 | } 68 | 69 | // ParticipantEventListener --------------------------------------------------------------------------------------- 70 | 71 | @Override 72 | public void participantCreatedFromSdesChunk(RtpParticipant participant) { 73 | for (RtpSessionEventListener listener : this.eventListeners) { 74 | listener.participantJoinedFromControl(this, participant); 75 | } 76 | } 77 | 78 | @Override 79 | public void participantCreatedFromDataPacket(RtpParticipant participant) { 80 | for (RtpSessionEventListener listener : this.eventListeners) { 81 | listener.participantJoinedFromData(this, participant); 82 | } 83 | } 84 | 85 | @Override 86 | public void participantDeleted(RtpParticipant participant) { 87 | for (RtpSessionEventListener listener : this.eventListeners) { 88 | listener.participantDeleted(this, participant); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/session/RtpSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.session; 18 | 19 | import com.biasedbit.efflux.network.ControlPacketReceiver; 20 | import com.biasedbit.efflux.network.DataPacketReceiver; 21 | import com.biasedbit.efflux.packet.CompoundControlPacket; 22 | import com.biasedbit.efflux.packet.ControlPacket; 23 | import com.biasedbit.efflux.packet.DataPacket; 24 | import com.biasedbit.efflux.participant.RtpParticipant; 25 | import java.util.Set; 26 | import java.util.Map; 27 | 28 | /** 29 | * @author Bruno de Carvalho 30 | */ 31 | public interface RtpSession extends DataPacketReceiver, ControlPacketReceiver { 32 | 33 | String getId(); 34 | 35 | Set getPayloadType(); 36 | 37 | boolean init(); 38 | 39 | void terminate(); 40 | 41 | boolean sendData(byte[] data, long timestamp, boolean marked); 42 | 43 | boolean sendDataPacket(DataPacket packet); 44 | 45 | boolean sendControlPacket(ControlPacket packet); 46 | 47 | boolean sendControlPacket(CompoundControlPacket packet); 48 | 49 | RtpParticipant getLocalParticipant(); 50 | 51 | boolean addReceiver(RtpParticipant remoteParticipant); 52 | 53 | boolean removeReceiver(RtpParticipant remoteParticipant); 54 | 55 | RtpParticipant getRemoteParticipant(long ssrsc); 56 | 57 | Map getRemoteParticipants(); 58 | 59 | void addDataListener(RtpSessionDataListener listener); 60 | 61 | void removeDataListener(RtpSessionDataListener listener); 62 | 63 | void addControlListener(RtpSessionControlListener listener); 64 | 65 | void removeControlListener(RtpSessionControlListener listener); 66 | 67 | void addEventListener(RtpSessionEventListener listener); 68 | 69 | void removeEventListener(RtpSessionEventListener listener); 70 | } 71 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/session/RtpSessionControlListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.session; 18 | 19 | import com.biasedbit.efflux.packet.AppDataPacket; 20 | import com.biasedbit.efflux.packet.CompoundControlPacket; 21 | 22 | /** 23 | * @author Bruno de Carvalho 24 | */ 25 | public interface RtpSessionControlListener { 26 | 27 | void controlPacketReceived(RtpSession session, CompoundControlPacket packet); 28 | 29 | void appDataReceived(RtpSession session, AppDataPacket appDataPacket); 30 | } 31 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/session/RtpSessionDataListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.session; 18 | 19 | import com.biasedbit.efflux.packet.DataPacket; 20 | import com.biasedbit.efflux.participant.RtpParticipantInfo; 21 | 22 | /** 23 | * @author Bruno de Carvalho 24 | */ 25 | public interface RtpSessionDataListener { 26 | void dataPacketReceived(RtpSession session, RtpParticipantInfo participant, DataPacket packet); 27 | } 28 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/session/RtpSessionEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.session; 18 | 19 | import com.biasedbit.efflux.participant.RtpParticipant; 20 | 21 | /** 22 | * @author Bruno de Carvalho 23 | */ 24 | public interface RtpSessionEventListener { 25 | 26 | static final Throwable TERMINATE_CALLED = new Throwable("RtpSession.terminate() called"); 27 | 28 | void participantJoinedFromData(RtpSession session, RtpParticipant participant); 29 | 30 | void participantJoinedFromControl(RtpSession session, RtpParticipant participant); 31 | 32 | void participantDataUpdated(RtpSession session, RtpParticipant participant); 33 | 34 | void participantLeft(RtpSession session, RtpParticipant participant); 35 | 36 | void participantDeleted(RtpSession session, RtpParticipant participant); 37 | 38 | void resolvedSsrcConflict(RtpSession session, long oldSsrc, long newSsrc); 39 | 40 | void sessionTerminated(RtpSession session, Throwable cause); 41 | } 42 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/util/ByteUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.util; 18 | 19 | import java.security.MessageDigest; 20 | import java.security.NoSuchAlgorithmException; 21 | 22 | /** 23 | * @author Bruno de Carvalho 24 | */ 25 | public class ByteUtils { 26 | 27 | // constructors --------------------------------------------------------------------------------------------------- 28 | 29 | private ByteUtils() { 30 | } 31 | 32 | // public static methods ------------------------------------------------------------------------------------------ 33 | 34 | /** 35 | * Hash a string 36 | * 37 | * @param toHash String to be hashed. 38 | * 39 | * @return Hashed string. 40 | */ 41 | public static String hash(Object toHash) { 42 | String hashString = toHash.toString(); 43 | MessageDigest md; 44 | try { 45 | md = MessageDigest.getInstance("MD5"); 46 | } catch (NoSuchAlgorithmException e) { 47 | return hashString; 48 | } 49 | 50 | md.update(hashString.getBytes(), 0, hashString.length()); 51 | return convertToHex(md.digest()); 52 | } 53 | 54 | public static String convertToHex(byte[] data) { 55 | StringBuffer buf = new StringBuffer(); 56 | for (byte aData : data) { 57 | int halfbyte = (aData >>> 4) & 0x0F; 58 | int two_halfs = 0; 59 | do { 60 | if ((0 <= halfbyte) && (halfbyte <= 9)) { 61 | buf.append((char) ('0' + halfbyte)); 62 | } else { 63 | buf.append((char) ('a' + (halfbyte - 10))); 64 | } 65 | halfbyte = aData & 0x0F; 66 | } while (two_halfs++ < 1); 67 | } 68 | return buf.toString(); 69 | } 70 | 71 | public static String writeArrayAsHex(byte[] array, boolean packedPrint) { 72 | if (packedPrint) { 73 | return convertToHex(array); 74 | } 75 | 76 | StringBuilder builder = new StringBuilder(); 77 | for (byte b : array) { 78 | builder.append(" 0x"); 79 | String hex = Integer.toHexString(b); 80 | switch (hex.length()) { 81 | case 1: 82 | builder.append('0').append(hex); 83 | break; 84 | case 2: 85 | builder.append(hex); 86 | break; 87 | default: 88 | builder.append(hex.substring(6, 8)); 89 | } 90 | } 91 | 92 | return builder.toString(); 93 | } 94 | 95 | public static byte[] convertHexStringToByteArray(String hexString) { 96 | if ((hexString.length() % 2) != 0) { 97 | throw new IllegalArgumentException("Invalid hex string (length % 2 != 0)"); 98 | } 99 | 100 | byte[] array = new byte[hexString.length() / 2]; 101 | for (int i = 0, arrayIndex = 0; i < hexString.length(); i += 2, arrayIndex++) { 102 | array[arrayIndex] = Integer.valueOf(hexString.substring(i, i + 2), 16).byteValue(); 103 | } 104 | 105 | return array; 106 | } 107 | 108 | /** 109 | * Get a byte array in a printable binary form. 110 | * 111 | * @param bytes The bytes to be writen. 112 | * @return A String representation of the bytes. 113 | */ 114 | public static String writeBits(byte[] bytes) { 115 | StringBuilder stringBuilder = new StringBuilder(); 116 | for (int i = 0; i < bytes.length; i++) { 117 | // New line every 4 bytes 118 | if ((i % 4) == 0) { 119 | stringBuilder.append("\n"); 120 | } 121 | stringBuilder.append(writeBits(bytes[i])).append(" "); 122 | } 123 | return stringBuilder.toString(); 124 | } 125 | 126 | /** 127 | * Get a byte in a printable binary form. 128 | * 129 | * @param b The byte to be writen. 130 | * @return A String representation of the byte. 131 | */ 132 | public static String writeBits(byte b) { 133 | StringBuffer stringBuffer = new StringBuffer(); 134 | int bit; 135 | for (int i = 7; i >= 0; i--) { 136 | bit = (b >>> i) & 0x01; 137 | stringBuffer.append(bit); 138 | } 139 | return stringBuffer.toString(); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /efflux/src/main/java/com/biasedbit/efflux/util/TimeUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 Bruno de Carvalho 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.biasedbit.efflux.util; 18 | 19 | /** 20 | * @author Bruno de Carvalho 21 | */ 22 | public class TimeUtils { 23 | 24 | // constructors --------------------------------------------------------------------------------------------------- 25 | 26 | private TimeUtils() { 27 | } 28 | 29 | // public static methods ------------------------------------------------------------------------------------------ 30 | 31 | /** 32 | * Retrieve a timestamp for the current instant. 33 | * 34 | * @return Current instant. 35 | */ 36 | public static long now() { 37 | return System.currentTimeMillis(); 38 | } 39 | 40 | /** 41 | * Retrieve a timestamp for the current instant, in nanoseconds. 42 | * 43 | * @return Current instant. 44 | */ 45 | public static long nowNanos() { 46 | return System.nanoTime(); 47 | } 48 | 49 | /** 50 | * Test whether a given event has timed out (in seconds). 51 | * 52 | * @param now Current instant. 53 | * @param eventTime Instant at which the event took place. 54 | * @param timeBuffer The amount of time for which the event is valid (in seconds). 55 | * 56 | * @return true if the event has expired, false otherwise 57 | */ 58 | public static boolean hasExpired(long now, long eventTime, long timeBuffer) { 59 | return hasExpiredMillis(now, eventTime, timeBuffer * 1000); 60 | } 61 | 62 | /** 63 | * Test whether a given event has timed out (in milliseconds). 64 | * 65 | * @param now Current instant. 66 | * @param eventTime Instant at which the event took place. 67 | * @param timeBuffer The amount of time for which the event is valid (in milliseconds). 68 | * 69 | * @return true if the event has expired, false otherwise 70 | */ 71 | public static boolean hasExpiredMillis(long now, long eventTime, long timeBuffer) { 72 | return (eventTime + timeBuffer) < now; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.c77.androidstreamingclient.example" 9 | minSdkVersion 17 10 | targetSdkVersion 19 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | packagingOptions { 22 | exclude 'META-INF/LICENSE.txt' 23 | exclude 'META-INF/NOTICE.txt' 24 | } 25 | 26 | lintOptions { 27 | abortOnError false 28 | } 29 | } 30 | 31 | dependencies { 32 | compile('com.creativa77:android_streaming_client:1.0.6') { 33 | exclude group: 'org.apache.commons' 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /example/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /opt/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /example/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/src/main/assets/configuration.ini: -------------------------------------------------------------------------------- 1 | # General decoder configuration values 2 | DEBUGGING=true 3 | USE_NIO=true 4 | RECEIVE_BUFFER_SIZE_BYTES=50000 5 | # Has to be one of: 'time-window' or 'min-delay' 6 | BUFFER_TYPE=time-window 7 | # Maximum delay in milliseconds for the min-delay buffer 8 | NODELAY_TIMEOUT=500 9 | # Window size in milliseconds for the time-window buffer 10 | FRAMES_WINDOW_TIME=1000 11 | -------------------------------------------------------------------------------- /example/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/example/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/example/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/example/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/example/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /example/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /example/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Android Streaming Client Example 4 | : 5 | 6 | -------------------------------------------------------------------------------- /example/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | VERSION_NAME=1.0.1 21 | VERSION_CODE=2 22 | GROUP=com.creativa77 23 | 24 | POM_DESCRIPTION=AndroidStreamingClient library 25 | POM_URL=https://github.com/creativa77/AndroidStreamingClient 26 | POM_SCM_URL=scm:https://github.com/creativa77/AndroidStreamingClient 27 | POM_SCM_CONNECTION=scm:https://github.com/creativa77/AndroidStreamingClient 28 | POM_SCM_DEV_CONNECTION=scm:https://github.com/creativa77/AndroidStreamingClient 29 | POM_LICENCE_NAME=The Apache Software License, Version 2.0 30 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 31 | POM_LICENCE_DIST=repo 32 | POM_DEVELOPER_ID=ashyonline 33 | POM_DEVELOPER_NAME=Ayelen Chavez 34 | POM_DEVELOPER_EMAIL=ashi@creativa77.com.ar 35 | 36 | NEXUS_USERNAME=xxxx 37 | NEXUS_PASSWORD=yyyy 38 | 39 | SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots 40 | RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2 41 | 42 | signing.keyId=wwww 43 | signing.password=zzzz 44 | signing.secretKeyRingFile=/home//.gnupg/secring.gpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekumenlabs/AndroidStreamingClient/40be127ced64ee2d23a0435ae09520d679b43ee4/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /license_script/apply_license.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | for f in $(find . -name '*.java' -type f); do 3 | cp $f $f.bak 4 | cat "license" $f.bak > $f 5 | done -------------------------------------------------------------------------------- /license_script/license: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Creativa77 SRL and others 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | * Contributors: 17 | * 18 | * Ayelen Chavez ashi@creativa77.com.ar 19 | * Julian Cerruti jcerruti@creativa77.com.ar 20 | * 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /maven_push.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'maven' 2 | apply plugin: 'signing' 3 | 4 | def isReleaseBuild() { 5 | return VERSION_NAME.contains("SNAPSHOT") == false 6 | } 7 | 8 | def getReleaseRepositoryUrl() { 9 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL 10 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" 11 | } 12 | 13 | def getSnapshotRepositoryUrl() { 14 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL 15 | : "https://oss.sonatype.org/content/repositories/snapshots/" 16 | } 17 | 18 | def getRepositoryUsername() { 19 | return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" 20 | } 21 | 22 | def getRepositoryPassword() { 23 | return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" 24 | } 25 | 26 | afterEvaluate { project -> 27 | uploadArchives { 28 | repositories { 29 | mavenDeployer { 30 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 31 | 32 | pom.groupId = GROUP 33 | pom.artifactId = POM_ARTIFACT_ID 34 | pom.version = VERSION_NAME 35 | 36 | repository(url: getReleaseRepositoryUrl()) { 37 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 38 | } 39 | snapshotRepository(url: getSnapshotRepositoryUrl()) { 40 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 41 | } 42 | 43 | pom.project { 44 | name POM_NAME 45 | packaging POM_PACKAGING 46 | description POM_DESCRIPTION 47 | url POM_URL 48 | 49 | scm { 50 | url POM_SCM_URL 51 | connection POM_SCM_CONNECTION 52 | developerConnection POM_SCM_DEV_CONNECTION 53 | } 54 | 55 | licenses { 56 | license { 57 | name POM_LICENCE_NAME 58 | url POM_LICENCE_URL 59 | distribution POM_LICENCE_DIST 60 | } 61 | } 62 | 63 | developers { 64 | developer { 65 | id POM_DEVELOPER_ID 66 | name POM_DEVELOPER_NAME 67 | email POM_DEVELOPER_EMAIL 68 | } 69 | } 70 | } 71 | } 72 | } 73 | } 74 | 75 | signing { 76 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } 77 | sign configurations.archives 78 | } 79 | 80 | task androidSourcesJar(type: Jar) { 81 | classifier = 'sources' 82 | from android.sourceSets.main.java.sourceFiles 83 | } 84 | 85 | artifacts { 86 | archives androidSourcesJar 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':example', ':android_streaming_client', ':efflux' 2 | --------------------------------------------------------------------------------