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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 virtual void Read(const ReadCB& read_cb) = 0; | 52 virtual void Read(const ReadCB& read_cb) = 0; |
| 53 | 53 |
| 54 // Resets decoder state, fulfilling all pending ReadCB and dropping extra | 54 // Resets decoder state, fulfilling all pending ReadCB and dropping extra |
| 55 // queued decoded data. After this call, the decoder is back to an initialized | 55 // queued decoded data. After this call, the decoder is back to an initialized |
| 56 // clean state. | 56 // clean state. |
| 57 // Note: No VideoDecoder calls should be made before |closure| is executed. | 57 // Note: No VideoDecoder calls should be made before |closure| is executed. |
| 58 virtual void Reset(const base::Closure& closure) = 0; | 58 virtual void Reset(const base::Closure& closure) = 0; |
| 59 | 59 |
| 60 // Stops decoder, fires any pending callbacks and sets the decoder to an | 60 // Stops decoder, fires any pending callbacks and sets the decoder to an |
| 61 // uninitialized state. A VideoDecoder cannot be re-initialized after it has | 61 // uninitialized state. A VideoDecoder cannot be re-initialized after it has |
| 62 // been stopped. | 62 // been stopped. A VideoDecoder should not access the DemuxerStream after it |
|
Ami GONE FROM CHROMIUM
2013/04/04 03:43:22
This seems like a commentary on the lifecycle of t
xhwang
2013/04/04 17:05:33
Done.
| |
| 63 // has been stopped. | |
| 63 // Note that if Initialize() has been called, Stop() must be called and | 64 // Note that if Initialize() has been called, Stop() must be called and |
| 64 // complete before deleting the decoder. | 65 // complete before deleting the decoder. |
| 65 virtual void Stop(const base::Closure& closure) = 0; | 66 virtual void Stop(const base::Closure& closure) = 0; |
| 66 | 67 |
| 67 // Returns true if the output format has an alpha channel. Most formats do not | 68 // Returns true if the output format has an alpha channel. Most formats do not |
| 68 // have alpha so the default is false. Override and return true for decoders | 69 // have alpha so the default is false. Override and return true for decoders |
| 69 // that return formats with an alpha channel. | 70 // that return formats with an alpha channel. |
| 70 virtual bool HasAlpha() const; | 71 virtual bool HasAlpha() const; |
| 71 | 72 |
| 72 // Returns true if the decoder currently has the ability to decode and return | 73 // Returns true if the decoder currently has the ability to decode and return |
| 73 // a VideoFrame. Most implementations can allocate a new VideoFrame and hence | 74 // a VideoFrame. Most implementations can allocate a new VideoFrame and hence |
| 74 // this will always return true. Override and return false for decoders that | 75 // this will always return true. Override and return false for decoders that |
| 75 // use a fixed set of VideoFrames for decoding. | 76 // use a fixed set of VideoFrames for decoding. |
| 76 virtual bool HasOutputFrameAvailable() const; | 77 virtual bool HasOutputFrameAvailable() const; |
| 77 | 78 |
| 78 protected: | 79 protected: |
| 79 friend class base::RefCountedThreadSafe<VideoDecoder>; | 80 friend class base::RefCountedThreadSafe<VideoDecoder>; |
| 80 virtual ~VideoDecoder(); | 81 virtual ~VideoDecoder(); |
| 81 VideoDecoder(); | 82 VideoDecoder(); |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 84 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace media | 87 } // namespace media |
| 87 | 88 |
| 88 #endif // MEDIA_BASE_VIDEO_DECODER_H_ | 89 #endif // MEDIA_BASE_VIDEO_DECODER_H_ |
| OLD | NEW |