Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exoplayer analytics additions #1

Merged
merged 9 commits into from
Aug 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Release notes #

### Current dev branch (from r1.4.1) ###
### Current dev branch (from r1.4.2) ###

* Added MulticastDataSource for connecting to multicast streams.
* Nothing yet.

### r1.4.2 ###

* Implemented automatic format detection for regular container formats.
* Added UdpDataSource for connecting to multicast streams.
* Improved robustness for MP4 playbacks.
* Misc bug fixes.

### r1.4.1 ###

Expand Down
4 changes: 2 additions & 2 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.exoplayer.demo"
android:versionCode="1401"
android:versionName="1.4.1"
android:versionCode="1402"
android:versionName="1.4.2"
android:theme="@style/RootTheme">

<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ public void onSingleManifest(HlsPlaylist manifest) {
player.onRenderersError(e);
return;
}
}

if (variantIndices.length == 0) {
player.onRenderersError(new IllegalStateException("No variants selected."));
return;
if (variantIndices.length == 0) {
player.onRenderersError(new IllegalStateException("No variants selected."));
return;
}
}

DataSource dataSource = new DefaultUriDataSource(context, bandwidthMeter, userAgent);
Expand Down
4 changes: 2 additions & 2 deletions demo_misc/webm_sw_decoder/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.exoplayer.demo.webm"
android:versionCode="1401"
android:versionName="1.4.1"
android:versionCode="1402"
android:versionName="1.4.2"
android:theme="@style/RootTheme">

<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

