Skip to content

Commit

Permalink
VAA-32: Fixed bug in setting framerate
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Jun 27, 2020
1 parent 0c4cc56 commit 31e684e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void testCreateMedia() throws Exception {
media.setUri(URI.create("http://www.foo.bar/test/Test-02-" + now.toEpochMilli() + ".mp4"));
media.setStartTimestamp(now);
media.setSha512(randomSha512());
media.setFrameRate(24.0);
var f = mediaService.create(media);
var m = f.get(5000, TimeUnit.MILLISECONDS);
assertNotNull(m);
Expand All @@ -72,6 +73,7 @@ public void testCreateMedia() throws Exception {
assertNotNull(m.getVideoSequenceUuid());
assertNotNull(m.getVideoUuid());
assertNotNull(m.getVideoReferenceUuid());
assertEquals(media.getFrameRate(), m.getFrameRate());
}

@Ignore
Expand Down Expand Up @@ -117,14 +119,15 @@ public void testUpdateMedia() throws Exception {
m.setDuration(duration);
m.setWidth(200);
m.setHeight(200);
m.setFrameRate(24.0);
var m1 = mediaService.update(m).get(5000, TimeUnit.MILLISECONDS);
assertNotNull(m1);
assertNotNull(m1.getVideoReferenceUuid());
assertEquals(then, m1.getStartTimestamp());
assertEquals(duration, m1.getDuration());
assertEquals(200, m1.getWidth().intValue());
assertEquals(200, m1.getHeight().intValue());

assertEquals(m.getWidth().intValue(), m1.getWidth().intValue());
assertEquals(m.getHeight().intValue(), m1.getHeight().intValue());
assertEquals(m.getFrameRate(), m1.getFrameRate());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CompletableFuture<Media> create(Media media) {
addField(fieldMap, "container", media::getContainer);
addField(fieldMap, "width", () -> media.getWidth().toString());
addField(fieldMap, "height", () -> media.getHeight().toString());
addField(fieldMap, "frameRate", () -> media.getFrameRate().toString());
addField(fieldMap, "frame_rate", () -> media.getFrameRate().toString());
addField(fieldMap, "size_bytes", () -> media.getSizeBytes().toString());
addField(fieldMap, "sha512", () -> HexUtils.printHexBinary(media.getSha512()));
addField(fieldMap, "video_codec", media::getVideoCodec);
Expand Down Expand Up @@ -101,7 +101,7 @@ public CompletableFuture<Media> update(Media media) {
addField(fieldMap, "container", media::getContainer);
addField(fieldMap, "width", () -> media.getWidth().toString());
addField(fieldMap, "height", () -> media.getHeight().toString());
addField(fieldMap, "frameRate", () -> media.getFrameRate().toString());
addField(fieldMap, "frame_rate", () -> media.getFrameRate().toString());
addField(fieldMap, "size_bytes", () -> media.getSizeBytes().toString());
addField(fieldMap, "sha512", () -> HexUtils.printHexBinary(media.getSha512()));
addField(fieldMap, "video_codec", media::getVideoCodec);
Expand Down

0 comments on commit 31e684e

Please sign in to comment.