mirror of
https://github.com/samsonjs/media.git
synced 2026-03-31 10:25:48 +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)
|
||||
? 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 + ", "
|
||||
|
|
|
|||
Loading…
Reference in a new issue