From 4bf7477e3e69079a07b260f5f40cccf1610c14d1 Mon Sep 17 00:00:00 2001 From: claincly Date: Fri, 30 Apr 2021 16:29:10 +0100 Subject: [PATCH] Flatten packages within the RTSP package. #minor-release PiperOrigin-RevId: 371337762 --- .../rtsp/{sdp => }/MediaDescription.java | 10 ++--- .../source/rtsp/{rtp => }/RtpDataChannel.java | 4 +- .../rtsp/{rtp => }/RtpDataLoadable.java | 7 ++- .../source/rtsp/{rtp => }/RtpExtractor.java | 8 ++-- .../source/rtsp/{rtp => }/RtpPacket.java | 2 +- .../{rtp => }/RtpPacketReorderingQueue.java | 4 +- .../rtsp/{rtp => }/RtpPayloadFormat.java | 4 +- .../exoplayer2/source/rtsp/RtspClient.java | 43 +++++++------------ .../{message => }/RtspDescribeResponse.java | 6 +-- .../rtsp/{message => }/RtspHeaders.java | 4 +- .../source/rtsp/RtspMediaPeriod.java | 4 +- .../source/rtsp/RtspMediaSource.java | 1 - .../source/rtsp/RtspMediaTrack.java | 12 +++--- .../{message => }/RtspMessageChannel.java | 4 +- .../rtsp/{message => }/RtspMessageUtil.java | 30 ++++++------- .../{message => }/RtspOptionsResponse.java | 4 +- .../rtsp/{message => }/RtspPlayResponse.java | 6 +-- .../rtsp/{message => }/RtspRequest.java | 4 +- .../rtsp/{message => }/RtspResponse.java | 4 +- .../source/rtsp/RtspSessionTiming.java | 2 +- .../rtsp/{message => }/RtspSetupResponse.java | 4 +- .../source/rtsp/RtspTrackTiming.java | 3 +- .../rtsp/{sdp => }/SessionDescription.java | 4 +- .../{sdp => }/SessionDescriptionParser.java | 6 +-- .../UdpDataSourceRtpDataChannel.java | 4 +- .../source/rtsp/message/package-info.java | 19 -------- .../DefaultRtpPayloadReaderFactory.java | 7 +-- .../rtsp/{rtp => }/reader/RtpAacReader.java | 4 +- .../rtsp/{rtp => }/reader/RtpAc3Reader.java | 6 +-- .../rtsp/{rtp => }/reader/RtpH264Reader.java | 6 +-- .../{rtp => }/reader/RtpPayloadReader.java | 6 +-- .../rtsp/{rtp => reader}/package-info.java | 2 +- .../source/rtsp/rtp/reader/package-info.java | 19 -------- .../source/rtsp/sdp/package-info.java | 19 -------- .../RtpPacketReorderingQueueTest.java | 4 +- .../source/rtsp/{rtp => }/RtpPacketTest.java | 4 +- .../rtsp/{message => }/RtspHeadersTest.java | 2 +- .../source/rtsp/RtspMediaPeriodTest.java | 3 -- .../source/rtsp/RtspMediaTrackTest.java | 14 +++--- .../{message => }/RtspMessageUtilTest.java | 2 +- .../exoplayer2/source/rtsp/RtspServer.java | 7 +-- .../{sdp => }/SessionDescriptionTest.java | 20 ++++----- .../{rtp => reader}/RtpAc3ReaderTest.java | 5 ++- 43 files changed, 121 insertions(+), 212 deletions(-) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{sdp => }/MediaDescription.java (96%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpDataChannel.java (91%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpDataLoadable.java (97%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpExtractor.java (96%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpPacket.java (99%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpPacketReorderingQueue.java (98%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpPayloadFormat.java (95%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspDescribeResponse.java (87%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspHeaders.java (98%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspMessageChannel.java (98%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspMessageUtil.java (90%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspOptionsResponse.java (94%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspPlayResponse.java (87%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspRequest.java (97%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspResponse.java (94%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspSetupResponse.java (93%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{sdp => }/SessionDescription.java (99%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{sdp => }/SessionDescriptionParser.java (97%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/UdpDataSourceRtpDataChannel.java (92%) delete mode 100644 library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/package-info.java rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/reader/DefaultRtpPayloadReaderFactory.java (85%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/reader/RtpAacReader.java (98%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/reader/RtpAc3Reader.java (97%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/reader/RtpH264Reader.java (98%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/reader/RtpPayloadReader.java (94%) rename library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/{rtp => reader}/package-info.java (92%) delete mode 100644 library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/package-info.java delete mode 100644 library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/package-info.java rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpPacketReorderingQueueTest.java (98%) rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{rtp => }/RtpPacketTest.java (98%) rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspHeadersTest.java (98%) rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{message => }/RtspMessageUtilTest.java (99%) rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{sdp => }/SessionDescriptionTest.java (88%) rename library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/{rtp => reader}/RtpAc3ReaderTest.java (97%) diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/MediaDescription.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/MediaDescription.java similarity index 96% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/MediaDescription.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/MediaDescription.java index 9a1e637a90..e4467d395e 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/MediaDescription.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/MediaDescription.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.sdp; +package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.message.RtspMessageUtil.parseInt; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_FMTP; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_RTPMAP; +import static com.google.android.exoplayer2.source.rtsp.RtspMessageUtil.parseInt; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_FMTP; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_RTPMAP; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkState; import static com.google.android.exoplayer2.util.Util.castNonNull; @@ -35,7 +35,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** Represents one media description section in a SDP message. */ -public final class MediaDescription { +/* package */ final class MediaDescription { /** Represents the mandatory RTPMAP attribute in MediaDescription. Reference RFC 2327 Page 22. */ public static final class RtpMapAttribute { diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataChannel.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataChannel.java similarity index 91% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataChannel.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataChannel.java index d451ec9e59..41ea556e5a 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataChannel.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataChannel.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import com.google.android.exoplayer2.upstream.DataSource; /** An RTP {@link DataSource}. */ -public interface RtpDataChannel extends DataSource { +/* package */ interface RtpDataChannel extends DataSource { /** Creates {@link RtpDataChannel} for RTSP streams. */ interface Factory { diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataLoadable.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataLoadable.java similarity index 97% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataLoadable.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataLoadable.java index 66c367137d..dd6847d83b 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpDataLoadable.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpDataLoadable.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Util.closeQuietly; @@ -27,7 +27,6 @@ import com.google.android.exoplayer2.extractor.DefaultExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorOutput; import com.google.android.exoplayer2.extractor.PositionHolder; -import com.google.android.exoplayer2.source.rtsp.RtspMediaTrack; import com.google.android.exoplayer2.upstream.DataSpec; import com.google.android.exoplayer2.upstream.Loader; import com.google.android.exoplayer2.util.Util; @@ -47,7 +46,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; *

