Index: content/renderer/media/webmediaplayer_impl.h |
diff --git a/content/renderer/media/webmediaplayer_impl.h b/content/renderer/media/webmediaplayer_impl.h |
index 270186bbbe5aad43fce9d7c4d3ee8a7c4977fab2..ee148b34170266292952cb96815553a8931b3ea4 100644 |
--- a/content/renderer/media/webmediaplayer_impl.h |
+++ b/content/renderer/media/webmediaplayer_impl.h |
@@ -20,6 +20,7 @@ |
#ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
#define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
+#include <map> |
#include <string> |
#include <vector> |
@@ -55,9 +56,10 @@ class MessageLoopProxy; |
namespace media { |
class ChunkDemuxer; |
-class FFmpegDemuxer; |
+class DemuxerStream; |
class GpuVideoAcceleratorFactories; |
class MediaLog; |
+class TextCue; |
} |
namespace webkit { |
@@ -197,9 +199,16 @@ class WebMediaPlayerImpl |
void OnNeedKey(const std::string& type, |
const std::string& session_id, |
const std::vector<uint8>& init_data); |
+ // TODO(matthewjheaney): Once we're satisfied that we have the threading model |
+ // correct for handling text cues, move the media source from OnTextTrack over |
+ // to AddTextStream. |
scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind, |
const std::string& label, |
const std::string& language); |
+ void AddTextStream(media::DemuxerStream* stream, |
+ media::TextKind kind, |
+ const std::string& label, |
+ const std::string& language); |
void SetOpaque(bool); |
private: |
@@ -258,6 +267,12 @@ class WebMediaPlayerImpl |
// painted. |
void FrameReady(const scoped_refptr<media::VideoFrame>& frame); |
+ // Called by the TextRenderer when a decoded cue has been delivered on |
+ // |text_stream|, and hence that it be added to the cue list for its |
+ // associated text track. |
+ void CueReady(media::DemuxerStream* text_stream, |
+ const scoped_refptr<media::TextCue>& text_cue); |
+ |
WebKit::WebFrame* frame_; |
// TODO(hclam): get rid of these members and read from the pipeline directly. |
@@ -367,6 +382,14 @@ class WebMediaPlayerImpl |
// Text track objects get a unique index value when they're created. |
int text_track_index_; |
+ // Manipulation of TextTrack objects must be done on the main loop, not the |
+ // media loop, so we declare this cache here. Objects in the pipeline |
+ // dispatch callbacks to player (using DemuxerStream as the key), the |
+ // player looks up the associated TextTrack, and then it manipulates the |
+ // TextTrack object as necessary. |
+ typedef std::map<media::DemuxerStream*, media::TextTrack*> TextTrackMap; |
+ TextTrackMap text_track_map_; |
+ |
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
}; |