@@ -74,7 +74,7 @@ public static MediaTranscoder getInstance() {
74
74
* @deprecated Use {@link #transcodeVideo(FileDescriptor, String, MediaFormatStrategy, MediaTranscoder.Listener)} which accepts output video format.
75
75
*/
76
76
@ Deprecated
77
- public Future transcodeVideo (final FileDescriptor inFileDescriptor , final String outPath , final Listener listener ) {
77
+ public Future < Void > transcodeVideo (final FileDescriptor inFileDescriptor , final String outPath , final Listener listener ) {
78
78
return transcodeVideo (inFileDescriptor , outPath , new MediaFormatStrategy () {
79
79
@ Override
80
80
public MediaFormat createVideoOutputFormat (MediaFormat inputFormat ) {
@@ -98,7 +98,7 @@ public MediaFormat createAudioOutputFormat(MediaFormat inputFormat) {
98
98
* @param listener Listener instance for callback.
99
99
* @throws IOException if input file could not be read.
100
100
*/
101
- public Future transcodeVideo (final String inPath , final String outPath , final MediaFormatStrategy outFormatStrategy , final Listener listener ) throws IOException {
101
+ public Future < Void > transcodeVideo (final String inPath , final String outPath , final MediaFormatStrategy outFormatStrategy , final Listener listener ) throws IOException {
102
102
FileInputStream fileInputStream = null ;
103
103
FileDescriptor inFileDescriptor ;
104
104
try {
@@ -158,11 +158,11 @@ private void closeStream() {
158
158
* @param outFormatStrategy Strategy for output video format.
159
159
* @param listener Listener instance for callback.
160
160
*/
161
- public Future transcodeVideo (final FileDescriptor inFileDescriptor , final String outPath , final MediaFormatStrategy outFormatStrategy , final Listener listener ) {
161
+ public Future < Void > transcodeVideo (final FileDescriptor inFileDescriptor , final String outPath , final MediaFormatStrategy outFormatStrategy , final Listener listener ) {
162
162
Looper looper = Looper .myLooper ();
163
163
if (looper == null ) looper = Looper .getMainLooper ();
164
164
final Handler handler = new Handler (looper );
165
- final AtomicReference <Future > futureReference = new AtomicReference <>();
165
+ final AtomicReference <Future < Void > > futureReference = new AtomicReference <>();
166
166
final Future <Void > createdFuture = mExecutor .submit (new Callable <Void >() {
167
167
@ Override
168
168
public Void call () throws Exception {
@@ -201,7 +201,7 @@ public void run() {
201
201
if (exception == null ) {
202
202
listener .onTranscodeCompleted ();
203
203
} else {
204
- Future future = futureReference .get ();
204
+ Future < Void > future = futureReference .get ();
205
205
if (future != null && future .isCancelled ()) {
206
206
listener .onTranscodeCanceled ();
207
207
} else {
0 commit comments