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