Adaptation of new PPI APIs of graphics-control module.
authorshuyu-guo <shuyu.guo@samsung.com>
Mon, 23 Sep 2024 12:58:24 +0000 (20:58 +0800)
committershuyu-guo <shuyu.guo@samsung.com>
Mon, 23 Sep 2024 12:58:24 +0000 (20:58 +0800)
src/mixer/include_internal/mixer/sys/tbminterface.h
src/mixer/include_internal/mixer/tizen/tizenbuffermgr.h
src/mixer/src/sys/tbminterface.cpp
ut/src/mixer/ut_tizenbuffermgr.cpp

index fd86f3a667c8a1443746e8e687781b928d74f2f7..99fcc6b2ba560f605f5247c3019f3128e8e58f9a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __ESPLUSPLAYER_MIXER_SYS_TBM_INTERFACE_H__
 #define __ESPLUSPLAYER_MIXER_SYS_TBM_INTERFACE_H__
 
-#include <capi-graphics-control.h>
+#include <ppi-graphics-control.h>
 
 #include "mixer/types/buffertype.h"
 
@@ -19,9 +19,9 @@ class TBMInterface {
   static BufferKeyType BoExport(BufferDefaultType bo);
   static BufferDefaultType BoAlloc(tbm_bufmgr bufmgr, int size, int flag);
   static BufferDefaultType BoImport(tbm_bufmgr bufmgr, BufferKeyType key);
-  static int GAScale(tbm_bufmgr bufmgr, GraphicsGAScaleInfo* info);
-  static int GACopy(tbm_bufmgr bufmgr, GraphicsGABltRopInfo* info);
-  static int GAFill(tbm_bufmgr bufmgr, GraphicsGAFillRectInfo* info);
+  static int GAScale(tbm_bufmgr bufmgr, ppi_graphics_control_ga_scale_info_s* info);
+  static int GACopy(tbm_bufmgr bufmgr, ppi_graphics_control_ga_blt_rop_info_s* info);
+  static int GAFill(tbm_bufmgr bufmgr, ppi_graphics_control_ga_fill_rect_info_s* info);
 };
 }  // namespace tizen
 }  // namespace esplusplayer
