mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Bit of a hack to pass through original MediaFormat from FrameworkSampleSource.
This commit is contained in:
parent
c9d9808013
commit
ea7caf4f91
2 changed files with 16 additions and 2 deletions
|
|
@ -315,10 +315,12 @@ public final class FrameworkSampleSource implements SampleSource, SampleSourceRe
|
||||||
}
|
}
|
||||||
long durationUs = format.containsKey(android.media.MediaFormat.KEY_DURATION)
|
long durationUs = format.containsKey(android.media.MediaFormat.KEY_DURATION)
|
||||||
? format.getLong(android.media.MediaFormat.KEY_DURATION) : C.UNKNOWN_TIME_US;
|
? format.getLong(android.media.MediaFormat.KEY_DURATION) : C.UNKNOWN_TIME_US;
|
||||||
return new MediaFormat(mimeType, maxInputSize, durationUs, width, height, rotationDegrees,
|
MediaFormat mediaFormat = new MediaFormat(mimeType, maxInputSize, durationUs, width, height,
|
||||||
MediaFormat.NO_VALUE, channelCount, sampleRate, language,
|
rotationDegrees, MediaFormat.NO_VALUE, channelCount, sampleRate, language,
|
||||||
MediaFormat.OFFSET_SAMPLE_RELATIVE, initializationData, false, MediaFormat.NO_VALUE,
|
MediaFormat.OFFSET_SAMPLE_RELATIVE, initializationData, false, MediaFormat.NO_VALUE,
|
||||||
MediaFormat.NO_VALUE);
|
MediaFormat.NO_VALUE);
|
||||||
|
mediaFormat.setFrameworkFormatV16(format);
|
||||||
|
return mediaFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(16)
|
@TargetApi(16)
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,18 @@ public final class MediaFormat {
|
||||||
return frameworkMediaFormat;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MediaFormat(" + mimeType + ", " + maxInputSize + ", " + width + ", " + height + ", "
|
return "MediaFormat(" + mimeType + ", " + maxInputSize + ", " + width + ", " + height + ", "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue