@Test
public void testParcelable() {

  DrmInitData.SchemeData drmData1 = new DrmInitData.SchemeData(WIDEVINE_UUID, VIDEO_MP4,
      TestUtil.buildTestData(128, 1 /* data seed */));
  DrmInitData.SchemeData drmData2 = new DrmInitData.SchemeData(C.UUID_NIL, VIDEO_WEBM,
      TestUtil.buildTestData(128, 1 /* data seed */));
  DrmInitData drmInitData = new DrmInitData(drmData1, drmData2);
  byte[] projectionData = new byte[] {1, 2, 3};
  Metadata metadata = new Metadata(
      new TextInformationFrame("id1", "description1", "value1"),
      new TextInformationFrame("id2", "description2", "value2"));
  ColorInfo colorInfo =  new ColorInfo(C.COLOR_SPACE_BT709,
      C.COLOR_RANGE_LIMITED, C.COLOR_TRANSFER_SDR, new byte[] {1, 2, 3, 4, 5, 6, 7});
  Format formatToParcel =
      new Format(
          "id",
          "label",
          C.SELECTION_FLAG_DEFAULT,
          C.ROLE_FLAG_MAIN,
          /* bitrate= */ 1024,
          "codec",
          metadata,
          /* containerMimeType= */ MimeTypes.VIDEO_MP4,
          /* sampleMimeType= */ MimeTypes.VIDEO_H264,
          /* maxInputSize= */ 2048,
          initData,
          drmInitData,
          Format.OFFSET_SAMPLE_RELATIVE,
          /* width= */ 1920,
          /* height= */ 1080,
          /* frameRate= */ 24,
          /* rotationDegrees= */ 90,
          /* pixelWidthHeightRatio= */ 2,
          projectionData,
          C.STEREO_MODE_TOP_BOTTOM,
          colorInfo,
          /* channelCount= */ 6,
          /* sampleRate= */ 44100,
          C.ENCODING_PCM_24BIT,
          /* encoderDelay= */ 1001,
          /* encoderPadding= */ 1002,
          "language",
          /* accessibilityChannel= */ Format.NO_VALUE,
          /* exoMediaCryptoType= */ null);
  Parcel parcel = Parcel.obtain();
  formatToParcel.writeToParcel(parcel, 0);
  parcel.setDataPosition(0);
  Format formatFromParcel = Format.CREATOR.createFromParcel(parcel);
  assertThat(formatFromParcel).isEqualTo(formatToParcel);
  parcel.recycle();
}