index f12d832c297388acff422aa430b4895e31448940..0b3ff9b7a89eb44a94b33a500f5672eedfd2712c 100644 (file)
@@ -155,16 +155,16 @@ bool BufferManagerWithType<TBM>::Copy_(
     const VideoPlaneManipulableInfo& dst) const {
   if (src.component != dst.component) return false;
   if (IsValid() == false) return false;
-  GraphicsGABltRopInfo info;
-  std::memset(&info, 0, sizeof(GraphicsGABltRopInfo));
-  info.ga_mode = GRAPHICS_GA_BITBLT_MODE_NORMAL;
-  info.rop_mode = GRAPHICS_GA_ROP_COPY;
-  info.ga_op_type = GRAPHICS_GA_COPY;
+  ppi_graphics_control_ga_blt_rop_info_s info;
+  std::memset(&info, 0, sizeof(ppi_graphics_control_ga_blt_rop_info_s));
+  info.ga_mode = PPI_GRAPHICS_GA_BITBLT_MODE_NORMAL;
+  info.rop_mode = PPI_GRAPHICS_GA_ROP_COPY;
+  info.ga_op_type = PPI_GRAPHICS_GA_COPY;
   info.pre_alphamode = 0;
   info.ca_value = 0;
   info.color_format =
-      (src.component == PlaneComponent::kYComponent ? GRAPHICS_GA_FORMAT_8BPP
-                                                    : GRAPHICS_GA_FORMAT_16BPP);
+      (src.component == PlaneComponent::kYComponent ? PPI_GRAPHICS_GA_FORMAT_8BPP
+                                                    : PPI_GRAPHICS_GA_FORMAT_16BPP);
 
   info.src_handle = src.handle;
   info.src_hbytesize = src.linesize;
@@ -190,17 +190,17 @@ bool BufferManagerWithType<TBM>::Scale_(
     const VideoPlaneManipulableInfo& dst) const {
   if (src.component != dst.component) return false;
   if (IsValid() == false) return false;
-  GraphicsGAScaleInfo info;
-  std::memset(&info, 0, sizeof(GraphicsGAScaleInfo));
-  info.ga_mode = GRAPHICS_GA_SCALE_MODE;
-  info.rop_mode = GRAPHICS_GA_ROP_COPY;
-  info.ga_op_type = GRAPHICS_GA_SCALE;
+  ppi_graphics_control_ga_scale_info_s info;
+  std::memset(&info, 0, sizeof(ppi_graphics_control_ga_scale_info_s));
+  info.ga_mode = PPI_GRAPHICS_GA_SCALE_MODE;
+  info.rop_mode = PPI_GRAPHICS_GA_ROP_COPY;
+  info.ga_op_type = PPI_GRAPHICS_GA_SCALE;
   info.pre_alphamode = 0;
   info.ca_value = 0;
   info.rop_on_off = 0;
   info.color_format =
-      (src.component == PlaneComponent::kYComponent ? GRAPHICS_GA_FORMAT_8BPP
-                                                    : GRAPHICS_GA_FORMAT_16BPP);
+      (src.component == PlaneComponent::kYComponent ? PPI_GRAPHICS_GA_FORMAT_8BPP
+                                                    : PPI_GRAPHICS_GA_FORMAT_16BPP);
 
   info.src_handle = src.handle;
   info.src_hbytesize = src.linesize;
@@ -223,12 +223,12 @@ template <typename TBM>
 bool BufferManagerWithType<TBM>::Fill_(
     const std::uint32_t color, const VideoPlaneManipulableInfo& dst) const {
   if (IsValid() == false) return false;
-  GraphicsGAFillRectInfo info;
-  std::memset(&info, 0, sizeof(GraphicsGAFillRectInfo));
+  ppi_graphics_control_ga_fill_rect_info_s info;
+  std::memset(&info, 0, sizeof(ppi_graphics_control_ga_fill_rect_info_s));
   info.color_format =
-      (dst.component == PlaneComponent::kYComponent ? GRAPHICS_GA_FORMAT_8BPP
-                                                    : GRAPHICS_GA_FORMAT_16BPP);
-  info.ga_op_type = GRAPHICS_GA_SOLID_FILL;
+      (dst.component == PlaneComponent::kYComponent ? PPI_GRAPHICS_GA_FORMAT_8BPP
+                                                    : PPI_GRAPHICS_GA_FORMAT_16BPP);
+  info.ga_op_type = PPI_GRAPHICS_GA_SOLID_FILL;
   info.color = color;
 
   info.handle = dst.handle;
index 56582f2d35a523e6b3f45e467442faa0fa373d21..3544e1101eb20a297dd92523076a7aa2ce99684e 100644 (file)
@@ -35,16 +35,16 @@ BufferDefaultType TBMInterface::BoImport(tbm_bufmgr bufmgr, BufferKeyType key) {
   return tbm_bo_import(bufmgr, key);
 }
 
-int TBMInterface::GAScale(tbm_bufmgr bufmgr, GraphicsGAScaleInfo* info) {
-  return Gfx_GA_Scale(bufmgr, info);
+int TBMInterface::GAScale(tbm_bufmgr bufmgr, ppi_graphics_control_ga_scale_info_s* info) {
+  return ppi_graphics_control_ga_scale(bufmgr, info);
 }
 
-int TBMInterface::GACopy(tbm_bufmgr bufmgr, GraphicsGABltRopInfo* info) {
-  return Gfx_GA_BltRop(bufmgr, info);
+int TBMInterface::GACopy(tbm_bufmgr bufmgr, ppi_graphics_control_ga_blt_rop_info_s* info) {
+  return ppi_graphics_control_ga_bltrop(bufmgr, info);
 }
 
-int TBMInterface::GAFill(tbm_bufmgr bufmgr, GraphicsGAFillRectInfo* info) {
-  return Gfx_GA_FillRect(bufmgr, info);
+int TBMInterface::GAFill(tbm_bufmgr bufmgr, ppi_graphics_control_ga_fill_rect_info_s* info) {
+  return ppi_graphics_control_ga_fillrect(bufmgr, info);
 }
 }  // namespace tizen
 }  // namespace esplusplayer
\ No newline at end of file
index 46e3089cfeead023e831277d04e11cc983c90ec2..981ce867385cd3d5cbc3dc330d75e88ae8a0223d 100644 (file)
@@ -20,9 +20,9 @@ struct MockTBM {
     MOCK_METHOD3(BoAlloc, BufferDefaultType(tbm_bufmgr, int, int));
     MOCK_METHOD1(BoUnRef, void(BufferDefaultType));
     MOCK_METHOD2(BoImport, BufferDefaultType(tbm_bufmgr, BufferKeyType));
-    MOCK_METHOD2(GACopy, int(tbm_bufmgr, GraphicsGABltRopInfo*));
-    MOCK_METHOD2(GAScale, int(tbm_bufmgr, GraphicsGAScaleInfo*));
-    MOCK_METHOD2(GAFill, int(tbm_bufmgr, GraphicsGAFillRectInfo*));
+    MOCK_METHOD2(GACopy, int(tbm_bufmgr, ppi_graphics_control_ga_blt_rop_info_s*));
+    MOCK_METHOD2(GAScale, int(tbm_bufmgr, ppi_graphics_control_ga_scale_info_s*));
+    MOCK_METHOD2(GAFill, int(tbm_bufmgr, ppi_graphics_control_ga_fill_rect_info_s*));
   };
 
   static Fake* instance;
@@ -36,15 +36,15 @@ struct MockTBM {
     return instance->BoImport(bufmgr, key);
   }
 
-  static int GAScale(tbm_bufmgr bufmgr, GraphicsGAScaleInfo* info) {
+  static int GAScale(tbm_bufmgr bufmgr, ppi_graphics_control_ga_scale_info_s* info) {
     return instance->GAScale(bufmgr, info);
   }
 
-  static int GACopy(tbm_bufmgr bufmgr, GraphicsGABltRopInfo* info) {
+  static int GACopy(tbm_bufmgr bufmgr, ppi_graphics_control_ga_blt_rop_info_s* info) {
     return instance->GACopy(bufmgr, info);
   }
 
-  static int GAFill(tbm_bufmgr bufmgr, GraphicsGAFillRectInfo* info) {
+  static int GAFill(tbm_bufmgr bufmgr, ppi_graphics_control_ga_fill_rect_info_s* info) {
     return instance->GAFill(bufmgr, info);
   }
 };
@@ -143,30 +143,30 @@ TEST_F(TizenBufferManagerScalerTest, Do) {
       GAScale(
           NotNull(),
           AllOf(
-              Field(&GraphicsGAScaleInfo::ga_mode, GRAPHICS_GA_SCALE_MODE),
-              Field(&GraphicsGAScaleInfo::rop_mode, GRAPHICS_GA_ROP_COPY),
-              Field(&GraphicsGAScaleInfo::ga_op_type, GRAPHICS_GA_SCALE),
-              Field(&GraphicsGAScaleInfo::pre_alphamode, 0),
-              Field(&GraphicsGAScaleInfo::ca_value, 0),
-              Field(&GraphicsGAScaleInfo::rop_on_off, 0),
-              Field(&GraphicsGAScaleInfo::src_handle,
+              Field(&ppi_graphics_control_ga_scale_info_s::ga_mode, PPI_GRAPHICS_GA_SCALE_MODE),
+              Field(&ppi_graphics_control_ga_scale_info_s::rop_mode, PPI_GRAPHICS_GA_ROP_COPY),
+              Field(&ppi_graphics_control_ga_scale_info_s::ga_op_type, PPI_GRAPHICS_GA_SCALE),
+              Field(&ppi_graphics_control_ga_scale_info_s::pre_alphamode, 0),
+              Field(&ppi_graphics_control_ga_scale_info_s::ca_value, 0),
+              Field(&ppi_graphics_control_ga_scale_info_s::rop_on_off, 0),
+              Field(&ppi_graphics_control_ga_scale_info_s::src_handle,
                     kYComponentSrcVMInfo.handle),
-              Field(&GraphicsGAScaleInfo::src_hbytesize,
+              Field(&ppi_graphics_control_ga_scale_info_s::src_hbytesize,
                     kYComponentSrcVMInfo.linesize),
               Field(
-                  &GraphicsGAScaleInfo::src_rect,
+                  &ppi_graphics_control_ga_scale_info_s::src_rect,
                   AllOf(
                       Field(&GraphicsRectInfo::x, kYComponentSrcVMInfo.rect.x),
                       Field(&GraphicsRectInfo::y, kYComponentSrcVMInfo.rect.y),
                       Field(&GraphicsRectInfo::w, kYComponentSrcVMInfo.rect.w),
                       Field(&GraphicsRectInfo::h,
                             kYComponentSrcVMInfo.rect.h))),
-              Field(&GraphicsGAScaleInfo::dst_handle,
+              Field(&ppi_graphics_control_ga_scale_info_s::dst_handle,
                     kYComponentDestVMInfo.handle),
-              Field(&GraphicsGAScaleInfo::dst_hbytesize,
+              Field(&ppi_graphics_control_ga_scale_info_s::dst_hbytesize,
                     kYComponentDestVMInfo.linesize),
               Field(
-                  &GraphicsGAScaleInfo::dst_rect,
+                  &ppi_graphics_control_ga_scale_info_s::dst_rect,
                   AllOf(
                       Field(&GraphicsRectInfo::x, kYComponentDestVMInfo.rect.x),
                       Field(&GraphicsRectInfo::y, kYComponentDestVMInfo.rect.y),