Commit ea7caf4f by Oliver Woodman

Bit of a hack to pass through original MediaFormat from FrameworkSampleSource.

parent c9d98080
......@@ -315,10 +315,12 @@ public final class FrameworkSampleSource implements SampleSource, SampleSourceRe
}
long durationUs = format.containsKey(android.media.MediaFormat.KEY_DURATION)
? format.getLong(android.media.MediaFormat.KEY_DURATION) : C.UNKNOWN_TIME_US;
return new MediaFormat(mimeType, maxInputSize, durationUs, width, height, rotationDegrees,
MediaFormat.NO_VALUE, channelCount, sampleRate, language,
MediaFormat mediaFormat = new MediaFormat(mimeType, maxInputSize, durationUs, width, height,
rotationDegrees, MediaFormat.NO_VALUE, channelCount, sampleRate, language,
MediaFormat.OFFSET_SAMPLE_RELATIVE, initializationData, false, MediaFormat.NO_VALUE,
MediaFormat.NO_VALUE);
mediaFormat.setFrameworkFormatV16(format);
return mediaFormat;
}
@TargetApi(16)
......
......@@ -262,6 +262,18 @@ public final class MediaFormat {
return frameworkMediaFormat;
}
/**
* Sets the framework format returned by {@link #getFrameworkMediaFormatV16()}.
*
* @deprecated This method only exists for FrameworkSampleSource, which is itself deprecated.
* @param format The framework format.
*/
@Deprecated
@TargetApi(16)
/* package */ final void setFrameworkFormatV16(android.media.MediaFormat format) {
frameworkMediaFormat = format;
}
@Override
public String toString() {
return "MediaFormat(" + mimeType + ", " + maxInputSize + ", " + width + ", " + height + ", "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment