Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6f7c97a7
authored
Nov 10, 2020
by
claincly
Committed by
kim-vde
Nov 11, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add method to expose the locally opened port for UdpDataSource.
PiperOrigin-RevId: 341707809
parent
b1eef00b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
library/core/src/main/java/com/google/android/exoplayer2/upstream/UdpDataSource.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/UdpDataSource.java
View file @
6f7c97a7
...
@@ -45,6 +45,8 @@ public final class UdpDataSource extends BaseDataSource {
...
@@ -45,6 +45,8 @@ public final class UdpDataSource extends BaseDataSource {
/** The default socket timeout, in milliseconds. */
/** The default socket timeout, in milliseconds. */
public
static
final
int
DEFAULT_SOCKET_TIMEOUT_MILLIS
=
8
*
1000
;
public
static
final
int
DEFAULT_SOCKET_TIMEOUT_MILLIS
=
8
*
1000
;
public
static
final
int
UDP_PORT_UNSET
=
-
1
;
private
final
int
socketTimeoutMillis
;
private
final
int
socketTimeoutMillis
;
private
final
byte
[]
packetBuffer
;
private
final
byte
[]
packetBuffer
;
private
final
DatagramPacket
packet
;
private
final
DatagramPacket
packet
;
...
@@ -169,4 +171,15 @@ public final class UdpDataSource extends BaseDataSource {
...
@@ -169,4 +171,15 @@ public final class UdpDataSource extends BaseDataSource {
transferEnded
();
transferEnded
();
}
}
}
}
/**
* Returns the local port number opened for the UDP connection, or {@link #UDP_PORT_UNSET} if no
* connection is open
*/
public
int
getLocalPort
()
{
if
(
socket
==
null
)
{
return
UDP_PORT_UNSET
;
}
return
socket
.
getLocalPort
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment