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

Unified 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: Comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_decoder.h
diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h
index d6abf03e175355e66e1d67962eec16d8311be8cf..5a474b56e21ebdc8177edc6cb351e98c7790f108 100644
--- a/media/base/video_decoder.h
+++ b/media/base/video_decoder.h
@@ -65,6 +65,10 @@ class MEDIA_EXPORT VideoDecoder {
// Upon reinitialization, all internal buffered frames will be dropped.
// 2) This method should not be called during pending decode or reset.
// 3) No VideoDecoder calls should be made before |init_cb| is executed.
+ // 4) VideoDecoders should take care to run |output_cb| as soon as the frame
+ // is ready (i.e. w/o thread trampolining) since it can strongly affect frame
+ // delivery times with high-frame-rate material. See Decode() for additional
+ // notes.
virtual void Initialize(const VideoDecoderConfig& config,
bool low_delay,
CdmContext* cdm_context,
@@ -84,9 +88,10 @@ class MEDIA_EXPORT VideoDecoder {
// called again).
//
// After decoding is finished the decoder calls |output_cb| specified in
- // Initialize() for each decoded frame. In general |output_cb| may be called
- // before or after |decode_cb|, but software decoders normally call
- // |output_cb| before calling |decode_cb|, i.e. while Decode() is pending.
+ // Initialize() for each decoded frame. |output_cb| is always called before
+ // |decode_cb|. However, |output_cb| may be called before Decode() returns, if
+ // other behavior is desired callers should ensure that |output_cb| will
+ // trampoline as necessary.
xhwang 2016/04/25 22:40:28 Note that we requires that the |decode_cb| must NO
DaleCurtis 2016/04/25 22:52:16 Do we need to say anything? If |output_cb| runs wh
DaleCurtis 2016/04/25 23:07:43 Discussed offline, while the existing behavior is
//
// If |buffer| is an EOS buffer then the decoder must be flushed, i.e.
// |output_cb| must be called for each frame pending in the queue and
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698