Shaka Player Embedded
default_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_DEFAULT_MEDIA_PLAYER_H_
16 #define SHAKA_EMBEDDED_MEDIA_DEFAULT_MEDIA_PLAYER_H_
17 
18 #include <memory>
19 
20 #include "../macros.h"
21 #include "decoder.h"
22 #include "proxy_media_player.h"
23 #include "renderer.h"
24 
25 namespace shaka {
26 namespace media {
27 
36  public:
45  DefaultMediaPlayer(VideoRenderer* video_renderer,
46  AudioRenderer* audio_renderer);
47  ~DefaultMediaPlayer() override;
48 
60  void SetDecoders(Decoder* video_decoder, Decoder* audio_decoder);
61 
69  const void* GetIosView();
70 
78  const void* GetAvPlayer();
79 
80 
81  MediaCapabilitiesInfo DecodingInfo(
82  const MediaDecodingConfiguration& config) const override;
83 
84  std::vector<std::shared_ptr<MediaTrack>> AudioTracks() override;
85  std::vector<std::shared_ptr<const MediaTrack>> AudioTracks() const override;
86  std::vector<std::shared_ptr<MediaTrack>> VideoTracks() override;
87  std::vector<std::shared_ptr<const MediaTrack>> VideoTracks() const override;
88  std::vector<std::shared_ptr<TextTrack>> TextTracks() override;
89  std::vector<std::shared_ptr<const TextTrack>> TextTracks() const override;
90  std::shared_ptr<TextTrack> AddTextTrack(TextTrackKind kind,
91  const std::string& label,
92  const std::string& language) override;
93 
94  void Detach() override;
95 
96  private:
97  MediaPlayer* CreateMse() override;
98  MediaPlayer* CreateSource(const std::string& src) override;
99 
100  class Impl;
101  std::unique_ptr<Impl> impl_;
102 };
103 
104 } // namespace media
105 } // namespace shaka
106 
107 #endif // SHAKA_EMBEDDED_MEDIA_DEFAULT_MEDIA_PLAYER_H_
#define SHAKA_EXPORT
Definition: macros.h:30