Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ dependencies {
- [x] RTMPS (under TLS)
- [x] RTMPT and RTMPTS (tunneled and tunneled under TLS)
- [x] AMF0
- [ ] AMF3

### RTSP:

Expand Down
4 changes: 4 additions & 0 deletions common/src/main/java/com/pedro/common/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ fun ByteArray.toUInt32(): Int {
return this[0].toInt() and 0xff shl 24 or (this[1].toInt() and 0xff shl 16) or (this[2].toInt() and 0xff shl 8) or (this[3].toInt() and 0xff)
}

fun ByteArray.toUInt64(): Long {
return (this[0].toLong() and 0xff shl 56) or (this[1].toLong() and 0xff shl 48) or (this[2].toLong() and 0xff shl 40) or (this[3].toLong() and 0xff shl 32) or (this[4].toLong() and 0xff shl 24) or (this[5].toLong() and 0xff shl 16) or (this[6].toLong() and 0xff shl 8) or (this[7].toLong() and 0xff)
}

fun ByteArray.toUInt32LittleEndian(): Int {
return Integer.reverseBytes(toUInt32())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import com.pedro.encoder.video.VideoEncoderHelper
import com.pedro.library.base.recording.AsyncBaseRecordController
import com.pedro.library.base.recording.RecordController
import com.pedro.library.base.recording.RecordController.RecordTracks
import com.pedro.rtmp.amf.v0.AmfEcmaArray
import com.pedro.rtmp.amf.v0.AmfString
import com.pedro.rtmp.amf.AmfEcmaArray
import com.pedro.rtmp.amf.AmfString
import com.pedro.rtmp.flv.BasePacket
import com.pedro.rtmp.flv.FlvPacket
import com.pedro.rtmp.flv.FlvType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.IOException
import java.io.InputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.IOException
import java.io.InputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.TimeUtils
import com.pedro.common.readUntil
Expand All @@ -36,7 +36,7 @@ class AmfDate(var date: Double = TimeUtils.getCurrentTimeMillis().toDouble()): A
val bytes = ByteArray(getSize() - 2)
input.readUntil(bytes)
val value = ByteBuffer.wrap(bytes).long
date = Double.Companion.fromBits(value)
date = Double.fromBits(value)
val timeZone = byteArrayOf(0x00, 0x00)
input.readUntil(timeZone)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUInt32
import com.pedro.common.writeUInt32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUInt32
import com.pedro.common.readUntil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.IOException
import java.io.InputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUntil
import java.io.IOException
Expand All @@ -34,7 +34,7 @@ class AmfNumber(var value: Double = 0.0): AmfData() {
val bytes = ByteArray(getSize())
input.readUntil(bytes)
val value = ByteBuffer.wrap(bytes).long
this.value = Double.Companion.fromBits(value)
this.value = Double.fromBits(value)
}

@Throws(IOException::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.BufferedInputStream
import java.io.IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUntil
import java.io.IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUInt32
import com.pedro.common.writeUInt32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import com.pedro.common.readUInt16
import com.pedro.common.readUntil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

/**
* Created by pedro on 20/04/21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.IOException
import java.io.InputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import java.io.IOException
import java.io.InputStream
Expand Down
24 changes: 0 additions & 24 deletions rtmp/src/main/java/com/pedro/rtmp/amf/AmfVersion.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.pedro.rtmp.amf.v0
package com.pedro.rtmp.amf

import org.w3c.dom.Document
import org.xml.sax.InputSource
Expand Down
40 changes: 0 additions & 40 deletions rtmp/src/main/java/com/pedro/rtmp/amf/v3/Amf3Array.kt

This file was deleted.

77 changes: 0 additions & 77 deletions rtmp/src/main/java/com/pedro/rtmp/amf/v3/Amf3Data.kt

This file was deleted.

40 changes: 0 additions & 40 deletions rtmp/src/main/java/com/pedro/rtmp/amf/v3/Amf3Dictionary.kt

This file was deleted.

Loading
Loading