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 | |
10 import org.chromium.base.annotations.CalledByNative; | |
11 import org.chromium.base.annotations.JNINamespace; | |
12 | |
13 /** | |
14 * Wrapper for IAndroidOverlayProvider, to provide JNI bindings for arbitrary | |
15 * implementations of IAndroidOverlayProvider. In practice, there is one: the | |
16 * IBinder stub we get from the browser. However, if one creates a local | |
17 * provider such as in the GPU process, then this will work too. | |
18 * | |
19 * When one gets an IAndroidOverlayProvider, whether remote from the browser or | |
20 * local (if supported), it can be used by native classes by wrapping it in a | |
21 * AndroidOverlayProviderWrapper instance. | |
22 * | |
23 * Note that all of that is wrapped in the C++ bindings for this class, so see | |
24 * the docs in android_overlay_provider.h if you'd like to use this in C++. | |
25 * There's no need to use it in Java. | |
26 */ | |
27 @JNINamespace("media") | |
28 class AndroidOverlayProviderProxy { | |
29 private final IAndroidOverlayProvider mProvider; | |
30 | |
31 private AndroidOverlayProviderProxy(IAndroidOverlayProvider provider) { | |
32 mProvider = provider; | |
33 } | |
34 | |
35 @CalledByNative | |
36 private static AndroidOverlayProviderProxy wrap(IBinder provider) { | |
37 return new AndroidOverlayProviderProxy(IAndroidOverlayProvider.Stub.asIn terface(provider)); | |
38 } | |
39 | |
40 @CalledByNative | |
41 public IAndroidOverlay createOverlay(int rendererPid, int renderFrameId, | |
42 IAndroidOverlayCallback callback, int x, int y, int width, int heigh t) | |
43 throws RemoteException { | |
boliu
2017/02/08 00:01:59
any exception thrown by @CalledByNative methods wi
| |
44 return mProvider.createOverlay(rendererPid, renderFrameId, callback, x, y, width, height); | |
45 } | |
46 } | |
OLD | NEW |