• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef WEBRTC_MODULES_VIDEO_RENDER_IOS_VIDEO_RENDER_IOS_IMPL_H_
12 #define WEBRTC_MODULES_VIDEO_RENDER_IOS_VIDEO_RENDER_IOS_IMPL_H_
13 
14 #include <list>
15 #include <map>
16 
17 #include "webrtc/modules/video_render/i_video_render.h"
18 
19 namespace webrtc {
20 
21 class VideoRenderIosGles20;
22 class CriticalSectionWrapper;
23 
24 class VideoRenderIosImpl : IVideoRender {
25  public:
26   explicit VideoRenderIosImpl(const int32_t id,
27                               void* window,
28                               const bool full_screen);
29 
30   ~VideoRenderIosImpl();
31 
32   // Implementation of IVideoRender.
33   int32_t Init() OVERRIDE;
34   int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
35   int32_t ChangeWindow(void* window) OVERRIDE;
36 
37   VideoRenderCallback* AddIncomingRenderStream(const uint32_t stream_id,
38                                                const uint32_t z_order,
39                                                const float left,
40                                                const float top,
41                                                const float right,
42                                                const float bottom) OVERRIDE;
43 
44   int32_t DeleteIncomingRenderStream(const uint32_t stream_id) OVERRIDE;
45 
46   int32_t GetIncomingRenderStreamProperties(const uint32_t stream_id,
47                                             uint32_t& z_order,
48                                             float& left,
49                                             float& top,
50                                             float& right,
51                                             float& bottom) const OVERRIDE;
52 
53   int32_t StartRender() OVERRIDE;
54   int32_t StopRender() OVERRIDE;
55 
56   VideoRenderType RenderType() OVERRIDE;
57   RawVideoType PerferedVideoType() OVERRIDE;
58   bool FullScreen() OVERRIDE;
59   int32_t GetGraphicsMemory(
60       uint64_t& total_graphics_memory,
61       uint64_t& available_graphics_memory) const OVERRIDE;  // NOLINT
62   int32_t GetScreenResolution(
63       uint32_t& screen_width,
64       uint32_t& screen_height) const OVERRIDE;  // NOLINT
65   uint32_t RenderFrameRate(const uint32_t stream_id);
66   int32_t SetStreamCropping(const uint32_t stream_id,
67                             const float left,
68                             const float top,
69                             const float right,
70                             const float bottom) OVERRIDE;
71   int32_t ConfigureRenderer(const uint32_t stream_id,
72                             const unsigned int z_order,
73                             const float left,
74                             const float top,
75                             const float right,
76                             const float bottom) OVERRIDE;
77   int32_t SetTransparentBackground(const bool enable) OVERRIDE;
78   int32_t SetText(const uint8_t text_id,
79                   const uint8_t* text,
80                   const int32_t text_length,
81                   const uint32_t text_color_ref,
82                   const uint32_t background_color_ref,
83                   const float left,
84                   const float top,
85                   const float right,
86                   const float bottom) OVERRIDE;
87   int32_t SetBitmap(const void* bit_map,
88                     const uint8_t picture_id,
89                     const void* color_key,
90                     const float left,
91                     const float top,
92                     const float right,
93                     const float bottom);
94   int32_t FullScreenRender(void* window, const bool enable);
95 
96  private:
97   int32_t id_;
98   void* ptr_window_;
99   bool full_screen_;
100 
101   CriticalSectionWrapper* crit_sec_;
102   webrtc::scoped_ptr<VideoRenderIosGles20> ptr_ios_render_;
103 };
104 }  // namespace webrtc
105 #endif  // WEBRTC_MODULES_VIDEO_RENDER_IOS_VIDEO_RENDER_IOS_IMPL_H_
106