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

Side by Side 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: incorporate aaron's comments (9/28) Created 7 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player.
6 // It contains Pipeline which is the actual media player pipeline, it glues 6 // It contains Pipeline which is the actual media player pipeline, it glues
7 // the media player pipeline, data source, audio renderer and renderer. 7 // the media player pipeline, data source, audio renderer and renderer.
8 // Pipeline would creates multiple threads and access some public methods 8 // Pipeline would creates multiple threads and access some public methods
9 // of this class, so we need to be extra careful about concurrent access of 9 // of this class, so we need to be extra careful about concurrent access of
10 // methods and members. 10 // methods and members.
11 // 11 //
12 // Other issues: 12 // Other issues:
13 // During tear down of the whole browser or a tab, the DOM tree may not be 13 // During tear down of the whole browser or a tab, the DOM tree may not be
14 // destructed nicely, and there will be some dangling media threads trying to 14 // destructed nicely, and there will be some dangling media threads trying to
15 // the main thread, so we need this class to listen to destruction event of the 15 // the main thread, so we need this class to listen to destruction event of the
16 // main thread and cleanup the media threads when the even is received. Also 16 // main thread and cleanup the media threads when the even is received. Also
17 // at destruction of this class we will need to unhook it from destruction event 17 // at destruction of this class we will need to unhook it from destruction event
18 // list of the main thread. 18 // list of the main thread.
19 19
20 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 20 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_
21 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 21 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_
22 22
23 #include <map>
acolwell GONE FROM CHROMIUM 2013/10/08 15:45:24 nit: no longer needed.
Matthew Heaney (Chromium) 2013/10/13 05:30:17 Done.
23 #include <string> 24 #include <string>
24 #include <vector> 25 #include <vector>
25 26
26 #include "base/basictypes.h" 27 #include "base/basictypes.h"
27 #include "base/memory/ref_counted.h" 28 #include "base/memory/ref_counted.h"
28 #include "base/memory/scoped_ptr.h" 29 #include "base/memory/scoped_ptr.h"
29 #include "base/memory/weak_ptr.h" 30 #include "base/memory/weak_ptr.h"
30 #include "base/threading/thread.h" 31 #include "base/threading/thread.h"
31 #include "cc/layers/video_frame_provider.h" 32 #include "cc/layers/video_frame_provider.h"
32 #include "content/renderer/media/crypto/proxy_decryptor.h" 33 #include "content/renderer/media/crypto/proxy_decryptor.h"
(...skipping 15 matching lines...) Expand all
48 namespace WebKit { 49 namespace WebKit {
49 class WebFrame; 50 class WebFrame;
50 } 51 }
51 52
52 namespace base { 53 namespace base {
53 class MessageLoopProxy; 54 class MessageLoopProxy;
54 } 55 }
55 56
56 namespace media { 57 namespace media {
57 class ChunkDemuxer; 58 class ChunkDemuxer;
58 class FFmpegDemuxer; 59 class DemuxerStream;
59 class GpuVideoAcceleratorFactories; 60 class GpuVideoAcceleratorFactories;
60 class MediaLog; 61 class MediaLog;
62 class TextCue;
acolwell GONE FROM CHROMIUM 2013/10/08 15:45:24 nit: Not needed
Matthew Heaney (Chromium) 2013/10/13 05:30:17 Done.
61 } 63 }
62 64
63 namespace webkit { 65 namespace webkit {
64 class WebLayerImpl; 66 class WebLayerImpl;
65 } 67 }
66 68
67 namespace content { 69 namespace content {
68 class BufferedDataSource; 70 class BufferedDataSource;
69 class WebAudioSourceProviderImpl; 71 class WebAudioSourceProviderImpl;
70 class WebMediaPlayerDelegate; 72 class WebMediaPlayerDelegate;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void OnKeyAdded(const std::string& session_id); 192 void OnKeyAdded(const std::string& session_id);
191 void OnKeyError(const std::string& session_id, 193 void OnKeyError(const std::string& session_id,
192 media::MediaKeys::KeyError error_code, 194 media::MediaKeys::KeyError error_code,
193 int system_code); 195 int system_code);
194 void OnKeyMessage(const std::string& session_id, 196 void OnKeyMessage(const std::string& session_id,
195 const std::vector<uint8>& message, 197 const std::vector<uint8>& message,
196 const std::string& default_url); 198 const std::string& default_url);
197 void OnNeedKey(const std::string& type, 199 void OnNeedKey(const std::string& type,
198 const std::string& session_id, 200 const std::string& session_id,
199 const std::vector<uint8>& init_data); 201 const std::vector<uint8>& init_data);
202 // TODO(matthewjheaney): Once we're satisfied that we have the threading model
203 // correct for handling text cues, move the media source from OnTextTrack over
204 // to AddTextStream.
acolwell GONE FROM CHROMIUM 2013/10/08 15:45:24 I'd like this fixed in this CL. Now that OnAddText
Matthew Heaney (Chromium) 2013/10/13 05:30:17 I modified the chunk demuxer and friends to handle
200 scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind, 205 scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind,
201 const std::string& label, 206 const std::string& label,
202 const std::string& language); 207 const std::string& language);
208
209 void OnAddTextStream(media::DemuxerStream*,
210 media::TextKind kind,
211 const std::string& label,
212 const std::string& language,
213 const media::AddTextTrackDoneCB& done_cb);
214
203 void SetOpaque(bool); 215 void SetOpaque(bool);
204 216
205 private: 217 private:
206 // Called after |defer_load_cb_| has decided to allow the load. If 218 // Called after |defer_load_cb_| has decided to allow the load. If
207 // |defer_load_cb_| is null this is called immediately. 219 // |defer_load_cb_| is null this is called immediately.
208 void DoLoad(LoadType load_type, 220 void DoLoad(LoadType load_type,
209 const WebKit::WebURL& url, 221 const WebKit::WebURL& url,
210 CORSMode cors_mode); 222 CORSMode cors_mode);
211 223
212 // Called after asynchronous initialization of a data source completed. 224 // Called after asynchronous initialization of a data source completed.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 378
367 // Text track objects get a unique index value when they're created. 379 // Text track objects get a unique index value when they're created.
368 int text_track_index_; 380 int text_track_index_;
369 381
370 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 382 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
371 }; 383 };
372 384
373 } // namespace content 385 } // namespace content
374 386
375 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 387 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698