version=1.3.2
version=1.4.2-INTERNAL
group=com.google.exoplayer
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ publish {
userOrg = 'google'
groupId = 'com.google.android.exoplayer'
artifactId = 'exoplayer'
version = 'r1.4.1'
version = 'r1.4.2'
description = 'The ExoPlayer library.'
website = 'https://github.com/google/ExoPlayer'
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class TimeRangeTest extends TestCase {
public void testEquals() {
TimeRange timeRange1 = new TimeRange(TimeRange.TYPE_SNAPSHOT, 0, 30000000);
assertTrue(timeRange1.equals(timeRange1));

TimeRange timeRange2 = new TimeRange(TimeRange.TYPE_SNAPSHOT, 0, 30000000);
assertTrue(timeRange1.equals(timeRange2));

TimeRange timeRange3 = new TimeRange(TimeRange.TYPE_SNAPSHOT, 0, 60000000);
assertFalse(timeRange1.equals(timeRange3));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public class DashChunkSourceTest extends InstrumentationTestCase {
new Format("3", "video/mp4", WIDE_WIDTH, 50, -1, -1, -1, 1000);

@Mock private DataSource mockDataSource;
@Mock private ManifestFetcher<MediaPresentationDescription> mockManifestFetcher;

@Override
public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Thrown when a live playback falls behind the available media window.
*/
public class BehindLiveWindowException extends IOException {
public final class BehindLiveWindowException extends IOException {

public BehindLiveWindowException() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Compatibility wrapper around {@link android.media.MediaCodec.CryptoInfo}.
*/
public class CryptoInfo {
public final class CryptoInfo {

/**
* @see android.media.MediaCodec.CryptoInfo#iv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* itself as a task with priority {@link NetworkLock#STREAMING_PRIORITY} during loading periods,
* and unregistering itself during draining periods.
*/
public class DefaultLoadControl implements LoadControl {
public final class DefaultLoadControl implements LoadControl {

/**
* Interface definition for a callback to be notified of {@link DefaultLoadControl} events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* to request that it should be ignored. {@link IllegalStateException} is thrown from all methods
* that are documented to indicate that they should not be invoked unless the renderer is prepared.
*/
public class DummyTrackRenderer extends TrackRenderer {
public final class DummyTrackRenderer extends TrackRenderer {

@Override
protected int doPrepare(long positionUs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@
/**
* Information about the ExoPlayer library.
*/
// TODO: This file should be automatically generated by the build system.
public class ExoPlayerLibraryInfo {

private ExoPlayerLibraryInfo() {}
public final class ExoPlayerLibraryInfo {

/**
* The version of the library, expressed as a string.
*/
public static final String VERSION = "1.4.1";
public static final String VERSION = "1.4.2";

/**
* The version of the library, expressed as an integer.
* <p>
* Three digits are used for each component of {@link #VERSION}. For example "1.2.3" has the
* corresponding integer version 001002003.
*/
public static final int VERSION_INT = 001004001;
public static final int VERSION_INT = 001004002;

/**
* Whether the library was compiled with {@link com.google.android.exoplayer.util.Assertions}
Expand All @@ -48,4 +45,6 @@ private ExoPlayerLibraryInfo() {}
*/
public static final boolean TRACE_ENABLED = true;

private ExoPlayerLibraryInfo() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* A utility class for querying the available codecs.
*/
@TargetApi(16)
public class MediaCodecUtil {
public final class MediaCodecUtil {

/**
* Thrown when an error occurs querying the device for its underlying media capabilities.
Expand All @@ -54,6 +54,8 @@ private DecoderQueryException(Throwable cause) {

private static final HashMap<CodecKey, Pair<String, CodecCapabilities>> codecs = new HashMap<>();

private MediaCodecUtil() {}

/**
* Get information about the decoder that will be used for a given mime type.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Defines the format of an elementary media stream.
*/
public class MediaFormat {
public final class MediaFormat {

private static final String KEY_PIXEL_WIDTH_HEIGHT_RATIO =
"com.google.android.videos.pixelWidthHeightRatio";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Makes a best effort to adjust frame release timestamps for a smoother visual result.
*/
@TargetApi(16)
public class SmoothFrameReleaseTimeHelper implements FrameReleaseTimeHelper, FrameCallback {
public final class SmoothFrameReleaseTimeHelper implements FrameReleaseTimeHelper, FrameCallback {

private static final long CHOREOGRAPHER_SAMPLE_DELAY_MILLIS = 500;
private static final long MAX_ALLOWED_DRIFT_NS = 20000000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* A standalone {@link MediaClock}. The clock can be started, stopped and its time can be set and
* retrieved. When started, this clock is based on {@link SystemClock#elapsedRealtime()}.
*/
/* package */ class StandaloneMediaClock implements MediaClock {
/* package */ final class StandaloneMediaClock implements MediaClock {

private boolean started;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,68 +74,69 @@ public ContainerMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger
}

@Override
public long bytesLoaded() {
public final long bytesLoaded() {
return bytesLoaded;
}

@Override
public MediaFormat getMediaFormat() {
public final MediaFormat getMediaFormat() {
return mediaFormat;
}

@Override
public DrmInitData getDrmInitData() {
public final DrmInitData getDrmInitData() {
return drmInitData;
}

// SingleTrackOutput implementation.

@Override
public void seekMap(SeekMap seekMap) {
public final void seekMap(SeekMap seekMap) {
// Do nothing.
}

@Override
public void drmInitData(DrmInitData drmInitData) {
public final void drmInitData(DrmInitData drmInitData) {
this.drmInitData = drmInitData;
}

@Override
public void format(MediaFormat mediaFormat) {
public final void format(MediaFormat mediaFormat) {
this.mediaFormat = mediaFormat;
}

@Override
public int sampleData(ExtractorInput input, int length, boolean allowEndOfInput)
public final int sampleData(ExtractorInput input, int length, boolean allowEndOfInput)
throws IOException, InterruptedException {
return getOutput().sampleData(input, length, allowEndOfInput);
}

@Override
public void sampleData(ParsableByteArray data, int length) {
public final void sampleData(ParsableByteArray data, int length) {
getOutput().sampleData(data, length);
}

@Override
public void sampleMetadata(long timeUs, int flags, int size, int offset, byte[] encryptionKey) {
public final void sampleMetadata(long timeUs, int flags, int size, int offset,
byte[] encryptionKey) {
getOutput().sampleMetadata(timeUs + sampleOffsetUs, flags, size, offset, encryptionKey);
}

// Loadable implementation.

@Override
public void cancelLoad() {
public final void cancelLoad() {
loadCanceled = true;
}

@Override
public boolean isLoadCanceled() {
public final boolean isLoadCanceled() {
return loadCanceled;
}

@SuppressWarnings("NonAtomicVolatileUpdate")
@Override
public void load() throws IOException, InterruptedException {
public final void load() throws IOException, InterruptedException {
DataSpec loadDataSpec = Util.getRemainderDataSpec(dataSpec, bytesLoaded);
try {
// Create and open the input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public int compare(Format a, Format b) {
*/
public final String id;

/**
* The rendition url.
*/
public final String renditionUrl;

/**
* The mime type of the format.
*/
Expand Down Expand Up @@ -119,7 +124,7 @@ public Format(String id, String mimeType, int width, int height, float frameRate
*/
public Format(String id, String mimeType, int width, int height, float frameRate, int numChannels,
int audioSamplingRate, int bitrate, String language) {
this(id, mimeType, width, height, frameRate, numChannels, audioSamplingRate, bitrate, language,
this(id, null, mimeType, width, height, frameRate, numChannels, audioSamplingRate, bitrate, language,
null);
}

Expand All @@ -137,9 +142,10 @@ public Format(String id, String mimeType, int width, int height, float frameRate
* @param language The language of the format.
* @param codecs The codecs used to decode the format.
*/
public Format(String id, String mimeType, int width, int height, float frameRate, int numChannels,
public Format(String id, String renditionUrl, String mimeType, int width, int height, float frameRate, int numChannels,
int audioSamplingRate, int bitrate, String language, String codecs) {
this.id = Assertions.checkNotNull(id);
this.renditionUrl = renditionUrl;
this.mimeType = mimeType;
this.width = width;
this.height = height;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* A {@link ChunkSource} providing the ability to switch between multiple other {@link ChunkSource}
* instances.
*/
public class MultiTrackChunkSource implements ChunkSource, ExoPlayerComponent {
public final class MultiTrackChunkSource implements ChunkSource, ExoPlayerComponent {

/**
* A message to indicate a source selection. Source selection can only be performed when the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* An example use case for this implementation is to act as the source for loading out-of-band
* subtitles, where subtitles for the entire video are delivered as a single file.
*/
public class SingleSampleChunkSource implements ChunkSource {
public final class SingleSampleChunkSource implements ChunkSource {

private final DataSource dataSource;
private final DataSpec dataSpec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* An implementation of {@link DashSegmentIndex} that wraps a {@link ChunkIndex} parsed from a
* media stream.
*/
public class DashWrappingSegmentIndex implements DashSegmentIndex {
/* package */ final class DashWrappingSegmentIndex implements DashSegmentIndex {

private final ChunkIndex chunkIndex;
private final String uri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer.dash;
package com.google.android.exoplayer.dash.mpd;

import com.google.android.exoplayer.dash.mpd.RangedUri;
import com.google.android.exoplayer.dash.DashSegmentIndex;

/**
* A {@link DashSegmentIndex} that defines a single segment.
*/
public class DashSingleSegmentIndex implements DashSegmentIndex {
/* package */ final class DashSingleSegmentIndex implements DashSegmentIndex {

private final long startTimeUs;
private final long durationUs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ protected Representation parseRepresentation(XmlPullParser xpp, String baseUrl,

protected Format buildFormat(String id, String mimeType, int width, int height, float frameRate,
int numChannels, int audioSamplingRate, int bandwidth, String language, String codecs) {
return new Format(id, mimeType, width, height, frameRate, numChannels, audioSamplingRate,
return new Format(id, null, mimeType, width, height, frameRate, numChannels, audioSamplingRate,
bandwidth, language, codecs);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.google.android.exoplayer.chunk.Format;
import com.google.android.exoplayer.chunk.FormatWrapper;
import com.google.android.exoplayer.dash.DashSegmentIndex;
import com.google.android.exoplayer.dash.DashSingleSegmentIndex;
import com.google.android.exoplayer.dash.mpd.SegmentBase.MultiSegmentBase;
import com.google.android.exoplayer.dash.mpd.SegmentBase.SingleSegmentBase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Represents a UTCTiming element.
*/
public class UtcTimingElement {
public final class UtcTimingElement {

public final String schemeIdUri;
public final String value;
Expand Down
Loading