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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 virtual void Initialize(const VideoDecoderConfig& config, | 72 virtual void Initialize(const VideoDecoderConfig& config, |
73 bool low_delay, | 73 bool low_delay, |
74 CdmContext* cdm_context, | 74 CdmContext* cdm_context, |
75 const InitCB& init_cb, | 75 const InitCB& init_cb, |
76 const OutputCB& output_cb) = 0; | 76 const OutputCB& output_cb) = 0; |
77 | 77 |
78 // Requests a |buffer| to be decoded. The status of the decoder and decoded | 78 // Requests a |buffer| to be decoded. The status of the decoder and decoded |
79 // frame are returned via the provided callback. Some decoders may allow | 79 // frame are returned via the provided callback. Some decoders may allow |
80 // decoding multiple buffers in parallel. Callers should call | 80 // decoding multiple buffers in parallel. Callers should call |
81 // GetMaxDecodeRequests() to get number of buffers that may be decoded in | 81 // GetMaxDecodeRequests() to get number of buffers that may be decoded in |
82 // parallel. Decoder must call |decode_cb| in the same order in which Decode() | 82 // parallel. |
83 // is called. | |
84 // | 83 // |
85 // Implementations guarantee that the |decode_cb| will not be called from | 84 // Implementations guarantee that the |decode_cb| will not be called from |
86 // within this method, and that it will be called even if Decode() is never | 85 // within this method, and that it will be called even if Decode() is never |
87 // called again. | 86 // called again. |
88 // | 87 // |
89 // After decoding is finished the decoder calls |output_cb| specified in | 88 // After decoding is finished the decoder calls |output_cb| specified in |
90 // Initialize() for each decoded frame. |output_cb| may be called before or | 89 // Initialize() for each decoded frame. |output_cb| may be called before or |
91 // after |decode_cb|, including before Decode() returns. | 90 // after |decode_cb|, including before Decode() returns. |
92 // | 91 // |
93 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. | 92 // If |buffer| is an EOS buffer then the decoder must be flushed, i.e. |
(...skipping 20 matching lines...) Expand all Loading... |
114 // Returns maximum number of parallel decode requests. | 113 // Returns maximum number of parallel decode requests. |
115 virtual int GetMaxDecodeRequests() const; | 114 virtual int GetMaxDecodeRequests() const; |
116 | 115 |
117 private: | 116 private: |
118 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | 117 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); |
119 }; | 118 }; |
120 | 119 |
121 } // namespace media | 120 } // namespace media |
122 | 121 |
123 #endif // MEDIA_BASE_VIDEO_DECODER_H_ | 122 #endif // MEDIA_BASE_VIDEO_DECODER_H_ |
OLD | NEW |