Received RTP packets' payloads will be extracted by an {@link RtpExtractor}, and will be * written to the {@link ExtractorOutput} instance provided at construction. */ -public final class RtpDataLoadable implements Loader.Loadable { +/* package */ final class RtpDataLoadable implements Loader.Loadable { /** Called on loadable events. */ public interface EventListener { diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpExtractor.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpExtractor.java similarity index 96% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpExtractor.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpExtractor.java index 377006eccf..50894a45f5 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpExtractor.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; @@ -27,8 +27,8 @@ import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorOutput; import com.google.android.exoplayer2.extractor.PositionHolder; import com.google.android.exoplayer2.extractor.SeekMap; -import com.google.android.exoplayer2.source.rtsp.rtp.reader.DefaultRtpPayloadReaderFactory; -import com.google.android.exoplayer2.source.rtsp.rtp.reader.RtpPayloadReader; +import com.google.android.exoplayer2.source.rtsp.reader.DefaultRtpPayloadReaderFactory; +import com.google.android.exoplayer2.source.rtsp.reader.RtpPayloadReader; import com.google.android.exoplayer2.util.ParsableByteArray; import java.io.IOException; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacket.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacket.java similarity index 99% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacket.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacket.java index 2377836012..84cf1bcc4f 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacket.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacket.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueue.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueue.java similarity index 98% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueue.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueue.java index c502fad893..1f1cb79595 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueue.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueue.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static java.lang.Math.abs; import static java.lang.Math.max; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPayloadFormat.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPayloadFormat.java similarity index 95% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPayloadFormat.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPayloadFormat.java index c80e84eaa6..cf1ec7e609 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPayloadFormat.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtpPayloadFormat.java @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import androidx.annotation.Nullable; import com.google.android.exoplayer2.Format; -import com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription; -import com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription; import com.google.android.exoplayer2.util.MimeTypes; import com.google.common.base.Ascii; import com.google.common.collect.ImmutableMap; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspClient.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspClient.java index a39ac6c138..c64bf343c6 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspClient.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspClient.java @@ -15,20 +15,20 @@ */ package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.message.RtspMessageChannel.DEFAULT_RTSP_PORT; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_ANNOUNCE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_DESCRIBE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_GET_PARAMETER; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_OPTIONS; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PAUSE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PLAY; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PLAY_NOTIFY; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_RECORD; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_REDIRECT; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_SETUP; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_SET_PARAMETER; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_TEARDOWN; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_UNSET; +import static com.google.android.exoplayer2.source.rtsp.RtspMessageChannel.DEFAULT_RTSP_PORT; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_ANNOUNCE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_DESCRIBE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_GET_PARAMETER; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_OPTIONS; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PAUSE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PLAY; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PLAY_NOTIFY; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_RECORD; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_REDIRECT; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_SETUP; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_SET_PARAMETER; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_TEARDOWN; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_UNSET; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkState; @@ -42,20 +42,7 @@ import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.source.rtsp.RtspMediaPeriod.RtpLoadInfo; import com.google.android.exoplayer2.source.rtsp.RtspMediaSource.RtspPlaybackException; -import com.google.android.exoplayer2.source.rtsp.message.RtspDescribeResponse; -import com.google.android.exoplayer2.source.rtsp.message.RtspHeaders; -import com.google.android.exoplayer2.source.rtsp.message.RtspMessageChannel; -import com.google.android.exoplayer2.source.rtsp.message.RtspMessageUtil; -import com.google.android.exoplayer2.source.rtsp.message.RtspMessageUtil.RtspSessionHeader; -import com.google.android.exoplayer2.source.rtsp.message.RtspOptionsResponse; -import com.google.android.exoplayer2.source.rtsp.message.RtspPlayResponse; -import com.google.android.exoplayer2.source.rtsp.message.RtspRequest; -import com.google.android.exoplayer2.source.rtsp.message.RtspResponse; -import com.google.android.exoplayer2.source.rtsp.message.RtspSetupResponse; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; -import com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription; -import com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription; -import com.google.android.exoplayer2.source.rtsp.sdp.SessionDescriptionParser; +import com.google.android.exoplayer2.source.rtsp.RtspMessageUtil.RtspSessionHeader; import com.google.android.exoplayer2.util.Util; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspDescribeResponse.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspDescribeResponse.java similarity index 87% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspDescribeResponse.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspDescribeResponse.java index 631ebf7012..04d8273ca8 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspDescribeResponse.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspDescribeResponse.java @@ -13,12 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; - -import com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription; +package com.google.android.exoplayer2.source.rtsp; /** Represents an RTSP DESCRIBE response. */ -public final class RtspDescribeResponse { +/* package */ final class RtspDescribeResponse { /** The response's status code. */ public final int status; /** The {@link SessionDescription} (see RFC2327) in the DESCRIBE response. */ diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeaders.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspHeaders.java similarity index 98% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeaders.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspHeaders.java index 1eb3de1adc..62ff519fd8 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeaders.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspHeaders.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import androidx.annotation.Nullable; import com.google.android.exoplayer2.util.Util; @@ -33,7 +33,7 @@ import java.util.Map; * with case-insensitive header names. The extra spaces around header names and values are trimmed. * Contrary to HTTP, RTSP does not allow ambiguous/arbitrary header names (RFC 2326 Section 12). */ -public final class RtspHeaders { +/* package */ final class RtspHeaders { public static final String ACCEPT = "Accept"; public static final String ALLOW = "Allow"; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriod.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriod.java index 67dd8b75b3..bf54f1775d 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriod.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriod.java @@ -43,8 +43,6 @@ import com.google.android.exoplayer2.source.TrackGroup; import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.rtsp.RtspClient.PlaybackEventListener; import com.google.android.exoplayer2.source.rtsp.RtspMediaSource.RtspPlaybackException; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpDataChannel; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpDataLoadable; import com.google.android.exoplayer2.trackselection.ExoTrackSelection; import com.google.android.exoplayer2.trackselection.TrackSelection; import com.google.android.exoplayer2.upstream.Allocator; @@ -61,7 +59,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** A {@link MediaPeriod} that loads an RTSP stream. */ -public final class RtspMediaPeriod implements MediaPeriod { +/* package */ final class RtspMediaPeriod implements MediaPeriod { private static final String TAG = "RtspMediaPeriod"; /** The maximum times to retry if the underlying data channel failed to bind. */ diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaSource.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaSource.java index 0211b3b35b..199ba11a2a 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaSource.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaSource.java @@ -31,7 +31,6 @@ import com.google.android.exoplayer2.source.MediaSource; import com.google.android.exoplayer2.source.MediaSourceFactory; import com.google.android.exoplayer2.source.SinglePeriodTimeline; import com.google.android.exoplayer2.source.rtsp.RtspClient.SessionInfoListener; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpDataChannel; import com.google.android.exoplayer2.upstream.Allocator; import com.google.android.exoplayer2.upstream.HttpDataSource; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrack.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrack.java index 59a105fda0..4217244c2d 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrack.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrack.java @@ -15,10 +15,10 @@ */ package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat.getMimeTypeFromRtpMediaType; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.MEDIA_TYPE_AUDIO; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_CONTROL; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_RTPMAP; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.MEDIA_TYPE_AUDIO; +import static com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat.getMimeTypeFromRtpMediaType; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_CONTROL; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_RTPMAP; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.NalUnitUtil.NAL_START_CODE; @@ -31,8 +31,6 @@ import androidx.annotation.VisibleForTesting; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.audio.AacUtil; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; -import com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.NalUnitUtil; import com.google.android.exoplayer2.util.Util; @@ -40,7 +38,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; /** Represents a media track in an RTSP playback. */ -public final class RtspMediaTrack { +/* package */ final class RtspMediaTrack { // Format specific parameter names. private static final String PARAMETER_PROFILE_LEVEL_ID = "profile-level-id"; private static final String PARAMETER_SPROP_PARAMS = "sprop-parameter-sets"; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageChannel.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageChannel.java similarity index 98% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageChannel.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageChannel.java index 4d12d03ea1..7aa4bdfff5 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageChannel.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageChannel.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; @@ -39,7 +39,7 @@ import java.util.List; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** Sends and receives RTSP messages. */ -public final class RtspMessageChannel implements Closeable { +/* package */ final class RtspMessageChannel implements Closeable { private static final String TAG = "RtspMessageChannel"; private static final boolean LOG_RTSP_MESSAGES = false; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtil.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtil.java similarity index 90% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtil.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtil.java index 5bc7dd1378..4ee0abb90c 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtil.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtil.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_ANNOUNCE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_DESCRIBE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_GET_PARAMETER; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_OPTIONS; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PAUSE; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PLAY; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_PLAY_NOTIFY; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_RECORD; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_REDIRECT; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_SETUP; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_SET_PARAMETER; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_TEARDOWN; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_UNSET; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_ANNOUNCE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_DESCRIBE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_GET_PARAMETER; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_OPTIONS; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PAUSE; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PLAY; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_PLAY_NOTIFY; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_RECORD; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_REDIRECT; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_SETUP; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_SET_PARAMETER; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_TEARDOWN; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_UNSET; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; @@ -45,7 +45,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** Utility methods for RTSP messages. */ -public final class RtspMessageUtil { +/* package */ final class RtspMessageUtil { /** Represents a RTSP Session header (RFC2326 Section 12.37). */ public static final class RtspSessionHeader { /** The session ID. */ diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspOptionsResponse.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspOptionsResponse.java similarity index 94% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspOptionsResponse.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspOptionsResponse.java index 9a9ce8cf0c..989303b461 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspOptionsResponse.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspOptionsResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import com.google.common.collect.ImmutableList; import java.util.List; @@ -21,7 +21,7 @@ import java.util.List; /** Represents an RTSP OPTIONS response. */ // TODO(b/180434754) Move all classes under message to the parent rtsp package, and change the // visibility. -public final class RtspOptionsResponse { +/* package */ final class RtspOptionsResponse { /** The response's status code. */ public final int status; /** diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspPlayResponse.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspPlayResponse.java similarity index 87% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspPlayResponse.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspPlayResponse.java index 5a29de4a9c..26d0344111 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspPlayResponse.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspPlayResponse.java @@ -13,15 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; -import com.google.android.exoplayer2.source.rtsp.RtspSessionTiming; -import com.google.android.exoplayer2.source.rtsp.RtspTrackTiming; import com.google.common.collect.ImmutableList; import java.util.List; /** Represents an RTSP PLAY response. */ -public final class RtspPlayResponse { +/* package */ final class RtspPlayResponse { /** The response's status code. */ public final int status; /** The playback start timing, {@link RtspSessionTiming#DEFAULT} if not present. */ diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspRequest.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspRequest.java similarity index 97% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspRequest.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspRequest.java index 17ef7f547a..5b7d0eeb26 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspRequest.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import android.net.Uri; import androidx.annotation.IntDef; @@ -23,7 +23,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** Represents an RTSP request. */ -public final class RtspRequest { +/* package */ final class RtspRequest { /** * RTSP request methods, as defined in RFC2326 Section 10. * diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspResponse.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspResponse.java similarity index 94% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspResponse.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspResponse.java index 298a4a1be4..7d56f1c580 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspResponse.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspResponse.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; /** Represents an RTSP Response. */ -public final class RtspResponse { +/* package */ final class RtspResponse { // TODO(b/172331505) Move this constant to MimeTypes. /** The MIME type associated with Session Description Protocol (RFC4566). */ public static final String SDP_MIME_TYPE = "application/sdp"; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSessionTiming.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSessionTiming.java index 9005a53e0a..73276d3446 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSessionTiming.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSessionTiming.java @@ -30,7 +30,7 @@ import java.util.regex.Pattern; * *

Currently only NPT is supported. See RFC2326 Section 3.6 for detail of NPT. */ -public final class RtspSessionTiming { +/* package */ final class RtspSessionTiming { /** The default session timing starting from 0.000 and indefinite length, effectively live. */ public static final RtspSessionTiming DEFAULT = new RtspSessionTiming(/* startTimeMs= */ 0, /* stopTimeMs= */ C.TIME_UNSET); diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspSetupResponse.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSetupResponse.java similarity index 93% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspSetupResponse.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSetupResponse.java index 102b0754ae..03d1698b8b 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/RtspSetupResponse.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspSetupResponse.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; /** Represents an RTSP SETUP response. */ // TODO(b/180434754) Move all classes under message to the parent rtsp package, and change the // visibility. -public final class RtspSetupResponse { +/* package */ final class RtspSetupResponse { /** The response's status code. */ public final int status; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspTrackTiming.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspTrackTiming.java index 07c6ebf059..37c6f9ed49 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspTrackTiming.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspTrackTiming.java @@ -19,7 +19,6 @@ import android.net.Uri; import androidx.annotation.Nullable; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.ParserException; -import com.google.android.exoplayer2.source.rtsp.message.RtspHeaders; import com.google.android.exoplayer2.util.Util; import com.google.common.collect.ImmutableList; @@ -29,7 +28,7 @@ import com.google.common.collect.ImmutableList; * *

The fields {@link #rtpTimestamp} and {@link #sequenceNumber} will not both be {@code null}. */ -public final class RtspTrackTiming { +/* package */ final class RtspTrackTiming { /** * Parses the RTP-Info header into a list of {@link RtspTrackTiming RtspTrackTimings}. diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescription.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescription.java similarity index 99% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescription.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescription.java index 0ff7f4585c..4ac138f554 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescription.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescription.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.sdp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Util.castNonNull; @@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableMap; *

SDP messages encapsulate information on the media play back session, including session * configuration information, formats of each playable track, etc. SDP is defined in RFC4566. */ -public final class SessionDescription { +/* package */ final class SessionDescription { /** Builder class for {@link SessionDescription}. */ public static final class Builder { diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionParser.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionParser.java similarity index 97% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionParser.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionParser.java index dbc3d9f03b..bff26c1703 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionParser.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionParser.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.sdp; +package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.SUPPORTED_SDP_VERSION; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.SUPPORTED_SDP_VERSION; import static com.google.android.exoplayer2.util.Assertions.checkArgument; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.common.base.Strings.nullToEmpty; @@ -29,7 +29,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** Parses a String based SDP message into {@link SessionDescription}. */ -public final class SessionDescriptionParser { +/* package */ final class SessionDescriptionParser { // SDP line always starts with an one letter tag, followed by an equal sign. The information // under the given tag follows an optional space. private static final Pattern SDP_LINE_PATTERN = Pattern.compile("([a-z])=\\s?(.+)"); diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/UdpDataSourceRtpDataChannel.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/UdpDataSourceRtpDataChannel.java similarity index 92% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/UdpDataSourceRtpDataChannel.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/UdpDataSourceRtpDataChannel.java index f1417c2717..429be6634d 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/UdpDataSourceRtpDataChannel.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/UdpDataSourceRtpDataChannel.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import android.net.Uri; import androidx.annotation.Nullable; @@ -23,7 +23,7 @@ import com.google.android.exoplayer2.upstream.UdpDataSource; import java.io.IOException; /** An {@link RtpDataChannel} for UDP transport. */ -public final class UdpDataSourceRtpDataChannel implements RtpDataChannel { +/* package */ final class UdpDataSourceRtpDataChannel implements RtpDataChannel { private final UdpDataSource dataSource; /** Creates a new instance. */ diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/package-info.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/package-info.java deleted file mode 100644 index 7f182ffcf2..0000000000 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/message/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2020 The Android Open Source Project - * - * 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. - */ -@NonNullApi -package com.google.android.exoplayer2.source.rtsp.message; - -import com.google.android.exoplayer2.util.NonNullApi; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/DefaultRtpPayloadReaderFactory.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/DefaultRtpPayloadReaderFactory.java similarity index 85% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/DefaultRtpPayloadReaderFactory.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/DefaultRtpPayloadReaderFactory.java index 37f15c4f6b..7ae10cd8d9 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/DefaultRtpPayloadReaderFactory.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/DefaultRtpPayloadReaderFactory.java @@ -14,16 +14,17 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp.reader; +package com.google.android.exoplayer2.source.rtsp.reader; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import androidx.annotation.Nullable; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.util.MimeTypes; /** Default {@link RtpPayloadReader.Factory} implementation. */ -public final class DefaultRtpPayloadReaderFactory implements RtpPayloadReader.Factory { +/* package */ public final class DefaultRtpPayloadReaderFactory + implements RtpPayloadReader.Factory { @Override @Nullable diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAacReader.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAacReader.java similarity index 98% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAacReader.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAacReader.java index eec22888a9..fe393a9eb5 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAacReader.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAacReader.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp.reader; +package com.google.android.exoplayer2.source.rtsp.reader; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.extractor.ExtractorOutput; import com.google.android.exoplayer2.extractor.TrackOutput; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.util.ParsableBitArray; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.Util; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAc3Reader.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3Reader.java similarity index 97% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAc3Reader.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3Reader.java index 4dbf24a3a2..ba520f841b 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpAc3Reader.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3Reader.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp.reader; +package com.google.android.exoplayer2.source.rtsp.reader; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Assertions.checkState; @@ -23,14 +23,14 @@ import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.audio.Ac3Util; import com.google.android.exoplayer2.extractor.ExtractorOutput; import com.google.android.exoplayer2.extractor.TrackOutput; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.util.ParsableBitArray; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.Util; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** Parses an AC3 byte stream carried on RTP packets, and extracts AC3 frames. */ -public final class RtpAc3Reader implements RtpPayloadReader { +/* package */ public final class RtpAc3Reader implements RtpPayloadReader { /** AC3 frame types defined in RFC4184 Section 4.1.1. */ private static final int AC3_FRAME_TYPE_COMPLETE_FRAME = 0; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpH264Reader.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpH264Reader.java similarity index 98% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpH264Reader.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpH264Reader.java index 887a29855a..18e724cb07 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpH264Reader.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpH264Reader.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp.reader; +package com.google.android.exoplayer2.source.rtsp.reader; import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; import static com.google.android.exoplayer2.util.Util.castNonNull; @@ -23,8 +23,8 @@ import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.extractor.ExtractorOutput; import com.google.android.exoplayer2.extractor.TrackOutput; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPacket; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; +import com.google.android.exoplayer2.source.rtsp.RtpPacket; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.util.NalUnitUtil; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.Util; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpPayloadReader.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpPayloadReader.java similarity index 94% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpPayloadReader.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpPayloadReader.java index d156b58df4..aa790372d3 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/RtpPayloadReader.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/RtpPayloadReader.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp.reader; +package com.google.android.exoplayer2.source.rtsp.reader; import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.extractor.ExtractorOutput; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.util.ParsableByteArray; import org.checkerframework.checker.nullness.qual.Nullable; /** Extracts media samples from the payload of received RTP packets. */ -public interface RtpPayloadReader { +/* package */ public interface RtpPayloadReader { /** Factory of {@link RtpPayloadReader} instances. */ interface Factory { diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/package-info.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/package-info.java similarity index 92% rename from library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/package-info.java rename to library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/package-info.java index 41e8a4ca7b..aca87817d6 100644 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/package-info.java +++ b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/reader/package-info.java @@ -14,6 +14,6 @@ * limitations under the License. */ @NonNullApi -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp.reader; import com.google.android.exoplayer2.util.NonNullApi; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/package-info.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/package-info.java deleted file mode 100644 index de756ea160..0000000000 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/reader/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2020 The Android Open Source Project - * - * 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. - */ -@NonNullApi -package com.google.android.exoplayer2.source.rtsp.rtp.reader; - -import com.google.android.exoplayer2.util.NonNullApi; diff --git a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/package-info.java b/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/package-info.java deleted file mode 100644 index 98f34fee50..0000000000 --- a/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/sdp/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * 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. - */ -@NonNullApi -package com.google.android.exoplayer2.source.rtsp.sdp; - -import com.google.android.exoplayer2.util.NonNullApi; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueueTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueueTest.java similarity index 98% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueueTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueueTest.java index ab162eba9b..fcfb19f5b6 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketReorderingQueueTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketReorderingQueueTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.common.truth.Truth.assertThat; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketTest.java similarity index 98% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketTest.java index 5246d7232b..929a0edc21 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpPacketTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtpPacketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 The Android Open Source Project + * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import static com.google.android.exoplayer2.util.Util.getBytesFromHexString; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeadersTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspHeadersTest.java similarity index 98% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeadersTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspHeadersTest.java index 69eaef7c4d..b1bd684462 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspHeadersTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspHeadersTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import static com.google.common.truth.Truth.assertThat; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriodTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriodTest.java index a3bb6dfe54..a93fe3a897 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriodTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaPeriodTest.java @@ -23,9 +23,6 @@ import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.source.MediaPeriod; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpDataChannel; -import com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription; -import com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription; import com.google.android.exoplayer2.upstream.DefaultAllocator; import com.google.common.collect.ImmutableList; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrackTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrackTest.java index 5020b087dc..0e6138a1d6 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrackTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMediaTrackTest.java @@ -15,20 +15,18 @@ */ package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.MEDIA_TYPE_AUDIO; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.MEDIA_TYPE_VIDEO; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.RTP_AVP_PROFILE; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_CONTROL; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_FMTP; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_RTPMAP; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.MEDIA_TYPE_AUDIO; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.MEDIA_TYPE_VIDEO; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.RTP_AVP_PROFILE; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_CONTROL; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_FMTP; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_RTPMAP; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.audio.AacUtil; -import com.google.android.exoplayer2.source.rtsp.rtp.RtpPayloadFormat; -import com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription; import com.google.android.exoplayer2.util.MimeTypes; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtilTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtilTest.java similarity index 99% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtilTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtilTest.java index 84f2e1d704..a594558ebc 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/message/RtspMessageUtilTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspMessageUtilTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.message; +package com.google.android.exoplayer2.source.rtsp; import static com.google.common.truth.Truth.assertThat; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspServer.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspServer.java index e61864011b..4b3f1bb3f0 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspServer.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/RtspServer.java @@ -15,16 +15,11 @@ */ package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.message.RtspRequest.METHOD_OPTIONS; +import static com.google.android.exoplayer2.source.rtsp.RtspRequest.METHOD_OPTIONS; import static com.google.android.exoplayer2.util.Assertions.checkNotNull; import android.os.Handler; import android.os.Looper; -import com.google.android.exoplayer2.source.rtsp.message.RtspHeaders; -import com.google.android.exoplayer2.source.rtsp.message.RtspMessageChannel; -import com.google.android.exoplayer2.source.rtsp.message.RtspMessageUtil; -import com.google.android.exoplayer2.source.rtsp.message.RtspRequest; -import com.google.android.exoplayer2.source.rtsp.message.RtspResponse; import com.google.android.exoplayer2.util.Util; import java.io.Closeable; import java.io.IOException; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionTest.java similarity index 88% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionTest.java index b9af19034f..d0a6aa6b23 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/sdp/SessionDescriptionTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/SessionDescriptionTest.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.sdp; +package com.google.android.exoplayer2.source.rtsp; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.MEDIA_TYPE_AUDIO; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.MEDIA_TYPE_VIDEO; -import static com.google.android.exoplayer2.source.rtsp.sdp.MediaDescription.RTP_AVP_PROFILE; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_CONTROL; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_FMTP; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_RANGE; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_RTPMAP; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_TOOL; -import static com.google.android.exoplayer2.source.rtsp.sdp.SessionDescription.ATTR_TYPE; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.MEDIA_TYPE_AUDIO; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.MEDIA_TYPE_VIDEO; +import static com.google.android.exoplayer2.source.rtsp.MediaDescription.RTP_AVP_PROFILE; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_CONTROL; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_FMTP; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_RANGE; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_RTPMAP; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_TOOL; +import static com.google.android.exoplayer2.source.rtsp.SessionDescription.ATTR_TYPE; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; diff --git a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpAc3ReaderTest.java b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3ReaderTest.java similarity index 97% rename from library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpAc3ReaderTest.java rename to library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3ReaderTest.java index 0ad4e99f46..14ce7913c6 100644 --- a/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpAc3ReaderTest.java +++ b/library/rtsp/src/test/java/com/google/android/exoplayer2/source/rtsp/reader/RtpAc3ReaderTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.android.exoplayer2.source.rtsp.rtp; +package com.google.android.exoplayer2.source.rtsp.reader; import static com.google.android.exoplayer2.util.Util.getBytesFromHexString; import static com.google.common.truth.Truth.assertThat; @@ -23,7 +23,8 @@ import static org.mockito.Mockito.when; import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.extractor.ExtractorOutput; -import com.google.android.exoplayer2.source.rtsp.rtp.reader.RtpAc3Reader; +import com.google.android.exoplayer2.source.rtsp.RtpPacket; +import com.google.android.exoplayer2.source.rtsp.RtpPayloadFormat; import com.google.android.exoplayer2.testutil.FakeTrackOutput; import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.ParsableByteArray;