am f1207122: Merge "MediaPlayer: provide mime type for all track types" into mnc-dev

* commit 'f12071222fcf7c762bb8d28800ae693ec58347f4':
  MediaPlayer: provide mime type for all track types
This commit is contained in:
Robert Shih
2015-05-01 00:46:54 +00:00
committed by Android Git Automerger

View File

@@ -1953,21 +1953,16 @@ public class MediaPlayer implements SubtitleController.Listener
TrackInfo(Parcel in) { TrackInfo(Parcel in) {
mTrackType = in.readInt(); mTrackType = in.readInt();
// TODO: parcel in the full MediaFormat // TODO: parcel in the full MediaFormat; currently we are using createSubtitleFormat
// even for audio/video tracks, meaning we only set the mime and language.
String mime = in.readString();
String language = in.readString(); String language = in.readString();
mFormat = MediaFormat.createSubtitleFormat(mime, language);
if (mTrackType == MEDIA_TRACK_TYPE_TIMEDTEXT) { if (mTrackType == MEDIA_TRACK_TYPE_SUBTITLE) {
mFormat = MediaFormat.createSubtitleFormat(
MEDIA_MIMETYPE_TEXT_SUBRIP, language);
} else if (mTrackType == MEDIA_TRACK_TYPE_SUBTITLE) {
String mime = in.readString();
mFormat = MediaFormat.createSubtitleFormat(mime, language);
mFormat.setInteger(MediaFormat.KEY_IS_AUTOSELECT, in.readInt()); mFormat.setInteger(MediaFormat.KEY_IS_AUTOSELECT, in.readInt());
mFormat.setInteger(MediaFormat.KEY_IS_DEFAULT, in.readInt()); mFormat.setInteger(MediaFormat.KEY_IS_DEFAULT, in.readInt());
mFormat.setInteger(MediaFormat.KEY_IS_FORCED_SUBTITLE, in.readInt()); mFormat.setInteger(MediaFormat.KEY_IS_FORCED_SUBTITLE, in.readInt());
} else {
mFormat = new MediaFormat();
mFormat.setString(MediaFormat.KEY_LANGUAGE, language);
} }
} }