Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_BASE_VIDEO_DECODER_H_ |
| 6 #define MEDIA_BASE_VIDEO_DECODER_H_ | 6 #define MEDIA_BASE_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/pipeline_status.h" | 10 #include "media/base/pipeline_status.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 // NULL video frames indicate an aborted read. This can happen if the | 48 // NULL video frames indicate an aborted read. This can happen if the |
| 49 // DemuxerStream gets flushed and doesn't have any more data to return. | 49 // DemuxerStream gets flushed and doesn't have any more data to return. |
| 50 typedef base::Callback<void(Status, const scoped_refptr<VideoFrame>&)> ReadCB; | 50 typedef base::Callback<void(Status, const scoped_refptr<VideoFrame>&)> ReadCB; |
| 51 virtual void Read(const ReadCB& read_cb) = 0; | 51 virtual void Read(const ReadCB& read_cb) = 0; |
| 52 | 52 |
| 53 // Reset decoder state, fulfilling all pending ReadCB and dropping extra | 53 // Reset decoder state, fulfilling all pending ReadCB and dropping extra |
| 54 // queued decoded data. After this call, the decoder is back to an initialized | 54 // queued decoded data. After this call, the decoder is back to an initialized |
| 55 // clean state. | 55 // clean state. |
| 56 virtual void Reset(const base::Closure& closure) = 0; | 56 virtual void Reset(const base::Closure& closure) = 0; |
| 57 | 57 |
| 58 // Stop decoder and set it to an uninitialized state. Note that a VideoDecoder | 58 // Stops decoder and sets it to an uninitialized state. Note that a |
| 59 // should/could not be re-initialized after it has been stopped. | 59 // VideoDecoder cannot be re-initialized after it has been stopped. |
| 60 // If the VideoDecoder has been initialized, Stop() must be called before the | |
|
scherkus (not reviewing)
2012/09/25 20:58:16
/must be called/must complete/
scherkus (not reviewing)
2012/09/25 20:58:16
s/VideoDecoder/decoder/
Ami GONE FROM CHROMIUM
2012/09/25 21:18:26
Initialize() is async; "has been initialized" is u
xhwang
2012/09/26 01:09:58
Done.
xhwang
2012/09/26 01:09:58
Done.
| |
| 61 // VideoDecoder can be destructed. | |
|
scherkus (not reviewing)
2012/09/25 20:58:16
s/the VideoDecoder can be destructed/deleting the
xhwang
2012/09/26 01:09:58
Done.
| |
| 60 virtual void Stop(const base::Closure& closure) = 0; | 62 virtual void Stop(const base::Closure& closure) = 0; |
| 61 | 63 |
| 62 // Returns true if the output format has an alpha channel. Most formats do not | 64 // Returns true if the output format has an alpha channel. Most formats do not |
| 63 // have alpha so the default is false. Override and return true for decoders | 65 // have alpha so the default is false. Override and return true for decoders |
| 64 // that return formats with an alpha channel. | 66 // that return formats with an alpha channel. |
| 65 virtual bool HasAlpha() const; | 67 virtual bool HasAlpha() const; |
| 66 | 68 |
| 67 protected: | 69 protected: |
| 68 friend class base::RefCountedThreadSafe<VideoDecoder>; | 70 friend class base::RefCountedThreadSafe<VideoDecoder>; |
| 69 virtual ~VideoDecoder(); | 71 virtual ~VideoDecoder(); |
| 70 VideoDecoder(); | 72 VideoDecoder(); |
| 71 | 73 |
| 72 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 74 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 } // namespace media | 77 } // namespace media |
| 76 | 78 |
| 77 #endif // MEDIA_BASE_VIDEO_DECODER_H_ | 79 #endif // MEDIA_BASE_VIDEO_DECODER_H_ |
| OLD | NEW |