File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash
main/java/androidx/media3/exoplayer/upstream
test/java/androidx/media3/exoplayer/upstream Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 14
14
* Fix memory leak in ` MergingMediaSource ` , for example used when
15
15
sideloading subtitles
16
16
([ #2338 ] ( https://github.com/androidx/media/issues/2338 ) ).
17
+ * Allow ` CmcdConfiguration.Factory ` to return ` null ` to disable CMCD
18
+ logging for specific media items
19
+ ([ #2386 ] ( https://github.com/androidx/media/pull/2386 ) ).
17
20
* Transformer:
18
21
* Filling an initial gap (added via ` addGap() ` ) with silent audio now
19
22
requires explicitly setting ` experimentalSetForceAudioTrack(true) ` in
Original file line number Diff line number Diff line change @@ -127,8 +127,9 @@ public interface Factory {
127
127
* Creates a {@link CmcdConfiguration} based on the provided {@link MediaItem}.
128
128
*
129
129
* @param mediaItem The {@link MediaItem} from which to create the CMCD configuration.
130
- * @return A {@link CmcdConfiguration} instance.
130
+ * @return A {@link CmcdConfiguration} instance, or {@code null} to disable CMCD logging .
131
131
*/
132
+ @ Nullable
132
133
CmcdConfiguration createCmcdConfiguration (MediaItem mediaItem );
133
134
134
135
/**
Original file line number Diff line number Diff line change 18
18
import static com .google .common .truth .Truth .assertThat ;
19
19
import static org .junit .Assert .assertThrows ;
20
20
21
+ import androidx .annotation .Nullable ;
21
22
import androidx .media3 .common .C ;
22
23
import androidx .media3 .common .MediaItem ;
23
24
import androidx .test .ext .junit .runners .AndroidJUnit4 ;
@@ -134,4 +135,16 @@ public int getRequestedMaximumThroughputKbps(int throughputKbps) {
134
135
/* throughputKbps= */ 100 ))
135
136
.isEqualTo (200 );
136
137
}
138
+
139
+ @ Test
140
+ public void customFactory_returnsNull () {
141
+ CmcdConfiguration .Factory cmcdConfigurationFactory = mediaItem -> null ;
142
+ MediaItem mediaItem = new MediaItem .Builder ().setMediaId (TEST_MEDIA_ID ).build ();
143
+
144
+ @ Nullable
145
+ CmcdConfiguration cmcdConfiguration =
146
+ cmcdConfigurationFactory .createCmcdConfiguration (mediaItem );
147
+
148
+ assertThat (cmcdConfiguration ).isNull ();
149
+ }
137
150
}
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ public static final class Factory implements MediaSourceFactory {
113
113
private final DashChunkSource .Factory chunkSourceFactory ;
114
114
@ Nullable private final DataSource .Factory manifestDataSourceFactory ;
115
115
116
- private CmcdConfiguration .Factory cmcdConfigurationFactory ;
116
+ @ Nullable private CmcdConfiguration .Factory cmcdConfigurationFactory ;
117
117
private DrmSessionManagerProvider drmSessionManagerProvider ;
118
118
private CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory ;
119
119
private LoadErrorHandlingPolicy loadErrorHandlingPolicy ;
You can’t perform that action at this time.
0 commit comments