Shaka Player Embedded
av_media_player.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_IOS_AV_MEDIA_PLAYER_H_
16 #define SHAKA_EMBEDDED_MEDIA_IOS_AV_MEDIA_PLAYER_H_
17 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
24 
25 namespace shaka {
26 namespace media {
27 namespace ios {
28 
32 class AvMediaPlayer : public MediaPlayer {
33  public:
34  explicit AvMediaPlayer(ClientList* clients);
35  ~AvMediaPlayer() override;
36 
37  const void* GetIosView();
38  const void* GetAvPlayer();
39 
41  const MediaDecodingConfiguration& config) const override;
42  struct VideoPlaybackQuality VideoPlaybackQuality() const override;
43  void AddClient(Client* client) const override;
44  void RemoveClient(Client* client) const override;
45 
46  std::vector<BufferedRange> GetBuffered() const override;
47  VideoReadyState ReadyState() const override;
48  VideoPlaybackState PlaybackState() const override;
49  std::vector<std::shared_ptr<MediaTrack>> AudioTracks() override;
50  std::vector<std::shared_ptr<const MediaTrack>> AudioTracks() const override;
51  std::vector<std::shared_ptr<MediaTrack>> VideoTracks() override;
52  std::vector<std::shared_ptr<const MediaTrack>> VideoTracks() const override;
53  std::vector<std::shared_ptr<TextTrack>> TextTracks() override;
54  std::vector<std::shared_ptr<const TextTrack>> TextTracks() const override;
55  std::shared_ptr<TextTrack> AddTextTrack(
56  TextTrackKind kind, const std::string& label,
57  const std::string& language) override;
58 
59  bool SetVideoFillMode(VideoFillMode mode) override;
60  uint32_t Width() const override;
61  uint32_t Height() const override;
62  double Volume() const override;
63  void SetVolume(double volume) override;
64  bool Muted() const override;
65  void SetMuted(bool muted) override;
66 
67  void Play() override;
68  void Pause() override;
69  double CurrentTime() const override;
70  void SetCurrentTime(double time) override;
71  double Duration() const override;
72  void SetDuration(double duration) override;
73  double PlaybackRate() const override;
74  void SetPlaybackRate(double rate) override;
75 
76  bool AttachSource(const std::string& src) override;
77  bool AttachMse() override;
78  bool AddMseBuffer(const std::string& mime, bool is_video,
79  const ElementaryStream* stream) override;
80  void LoadedMetaData(double duration) override;
81  void MseEndOfStream() override;
82  bool SetEmeImplementation(const std::string& key_system,
83  eme::Implementation* implementation) override;
84  void Detach() override;
85 
86  class Impl;
87 
88  private:
89  std::unique_ptr<Impl> impl_;
90 };
91 
92 } // namespace ios
93 } // namespace media
94 } // namespace shaka
95 
96 #endif // SHAKA_EMBEDDED_MEDIA_IOS_AV_MEDIA_PLAYER_H_
bool AddMseBuffer(const std::string &mime, bool is_video, const ElementaryStream *stream) override
void AddClient(Client *client) const override
double Volume() const override
void SetCurrentTime(double time) override
void SetVolume(double volume) override
uint32_t Height() const override
VideoFillMode
Definition: utils.h:41
std::vector< std::shared_ptr< MediaTrack > > AudioTracks() override
void SetPlaybackRate(double rate) override
double Duration() const override
bool SetEmeImplementation(const std::string &key_system, eme::Implementation *implementation) override
VideoPlaybackState PlaybackState() const override
VideoReadyState ReadyState() const override
AvMediaPlayer(ClientList *clients)
void RemoveClient(Client *client) const override
std::shared_ptr< TextTrack > AddTextTrack(TextTrackKind kind, const std::string &label, const std::string &language) override
double PlaybackRate() const override
std::vector< BufferedRange > GetBuffered() const override
void SetMuted(bool muted) override
void LoadedMetaData(double duration) override
std::vector< std::shared_ptr< TextTrack > > TextTracks() override
bool SetVideoFillMode(VideoFillMode mode) override
MediaCapabilitiesInfo DecodingInfo(const MediaDecodingConfiguration &config) const override
std::vector< std::shared_ptr< MediaTrack > > VideoTracks() override
bool AttachSource(const std::string &src) override
double CurrentTime() const override
void SetDuration(double duration) override
uint32_t Width() const override