1 /* 2 * Copyright 2018 Rockchip Electronics Co. LTD 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 #ifndef INCLUDE_RT_PLAYER_RTSUBTITLESINKINTERFACE_H_ 18 #define INCLUDE_RT_PLAYER_RTSUBTITLESINKINTERFACE_H_ 19 20 #include <sys/types.h> 21 #include <inttypes.h> 22 #include "rt_type.h" // NOLINT 23 24 typedef enum _RTSubRenderType { 25 RENDER_RGA, 26 RENDER_GPU 27 } RTSubRenderType; 28 29 typedef struct _RTSubFrame { 30 void* data; 31 INT32 x; 32 INT32 y; 33 INT32 width; 34 INT32 height; 35 INT32 subWidth; 36 INT32 subHeight; 37 bool needcrop; 38 } RTSubFrame; 39 40 class RTSubtitleSinkInterface { 41 public: ~RTSubtitleSinkInterface()42 virtual ~RTSubtitleSinkInterface() {} 43 44 virtual void create(INT32 renderType, INT32 display) = 0; 45 virtual void destroy() = 0; 46 virtual void initScene() = 0; 47 virtual void showScene() = 0; // swap buffer to screen 48 virtual void render(RTSubFrame *frame) = 0; 49 virtual void clean() = 0; 50 virtual void show() = 0; 51 virtual void hide() = 0; 52 virtual bool isShowing() = 0; 53 }; 54 55 #endif // INCLUDE_RT_PLAYER_RTSUBTITLESINKINTERFACE_H_ 56 57