Skip to content

Commit

Permalink
Set TargetFormat to TrackTransformationObject when initiating the sta…
Browse files Browse the repository at this point in the history
…ts. If the format is not set here initially then it is never available in cases where we fail to create a corresponding TrackTranscoder. (#262)
  • Loading branch information
vamshi-dhulipala authored Aug 16, 2023
1 parent c3c0c4b commit f894a68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ protected void error(@Nullable Throwable cause) {
@VisibleForTesting
void initStatsCollector() {
// TODO modify TrackTransformationInfo to report muxing/demuxing and different media sources/targets
for (TrackTransform trackTransform : trackTransforms) {
for (int track = 0; track < trackTransforms.size(); track++) {
TrackTransform trackTransform = trackTransforms.get(track);
statsCollector.addSourceTrack(trackTransform.getMediaSource().getTrackFormat(trackTransform.getSourceTrack()));
statsCollector.setTargetFormat(track, trackTransform.getTargetFormat());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ public void transformWhenNoErrors() throws Exception {
transformationJob.transform();

verify(marshallingTransformationListener).onCompleted(eq(JOB_ID), ArgumentMatchers.<TrackTransformationInfo>anyList());
verify(statsCollector).setTargetFormat(0, targetVideoFormat);
verify(statsCollector).addSourceTrack(sourceVideoFormat);
verify(statsCollector).addSourceTrack(sourceAudioFormat);
verify(statsCollector).setTargetFormat(1, targetAudioFormat);
}

@Test(expected = InsufficientDiskSpaceException.class)
Expand Down

0 comments on commit f894a68

Please sign in to comment.