Shaka Player Embedded
video_renderer_common.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_VIDEO_RENDERER_COMMON_H_
16 #define SHAKA_EMBEDDED_MEDIA_VIDEO_RENDERER_COMMON_H_
17 
18 #include <atomic>
19 #include <memory>
20 
22 #include "shaka/media/renderer.h"
23 #include "src/debug/mutex.h"
24 
25 namespace shaka {
26 namespace media {
27 
33  public:
35  ~VideoRendererCommon() override;
36 
37  VideoFillMode fill_mode() const;
38 
44  double GetCurrentFrame(std::shared_ptr<DecodedFrame>* frame);
45 
46 
47  void SetPlayer(const MediaPlayer* player) override;
48  void Attach(const DecodedStream* stream) override;
49  void Detach() override;
50 
51  struct VideoPlaybackQuality VideoPlaybackQuality() const override;
52  bool SetVideoFillMode(VideoFillMode mode) override;
53 
54  private:
55  void OnSeeking() override;
56 
57  mutable Mutex mutex_;
58 
59  const MediaPlayer* player_;
60  const DecodedStream* input_;
61  struct VideoPlaybackQuality quality_;
62  std::atomic<VideoFillMode> fill_mode_;
63  double prev_time_;
64 };
65 
66 } // namespace media
67 } // namespace shaka
68 
69 #endif // SHAKA_EMBEDDED_MEDIA_VIDEO_RENDERER_COMMON_H_
VideoFillMode
Definition: utils.h:41
std::shared_ptr< shaka::media::DecodedFrame > frame
double GetCurrentFrame(std::shared_ptr< DecodedFrame > *frame)
void SetPlayer(const MediaPlayer *player) override
void Attach(const DecodedStream *stream) override
bool SetVideoFillMode(VideoFillMode mode) override