You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd.. 2022-2022. All rights reserved.
* Description: bootvideo surface ui head file
*/
#ifndef SURFACEUI_H
#define SURFACEUI_H
#include <gui/SurfaceControl.h>
#include <gui/Surface.h>
#if PLATFORM_SDK_VERSION <= __ANDROID_API_Q__
#else
#include <ui/Rotation.h>
#endif
namespace android {
class SurfaceUI : public RefBase {
public:
SurfaceUI();
virtual ~SurfaceUI();
virtual bool CreateSurface() = 0;
int GetDisplayOrientation() const;
// android native
sp<SurfaceControl> controlPlayer = nullptr;
sp<SurfaceControl> controlUi = nullptr;
unsigned int surfaceW = 0;
unsigned int surfaceH = 0;
};
#if PLATFORM_SDK_VERSION <= __ANDROID_API_Q__
class SurfaceQverUI : public SurfaceUI {
public:
SurfaceQverUI();
~SurfaceQverUI() override;
bool CreateSurface() override;
};
#else
class SurfaceSverUI : public SurfaceUI {
public:
SurfaceSverUI();
~SurfaceSverUI() override;
bool CreateSurface() override;
ui::Size limitSurfaceSize(int width, int height) const;
private:
int mMaxWidth;
int mMaxHeight;
};
#endif
};
#endif