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

Side by Side Diff: media/filters/decrypting_video_decoder.h

Issue 11492003: Encrypted Media: Support Audio Decrypt-Only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: working and not hacky; need to update comments and tests Created 8 years 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 | Annotate | Revision Log
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_FILTERS_DECRYPTING_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/decryptor.h" 10 #include "media/base/decryptor.h"
(...skipping 13 matching lines...) Expand all
24 // encrypted video buffers and return decrypted and decompressed video frames. 24 // encrypted video buffers and return decrypted and decompressed video frames.
25 // All public APIs and callbacks are trampolined to the |message_loop_| so 25 // All public APIs and callbacks are trampolined to the |message_loop_| so
26 // that no locks are required for thread safety. 26 // that no locks are required for thread safety.
27 // 27 //
28 // TODO(xhwang): For now, DecryptingVideoDecoder relies on the decryptor to do 28 // TODO(xhwang): For now, DecryptingVideoDecoder relies on the decryptor to do
29 // both decryption and video decoding. Add the path to use the decryptor for 29 // both decryption and video decoding. Add the path to use the decryptor for
30 // decryption only and use other VideoDecoder implementations within 30 // decryption only and use other VideoDecoder implementations within
31 // DecryptingVideoDecoder for video decoding. 31 // DecryptingVideoDecoder for video decoding.
32 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder { 32 class MEDIA_EXPORT DecryptingVideoDecoder : public VideoDecoder {
33 public: 33 public:
34 // Callback to notify decryptor creation.
35 typedef base::Callback<void(Decryptor*)> DecryptorNotificationCB;
36 // Callback to request/cancel decryptor creation notification.
37 // Calling this callback with a non-null callback registers decryptor creation
38 // notification. When the decryptor is created, notification will be sent
39 // through the provided callback.
40 // Calling this callback with a null callback cancels previously registered
41 // decryptor creation notification. Any previously provided callback will be
42 // fired immediately with NULL.
43 typedef base::Callback<void(const DecryptorNotificationCB&)>
44 RequestDecryptorNotificationCB;
45
46 DecryptingVideoDecoder( 34 DecryptingVideoDecoder(
47 const scoped_refptr<base::MessageLoopProxy>& message_loop, 35 const scoped_refptr<base::MessageLoopProxy>& message_loop,
48 const RequestDecryptorNotificationCB& request_decryptor_notification_cb); 36 const RequestDecryptorNotificationCB& request_decryptor_notification_cb);
49 37
50 // VideoDecoder implementation. 38 // VideoDecoder implementation.
51 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, 39 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream,
52 const PipelineStatusCB& status_cb, 40 const PipelineStatusCB& status_cb,
53 const StatisticsCB& statistics_cb) OVERRIDE; 41 const StatisticsCB& statistics_cb) OVERRIDE;
54 virtual void Read(const ReadCB& read_cb) OVERRIDE; 42 virtual void Read(const ReadCB& read_cb) OVERRIDE;
55 virtual void Reset(const base::Closure& closure) OVERRIDE; 43 virtual void Reset(const base::Closure& closure) OVERRIDE;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the 121 // A unique ID to trace Decryptor::DecryptAndDecodeVideo() call and the
134 // matching DecryptCB call (in DoDeliverFrame()). 122 // matching DecryptCB call (in DoDeliverFrame()).
135 uint32 trace_id_; 123 uint32 trace_id_;
136 124
137 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder); 125 DISALLOW_COPY_AND_ASSIGN(DecryptingVideoDecoder);
138 }; 126 };
139 127
140 } // namespace media 128 } // namespace media
141 129
142 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_ 130 #endif // MEDIA_FILTERS_DECRYPTING_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698