Home | History | Annotate | Download | only in protocol
      1 /*
      2  * Copyright (C) 2016 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 com.android.incallui.videosurface.protocol;
     18 
     19 import android.graphics.Point;
     20 import android.support.annotation.IntDef;
     21 import android.view.Surface;
     22 import android.view.TextureView;
     23 import java.lang.annotation.Retention;
     24 import java.lang.annotation.RetentionPolicy;
     25 
     26 /** Represents a surface texture for a video feed. */
     27 public interface VideoSurfaceTexture {
     28 
     29   /** Whether this represents the preview or remote display. */
     30   @Retention(RetentionPolicy.SOURCE)
     31   @IntDef({
     32     SURFACE_TYPE_LOCAL,
     33     SURFACE_TYPE_REMOTE,
     34   })
     35   @interface SurfaceType {}
     36 
     37   int SURFACE_TYPE_LOCAL = 1;
     38   int SURFACE_TYPE_REMOTE = 2;
     39 
     40   void setDelegate(VideoSurfaceDelegate delegate);
     41 
     42   int getSurfaceType();
     43 
     44   Surface getSavedSurface();
     45 
     46   void setSurfaceDimensions(Point surfaceDimensions);
     47 
     48   Point getSurfaceDimensions();
     49 
     50   void setSourceVideoDimensions(Point sourceVideoDimensions);
     51 
     52   Point getSourceVideoDimensions();
     53 
     54   void attachToTextureView(TextureView textureView);
     55 
     56   void setDoneWithSurface();
     57 }
     58