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

Unified Diff: media/filters/ffmpeg_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: Created 7 years, 4 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/filters/ffmpeg_text_decoder.h
diff --git a/media/filters/ffmpeg_text_decoder.h b/media/filters/ffmpeg_text_decoder.h
new file mode 100644
index 0000000000000000000000000000000000000000..632799d1b3e96d4c6d68b94f3b57eed7a07f2352
--- /dev/null
+++ b/media/filters/ffmpeg_text_decoder.h
@@ -0,0 +1,56 @@
+// 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_FILTERS_FFMPEG_TEXT_DECODER_H_
+#define MEDIA_FILTERS_FFMPEG_TEXT_DECODER_H_
+
+#include <vector>
+
+#include "base/memory/weak_ptr.h"
+#include "media/base/demuxer_stream.h"
+#include "media/base/text_decoder.h"
+
+namespace base {
+class MessageLoopProxy;
+}
+
+namespace media {
+
+class MEDIA_EXPORT FFmpegTextDecoder : public TextDecoder {
+ public:
+ explicit FFmpegTextDecoder(
+ const scoped_refptr<base::MessageLoopProxy>& message_loop);
+ virtual ~FFmpegTextDecoder();
+
+ // TextDecoder implementation.
+ virtual void Initialize(Demuxer* demuxer) OVERRIDE;
+ virtual void Read(int index, const ReadCB& read_cb) OVERRIDE;
+
+ private:
+ // Callback delivered by the demuxer stream at |index| when
+ // a read from the stream completes.
+ void BufferReady(int index,
+ DemuxerStream::Status status,
+ const scoped_refptr<DecoderBuffer>& input);
+
+ scoped_refptr<base::MessageLoopProxy> message_loop_;
+ base::WeakPtrFactory<FFmpegTextDecoder> weak_factory_;
+ base::WeakPtr<FFmpegTextDecoder> weak_this_;
+
+ // All the demuxer streams having type TEXT. The index
+ // position matches its index position in the demuxer.
+ // Index positions of streams that are not TEXT streams
+ // are set to NULL.
+ std::vector<DemuxerStream*> demuxer_streams_;
+
+ // Holds the callbacks for the read requests made by
+ // the downstream text renderer.
+ std::vector<ReadCB> read_callbacks_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegTextDecoder);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_FFMPEG_TEXT_DECODER_H_

Powered by Google App Engine
This is Rietveld 408576698