# RtpUtils

# RtpUtils

Artifact:[androidx.media3:media3-exoplayer-rtsp](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/rtsp/RtpUtils.java+class:androidx.media3.exoplayer.rtsp.RtpUtils)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/rtsp/RtpUtils "View this page in Java")

<br />

```
@UnstableApi
class RtpUtils
```

<br />

*** ** * ** ***

Utility methods for RTP.

## Summary

|                                              ### Public functions                                               |
|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[DataSpec](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec)`!` | [getIncomingRtpDataSpec](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/rtsp/RtpUtils#getIncomingRtpDataSpec(int))`(portNumber: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the[DataSpec](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec)with the[Uri](https://developer.android.com/reference/android/net/Uri.html)for incoming RTP connection. |

## Public functions

### getIncomingRtpDataSpec

```
java-static fun getIncomingRtpDataSpec(portNumber: Int): DataSpec!
```

Returns the[DataSpec](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec)with the[Uri](https://developer.android.com/reference/android/net/Uri.html)for incoming RTP connection.