Skip to content

Commit

Permalink
update dependencies and adapt code
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Sep 1, 2024
1 parent bea0367 commit ab9b13d
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ allprojects {
}
}
dependencies {
implementation 'com.github.pedroSG94:RTSP-Server:1.3.0'
implementation 'com.github.pedroSG94.RootEncoder:library:2.4.6'
implementation 'com.github.pedroSG94:RTSP-Server:1.3.1'
implementation 'com.github.pedroSG94.RootEncoder:library:2.5.0'
}
```
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
libraryGroup = "com.github.pedroSG94"
versionCode = "130"
versionName = "1.3.0"
versionCode = "131"
versionName = "1.3.1"

#plugins versions
agp = "8.5.0"
kotlin = "2.0.0"
agp = "8.5.2"
kotlin = "2.0.20"
dokka = "1.9.20"

#dependencies versions
#noinspection GradleDependency, version 1.7.0 need min sdk 21
appcompat = "1.6.1"
constraintlayout = "2.1.4"
coroutines = "1.8.1"
rootencoder = "2.4.6"
rootencoder = "2.5.0"

[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@ class RtspServerCamera1: Camera1Base {
rtspServer.startServer()
}

override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) {
override fun onAudioInfoImp(isStereo: Boolean, sampleRate: Int) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun startStreamRtp(url: String) { //unused
override fun startStreamImp(url: String?) { //unused
}

override fun stopStreamRtp() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun onSpsPpsVpsRtp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
override fun onVideoInfoImp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
val newSps = sps.duplicate()
val newPps = pps?.duplicate()
val newVps = vps?.duplicate()
rtspServer.setVideoInfo(newSps, newPps, newVps)
}

override fun getH264DataRtp(h264Buffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(h264Buffer, info)
override fun getVideoDataImp(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(videoBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RtspServerCamera2: Camera2Base {
rtspServer = RtspServer(connectChecker, port)
}

constructor(context: Context, useOpengl: Boolean, connectCheckerRtsp: ConnectChecker, port: Int): super(context, useOpengl) {
constructor(context: Context, connectCheckerRtsp: ConnectChecker, port: Int): super(context) {
rtspServer = RtspServer(connectCheckerRtsp, port)
}

Expand All @@ -31,30 +31,30 @@ class RtspServerCamera2: Camera2Base {
rtspServer.startServer()
}

override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) {
override fun onAudioInfoImp(isStereo: Boolean, sampleRate: Int) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun startStreamRtp(url: String) { //unused
override fun startStreamImp(url: String?) { //unused
}

override fun stopStreamRtp() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun onSpsPpsVpsRtp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
override fun onVideoInfoImp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
val newSps = sps.duplicate()
val newPps = pps?.duplicate()
val newVps = vps?.duplicate()
rtspServer.setVideoInfo(newSps, newPps, newVps)
}

override fun getH264DataRtp(h264Buffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(h264Buffer, info)
override fun getVideoDataImp(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(videoBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@ class RtspServerDisplay(
rtspServer.startServer()
}

override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) {
override fun onAudioInfoImp(isStereo: Boolean, sampleRate: Int) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun startStreamRtp(url: String) { //unused
override fun startStreamImp(url: String?) { //unused
}

override fun stopStreamRtp() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun onSpsPpsVpsRtp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
override fun onVideoInfoImp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
val newSps = sps.duplicate()
val newPps = pps?.duplicate()
val newVps = vps?.duplicate()
rtspServer.setVideoInfo(newSps, newPps, newVps)
}

override fun getH264DataRtp(h264Buffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(h264Buffer, info)
override fun getVideoDataImp(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(videoBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,30 @@ class RtspServerFromFile: FromFileBase {
rtspServer.startServer()
}

override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) {
override fun onAudioInfoImp(isStereo: Boolean, sampleRate: Int) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun startStreamRtp(url: String) { //unused
override fun startStreamImp(url: String?) { //unused
}

override fun stopStreamRtp() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun onSpsPpsVpsRtp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
override fun onVideoInfoImp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
val newSps = sps.duplicate()
val newPps = pps?.duplicate()
val newVps = vps?.duplicate()
rtspServer.setVideoInfo(newSps, newPps, newVps)
}

override fun getH264DataRtp(h264Buffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(h264Buffer, info)
override fun getVideoDataImp(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(videoBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ class RtspServerOnlyAudio(
rtspServer.startServer()
}

override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) {
override fun onAudioInfoImp(isStereo: Boolean, sampleRate: Int) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun startStreamRtp(url: String) { //unused
override fun startStreamImp(url: String?) { //unused
}

override fun stopStreamRtp() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,30 @@ class RtspServerStream(
rtspServer.startServer()
}

override fun audioInfo(sampleRate: Int, isStereo: Boolean) {
override fun onAudioInfoImp(sampleRate: Int, isStereo: Boolean) {
rtspServer.setAudioInfo(sampleRate, isStereo)
}

override fun rtpStartStream(endPoint: String) { //unused
override fun startStreamImp(endPoint: String) { //unused
}

override fun rtpStopStream() {
override fun stopStreamImp() {
rtspServer.stopServer()
}

override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(aacBuffer, info)
override fun getAudioDataImp(audioBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendAudio(audioBuffer, info)
}

override fun onSpsPpsVpsRtp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
override fun onVideoInfoImp(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) {
val newSps = sps.duplicate()
val newPps = pps?.duplicate()
val newVps = vps?.duplicate()
rtspServer.setVideoInfo(newSps, newPps, newVps)
}

override fun getH264DataRtp(h264Buffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(h264Buffer, info)
override fun getVideoDataImp(videoBuffer: ByteBuffer, info: MediaCodec.BufferInfo) {
rtspServer.sendVideo(videoBuffer, info)
}

override fun getStreamClient(): RtspServerStreamClient = RtspServerStreamClient(rtspServer)
Expand Down

0 comments on commit ab9b13d

Please sign in to comment.