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

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

Issue 1446713003: Revert of media: Pass SetCdmReadyCB in {Audio|Video}Decoder::Initialize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « media/base/mock_filters.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "media/base/cdm_context.h"
13 #include "media/base/media_export.h" 12 #include "media/base/media_export.h"
14 #include "media/base/pipeline_status.h" 13 #include "media/base/pipeline_status.h"
15 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
16 15
17 namespace media { 16 namespace media {
18 17
19 class DecoderBuffer; 18 class DecoderBuffer;
20 class VideoDecoderConfig; 19 class VideoDecoderConfig;
21 class VideoFrame; 20 class VideoFrame;
22 21
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Initializes a VideoDecoder with the given |config|, executing the 56 // Initializes a VideoDecoder with the given |config|, executing the
58 // |init_cb| upon completion. |output_cb| is called for each output frame 57 // |init_cb| upon completion. |output_cb| is called for each output frame
59 // decoded by Decode(). 58 // decoded by Decode().
60 // 59 //
61 // 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,
62 // 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
63 // must be returned without waiting for Decode() to be called again. 62 // must be returned without waiting for Decode() to be called again.
64 // 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
65 // satisfy the requirements above. 64 // satisfy the requirements above.
66 // 65 //
67 // |set_cdm_ready_cb| can be used to set/cancel a CdmReadyCB with which the
68 // decoder can be notified when a CDM is ready. The decoder can use the CDM to
69 // handle encrypted video stream.
70 //
71 // Note: 66 // Note:
72 // 1) The VideoDecoder will be reinitialized if it was initialized before. 67 // 1) The VideoDecoder will be reinitialized if it was initialized before.
73 // Upon reinitialization, all internal buffered frames will be dropped. 68 // Upon reinitialization, all internal buffered frames will be dropped.
74 // 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.
75 // 3) No VideoDecoder calls should be made before |init_cb| is executed. 70 // 3) No VideoDecoder calls should be made before |init_cb| is executed.
76 virtual void Initialize(const VideoDecoderConfig& config, 71 virtual void Initialize(const VideoDecoderConfig& config,
77 bool low_delay, 72 bool low_delay,
78 const SetCdmReadyCB& set_cdm_ready_cb,
79 const InitCB& init_cb, 73 const InitCB& init_cb,
80 const OutputCB& output_cb) = 0; 74 const OutputCB& output_cb) = 0;
81 75
82 // Requests a |buffer| to be decoded. The status of the decoder and decoded 76 // Requests a |buffer| to be decoded. The status of the decoder and decoded
83 // frame are returned via the provided callback. Some decoders may allow 77 // frame are returned via the provided callback. Some decoders may allow
84 // decoding multiple buffers in parallel. Callers should call 78 // decoding multiple buffers in parallel. Callers should call
85 // GetMaxDecodeRequests() to get number of buffers that may be decoded in 79 // GetMaxDecodeRequests() to get number of buffers that may be decoded in
86 // parallel. Decoder must call |decode_cb| in the same order in which Decode() 80 // parallel. Decoder must call |decode_cb| in the same order in which Decode()
87 // is called. 81 // is called.
88 // 82 //
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Returns maximum number of parallel decode requests. 114 // Returns maximum number of parallel decode requests.
121 virtual int GetMaxDecodeRequests() const; 115 virtual int GetMaxDecodeRequests() const;
122 116
123 private: 117 private:
124 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); 118 DISALLOW_COPY_AND_ASSIGN(VideoDecoder);
125 }; 119 };
126 120
127 } // namespace media 121 } // namespace media
128 122
129 #endif // MEDIA_BASE_VIDEO_DECODER_H_ 123 #endif // MEDIA_BASE_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/base/mock_filters.h ('k') | media/filters/audio_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698