1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.media.cts;
18 
19 import android.media.MediaCodec;
20 import android.media.MediaCodec.BufferInfo;
21 import android.media.MediaCodec.Callback;
22 import android.media.MediaFormat;
23 import android.os.Bundle;
24 import android.view.Surface;
25 
26 import java.nio.ByteBuffer;
27 
28 /**
29  * This interface exposes the minimum set of {@link MediaCodec} APIs tested in {@link EncodeDecodeTest}
30  * and {@link VpxEncoderTest}.
31  */
32 public interface MediaCodecWrapper {
33 
release()34   void release();
35 
configure(MediaFormat format, int flags)36   void configure(MediaFormat format, int flags);
37 
configure(MediaFormat format, int flags, Surface surface)38   void configure(MediaFormat format, int flags, Surface surface);
39 
setInputSurface(InputSurfaceInterface inputSurface)40   void setInputSurface(InputSurfaceInterface inputSurface);
41 
createInputSurface()42   InputSurfaceInterface createInputSurface();
43 
start()44   void start();
45 
stop()46   void stop();
47 
dequeueOutputBuffer(BufferInfo info, long timeoutUs)48   int dequeueOutputBuffer(BufferInfo info, long timeoutUs);
49 
releaseOutputBuffer(int index, boolean render)50   void releaseOutputBuffer(int index, boolean render);
51 
signalEndOfInputStream()52   void signalEndOfInputStream();
53 
getOutputFormatString()54   String getOutputFormatString();
55 
getOutputBuffer(int index)56   ByteBuffer getOutputBuffer(int index);
57 
getOutputBuffers()58   ByteBuffer[] getOutputBuffers();
59 
getInputBuffer(int index)60   ByteBuffer getInputBuffer(int index);
61 
getInputBuffers()62   ByteBuffer[] getInputBuffers();
63 
queueInputBuffer( int index, int offset, int size, long presentationTimeUs, int flags)64   void queueInputBuffer(
65           int index,
66           int offset,
67           int size,
68           long presentationTimeUs,
69           int flags);
70 
dequeueInputBuffer(long timeoutUs)71   int dequeueInputBuffer(long timeoutUs);
72 
setParameters(Bundle params)73   void setParameters(Bundle params);
74 
setCallback(Callback mCallback)75   void setCallback(Callback mCallback);
76 
77 }
78