Index: media/base/text_decoder.h |
diff --git a/media/base/text_decoder.h b/media/base/text_decoder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a2d6220ff5a843b4d3795320367a62829dcbee5 |
--- /dev/null |
+++ b/media/base/text_decoder.h |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_BASE_TEXT_DECODER_H_ |
+#define MEDIA_BASE_TEXT_DECODER_H_ |
+ |
+#include "base/callback.h" |
+#include "base/memory/ref_counted.h" |
+#include "media/base/media_export.h" |
+ |
+namespace media { |
+ |
+class Demuxer; |
+class TextBuffer; |
+ |
+class MEDIA_EXPORT TextDecoder { |
+ public: |
+ TextDecoder(); |
+ virtual ~TextDecoder(); |
+ |
+ // Initialize a TextDecoder from the text streams from the given demuxer. |
+ virtual void Initialize(Demuxer* demuxer) = 0; |
acolwell GONE FROM CHROMIUM
2013/09/12 00:15:15
ISTM that this should be taking a DemuxerStream an
Matthew Heaney (Chromium)
2013/09/13 19:51:54
The pipeline model is that there is one decoder pe
acolwell GONE FROM CHROMIUM
2013/09/13 20:57:30
Text is blazing a new trail here since it is the f
Matthew Heaney (Chromium)
2013/09/20 23:53:54
I haven't done anything yet with a DemuxerTextStre
|
+ |
+ // Request frame from the demuxer stream having the given |index|, to be |
+ // decoded and returned as a text track cue via the provided callback. Only |
+ // one read per demuxer stream may be in flight at any given time. |
+ // |
+ // Implementations guarantee that the callback will not be called from within |
+ // this method. |
+ // |
+ // A non-NULL text buffer pointer will contain a decoded text track cue. |
+ // A NULL buffer pointer indicates end-of-stream, or error. |
+ typedef base::Callback<void(int index, |
+ const scoped_refptr<TextBuffer>& text_buffer)> |
+ ReadCB; |
+ virtual void Read(int index, const ReadCB& read_cb) = 0; |
acolwell GONE FROM CHROMIUM
2013/09/12 00:15:15
Why do you need an index here? It seems like there
Matthew Heaney (Chromium)
2013/09/13 19:51:54
It doesn't work that way. There is only a single
acolwell GONE FROM CHROMIUM
2013/09/13 20:57:30
Right. I was trying to say that I think there shou
Matthew Heaney (Chromium)
2013/09/20 23:53:54
I did change this from int to DemuxerStream, but t
|
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TextDecoder); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_TEXT_DECODER_H_ |