Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_TEXT_DECODER_H_ | |
| 6 #define MEDIA_BASE_TEXT_DECODER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "media/base/media_export.h" | |
| 11 | |
| 12 namespace media { | |
| 13 | |
| 14 class Demuxer; | |
| 15 class TextBuffer; | |
| 16 | |
| 17 class MEDIA_EXPORT TextDecoder { | |
| 18 public: | |
| 19 TextDecoder(); | |
| 20 virtual ~TextDecoder(); | |
| 21 | |
| 22 // Initialize a TextDecoder from the text streams from the given demuxer. | |
| 23 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
| |
| 24 | |
| 25 // Request frame from the demuxer stream having the given |index|, to be | |
| 26 // decoded and returned as a text track cue via the provided callback. Only | |
| 27 // one read per demuxer stream may be in flight at any given time. | |
| 28 // | |
| 29 // Implementations guarantee that the callback will not be called from within | |
| 30 // this method. | |
| 31 // | |
| 32 // A non-NULL text buffer pointer will contain a decoded text track cue. | |
| 33 // A NULL buffer pointer indicates end-of-stream, or error. | |
| 34 typedef base::Callback<void(int index, | |
| 35 const scoped_refptr<TextBuffer>& text_buffer)> | |
| 36 ReadCB; | |
| 37 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
| |
| 38 | |
| 39 private: | |
| 40 DISALLOW_COPY_AND_ASSIGN(TextDecoder); | |
| 41 }; | |
| 42 | |
| 43 } // namespace media | |
| 44 | |
| 45 #endif // MEDIA_BASE_TEXT_DECODER_H_ | |
| OLD | NEW |