Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
174 additions
and
228 deletions.
There are no files selected for viewing
76 changes: 0 additions & 76 deletions
76
library/src/main/java/com/pedro/library/rtmp/RtmpOnlyAudio.java
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
library/src/main/java/com/pedro/library/rtmp/RtmpOnlyAudio.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023 pedroSG94. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.pedro.library.rtmp | ||
|
||
import android.media.MediaCodec | ||
import com.pedro.common.AudioCodec | ||
import com.pedro.common.ConnectChecker | ||
import com.pedro.library.base.OnlyAudioBase | ||
import com.pedro.library.util.streamclient.RtmpStreamClient | ||
import com.pedro.rtmp.rtmp.RtmpClient | ||
import java.nio.ByteBuffer | ||
|
||
/** | ||
* More documentation see: | ||
* [com.pedro.library.base.OnlyAudioBase] | ||
* | ||
* Created by pedro on 10/07/18. | ||
*/ | ||
class RtmpOnlyAudio(connectChecker: ConnectChecker) : OnlyAudioBase() { | ||
|
||
private val rtmpClient = RtmpClient(connectChecker).apply { setOnlyAudio(true) } | ||
private val streamClient = RtmpStreamClient(rtmpClient, null) | ||
|
||
override fun getStreamClient(): RtmpStreamClient = streamClient | ||
|
||
override fun setAudioCodecImp(codec: AudioCodec) { | ||
rtmpClient.setAudioCodec(codec) | ||
} | ||
|
||
override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) { | ||
rtmpClient.setAudioInfo(sampleRate, isStereo) | ||
} | ||
|
||
override fun startStreamRtp(url: String) { | ||
rtmpClient.connect(url) | ||
} | ||
|
||
override fun stopStreamRtp() { | ||
rtmpClient.disconnect() | ||
} | ||
|
||
override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) { | ||
rtmpClient.sendAudio(aacBuffer, info) | ||
} | ||
} |
76 changes: 0 additions & 76 deletions
76
library/src/main/java/com/pedro/library/rtsp/RtspOnlyAudio.java
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
library/src/main/java/com/pedro/library/rtsp/RtspOnlyAudio.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023 pedroSG94. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.pedro.library.rtsp | ||
|
||
import android.media.MediaCodec | ||
import com.pedro.common.AudioCodec | ||
import com.pedro.common.ConnectChecker | ||
import com.pedro.library.base.OnlyAudioBase | ||
import com.pedro.library.util.streamclient.RtspStreamClient | ||
import com.pedro.rtsp.rtsp.RtspClient | ||
import java.nio.ByteBuffer | ||
|
||
/** | ||
* More documentation see: | ||
* [com.pedro.library.base.OnlyAudioBase] | ||
* | ||
* Created by pedro on 10/07/18. | ||
*/ | ||
class RtspOnlyAudio(connectChecker: ConnectChecker) : OnlyAudioBase() { | ||
|
||
private val rtspClient = RtspClient(connectChecker).apply { setOnlyAudio(true) } | ||
private val streamClient = RtspStreamClient(rtspClient, null) | ||
|
||
override fun getStreamClient(): RtspStreamClient = streamClient | ||
|
||
override fun setAudioCodecImp(codec: AudioCodec) { | ||
rtspClient.setAudioCodec(codec) | ||
} | ||
|
||
override fun prepareAudioRtp(isStereo: Boolean, sampleRate: Int) { | ||
rtspClient.setAudioInfo(sampleRate, isStereo) | ||
} | ||
|
||
override fun startStreamRtp(url: String) { | ||
rtspClient.connect(url) | ||
} | ||
|
||
override fun stopStreamRtp() { | ||
rtspClient.disconnect() | ||
} | ||
|
||
override fun getAacDataRtp(aacBuffer: ByteBuffer, info: MediaCodec.BufferInfo) { | ||
rtspClient.sendAudio(aacBuffer, info) | ||
} | ||
} |
76 changes: 0 additions & 76 deletions
76
library/src/main/java/com/pedro/library/srt/SrtOnlyAudio.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.