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 import java.nio.ByteBuffer;
26 
27 /**
28  * This interface exposes the minimum set of {@link MediaCodec} APIs tested in {@link EncodeDecodeTest}
29  * and {@link VpxEncoderTest}.
30  */
31 public interface MediaCodecWrapper {
32 
release()33   void release();
34 
configure(MediaFormat format, int flags)35   void configure(MediaFormat format, int flags);
36 
configure(MediaFormat format, int flags, Surface surface)37   void configure(MediaFormat format, int flags, Surface surface);
38 
setInputSurface(InputSurfaceInterface inputSurface)39   void setInputSurface(InputSurfaceInterface inputSurface);
40 
createInputSurface()41   InputSurfaceInterface createInputSurface();
42 
start()43   void start();
44 
stop()45   void stop();
46 
dequeueOutputBuffer(BufferInfo info, long timeoutUs)47   int dequeueOutputBuffer(BufferInfo info, long timeoutUs);
48 
releaseOutputBuffer(int index, boolean render)49   void releaseOutputBuffer(int index, boolean render);
50 
signalEndOfInputStream()51   void signalEndOfInputStream();
52 
getOutputFormatString()53   String getOutputFormatString();
54 
getOutputBuffer(int index)55   ByteBuffer getOutputBuffer(int index);
56 
getOutputBuffers()57   ByteBuffer[] getOutputBuffers();
58 
getInputBuffer(int index)59   ByteBuffer getInputBuffer(int index);
60 
getInputBuffers()61   ByteBuffer[] getInputBuffers();
62 
queueInputBuffer( int index, int offset, int size, long presentationTimeUs, int flags)63   void queueInputBuffer(
64           int index,
65           int offset,
66           int size,
67           long presentationTimeUs,
68           int flags);
69 
dequeueInputBuffer(long timeoutUs)70   int dequeueInputBuffer(long timeoutUs);
71 
setParameters(Bundle params)72   void setParameters(Bundle params);
73 
setCallback(Callback mCallback)74   void setCallback(Callback mCallback);
75 
76 }
77