OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_TV_H_ |
| 6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_TV_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/base/demuxer_stream.h" |
| 11 #include "webkit/media/android/webmediaplayer_android.h" |
| 12 |
| 13 namespace media { |
| 14 class Demuxer; |
| 15 class MediaLog; |
| 16 } |
| 17 |
| 18 namespace WebKit { |
| 19 class WebFrame; |
| 20 class WebMediaSource; |
| 21 } |
| 22 |
| 23 namespace webkit_media { |
| 24 |
| 25 class MediaSourceDelegate; |
| 26 class MediaStreamAudioRenderer; |
| 27 class MediaStreamClient; |
| 28 class StreamTextureFactory; |
| 29 class WebMediaPlayerManagerAndroid; |
| 30 class WebMediaPlayerProxyAndroid; |
| 31 |
| 32 // This class adds TV functionality such as MSE and H/W backed media stream |
| 33 // to WebMediaPlayerAndroid. |
| 34 class WebMediaPlayerTv : public WebMediaPlayerAndroid { |
| 35 public: |
| 36 // Construct a WebMediaPlayerTv object. |
| 37 WebMediaPlayerTv(WebKit::WebFrame* frame, |
| 38 WebKit::WebMediaPlayerClient* client, |
| 39 WebMediaPlayerManagerAndroid* manager, |
| 40 WebMediaPlayerProxyAndroid* proxy, |
| 41 StreamTextureFactory* factory, |
| 42 media::MediaLog* media_log, |
| 43 MediaStreamClient* media_stream_client, |
| 44 media::Demuxer* remote_stream_demuxer); |
| 45 virtual ~WebMediaPlayerTv(); |
| 46 |
| 47 // Methods inherited from WebMediaPlayerAndroid. |
| 48 virtual void load(const WebKit::WebURL& url, |
| 49 WebKit::WebMediaSource* media_source, |
| 50 CORSMode cors_mode) OVERRIDE; |
| 51 virtual void play() OVERRIDE; |
| 52 virtual void pause() OVERRIDE; |
| 53 virtual void seek(double seconds) OVERRIDE; |
| 54 virtual const WebKit::WebTimeRanges& buffered() OVERRIDE; |
| 55 virtual unsigned decodedFrameCount() const OVERRIDE; |
| 56 virtual unsigned droppedFrameCount() const OVERRIDE; |
| 57 virtual unsigned audioDecodedByteCount() const OVERRIDE; |
| 58 virtual unsigned videoDecodedByteCount() const OVERRIDE; |
| 59 virtual void OnVideoSizeChanged(int width, int height) OVERRIDE; |
| 60 |
| 61 virtual MediaKeyException generateKeyRequest( |
| 62 const WebKit::WebString& key_system, |
| 63 const unsigned char* init_data, |
| 64 unsigned init_data_length) OVERRIDE; |
| 65 virtual MediaKeyException addKey( |
| 66 const WebKit::WebString& key_system, |
| 67 const unsigned char* key, |
| 68 unsigned key_length, |
| 69 const unsigned char* init_data, |
| 70 unsigned init_data_length, |
| 71 const WebKit::WebString& session_id) OVERRIDE; |
| 72 virtual MediaKeyException cancelKeyRequest( |
| 73 const WebKit::WebString& key_system, |
| 74 const WebKit::WebString& session_id) OVERRIDE; |
| 75 |
| 76 // Called when DemuxerStreamPlayer needs to read data from |
| 77 // MediaSourceDelegate. |
| 78 void OnReadFromDemuxer(media::DemuxerStream::Type type, bool seek_done); |
| 79 |
| 80 private: |
| 81 media::MediaLog* media_log_; |
| 82 scoped_ptr<MediaSourceDelegate> media_source_delegate_; |
| 83 MediaStreamClient* media_stream_client_; |
| 84 media::Demuxer* demuxer_; |
| 85 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; |
| 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerTv); |
| 88 }; |
| 89 |
| 90 } // namespace webkit_media |
| 91 |
| 92 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_TV_H_ |
OLD | NEW |