Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1756)

Unified Diff: content/renderer/media/webmediaplayer_impl.h

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporated more of aaron's comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « no previous file | content/renderer/media/webmediaplayer_impl.cc » ('j') | content/renderer/media/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698