Lines Matching defs:Metadata
18 import android.media.Metadata;
28 * Check the Java layer that parses serialized metadata in Parcel
38 private Metadata mMetadata = null;
44 mMetadata = new Metadata();
131 // misses metadata id and metadata type.
139 mParcel.writeInt(Metadata.TITLE);
140 // misses metadata type
156 mParcel.writeInt(Metadata.TITLE);
157 mParcel.writeInt(Metadata.STRING_VAL);
166 writeStringRecord(Metadata.TITLE, "a title");
167 writeStringRecord(Metadata.GENRE, "comedy");
168 writeStringRecord(Metadata.firstCustomId(), "custom");
171 assertTrue(mMetadata.has(Metadata.TITLE));
172 assertTrue(mMetadata.has(Metadata.GENRE));
173 assertTrue(mMetadata.has(Metadata.firstCustomId()));
174 assertFalse(mMetadata.has(Metadata.DRM_CRIPPLED));
178 // Detects bad metadata type
183 mParcel.writeInt(Metadata.TITLE);
192 // Check a Metadata instance can be reused, i.e the parse method
196 writeStringRecord(Metadata.TITLE, "a title");
197 writeStringRecord(Metadata.GENRE, "comedy");
198 writeStringRecord(Metadata.firstCustomId(), "custom");
203 writeStringRecord(Metadata.MIME_TYPE, "audio/mpg");
207 // Only the mime type metadata should be present.
209 assertTrue(mMetadata.has(Metadata.MIME_TYPE));
211 assertFalse(mMetadata.has(Metadata.TITLE));
212 assertFalse(mMetadata.has(Metadata.GENRE));
213 assertFalse(mMetadata.has(Metadata.firstCustomId()));
223 writeStringRecord(Metadata.TITLE, "a title");
224 writeStringRecord(Metadata.GENRE, "comedy");
228 assertEquals("a title", mMetadata.getString(Metadata.TITLE));
229 assertEquals("comedy", mMetadata.getString(Metadata.GENRE));
235 writeStringRecord(Metadata.TITLE, "");
239 assertEquals("", mMetadata.getString(Metadata.TITLE));
245 writeStringRecord(Metadata.TITLE, null);
249 assertEquals(null, mMetadata.getString(Metadata.TITLE));
255 writeIntRecord(Metadata.DURATION, 5);
260 mMetadata.getString(Metadata.DURATION);
270 writeIntRecord(Metadata.CD_TRACK_NUM, 1);
274 assertEquals(1, mMetadata.getInt(Metadata.CD_TRACK_NUM));
280 writeBooleanRecord(Metadata.PAUSE_AVAILABLE, true);
281 writeBooleanRecord(Metadata.SEEK_AVAILABLE, true);
282 writeBooleanRecord(Metadata.SEEK_BACKWARD_AVAILABLE, true);
283 writeBooleanRecord(Metadata.SEEK_FORWARD_AVAILABLE, true);
287 assertEquals(true, mMetadata.getBoolean(Metadata.PAUSE_AVAILABLE));
288 assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_AVAILABLE));
289 assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE));
290 assertEquals(true, mMetadata.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE));
296 writeLongRecord(Metadata.DURATION, 1L);
300 assertEquals(1L, mMetadata.getLong(Metadata.DURATION));
306 writeDoubleRecord(Metadata.VIDEO_FRAME_RATE, 29.97);
310 assertEquals(29.97, mMetadata.getDouble(Metadata.VIDEO_FRAME_RATE));
318 writeByteArrayRecord(Metadata.ALBUM_ART, data);
322 byte res[] = mMetadata.getByteArray(Metadata.ALBUM_ART);
331 writeDateRecord(Metadata.DATE, 0, "PST");
335 assertEquals(new Date(0), mMetadata.getDate(Metadata.DATE));
347 mParcel.writeInt(Metadata.STRING_VAL);
357 mParcel.writeInt(Metadata.INTEGER_VAL);
367 mParcel.writeInt(Metadata.BOOLEAN_VAL);
377 mParcel.writeInt(Metadata.LONG_VAL);
387 mParcel.writeInt(Metadata.DOUBLE_VAL);
397 mParcel.writeInt(Metadata.BYTE_ARRAY_VAL);
407 mParcel.writeInt(Metadata.DATE_VAL);