From 1d5d7f2376eed4dee192a6435af2489d4e365c40 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sun, 17 Apr 2022 08:20:11 +0200 Subject: [PATCH 1/2] Gradle project --- .classpath | 9 - .gitignore | 26 +- .project | 33 - AndroidManifest.xml | 10 - README.md | 29 +- build.gradle | 26 + build.xml | 92 -- doc/allclasses-frame.html | 80 +- doc/allclasses-noframe.html | 80 +- doc/constant-values.html | 284 ++--- doc/index-all.html | 1048 ++++++++--------- .../streaming/MediaStream.html | 156 +-- .../streaming/Session.Callback.html | 60 +- .../majorkernelpanic/streaming/Session.html | 284 ++--- .../streaming/SessionBuilder.html | 266 ++--- .../majorkernelpanic/streaming/Stream.html | 52 +- .../streaming/audio/AACStream.html | 106 +- .../streaming/audio/AMRNBStream.html | 90 +- .../streaming/audio/AudioQuality.html | 48 +- .../streaming/audio/AudioStream.html | 52 +- .../streaming/audio/package-frame.html | 12 +- .../streaming/audio/package-summary.html | 30 +- .../streaming/audio/package-tree.html | 28 +- .../exceptions/CameraInUseException.html | 16 +- .../exceptions/ConfNotSupportedException.html | 20 +- .../exceptions/InvalidSurfaceException.html | 20 +- .../StorageUnavailableException.html | 16 +- .../streaming/exceptions/package-frame.html | 12 +- .../streaming/exceptions/package-summary.html | 26 +- .../streaming/exceptions/package-tree.html | 26 +- .../streaming/gl/SurfaceManager.html | 34 +- .../SurfaceView.ViewAspectRatioMeasurer.html | 48 +- .../streaming/gl/SurfaceView.html | 66 +- .../streaming/gl/TextureManager.html | 34 +- .../streaming/gl/package-frame.html | 10 +- .../streaming/gl/package-summary.html | 24 +- .../streaming/gl/package-tree.html | 26 +- .../streaming/hw/CodecManager.html | 32 +- .../streaming/hw/EncoderDebugger.html | 54 +- .../streaming/hw/NV21Convertor.html | 44 +- .../streaming/hw/package-frame.html | 10 +- .../streaming/hw/package-summary.html | 24 +- .../streaming/hw/package-tree.html | 24 +- .../streaming/mp4/MP4Config.html | 30 +- .../streaming/mp4/MP4Parser.html | 28 +- .../streaming/mp4/package-frame.html | 8 +- .../streaming/mp4/package-summary.html | 22 +- .../streaming/mp4/package-tree.html | 22 +- .../streaming/package-frame.html | 14 +- .../streaming/package-summary.html | 30 +- .../streaming/package-tree.html | 24 +- .../streaming/rtcp/SenderReport.html | 36 +- .../streaming/rtcp/package-frame.html | 6 +- .../streaming/rtcp/package-summary.html | 20 +- .../streaming/rtcp/package-tree.html | 20 +- .../streaming/rtp/AACADTSPacketizer.html | 40 +- .../streaming/rtp/AACLATMPacketizer.html | 44 +- .../streaming/rtp/AMRNBPacketizer.html | 46 +- .../streaming/rtp/AbstractPacketizer.html | 40 +- .../streaming/rtp/H263Packetizer.html | 46 +- .../streaming/rtp/H264Packetizer.html | 50 +- .../streaming/rtp/MediaCodecInputStream.html | 34 +- .../streaming/rtp/RtpSocket.html | 70 +- .../streaming/rtp/package-frame.html | 20 +- .../streaming/rtp/package-summary.html | 34 +- .../streaming/rtp/package-tree.html | 34 +- .../streaming/rtsp/RtspClient.Callback.html | 18 +- .../streaming/rtsp/RtspClient.html | 102 +- .../rtsp/RtspServer.CallbackListener.html | 32 +- .../rtsp/RtspServer.LocalBinder.html | 26 +- .../streaming/rtsp/RtspServer.html | 100 +- .../streaming/rtsp/UriParser.html | 24 +- .../streaming/rtsp/package-frame.html | 14 +- .../streaming/rtsp/package-summary.html | 28 +- .../streaming/rtsp/package-tree.html | 30 +- .../streaming/video/CodecManager.html | 22 +- .../streaming/video/H263Stream.html | 82 +- .../streaming/video/H264Stream.html | 84 +- .../streaming/video/VideoQuality.html | 74 +- .../streaming/video/VideoStream.html | 134 +-- .../streaming/video/package-frame.html | 14 +- .../streaming/video/package-summary.html | 28 +- .../streaming/video/package-tree.html | 26 +- doc/overview-frame.html | 20 +- doc/overview-summary.html | 20 +- doc/overview-tree.html | 104 +- doc/package-list | 20 +- doc/serialized-form.html | 18 +- gradle.properties | 21 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59536 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 234 ++++ gradlew.bat | 89 ++ libStream/build.gradle | 28 + .../proguard-project.txt | 0 libStream/src/main/AndroidManifest.xml | 11 + .../streaming/MediaStream.java | 12 +- .../majorkernelpanic/streaming/Session.java | 8 +- .../streaming/SessionBuilder.java | 0 .../majorkernelpanic/streaming/Stream.java | 0 .../streaming/audio/AACStream.java | 94 +- .../streaming/audio/AMRNBStream.java | 2 +- .../streaming/audio/AudioQuality.java | 0 .../streaming/audio/AudioStream.java | 2 +- .../exceptions/CameraInUseException.java | 0 .../exceptions/ConfNotSupportedException.java | 0 .../exceptions/InvalidSurfaceException.java | 0 .../StorageUnavailableException.java | 0 .../streaming/gl/SurfaceManager.java | 0 .../streaming/gl/SurfaceView.java | 0 .../streaming/gl/TextureManager.java | 0 .../streaming/hw/CodecManager.java | 0 .../streaming/hw/EncoderDebugger.java | 0 .../streaming/hw/NV21Convertor.java | 0 .../streaming/mp4/MP4Config.java | 0 .../streaming/mp4/MP4Parser.java | 0 .../streaming/rtcp/SenderReport.java | 0 .../streaming/rtp/AACADTSPacketizer.java | 0 .../streaming/rtp/AACLATMPacketizer.java | 0 .../streaming/rtp/AMRNBPacketizer.java | 0 .../streaming/rtp/AbstractPacketizer.java | 0 .../streaming/rtp/H263Packetizer.java | 0 .../streaming/rtp/H264Packetizer.java | 2 +- .../streaming/rtp/MediaCodecInputStream.java | 0 .../streaming/rtp/RtpSocket.java | 0 .../streaming/rtsp/RtcpDeinterleaver.java | 0 .../streaming/rtsp/RtspClient.java | 4 +- .../streaming/rtsp/RtspServer.java | 4 +- .../streaming/rtsp/UriParser.java | 0 .../streaming/video/CodecManager.java | 0 .../streaming/video/H263Stream.java | 2 +- .../streaming/video/H264Stream.java | 6 +- .../streaming/video/VideoQuality.java | 0 .../streaming/video/VideoStream.java | 4 +- pom.xml | 80 -- project.properties | 12 - res/.gitkeep | 0 settings.gradle | 3 + 138 files changed, 3007 insertions(+), 2821 deletions(-) delete mode 100644 .classpath delete mode 100644 .project delete mode 100644 AndroidManifest.xml create mode 100644 build.gradle delete mode 100644 build.xml create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 libStream/build.gradle rename proguard-project.txt => libStream/proguard-project.txt (100%) create mode 100644 libStream/src/main/AndroidManifest.xml rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/MediaStream.java (96%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/Session.java (98%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/SessionBuilder.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/Stream.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/audio/AACStream.java (85%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/audio/AMRNBStream.java (96%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/audio/AudioQuality.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/audio/AudioStream.java (97%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/exceptions/CameraInUseException.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/exceptions/ConfNotSupportedException.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/exceptions/InvalidSurfaceException.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/exceptions/StorageUnavailableException.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/gl/SurfaceManager.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/gl/SurfaceView.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/gl/TextureManager.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/hw/CodecManager.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/hw/EncoderDebugger.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/hw/NV21Convertor.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/mp4/MP4Config.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/mp4/MP4Parser.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtcp/SenderReport.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/AACADTSPacketizer.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/AACLATMPacketizer.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/AMRNBPacketizer.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/AbstractPacketizer.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/H263Packetizer.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/H264Packetizer.java (99%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/MediaCodecInputStream.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtp/RtpSocket.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtsp/RtcpDeinterleaver.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtsp/RtspClient.java (99%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtsp/RtspServer.java (99%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/rtsp/UriParser.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/video/CodecManager.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/video/H263Stream.java (96%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/video/H264Stream.java (96%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/video/VideoQuality.java (100%) rename {src => libStream/src/main/java}/net/majorkernelpanic/streaming/video/VideoStream.java (99%) delete mode 100644 pom.xml delete mode 100644 project.properties delete mode 100644 res/.gitkeep create mode 100644 settings.gradle diff --git a/.classpath b/.classpath deleted file mode 100644 index 51769745..00000000 --- a/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.gitignore b/.gitignore index 12f6ddb2..9524e258 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,13 @@ -# built application files -*.apk -*.ap_ -*.dex -*.class -bin/ -gen/ -*.class -*.o -*.so -*.sh +*.iml +.gradle local.properties -custom_rules.xml -ant.properties -*~ \ No newline at end of file + +.idea/* +!.idea/codeStyles/ + +.DS_Store +build +captures + +.externalNativeBuild +.cxx diff --git a/.project b/.project deleted file mode 100644 index b3bcf810..00000000 --- a/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - libstreaming - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/AndroidManifest.xml b/AndroidManifest.xml deleted file mode 100644 index 9e2e14dc..00000000 --- a/AndroidManifest.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/README.md b/README.md index 21eb1997..8d738e07 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ * Android 4.0 or more recent is required. * Supported encoders include H.264, H.263, AAC and AMR. -The first step you will need to achieve to start a streaming session to some peer is called 'signaling'. During this step you will contact the receiver and send a description of the incomming streams. You have three ways to do that with libstreaming. +The first step you will need to achieve to start a net.majorkernelpanic.streaming session to some peer is called 'signaling'. During this step you will contact the receiver and send a description of the incomming streams. You have three ways to do that with libstreaming. * With the RTSP client: if you want to stream to a Wowza Media Server, it's the way to go. [The example 3](https://github.com/fyhertz/libstreaming-examples#example-3) illustrates that use case. * With the RTSP server: in that case the phone will act as a RTSP server and wait for a RTSP client to request a stream. This use case is illustated in [the example 1](https://github.com/fyhertz/libstreaming-examples#example-1). @@ -25,7 +25,7 @@ There are three ways on Android to get encoded data from the peripherals: ### Encoding with the MediaRecorder API -The **MediaRecorder** API was not intended for streaming applications but can be used to retrieve encoded data from the peripherals of the phone. The trick is to configure a MediaRecorder instance to write to a **LocalSocket** instead of a regular file (see **MediaStream.java**). +The **MediaRecorder** API was not intended for net.majorkernelpanic.streaming applications but can be used to retrieve encoded data from the peripherals of the phone. The trick is to configure a MediaRecorder instance to write to a **LocalSocket** instead of a regular file (see **MediaStream.java**). Edit: as of Android Lollipop using a **LocalSocket** is not possible anymore for security reasons. But using a [**ParcelFileDescriptor**](http://developer.android.com/reference/android/os/ParcelFileDescriptor.html) does the trick. More details in the file **MediaStream.java**! ([Thanks to those guys for the insight](http://stackoverflow.com/questions/26990816/mediarecorder-issue-on-android-lollipop)) @@ -42,15 +42,15 @@ The **MediaCodec** API do not present the limitations I just mentionned, but has The buffer-to-buffer method uses calls to [**dequeueInputBuffer**](http://developer.android.com/reference/android/media/MediaCodec.html#dequeueInputBuffer(long)) and [**queueInputBuffer**](http://developer.android.com/reference/android/media/MediaCodec.html#queueInputBuffer(int, int, int, long, int)) to feed the encoder with raw data. That seems easy right ? Well it's not, because video encoders that you get access to with this API are using different color formats and you need to support all of them. A list of those color formats is available [here](http://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html). Moreover, many encoders claim support for color formats they don't actually support properly or can present little glitches. -All the [**hw**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/streaming/hw/package-summary.html) package is dedicated to solving those issues. See in particular [**EncoderDebugger**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/streaming/hw/EncoderDebugger.html) class. +All the [**hw**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/net.majorkernelpanic.streaming/hw/package-summary.html) package is dedicated to solving those issues. See in particular [**EncoderDebugger**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/net.majorkernelpanic.streaming/hw/EncoderDebugger.html) class. -If streaming with that API fails, libstreaming fallbacks on streaming with the **MediaRecorder API**. +If net.majorkernelpanic.streaming with that API fails, libstreaming fallbacks on net.majorkernelpanic.streaming with the **MediaRecorder API**. The surface-to-buffer method uses the [createInputSurface()](http://developer.android.com/reference/android/media/MediaCodec.html#createInputSurface()) method. This method is probably the best way to encode raw video from the camera but it requires android 4.3 and up. -The [**gl**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/streaming/gl/package-summary.html) package is dedicated to using the MediaCodec API with a surface. +The [**gl**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/net.majorkernelpanic.streaming/gl/package-summary.html) package is dedicated to using the MediaCodec API with a surface. -It is not yet enabled by default in libstreaming but you can force it with the [**setStreamingMethod(byte)**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/streaming/MediaStream.html#setStreamingMethod(byte)) method. +It is not yet enabled by default in libstreaming but you can force it with the [**setStreamingMethod(byte)**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/net.majorkernelpanic.streaming/MediaStream.html#setStreamingMethod(byte)) method. ### Packetization process @@ -65,7 +65,7 @@ If you are looking for a basic implementation of one of the RFC mentionned above RTCP packets are also sent to the receiver since version 2.0 of libstreaming. Only Sender Reports are implemented. They are actually needed for lip sync. -The [**rtp**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/streaming/rtp/package-summary.html) package handles packetization of encoded data in RTP packets. +The [**rtp**](http://guigui.us/libstreaming/doc/net/majorkernelpanic/net.majorkernelpanic.streaming/rtp/package-summary.html) package handles packetization of encoded data in RTP packets. # Using libstreaming in your app @@ -139,7 +139,7 @@ This example is extracted from [this simple android app](https://github.com/fyhe @Override public void onSessionError(int message, int streamType, Exception e) { - // Might happen if the streaming at the requested resolution is not supported + // Might happen if the net.majorkernelpanic.streaming at the requested resolution is not supported // or if the preview surface is not ready... // Check the Session class for a list of the possible errors. Log.e(TAG, "An error occured", e); @@ -159,15 +159,15 @@ This example is extracted from [this simple android app](https://github.com/fyhe @Override public void surfaceDestroyed(SurfaceHolder holder) { - // Stops the streaming session + // Stops the net.majorkernelpanic.streaming session mSession.stop(); } ``` -The **SessionBuilder** simply facilitates the creation of **Session** objects. The call to **setSurfaceView** is needed for video streaming, that should not come up as a surprise since Android requires a valid surface for recording video (it's an annoying limitation of the **MediaRecorder** API). On Android 4.3, streaming with no **SurfaceView** is possible but not yet implemented. The call to **setContext(Context)** is necessary, it allows **H264Stream** objects and **AACStream** objects to store and recover data using **SharedPreferences**. +The **SessionBuilder** simply facilitates the creation of **Session** objects. The call to **setSurfaceView** is needed for video net.majorkernelpanic.streaming, that should not come up as a surprise since Android requires a valid surface for recording video (it's an annoying limitation of the **MediaRecorder** API). On Android 4.3, net.majorkernelpanic.streaming with no **SurfaceView** is possible but not yet implemented. The call to **setContext(Context)** is necessary, it allows **H264Stream** objects and **AACStream** objects to store and recover data using **SharedPreferences**. -A **Session** object represents a streaming session to some peer. It contains one or more **Stream** objects that are started (resp. stopped) when the **start()** (resp. **stop()**) method is invoked. +A **Session** object represents a net.majorkernelpanic.streaming session to some peer. It contains one or more **Stream** objects that are started (resp. stopped) when the **start()** (resp. **stop()**) method is invoked. The method **getSessionDescription()** will return a SDP of the session in the form of a String. Before calling it, you must make sure that the **Session** has been configured. After calling **configure()** or **startPreview()** on you Session instance, the callback **onSessionConfigured()** will be called. @@ -184,7 +184,7 @@ The method **getSessionDescription()** will return a SDP of the session in the f } Strinf sdp = mSession.getSessionDescription(); ... - // Blocks until streaming actually starts. + // Blocks until net.majorkernelpanic.streaming actually starts. try { mSession.syncStart(); } catch (Exception e) { @@ -203,7 +203,8 @@ Check out [this page of the wiki](https://github.com/fyhertz/libstreaming/wiki/U #### Add this to your manifest: ```xml - + + ``` If you decide to override **RtspServer** change the line above accordingly. @@ -239,5 +240,5 @@ context.stopService(new Intent(this,RtspServer.class)); # Spydroid-ipcamera -Visit [this github page](https://github.com/fyhertz/spydroid-ipcamera) to see how this streaming stack can be used and how it performs. +Visit [this github page](https://github.com/fyhertz/spydroid-ipcamera) to see how this net.majorkernelpanic.streaming stack can be used and how it performs. diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..6aaaf2a4 --- /dev/null +++ b/build.gradle @@ -0,0 +1,26 @@ +import org.gradle.internal.jvm.Jvm + +buildscript { + ext.kotlin_version = "1.6.20" + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:7.1.3' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +println "Gradle uses Java ${Jvm.current()}" + +allprojects { + repositories { + google() + mavenCentral() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/build.xml b/build.xml deleted file mode 100644 index 7b3ed94b..00000000 --- a/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html index 647e7252..3ae5a876 100644 --- a/doc/allclasses-frame.html +++ b/doc/allclasses-frame.html @@ -12,46 +12,46 @@

All Classes

diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html index 89a8ef5f..c8f784a2 100644 --- a/doc/allclasses-noframe.html +++ b/doc/allclasses-noframe.html @@ -12,46 +12,46 @@

All Classes

diff --git a/doc/constant-values.html b/doc/constant-values.html index 22c46765..5c9c4ef4 100644 --- a/doc/constant-values.html +++ b/doc/constant-values.html @@ -82,7 +82,7 @@

net.majorkernelpanic.*

@@ -359,7 +359,7 @@

MODE_MEDIACODEC_API

Raw audio/video will be encoded using the MediaCodec API with buffers.
See Also:
-
Constant Field Values
+
Constant Field Values
@@ -373,7 +373,7 @@

MODE_MEDIACODEC_API_2

Raw audio/video will be encoded using the MediaCode API with a surface.
See Also:
-
Constant Field Values
+
Constant Field Values
@@ -387,7 +387,7 @@

PIPE_API_LS

A LocalSocket will be used to feed the MediaRecorder object
See Also:
-
Constant Field Values
+
Constant Field Values
@@ -401,7 +401,7 @@

PIPE_API_PFD

A ParcelFileDescriptor will be used to feed the MediaRecorder object
See Also:
-
Constant Field Values
+
Constant Field Values
@@ -440,7 +440,7 @@

setDestinationAddress

Sets the destination IP address of the stream.
Specified by:
-
setDestinationAddress in interface Stream
+
setDestinationAddress in interface Stream
Parameters:
dest - The destination address of the stream
@@ -460,7 +460,7 @@

setDestinationPorts

number will be used for RTCP.
Specified by:
-
setDestinationPorts in interface Stream
+
setDestinationPorts in interface Stream
Parameters:
dport - The destination port
@@ -477,7 +477,7 @@

setDestinationPorts

Sets the destination ports of the stream.
Specified by:
-
setDestinationPorts in interface Stream
+
setDestinationPorts in interface Stream
Parameters:
rtpPort - Destination port that will be used for RTP
rtcpPort - Destination port that will be used for RTCP
@@ -497,7 +497,7 @@

setOutputStream

be specified with this method.
Specified by:
-
setOutputStream in interface Stream
+
setOutputStream in interface Stream
@@ -512,7 +512,7 @@

setTimeToLive

Sets the Time To Live of packets sent over the network.
Specified by:
-
setTimeToLive in interface Stream
+
setTimeToLive in interface Stream
Parameters:
ttl - The time to live
Throws:
@@ -531,7 +531,7 @@

getDestinationPorts

one used for RTP and the second one is used for RTCP.
Specified by:
-
getDestinationPorts in interface Stream
+
getDestinationPorts in interface Stream
@@ -546,7 +546,7 @@

getLocalPorts

one used for RTP and the second one is used for RTCP.
Specified by:
-
getLocalPorts in interface Stream
+
getLocalPorts in interface Stream
@@ -557,19 +557,19 @@

getLocalPorts

  • setStreamingMethod

    public void setStreamingMethod(byte mode)
    -
    Sets the streaming method that will be used. +
    Sets the net.majorkernelpanic.streaming method that will be used. - If the mode is set to MODE_MEDIARECORDER_API, raw audio/video will be encoded + If the mode is set to MODE_MEDIARECORDER_API, raw audio/video will be encoded using the MediaRecorder API.
    - If the mode is set to MODE_MEDIACODEC_API or to MODE_MEDIACODEC_API_2, + If the mode is set to MODE_MEDIACODEC_API or to MODE_MEDIACODEC_API_2, audio/video will be encoded with using the MediaCodec.
    - The MODE_MEDIACODEC_API_2 mode only concerns VideoStream, it makes + The MODE_MEDIACODEC_API_2 mode only concerns VideoStream, it makes use of the createInputSurface() method of the MediaCodec API (Android 4.3 is needed there).
    Parameters:
    -
    mode - Can be MODE_MEDIARECORDER_API, MODE_MEDIACODEC_API or MODE_MEDIACODEC_API_2
    +
    mode - Can be MODE_MEDIARECORDER_API, MODE_MEDIACODEC_API or MODE_MEDIACODEC_API_2
  • @@ -580,8 +580,8 @@

    setStreamingMethod

  • getStreamingMethod

    public byte getStreamingMethod()
    -
    Returns the streaming method in use, call this after - configure() to get an accurate response.
    +
    Returns the net.majorkernelpanic.streaming method in use, call this after + configure() to get an accurate response.
  • @@ -590,8 +590,8 @@

    getStreamingMethod

    @@ -619,12 +619,12 @@

    getBitrate

  • isStreaming

    public boolean isStreaming()
    -
    Indicates if the MediaStream is streaming.
    +
    Indicates if the MediaStream is net.majorkernelpanic.streaming.
    Specified by:
    -
    isStreaming in interface Stream
    +
    isStreaming in interface Stream
    Returns:
    -
    A boolean indicating if the MediaStream is streaming
    +
    A boolean indicating if the MediaStream is net.majorkernelpanic.streaming
  • @@ -638,12 +638,12 @@

    configure

    throws java.lang.IllegalStateException, java.io.IOException + VideoStream.setVideoQuality(net.majorkernelpanic.net.majorkernelpanic.streaming.video.VideoQuality) + for a VideoStream and AudioStream.setAudioQuality(net.majorkernelpanic.net.majorkernelpanic.streaming.audio.AudioQuality) + for a AudioStream.
    Specified by:
    -
    configure in interface Stream
    +
    configure in interface Stream
    Throws:
    java.lang.IllegalStateException
    java.io.IOException
    @@ -662,7 +662,7 @@

    start

    Starts the stream.
    Specified by:
    -
    start in interface Stream
    +
    start in interface Stream
    Throws:
    java.lang.IllegalStateException
    java.io.IOException
    @@ -679,7 +679,7 @@

    stop

    Stops the stream.
    Specified by:
    -
    stop in interface Stream
    +
    stop in interface Stream
    @@ -691,12 +691,12 @@

    stop

    getSessionDescription

    public abstract java.lang.String getSessionDescription()
    Returns a description of the stream using SDP. - This method can only be called after Stream.configure().
    + This method can only be called after Stream.configure().
    Specified by:
    -
    getSessionDescription in interface Stream
    +
    getSessionDescription in interface Stream
    Throws:
    -
    java.lang.IllegalStateException - Thrown when Stream.configure() was not called.
    +
    java.lang.IllegalStateException - Thrown when Stream.configure() was not called.
    @@ -707,10 +707,10 @@

    getSessionDescription

  • getSSRC

    public int getSSRC()
    -
    Returns the SSRC of the underlying RtpSocket.
    +
    Returns the SSRC of the underlying RtpSocket.
    Specified by:
    -
    getSSRC in interface Stream
    +
    getSSRC in interface Stream
    Returns:
    the SSRC of the stream
    @@ -744,10 +744,10 @@

    getSSRC

  • onPreviewStarted

    void onPreviewStarted()
    -
    Called when the previw of the VideoStream +
    Called when the previw of the VideoStream has correctly been started. If an error occurs while starting the preview, - onSessionError(int, int, Exception) will be - called instead of onPreviewStarted().
    + onSessionError(int, int, Exception) will be + called instead of onPreviewStarted().
  • @@ -226,10 +226,10 @@

    onPreviewStarted

    onSessionConfigured

    void onSessionConfigured()
    + after calling Session.configure(). + If an error occurs while configuring the Session, + onSessionError(int, int, Exception) will be + called instead of onSessionConfigured(). @@ -240,9 +240,9 @@

    onSessionConfigured

    onSessionStarted

    void onSessionStarted()
    + If an error occurs while starting the Session, + onSessionError(int, int, Exception) will be + called instead of onSessionStarted(). @@ -282,11 +282,11 @@

    onSessionStopped

    - +
    • setVideoQuality

      -
      public void setVideoQuality(VideoQuality quality)
      +
      public void setVideoQuality(VideoQuality quality)
      Sets the configuration of the stream.
      You can call this method at any time and changes will take - effect next time you call configure().
      + effect next time you call configure().
      Parameters:
      quality - Quality of the stream
    - +
    • setSurfaceView

      -
      public void setSurfaceView(SurfaceView view)
      +
      public void setSurfaceView(SurfaceView view)
      Sets a Surface to show a preview of recorded media (video).
      You can call this method at any time and changes will take - effect next time you call start() or startPreview().
      + effect next time you call start() or startPreview().
    @@ -739,23 +739,23 @@

    setPreviewOrientation

    public void setPreviewOrientation(int orientation)
    + effect next time you call configure().
    Parameters:
    orientation - The orientation of the preview
    - + @@ -796,7 +796,7 @@

    getSessionDescription

  • getDestination

    public java.lang.String getDestination()
    -
    Returns the destination set with setDestination(String).
    +
    Returns the destination set with setDestination(String).
  • @@ -836,22 +836,22 @@

    configure

  • syncConfigure

    public void syncConfigure()
    -                   throws CameraInUseException,
    -                          StorageUnavailableException,
    -                          ConfNotSupportedException,
    -                          InvalidSurfaceException,
    +                   throws CameraInUseException,
    +                          StorageUnavailableException,
    +                          ConfNotSupportedException,
    +                          InvalidSurfaceException,
                               java.lang.RuntimeException,
                               java.io.IOException
    -
    Does the same thing as configure(), but in a synchronous manner.
    +
    Does the same thing as configure(), but in a synchronous manner.
    Throws exceptions in addition to calling a callback - Session.Callback.onSessionError(int, int, Exception) when + Session.Callback.onSessionError(int, int, Exception) when an error occurs.
    Throws:
    -
    CameraInUseException
    -
    StorageUnavailableException
    -
    ConfNotSupportedException
    -
    InvalidSurfaceException
    +
    CameraInUseException
    +
    StorageUnavailableException
    +
    ConfNotSupportedException
    +
    InvalidSurfaceException
    java.lang.RuntimeException
    java.io.IOException
    @@ -874,10 +874,10 @@

    start

  • syncStart

    public void syncStart(int id)
    -               throws CameraInUseException,
    -                      StorageUnavailableException,
    -                      ConfNotSupportedException,
    -                      InvalidSurfaceException,
    +               throws CameraInUseException,
    +                      StorageUnavailableException,
    +                      ConfNotSupportedException,
    +                      InvalidSurfaceException,
                           java.net.UnknownHostException,
                           java.io.IOException
    Starts a stream in a synchronous manner.
    @@ -886,10 +886,10 @@

    syncStart

    Parameters:
    id - The id of the stream to start
    Throws:
    -
    CameraInUseException
    -
    StorageUnavailableException
    -
    ConfNotSupportedException
    -
    InvalidSurfaceException
    +
    CameraInUseException
    +
    StorageUnavailableException
    +
    ConfNotSupportedException
    +
    InvalidSurfaceException
    java.net.UnknownHostException
    java.io.IOException
  • @@ -902,20 +902,20 @@

    syncStart

  • syncStart

    public void syncStart()
    -               throws CameraInUseException,
    -                      StorageUnavailableException,
    -                      ConfNotSupportedException,
    -                      InvalidSurfaceException,
    +               throws CameraInUseException,
    +                      StorageUnavailableException,
    +                      ConfNotSupportedException,
    +                      InvalidSurfaceException,
                           java.net.UnknownHostException,
                           java.io.IOException
    -
    Does the same thing as start(), but in a synchronous manner.
    +
    Does the same thing as start(), but in a synchronous manner.
    Throws exceptions in addition to calling a callback.
    Throws:
    -
    CameraInUseException
    -
    StorageUnavailableException
    -
    ConfNotSupportedException
    -
    InvalidSurfaceException
    +
    CameraInUseException
    +
    StorageUnavailableException
    +
    ConfNotSupportedException
    +
    InvalidSurfaceException
    java.net.UnknownHostException
    java.io.IOException
    @@ -949,9 +949,9 @@

    syncStop

    startPreview

    public void startPreview()
    Asynchronously starts the camera preview.
    - You should of course pass a SurfaceView to setSurfaceView(SurfaceView) - before calling this method. Otherwise, the Session.Callback.onSessionError(int, int, Exception) - callback will be called with ERROR_INVALID_SURFACE.
    + You should of course pass a SurfaceView to setSurfaceView(SurfaceView) + before calling this method. Otherwise, the Session.Callback.onSessionError(int, int, Exception) + callback will be called with ERROR_INVALID_SURFACE.
  • @@ -972,9 +972,9 @@

    stopPreview

    switchCamera

    public void switchCamera()
    Switch between the front facing and the back facing camera of the phone.
    - If
    startPreview() has been called, the preview will be briefly interrupted.
    - If start() has been called, the stream will be briefly interrupted.
    - To find out which camera is currently selected, use getCamera()
    + If startPreview() has been called, the preview will be briefly interrupted.
    + If start() has been called, the stream will be briefly interrupted.
    + To find out which camera is currently selected, use getCamera() @@ -998,7 +998,7 @@

    toggleFlash

    public void toggleFlash()
    + getVideoTrack() and VideoStream.getFlashState(). @@ -1026,7 +1026,7 @@

    trackExists

    @@ -1056,11 +1056,11 @@

    getTrack

    @@ -131,42 +131,42 @@

    Field Summary

    static int -AUDIO_AAC -
    Can be used with setAudioEncoder(int).
    +AUDIO_AAC +
    Can be used with setAudioEncoder(int).
    static int -AUDIO_AMRNB -
    Can be used with setAudioEncoder(int).
    +AUDIO_AMRNB +
    Can be used with setAudioEncoder(int).
    static int -AUDIO_NONE -
    Can be used with setAudioEncoder(int).
    +AUDIO_NONE +
    Can be used with setAudioEncoder(int).
    static java.lang.String -TAG  +TAG  static int -VIDEO_H263 -
    Can be used with setVideoEncoder(int).
    +VIDEO_H263 +
    Can be used with setVideoEncoder(int).
    static int -VIDEO_H264 -
    Can be used with setVideoEncoder(int).
    +VIDEO_H264 +
    Can be used with setVideoEncoder(int).
    static int -VIDEO_NONE -
    Can be used with setVideoEncoder(int).
    +VIDEO_NONE +
    Can be used with setVideoEncoder(int).
    @@ -185,156 +185,156 @@

    Method Summary

    Method and Description -Session -build() -
    Creates a new Session.
    +Session +build() +
    Creates a new Session.
    -SessionBuilder -clone() -
    Returns a new SessionBuilder with the same configuration.
    +SessionBuilder +clone() +
    Returns a new SessionBuilder with the same configuration.
    int -getAudioEncoder() -
    Returns the audio encoder set with setAudioEncoder(int).
    +getAudioEncoder() +
    Returns the audio encoder set with setAudioEncoder(int).
    -AudioQuality -getAudioQuality() -
    Returns the AudioQuality set with setAudioQuality(AudioQuality).
    +AudioQuality +getAudioQuality() +
    Returns the AudioQuality set with setAudioQuality(AudioQuality).
    int -getCamera() -
    Returns the id of the android.hardware.Camera set with setCamera(int).
    +getCamera() +
    Returns the id of the android.hardware.Camera set with setCamera(int).
    Context -getContext() -
    Returns the context set with setContext(Context)
    +getContext() +
    Returns the context set with setContext(Context)
    java.lang.String -getDestination() -
    Returns the destination ip address set with setDestination(String).
    +getDestination() +
    Returns the destination ip address set with setDestination(String).
    boolean -getFlashState() -
    Returns the flash state set with setFlashEnabled(boolean).
    +getFlashState() +
    Returns the flash state set with setFlashEnabled(boolean).
    -static SessionBuilder -getInstance() -
    Returns a reference to the SessionBuilder.
    +static SessionBuilder +getInstance() +
    Returns a reference to the SessionBuilder.
    java.lang.String -getOrigin() -
    Returns the origin ip address set with setOrigin(String).
    +getOrigin() +
    Returns the origin ip address set with setOrigin(String).
    -SurfaceView -getSurfaceView() -
    Returns the SurfaceView set with setSurfaceView(SurfaceView).
    +SurfaceView +getSurfaceView() +
    Returns the SurfaceView set with setSurfaceView(SurfaceView).
    int -getTimeToLive() -
    Returns the time to live set with setTimeToLive(int).
    +getTimeToLive() +
    Returns the time to live set with setTimeToLive(int).
    int -getVideoEncoder() -
    Returns the video encoder set with setVideoEncoder(int).
    +getVideoEncoder() +
    Returns the video encoder set with setVideoEncoder(int).
    -VideoQuality -getVideoQuality() -
    Returns the VideoQuality set with setVideoQuality(VideoQuality).
    +VideoQuality +getVideoQuality() +
    Returns the VideoQuality set with setVideoQuality(VideoQuality).
    -SessionBuilder -setAudioEncoder(int encoder) +SessionBuilder +setAudioEncoder(int encoder)
    Sets the audio encoder.
    -SessionBuilder -setAudioQuality(AudioQuality quality) +SessionBuilder +setAudioQuality(AudioQuality quality)
    Sets the audio quality.
    -SessionBuilder -setCallback(Session.Callback callback)  +SessionBuilder +setCallback(Session.Callback callback)  -SessionBuilder -setCamera(int camera)  +SessionBuilder +setCamera(int camera)  -SessionBuilder -setContext(Context context) +SessionBuilder +setContext(Context context)
    Access to the context is needed for the H264Stream class to store some stuff in the SharedPreferences.
    -SessionBuilder -setDestination(java.lang.String destination) +SessionBuilder +setDestination(java.lang.String destination)
    Sets the destination of the session.
    -SessionBuilder -setFlashEnabled(boolean enabled)  +SessionBuilder +setFlashEnabled(boolean enabled)  -SessionBuilder -setOrigin(java.lang.String origin) +SessionBuilder +setOrigin(java.lang.String origin)
    Sets the origin of the session.
    -SessionBuilder -setPreviewOrientation(int orientation) +SessionBuilder +setPreviewOrientation(int orientation)
    Sets the orientation of the preview.
    -SessionBuilder -setSurfaceView(SurfaceView surfaceView) +SessionBuilder +setSurfaceView(SurfaceView surfaceView)
    Sets the SurfaceView required to preview the video stream.
    -SessionBuilder -setTimeToLive(int ttl)  +SessionBuilder +setTimeToLive(int ttl)  -SessionBuilder -setVideoEncoder(int encoder) +SessionBuilder +setVideoEncoder(int encoder)
    Sets the default video encoder.
    -SessionBuilder -setVideoQuality(VideoQuality quality) +SessionBuilder +setVideoQuality(VideoQuality quality)
    Sets the video stream quality.
    @@ -369,7 +369,7 @@

    TAG

    public static final java.lang.String TAG
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
    @@ -380,10 +380,10 @@

    TAG

  • VIDEO_NONE

    public static final int VIDEO_NONE
    -
    Can be used with setVideoEncoder(int).
    +
    Can be used with setVideoEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -394,10 +394,10 @@

    VIDEO_NONE

  • VIDEO_H264

    public static final int VIDEO_H264
    -
    Can be used with setVideoEncoder(int).
    +
    Can be used with setVideoEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -408,10 +408,10 @@

    VIDEO_H264

  • VIDEO_H263

    public static final int VIDEO_H263
    -
    Can be used with setVideoEncoder(int).
    +
    Can be used with setVideoEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -422,10 +422,10 @@

    VIDEO_H263

  • AUDIO_NONE

    public static final int AUDIO_NONE
    -
    Can be used with setAudioEncoder(int).
    +
    Can be used with setAudioEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -436,10 +436,10 @@

    AUDIO_NONE

  • AUDIO_AMRNB

    public static final int AUDIO_AMRNB
    -
    Can be used with setAudioEncoder(int).
    +
    Can be used with setAudioEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -450,10 +450,10 @@

    AUDIO_AMRNB

  • AUDIO_AAC

    public static final int AUDIO_AAC
    -
    Can be used with setAudioEncoder(int).
    +
    Can be used with setAudioEncoder(int).
    See Also:
    -
    Constant Field Values
    +
    Constant Field Values
  • @@ -471,11 +471,11 @@

    Method Detail

    @@ -485,8 +485,8 @@

    getInstance

    @@ -653,7 +653,7 @@

    getDestination

  • getOrigin

    public java.lang.String getOrigin()
    -
    +
    Returns the origin ip address set with setOrigin(String).
  • @@ -663,7 +663,7 @@

    getOrigin

  • getAudioEncoder

    public int getAudioEncoder()
    -
    +
    Returns the audio encoder set with setAudioEncoder(int).
  • @@ -673,7 +673,7 @@

    getAudioEncoder

  • getCamera

    public int getCamera()
    -
    +
    Returns the id of the android.hardware.Camera set with setCamera(int).
  • @@ -683,7 +683,7 @@

    getCamera

  • getVideoEncoder

    public int getVideoEncoder()
    -
    +
    Returns the video encoder set with setVideoEncoder(int).
  • @@ -692,8 +692,8 @@

    getVideoEncoder

    @@ -702,8 +702,8 @@

    getVideoQuality

    @@ -713,7 +713,7 @@

    getAudioQuality

  • getFlashState

    public boolean getFlashState()
    -
    +
    Returns the flash state set with setFlashEnabled(boolean).
  • @@ -722,8 +722,8 @@

    getFlashState

    @@ -733,7 +733,7 @@

    getSurfaceView

  • getTimeToLive

    public int getTimeToLive()
    -
    +
    Returns the time to live set with setTimeToLive(int).
  • @@ -742,8 +742,8 @@

    getTimeToLive

    @@ -399,14 +399,14 @@

    getSessionDescription

    public java.lang.String getSessionDescription()
                                            throws java.lang.IllegalStateException
    Returns a description of the stream using SDP. It can then be included in an SDP file. - Will fail if called when streaming.
    + Will fail if called when net.majorkernelpanic.streaming.
    Specified by:
    -
    getSessionDescription in interface Stream
    +
    getSessionDescription in interface Stream
    Specified by:
    -
    getSessionDescription in class MediaStream
    +
    getSessionDescription in class MediaStream
    Throws:
    -
    java.lang.IllegalStateException - Thrown when Stream.configure() was not called.
    +
    java.lang.IllegalStateException - Thrown when Stream.configure() was not called.
    @@ -438,10 +438,10 @@

    getSessionDescription

    java.lang.String -getSessionDescription() +getSessionDescription()
    Returns a description of the stream using SDP.
    void -start() +start()
    Starts the stream.
    @@ -342,11 +342,11 @@

    getSessionDescription