OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.media; |
| 6 |
| 7 import android.os.IBinder; |
| 8 import android.os.RemoteException; |
| 9 import android.view.Surface; |
| 10 |
| 11 import org.chromium.base.annotations.CalledByNative; |
| 12 import org.chromium.base.annotations.JNINamespace; |
| 13 |
| 14 /** |
| 15 * Wrapper for IDialogSurfaceController for JNI bindings. |
| 16 * |
| 17 * Makes any implementation of IDialogSurfaceController accessible through JNI. |
| 18 * Doesn't have to implement IDialogSurfaceController, except that it's an easy |
| 19 * way to keep the interface in sync. |
| 20 */ |
| 21 @JNINamespace("media") |
| 22 class DialogSurfaceControllerWrapper implements IDialogSurfaceController { |
| 23 private final IDialogSurfaceController mController; |
| 24 |
| 25 public DialogSurfaceControllerWrapper(IDialogSurfaceController controller) { |
| 26 mController = controller; |
| 27 } |
| 28 |
| 29 @CalledByNative |
| 30 private static DialogSurfaceControllerWrapper wrap(IDialogSurfaceController
controller) { |
| 31 return new DialogSurfaceControllerWrapper(controller); |
| 32 } |
| 33 |
| 34 @Override |
| 35 @CalledByNative |
| 36 public void release() throws RemoteException { |
| 37 mController.release(); |
| 38 } |
| 39 |
| 40 @Override |
| 41 @CalledByNative |
| 42 public Surface getSurface() throws RemoteException { |
| 43 return mController.getSurface(); |
| 44 } |
| 45 |
| 46 @Override |
| 47 @CalledByNative |
| 48 public void scheduleLayoutSurface(final int x, final int y, final int width,
final int height) |
| 49 throws RemoteException { |
| 50 mController.scheduleLayoutSurface(x, y, width, height); |
| 51 } |
| 52 |
| 53 @Override |
| 54 public IBinder asBinder() { |
| 55 return null; |
| 56 } |
| 57 } |
OLD | NEW |