Skip to content

Commit 2c2d722

Browse files
committed
多通道拉流代码恢复
1 parent 86ac95e commit 2c2d722

File tree

6 files changed

+364
-474
lines changed

6 files changed

+364
-474
lines changed

sdk/video-link-android/src/main/java/com/tencent/iot/video/link/consts/VideoConst.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ object VideoConst {
2626
const val VIDEO_WLAN_PARAMS = "params"
2727
const val VIDEO_WLAN_DEV_NAMES = "deviceName"
2828
const val MULTI_VIDEO_P2P_INFO = "p2pInfo"
29+
const val VIDEO_DEV_CHANNELS = "VideoDevChannels"
2930
}

sdkdemo/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@
6666
<activity
6767
android:name=".video.playback.VideoPlaybackActivity"
6868
android:configChanges="orientation|keyboardHidden|screenSize" />
69-
<!-- <activity-->
70-
<!-- android:name=".video.preview.VideoMultiPreviewActivity"-->
71-
<!-- android:configChanges="orientation|keyboardHidden|screenSize" />-->
69+
<activity
70+
android:name=".video.preview.VideoMultiPreviewActivity"
71+
android:configChanges="orientation|keyboardHidden|screenSize" />
7272
<activity
7373
android:name=".video.preview.VideoPreviewActivity"
7474
android:configChanges="orientation|keyboardHidden|screenSize" />

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/VideoDeviceFragment.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ import com.tencent.iot.explorer.link.demo.databinding.FragmentVideoDeviceBinding
2121
import com.tencent.iot.explorer.link.demo.video.nvr.VideoNvrActivity
2222
import com.tencent.iot.explorer.link.demo.video.playback.VideoPlaybackActivity
2323
import com.tencent.iot.explorer.link.demo.video.preview.DevUrl2Preview
24+
import com.tencent.iot.explorer.link.demo.video.preview.VideoMultiPreviewActivity
2425
import com.tencent.iot.explorer.link.demo.video.preview.VideoPreviewActivity
2526
import com.tencent.iot.explorer.link.demo.video.preview.VideoPreviewMJPEGActivity
2627
import com.tencent.iot.explorer.link.demo.video.preview.VideoPushStreamActivity
2728
import com.tencent.iot.explorer.link.demo.video.preview.VideoWithoutPropertyActivity
2829
import com.tencent.iot.explorer.link.demo.video.utils.ListOptionsDialog
30+
import com.tencent.iot.explorer.link.demo.video.utils.MultipleChannelChooseDialog
2931
import com.tencent.iot.explorer.link.demo.video.utils.ToastDialog
3032
import com.tencent.iot.video.link.callback.VideoCallback
3133
import com.tencent.iot.video.link.consts.VideoConst
@@ -37,13 +39,17 @@ import kotlinx.coroutines.MainScope
3739
import kotlinx.coroutines.cancel
3840
import kotlinx.coroutines.launch
3941

40-
class VideoDeviceFragment : BaseFragment<FragmentVideoDeviceBinding>(), VideoCallback, DevsAdapter.OnItemClicked,
42+
class VideoDeviceFragment : BaseFragment<FragmentVideoDeviceBinding>(), VideoCallback,
43+
DevsAdapter.OnItemClicked,
4144
CoroutineScope by MainScope() {
4245
private var devs: MutableList<DevInfo> = ArrayList()
4346
private var adapter: DevsAdapter? = null
4447
private var videoProductInfo: VideoProductInfo? = null
4548

46-
override fun getViewBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentVideoDeviceBinding = FragmentVideoDeviceBinding.inflate(inflater, container, false)
49+
override fun getViewBinding(
50+
inflater: LayoutInflater,
51+
container: ViewGroup?
52+
): FragmentVideoDeviceBinding = FragmentVideoDeviceBinding.inflate(inflater, container, false)
4753

4854
override fun startHere(view: View) {
4955
setListener()
@@ -165,22 +171,16 @@ class VideoDeviceFragment : BaseFragment<FragmentVideoDeviceBinding>(), VideoCal
165171
4 -> {
166172
VideoPushStreamActivity.startPreviewActivity(context, dev)
167173
}
168-
// 5 -> {
169-
// val multipleChannelChooseDialog = MultipleChannelChooseDialog(context)
170-
// multipleChannelChooseDialog.show()
171-
// multipleChannelChooseDialog.setOnDismisListener { selectChannels ->
172-
// var allUrl = ArrayList<DevUrl2Preview>()
173-
// for (i in 0 until selectChannels.size) {
174-
// var device = DevUrl2Preview()
175-
// device.devName = dev.DeviceName
176-
// device.Status = 1
177-
// device.channel = selectChannels[i]
178-
// allUrl.add(device)
179-
// }
180-
//
181-
// VideoMultiPreviewActivity.startMultiPreviewActivity(context, allUrl)
182-
// }
183-
// }
174+
175+
5 -> {
176+
val multipleChannelChooseDialog = MultipleChannelChooseDialog(context)
177+
multipleChannelChooseDialog.show()
178+
multipleChannelChooseDialog.setOnDismisListener { selectChannels ->
179+
VideoMultiPreviewActivity.startMultiPreviewActivity(
180+
context, dev, selectChannels
181+
)
182+
}
183+
}
184184
}
185185
}
186186
}

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/DevUrl2Preview.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class DevUrl2Preview {
1212
var channel2DevName = ""
1313
var surfaceTextureListener : TextureView.SurfaceTextureListener? = null
1414
var player: IjkMediaPlayer? = null
15-
var lock: Object = Object()
16-
var keepAliveThreadRuning = true
1715
var surface: Surface? = null
1816
var address = ""
1917
var port = 0

0 commit comments

Comments
 (0)