Shaka Player Embedded
sdl_video_renderer.h
Go to the documentation of this file.
1 // Copyright 2019 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_MEDIA_SDL_VIDEO_RENDERER_H_
16 #define SHAKA_EMBEDDED_MEDIA_SDL_VIDEO_RENDERER_H_
17 
18 #include <memory>
19 #include <string>
20 
21 #include "../macros.h"
22 #include "renderer.h"
23 
24 struct SDL_Rect;
25 struct SDL_Renderer;
26 
27 namespace shaka {
28 namespace media {
29 
39  public:
46  SdlManualVideoRenderer(SDL_Renderer* renderer = nullptr);
47  ~SdlManualVideoRenderer() override;
48 
57  void SetRenderer(SDL_Renderer* renderer);
58 
60  SDL_Renderer* GetRenderer() const;
61 
71  double Render(const SDL_Rect* region = nullptr);
72 
73 
74  void SetPlayer(const MediaPlayer* player) override;
75  void Attach(const DecodedStream* stream) override;
76  void Detach() override;
77 
78  struct VideoPlaybackQuality VideoPlaybackQuality() const override;
79  bool SetVideoFillMode(VideoFillMode mode) override;
80 
81  private:
82  class Impl;
83  std::unique_ptr<Impl> impl_;
84 };
85 
96  : public SdlManualVideoRenderer {
97  public:
103  SdlThreadVideoRenderer(SDL_Renderer* renderer);
112  SdlThreadVideoRenderer(SDL_Renderer* renderer, const SDL_Rect* region);
113  ~SdlThreadVideoRenderer() override;
114 
115  private:
116  class Impl;
117  std::unique_ptr<Impl> impl_;
118 };
119 
120 } // namespace media
121 } // namespace shaka
122 
123 #endif // SHAKA_EMBEDDED_MEDIA_SDL_VIDEO_RENDERER_H_
#define SHAKA_EXPORT
Definition: macros.h:30
VideoFillMode
Definition: utils.h:41