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..90a9514596eb9f8c518d7b06fccba027bdc9399e |
--- /dev/null |
+++ b/media/base/text_decoder.h |
@@ -0,0 +1,44 @@ |
+// 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 DemuxerStream; |
+class TextCue; |
+ |
+class MEDIA_EXPORT TextDecoder { |
+ public: |
+ TextDecoder(); |
+ virtual ~TextDecoder(); |
+ |
+ // Initialize a TextDecoder from the text streams from the given demuxer. |
+ virtual void Initialize() = 0; |
+ |
+ // Request frame from the given demuxer text stream, 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(DemuxerStream*, |
+ const scoped_refptr<TextCue>&)> ReadCB; |
+ virtual void Read(DemuxerStream* stream, const ReadCB& read_cb) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TextDecoder); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_TEXT_DECODER_H_ |