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

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

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Note: Since this is a destructor, |this| will be destroyed after this call. 46 // Note: Since this is a destructor, |this| will be destroyed after this call.
47 // Make sure the callbacks fired from this call doesn't post any task that 47 // Make sure the callbacks fired from this call doesn't post any task that
48 // depends on |this|. 48 // depends on |this|.
49 virtual ~VideoDecoder(); 49 virtual ~VideoDecoder();
50 50
51 // Returns the name of the decoder for logging purpose. 51 // Returns the name of the decoder for logging purpose.
52 virtual std::string GetDisplayName() const = 0; 52 virtual std::string GetDisplayName() const = 0;
53 53
54 // Initializes a VideoDecoder with the given |config|, executing the 54 // Initializes a VideoDecoder with the given |config|, executing the
55 // |status_cb| upon completion. |output_cb| is called for each output frame 55 // |status_cb| upon completion. |output_cb| is called for each output frame
56 // decoded by Decode(). 56 // decoded by Decode(). |waiting_for_encryption_key_cb| is called for
ddorwin 2015/02/19 05:33:17 dittos
jrummell 2015/02/23 22:06:32 Done.
57 // encrypted streams whenever a new key is required in order to decrypt
58 // the stream.
57 // 59 //
58 // If |low_delay| is true then the decoder is not allowed to queue frames, 60 // If |low_delay| is true then the decoder is not allowed to queue frames,
59 // except for out-of-order frames, i.e. if the next frame can be returned it 61 // except for out-of-order frames, i.e. if the next frame can be returned it
60 // must be returned without waiting for Decode() to be called again. 62 // must be returned without waiting for Decode() to be called again.
61 // Initialization should fail if |low_delay| is true and the decoder cannot 63 // Initialization should fail if |low_delay| is true and the decoder cannot
62 // satisfy the requirements above. 64 // satisfy the requirements above.
63 // 65 //
64 // Note: 66 // Note:
65 // 1) The VideoDecoder will be reinitialized if it was initialized before. 67 // 1) The VideoDecoder will be reinitialized if it was initialized before.
66 // Upon reinitialization, all internal buffered frames will be dropped. 68 // Upon reinitialization, all internal buffered frames will be dropped.
67 // 2) This method should not be called during pending decode or reset. 69 // 2) This method should not be called during pending decode or reset.
68 // 3) No VideoDecoder calls should be made before |status_cb| is executed. 70 // 3) No VideoDecoder calls should be made before |status_cb| is executed.
69 virtual void Initialize(const VideoDecoderConfig& config, 71 virtual void Initialize(
70 bool low_delay, 72 const VideoDecoderConfig& config,
71 const PipelineStatusCB& status_cb, 73 bool low_delay,
72 const OutputCB& output_cb) = 0; 74 const PipelineStatusCB& status_cb,
75 const OutputCB& output_cb,
76 const base::Closure& waiting_for_encryption_key_cb) = 0;
73 77
74 // 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
75 // frame are returned via the provided callback. Some decoders may allow 79 // frame are returned via the provided callback. Some decoders may allow
76 // decoding multiple buffers in parallel. Callers should call 80 // decoding multiple buffers in parallel. Callers should call
77 // GetMaxDecodeRequests() to get number of buffers that may be decoded in 81 // GetMaxDecodeRequests() to get number of buffers that may be decoded in
78 // parallel. Decoder must call |decode_cb| in the same order in which Decode() 82 // parallel. Decoder must call |decode_cb| in the same order in which Decode()
79 // is called. 83 // is called.
80 // 84 //
81 // Implementations guarantee that the callback will not be called from within 85 // Implementations guarantee that the callback will not be called from within
82 // this method and that |decode_cb| will not be blocked on the following 86 // this method and that |decode_cb| will not be blocked on the following
(...skipping 29 matching lines...) Expand all
112 // Returns maximum number of parallel decode requests. 116 // Returns maximum number of parallel decode requests.
113 virtual int GetMaxDecodeRequests() const; 117 virtual int GetMaxDecodeRequests() const;
114 118
115 private: 119 private:
116 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); 120 DISALLOW_COPY_AND_ASSIGN(VideoDecoder);
117 }; 121 };
118 122
119 } // namespace media 123 } // namespace media
120 124
121 #endif // MEDIA_BASE_VIDEO_DECODER_H_ 125 #endif // MEDIA_BASE_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698