Skip to content

Commit c2afcf8

Browse files
committed
Merge remote-tracking branch 'origin/development'
2 parents 99bc51d + d56ca35 commit c2afcf8

File tree

19 files changed

+449
-37
lines changed

19 files changed

+449
-37
lines changed

Readme.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# 5GMS Common Android Library
2-
3-
This repository holds the 5GMS Common Library implementation of the 5G-MAG Reference Tools.
1+
<h1 align="center">5GMS Common Android Library</h1>
2+
<p align="center">
3+
<img src="https://img.shields.io/badge/Status-Under_Development-yellow" alt="Under Development">
4+
<img src="https://img.shields.io/github/v/tag/5G-MAG/rt-5gms-common-android-library?label=version" alt="Version">
5+
<img src="https://img.shields.io/badge/License-5G--MAG%20Public%20License%20(v1.0)-blue" alt="License">
6+
</p>
47

58
## Introduction
69

710
The 5GMS Common Library is an Android library that includes models and helper classes used within
811
the different client-side Android applications such as the 5GMSd-Aware Application, 5GMSd Media Stream
912
Handler and the 5GMSd Media Session Handler.
1013

14+
Additional information can be found at: https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/
15+
1116
## Downloading
1217

1318
Release versions can be downloaded from
@@ -64,6 +69,9 @@ dependencyResolutionManagement {
6469

6570
#### 2. Include the 5GMS Common Library in your module gradle file
6671

72+
Replace the version number in the example below with the version number you are using,
73+
e.g. `1.2.0` instead of `1.0.0`.
74+
6775
````
6876
dependencies {
6977
// 5GMAG

app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ android {
1313
minSdk 29
1414
targetSdk 32
1515
versionCode 1
16-
versionName "1.1.0"
16+
versionName "1.2.0"
1717

1818
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1919
}
@@ -38,7 +38,7 @@ publishing {
3838
release(MavenPublication) {
3939
groupId = 'com.fivegmag'
4040
artifactId = 'a5gmscommonlibrary'
41-
version = '1.1.0'
41+
version = '1.2.0'
4242

4343
afterEvaluate {
4444
from components.release
@@ -64,6 +64,8 @@ dependencies {
6464
implementation 'com.google.android.material:material:1.8.0'
6565
implementation "androidx.media3:media3-exoplayer:1.0.2"
6666
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.1'
67+
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.0'
68+
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.0'
6769
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1'
6870
testImplementation 'junit:junit:4.13.2'
6971
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.fivegmag.a5gmscommonlibrary.consumptionReporting
2+
3+
import android.os.Parcelable
4+
import kotlinx.parcelize.Parcelize
5+
6+
@Parcelize
7+
data class ConsumptionRequest(
8+
var accessReporting : Boolean? = false,
9+
var locationReporting : Boolean? = false
10+
) : Parcelable

app/src/main/java/com/fivegmag/a5gmscommonlibrary/eventbus/MediaStreamHandlerMessageEvents.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
License: 5G-MAG Public License (v1.0)
3+
Author: Daniel Silhavy
4+
Copyright: (C) 2023 Fraunhofer FOKUS
5+
For full license terms please see the LICENSE file distributed with this
6+
program. If this file is missing then the license can be retrieved from
7+
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
8+
*/
9+
110
package com.fivegmag.a5gmscommonlibrary.eventbus
211

312
import android.telephony.CellInfo
@@ -20,6 +29,11 @@ class LoadStartedEvent(
2029
val loadEventInfo: LoadEventInfo,
2130
val mediaLoadData: MediaLoadData
2231
)
32+
class LoadCompletedEvent(
33+
val eventTime: EventTime,
34+
val loadEventInfo: LoadEventInfo,
35+
val mediaLoadData: MediaLoadData
36+
)
2337

2438
class CellInfoUpdatedEvent(
2539
val cellInfoList: MutableList<CellInfo>

app/src/main/java/com/fivegmag/a5gmscommonlibrary/helpers/Constants.kt

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ object SessionHandlerMessageTypes {
3131
const val SERVICE_ACCESS_INFORMATION_MESSAGE = 3
3232
const val REGISTER_CLIENT = 4
3333
const val UNREGISTER_CLIENT = 5
34-
const val START_PLAYBACK_BY_MEDIA_PLAYER_ENTRY_MESSAGE = 6
35-
const val SESSION_HANDLER_TRIGGERS_PLAYBACK = 6
36-
const val METRIC_REPORTING_MESSAGE = 7
37-
const val UPDATE_LOOKUP_TABLE = 8
38-
const val SET_M5_ENDPOINT = 9
39-
const val START_PLAYBACK_BY_SERVICE_LIST_ENTRY_MESSAGE = 10
40-
const val GET_CONSUMPTION_REPORT = 11
41-
const val CONSUMPTION_REPORT = 12
42-
const val UPDATE_PLAYBACK_CONSUMPTION_REPORTING_CONFIGURATION = 13
34+
const val TRIGGER_PLAYBACK = 6
35+
const val UPDATE_LOOKUP_TABLE = 7
36+
const val SET_M5_ENDPOINT = 8
37+
const val START_PLAYBACK_BY_SERVICE_LIST_ENTRY_MESSAGE = 9
38+
const val GET_CONSUMPTION_REPORT = 10
39+
const val CONSUMPTION_REPORT = 11
40+
const val UPDATE_PLAYBACK_CONSUMPTION_REPORTING_CONFIGURATION = 12
41+
const val GET_QOE_METRICS_REPORT = 13
42+
const val REPORT_QOE_METRICS = 14
4343
}
4444

4545
object SessionHandlerEvents {
@@ -52,6 +52,8 @@ object SessionHandlerEvents {
5252
object ContentTypes {
5353
const val DASH = "application/dash+xml"
5454
const val HLS = "application/vnd.apple.mpegurl"
55+
const val JSON = "application/json"
56+
const val XML = "application/xml"
5557
}
5658

5759
object UserAgentTokens {
@@ -63,4 +65,25 @@ object HostInfoTypes {
6365
const val IP_V4 = "ipv4"
6466
const val IP_V6 = "ipv6"
6567
const val DOMAIN_NAME = "domain_name"
68+
}
69+
70+
object MetricReportingSchemes {
71+
const val FIVE_G_MAG_EXOPLAYER_COMBINED_PLAYBACK_STATS = "urn:5gmag:exoplayer:combined"
72+
const val THREE_GPP_DASH_METRIC_REPORTING = "urn:3GPP:ns:PSS:DASH:QM10"
73+
}
74+
75+
object Metrics {
76+
const val BUFFER_LEVEL = "urn:3GPP:ns:PSS:DASH:QM10#BufferLevel"
77+
const val HTTP_LIST = "urn:3GPP:ns:PSS:DASH:QM10#HTTPList"
78+
const val REP_SWITCH_LIST = "urn:3GPP:ns:PSS:DASH:QM10#RepSwitchList"
79+
const val MPD_INFORMATION = "urn:3GPP:ns:PSS:DASH:QM10#MPDInformation"
80+
}
81+
82+
object XmlSchemaStrings {
83+
object THREE_GPP_METADATA_2011_HSD_RECEPTION_REPORT {
84+
const val SCHEMA = "urn:3gpp:metadata:2011:HSD:receptionreport"
85+
const val LOCATION = "DASH-QoE-Report.xsd"
86+
const val XSI = "http://www.w3.org/2001/XMLSchema-instance"
87+
const val SV = "urn:3gpp:metadata:2016:PSS:schemaVersion"
88+
}
6689
}

app/src/main/java/com/fivegmag/a5gmscommonlibrary/helpers/Utils.kt

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
/*
2+
License: 5G-MAG Public License (v1.0)
3+
Author: Daniel Silhavy
4+
Copyright: (C) 2023 Fraunhofer FOKUS
5+
For full license terms please see the LICENSE file distributed with this
6+
program. If this file is missing then the license can be retrieved from
7+
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
8+
*/
9+
110
package com.fivegmag.a5gmscommonlibrary.helpers
211

12+
import android.content.res.AssetManager
13+
import java.util.Properties
314
import com.fivegmag.a5gmscommonlibrary.models.EndpointAddress
415
import com.fivegmag.a5gmscommonlibrary.models.HostInfo
516
import java.text.SimpleDateFormat
@@ -8,6 +19,7 @@ import java.util.Date
819
import java.util.Random
920
import java.util.TimeZone
1021
import okhttp3.Headers
22+
import java.io.InputStream
1123
import java.net.NetworkInterface
1224
import java.net.URL
1325
import java.time.Instant
@@ -17,7 +29,7 @@ import java.util.UUID
1729
class Utils {
1830

1931
fun getCurrentTimestamp(): Long {
20-
return System.currentTimeMillis();
32+
return System.currentTimeMillis()
2133
}
2234

2335
fun convertTimestampToXsDateTime(timestampInMillis: Long): String {
@@ -32,6 +44,11 @@ class Utils {
3244
return dateFormat.format(date)
3345
}
3446

47+
fun generateUuidToHexBinary(): String {
48+
val uuid = this.generateUUID()
49+
return uuid.replace("-", "")
50+
}
51+
3552
fun generateUUID(): String {
3653
val uuid = UUID.randomUUID()
3754
return uuid.toString()
@@ -55,7 +72,7 @@ class Utils {
5572
return convertTimestampToXsDateTime(currentTimestamp)
5673
}
5774

58-
fun millisecondsToISO8601(milliseconds: Long): String? {
75+
fun millisecondsToISO8601(milliseconds: Long): String {
5976
// Create a Duration object from milliseconds
6077
val duration: Duration = Duration.ofMillis(milliseconds)
6178

@@ -116,7 +133,7 @@ class Utils {
116133
if ((ipVer == 4 && address.hostAddress.contains(".")) ||
117134
(ipVer == 6 && address.hostAddress.contains(":"))
118135
) {
119-
return address.hostAddress.toString()
136+
return address.hostAddress?.toString()
120137
}
121138
}
122139
}
@@ -190,4 +207,17 @@ class Utils {
190207

191208
}
192209

210+
fun loadConfiguration(assetManager: AssetManager, file: String): Properties {
211+
val configProperties = Properties()
212+
try {
213+
val inputStream: InputStream = assetManager.open(file)
214+
configProperties.loadFromXML(inputStream)
215+
inputStream.close()
216+
} catch (e: Exception) {
217+
print("loadConfiguration Exception: $e")
218+
}
219+
220+
return configProperties
221+
}
222+
193223
}

app/src/main/java/com/fivegmag/a5gmscommonlibrary/models/MessageModels.kt

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/src/main/java/com/fivegmag/a5gmscommonlibrary/models/ServiceAccessInformation.kt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ data class ServiceAccessInformation(
1717
val provisioningSessionId : String,
1818
val provisioningSessionType: String?,
1919
val streamingAccess: StreamingAccess,
20-
var clientConsumptionReportingConfiguration: ClientConsumptionReportingConfiguration?
20+
var clientConsumptionReportingConfiguration: ClientConsumptionReportingConfiguration?,
21+
var clientMetricsReportingConfigurations: ArrayList<ClientMetricsReportingConfiguration>?
2122
) : Parcelable
2223

2324
@Parcelize
@@ -32,4 +33,20 @@ data class ClientConsumptionReportingConfiguration(
3233
val samplePercentage: Float,
3334
val reportingInterval: Int? = null,
3435
val accessReporting: Boolean
36+
) : Parcelable
37+
38+
@Parcelize
39+
data class ClientMetricsReportingConfiguration(
40+
val metricsReportingConfigurationId: String,
41+
val serverAddresses: ArrayList<String>,
42+
val scheme: String,
43+
val dataNetworkName: String?,
44+
val reportingInterval: Long? = null,
45+
val samplePercentage: Float? = null,
46+
val urlFilters: ArrayList<String>?,
47+
val samplingPeriod: Long,
48+
val metrics: ArrayList<String>,
49+
50+
// These are additional fields that we need for processing. They are not included in the spec and are populated during runtime
51+
var isSchemeSupported: Boolean? = false
3552
) : Parcelable
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
License: 5G-MAG Public License (v1.0)
3+
Author: Daniel Silhavy
4+
Copyright: (C) 2023 Fraunhofer FOKUS
5+
For full license terms please see the LICENSE file distributed with this
6+
program. If this file is missing then the license can be retrieved from
7+
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
8+
*/
9+
10+
package com.fivegmag.a5gmscommonlibrary.qoeMetricsReporting
11+
12+
data class AvgThroughput(
13+
val numbytes: Integer,
14+
val activitytime: Integer,
15+
val t : String,
16+
val duration: Integer,
17+
val accessbearer: String,
18+
val inactivitytype: InactivityType
19+
)
20+
21+
enum class InactivityType {
22+
USER_REQUEST,
23+
CLIENT_MEASURE,
24+
ERROR
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
License: 5G-MAG Public License (v1.0)
3+
Author: Daniel Silhavy
4+
Copyright: (C) 2023 Fraunhofer FOKUS
5+
For full license terms please see the LICENSE file distributed with this
6+
program. If this file is missing then the license can be retrieved from
7+
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
8+
*/
9+
10+
package com.fivegmag.a5gmscommonlibrary.qoeMetricsReporting
11+
12+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper
13+
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
14+
15+
data class BufferLevel(
16+
@field:JacksonXmlProperty(localName = "BufferLevelEntry")
17+
@field:JacksonXmlElementWrapper(useWrapping = false)
18+
val entries: ArrayList<BufferLevelEntry>
19+
)
20+
21+
data class BufferLevelEntry(
22+
@field:JacksonXmlProperty(isAttribute = true)
23+
val t: String? = null,
24+
@field:JacksonXmlProperty(isAttribute = true)
25+
val level: Int = 0
26+
)

0 commit comments

Comments
 (0)