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

Side by Side Diff: media/base/demuxer.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_DEMUXER_H_ 5 #ifndef MEDIA_BASE_DEMUXER_H_
6 #define MEDIA_BASE_DEMUXER_H_ 6 #define MEDIA_BASE_DEMUXER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "media/base/data_source.h" 11 #include "media/base/data_source.h"
12 #include "media/base/demuxer_stream.h" 12 #include "media/base/demuxer_stream.h"
13 #include "media/base/media_export.h" 13 #include "media/base/media_export.h"
14 #include "media/base/pipeline_status.h" 14 #include "media/base/pipeline_status.h"
15 #include "media/base/text_track.h"
acolwell GONE FROM CHROMIUM 2013/09/25 23:23:10 nit: This doesn't appear to be needed.
Matthew Heaney (Chromium) 2013/09/29 03:31:23 It contains the declaration of media::TextKind, wh
15 16
16 namespace media { 17 namespace media {
17 18
19 class DemuxerStream;
acolwell GONE FROM CHROMIUM 2013/09/25 23:23:10 nit: This shouldn't be needed since demuxer_stream
Matthew Heaney (Chromium) 2013/09/29 03:31:23 Done.
20
18 class MEDIA_EXPORT DemuxerHost : public DataSourceHost { 21 class MEDIA_EXPORT DemuxerHost : public DataSourceHost {
19 public: 22 public:
20 // Sets the duration of the media in microseconds. 23 // Sets the duration of the media in microseconds.
21 // Duration may be kInfiniteDuration() if the duration is not known. 24 // Duration may be kInfiniteDuration() if the duration is not known.
22 virtual void SetDuration(base::TimeDelta duration) = 0; 25 virtual void SetDuration(base::TimeDelta duration) = 0;
23 26
24 // Stops execution of the pipeline due to a fatal error. Do not call this 27 // Stops execution of the pipeline due to a fatal error. Do not call this
25 // method with PIPELINE_OK. 28 // method with PIPELINE_OK.
26 virtual void OnDemuxerError(PipelineStatus error) = 0; 29 virtual void OnDemuxerError(PipelineStatus error) = 0;
27 30
31 // Add |text_stream| to the collection managed by the text renderer.
32 virtual void AddTextStream(DemuxerStream* text_stream,
33 TextKind kind,
34 const std::string& label,
35 const std::string& language) = 0;
36
28 protected: 37 protected:
29 virtual ~DemuxerHost(); 38 virtual ~DemuxerHost();
30 }; 39 };
31 40
32 class MEDIA_EXPORT Demuxer { 41 class MEDIA_EXPORT Demuxer {
33 public: 42 public:
34 // A new potentially encrypted stream has been parsed. 43 // A new potentially encrypted stream has been parsed.
35 // First parameter - The type of initialization data. 44 // First parameter - The type of initialization data.
36 // Second parameter - The initialization data associated with the stream. 45 // Second parameter - The initialization data associated with the stream.
37 typedef base::Callback<void(const std::string& type, 46 typedef base::Callback<void(const std::string& type,
(...skipping 24 matching lines...) Expand all
62 virtual void Stop(const base::Closure& callback); 71 virtual void Stop(const base::Closure& callback);
63 72
64 // This method is called from the pipeline when the audio renderer 73 // This method is called from the pipeline when the audio renderer
65 // is disabled. Demuxers can ignore the notification if they do not 74 // is disabled. Demuxers can ignore the notification if they do not
66 // need to react to this event. 75 // need to react to this event.
67 // 76 //
68 // TODO(acolwell): Change to generic DisableStream(DemuxerStream::Type). 77 // TODO(acolwell): Change to generic DisableStream(DemuxerStream::Type).
69 // TODO(scherkus): this might not be needed http://crbug.com/234708 78 // TODO(scherkus): this might not be needed http://crbug.com/234708
70 virtual void OnAudioRendererDisabled(); 79 virtual void OnAudioRendererDisabled();
71 80
72 // Returns the given stream type, or NULL if that type is not present. 81 // Returns the first stream of the given stream type, or NULL if that type
82 // of stream is not present.
73 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; 83 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0;
74 84
75 // Returns the starting time for the media file. 85 // Returns the starting time for the media file.
76 virtual base::TimeDelta GetStartTime() const = 0; 86 virtual base::TimeDelta GetStartTime() const = 0;
77 87
78 private: 88 private:
79 DISALLOW_COPY_AND_ASSIGN(Demuxer); 89 DISALLOW_COPY_AND_ASSIGN(Demuxer);
80 }; 90 };
81 91
82 } // namespace media 92 } // namespace media
83 93
84 #endif // MEDIA_BASE_DEMUXER_H_ 94 #endif // MEDIA_BASE_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698