-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathTrackStrategy.java
More file actions
34 lines (28 loc) · 1.26 KB
/
TrackStrategy.java
File metadata and controls
34 lines (28 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.otaliastudios.transcoder.strategy;
import android.media.MediaFormat;
import androidx.annotation.NonNull;
import com.otaliastudios.transcoder.engine.TrackStatus;
import com.otaliastudios.transcoder.strategy.size.Resizer;
import java.util.List;
/**
* Base class for video/audio format strategy.
* Video strategies should use a {@link Resizer} instance to compute the output
* video size.
*/
public interface TrackStrategy {
/**
* Create the output format for this track (either audio or video).
* Implementors should fill the outputFormat object and return a non-null {@link TrackStatus}:
* - {@link TrackStatus#COMPRESSING}: we want to compress this track. Output format will be used
* - {@link TrackStatus#PASS_THROUGH}: we want to use the input format. Output format will be ignored
* - {@link TrackStatus#REMOVING}: we want to remove this track. Output format will be ignored
*
* Subclasses can also throw to abort the whole transcoding operation.
*
* @param inputFormats the input formats
* @param outputFormat the output format to be filled
* @return the track status
*/
@NonNull
TrackStatus createOutputFormat(@NonNull List<MediaFormat> inputFormats, @NonNull MediaFormat outputFormat);
}