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

Side by Side Diff: media/base/video_decoder.h

Issue 1921803002: Avoid unnecessary post task during frame delivery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // satisfy the requirements above. 58 // satisfy the requirements above.
59 // 59 //
60 // |cdm_context| can be used to handle encrypted buffers. May be null if the 60 // |cdm_context| can be used to handle encrypted buffers. May be null if the
61 // stream is not encrypted. 61 // stream is not encrypted.
62 // 62 //
63 // Note: 63 // Note:
64 // 1) The VideoDecoder will be reinitialized if it was initialized before. 64 // 1) The VideoDecoder will be reinitialized if it was initialized before.
65 // Upon reinitialization, all internal buffered frames will be dropped. 65 // Upon reinitialization, all internal buffered frames will be dropped.
66 // 2) This method should not be called during pending decode or reset. 66 // 2) This method should not be called during pending decode or reset.
67 // 3) No VideoDecoder calls should be made before |init_cb| is executed. 67 // 3) No VideoDecoder calls should be made before |init_cb| is executed.
68 // 4) VideoDecoders should take care to run |output_cb| as soon as the frame
69 // is ready (i.e. w/o thread trampolining) since it can strongly affect frame
70 // delivery times with high-frame-rate material.
xhwang 2016/04/25 21:15:55 We typically expect callbacks (including the outpu
DaleCurtis 2016/04/25 21:31:44 This definitely buys us a lot of performance gain
DaleCurtis 2016/04/25 22:32:22 Done. Fixed the existing comment too which wasn't
68 virtual void Initialize(const VideoDecoderConfig& config, 71 virtual void Initialize(const VideoDecoderConfig& config,
69 bool low_delay, 72 bool low_delay,
70 CdmContext* cdm_context, 73 CdmContext* cdm_context,
71 const InitCB& init_cb, 74 const InitCB& init_cb,
72 const OutputCB& output_cb) = 0; 75 const OutputCB& output_cb) = 0;
73 76
74 // Requests a |buffer| to be decoded. The status of the decoder and decoded 77 // Requests a |buffer| to be decoded. The status of the decoder and decoded
75 // frame are returned via the provided callback. Some decoders may allow 78 // frame are returned via the provided callback. Some decoders may allow
76 // decoding multiple buffers in parallel. Callers should call 79 // decoding multiple buffers in parallel. Callers should call
77 // GetMaxDecodeRequests() to get number of buffers that may be decoded in 80 // GetMaxDecodeRequests() to get number of buffers that may be decoded in
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Returns maximum number of parallel decode requests. 115 // Returns maximum number of parallel decode requests.
113 virtual int GetMaxDecodeRequests() const; 116 virtual int GetMaxDecodeRequests() const;
114 117
115 private: 118 private:
116 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); 119 DISALLOW_COPY_AND_ASSIGN(VideoDecoder);
117 }; 120 };
118 121
119 } // namespace media 122 } // namespace media
120 123
121 #endif // MEDIA_BASE_VIDEO_DECODER_H_ 124 #endif // MEDIA_BASE_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698