[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / platform / android / activity / JNIXBMCVideoView.h
blobb18dfc34378c7d619d33fa35107f314c1ac90ceb
1 /*
2 * Copyright (C) 2016 Christian Browet
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/Event.h"
12 #include "utils/Geometry.h"
14 #include <androidjni/Context.h>
15 #include <androidjni/JNIBase.h>
16 #include <androidjni/Rect.h>
17 #include <androidjni/Surface.h>
18 #include <androidjni/SurfaceHolder.h>
20 class CJNIXBMCVideoView : virtual public CJNIBase, public CJNISurfaceHolderCallback, public CJNIInterfaceImplem<CJNIXBMCVideoView>
22 public:
23 CJNIXBMCVideoView(const jni::jhobject &object);
24 ~CJNIXBMCVideoView() override = default;
26 static void RegisterNatives(JNIEnv* env);
28 static CJNIXBMCVideoView* createVideoView(CJNISurfaceHolderCallback* callback);
30 // CJNISurfaceHolderCallback interface
31 void surfaceChanged(CJNISurfaceHolder holder, int format, int width, int height) override;
32 void surfaceCreated(CJNISurfaceHolder holder) override;
33 void surfaceDestroyed(CJNISurfaceHolder holder) override;
35 static void _surfaceChanged(JNIEnv* env, jobject thiz, jobject holder, jint format, jint width, jint height);
36 static void _surfaceCreated(JNIEnv* env, jobject thiz, jobject holder);
37 static void _surfaceDestroyed(JNIEnv* env, jobject thiz, jobject holder);
39 bool waitForSurface(unsigned int millis);
40 bool isActive() { return m_surfaceCreated.Signaled(); }
41 CJNISurface getSurface();
42 const CRect& getSurfaceRect();
43 void setSurfaceRect(const CRect& rect);
44 void add();
45 void release();
46 int ID() const;
47 bool isCreated() const;
49 protected:
50 CJNISurfaceHolderCallback* m_callback = nullptr;
51 CEvent m_surfaceCreated;
52 CRect m_surfaceRect;
54 private:
55 CJNIXBMCVideoView() = default;