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

Unified Diff: media/base/text_decoder.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, 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: 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 {
acolwell GONE FROM CHROMIUM 2013/10/08 15:45:24 Since we only have one instance of a text decoder
Matthew Heaney (Chromium) 2013/10/13 05:30:17 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698