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

Side by Side Diff: media/video/video_decode_accelerator.h

Issue 2058113002: Add 'cbcs' encryption scheme support in Android media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "media/base/bitstream_buffer.h" 15 #include "media/base/bitstream_buffer.h"
16 #include "media/base/cdm_context.h" 16 #include "media/base/cdm_context.h"
17 #include "media/base/encryption_scheme.h"
17 #include "media/base/surface_manager.h" 18 #include "media/base/surface_manager.h"
18 #include "media/base/video_decoder_config.h" 19 #include "media/base/video_decoder_config.h"
19 #include "media/video/picture.h" 20 #include "media/video/picture.h"
20 #include "ui/gfx/geometry/size.h" 21 #include "ui/gfx/geometry/size.h"
21 #include "ui/gfx/gpu_memory_buffer.h" 22 #include "ui/gfx/gpu_memory_buffer.h"
22 23
23 typedef unsigned int GLenum; 24 typedef unsigned int GLenum;
24 25
25 namespace base { 26 namespace base {
26 class SingleThreadTaskRunner; 27 class SingleThreadTaskRunner;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // When set to ALLOCATE, the VDA is expected to allocate backing memory 109 // When set to ALLOCATE, the VDA is expected to allocate backing memory
109 // for PictureBuffers at the time of AssignPictureBuffers() call. 110 // for PictureBuffers at the time of AssignPictureBuffers() call.
110 // When set to IMPORT, the VDA will not allocate, but after receiving 111 // When set to IMPORT, the VDA will not allocate, but after receiving
111 // AssignPictureBuffers() call, it will expect a call to 112 // AssignPictureBuffers() call, it will expect a call to
112 // ImportBufferForPicture() for each PictureBuffer before use. 113 // ImportBufferForPicture() for each PictureBuffer before use.
113 enum class OutputMode { 114 enum class OutputMode {
114 ALLOCATE, 115 ALLOCATE,
115 IMPORT, 116 IMPORT,
116 }; 117 };
117 118
118 Config() = default; 119 Config();
119 120
120 // Intentional converting constructor. 121 // Intentional converting constructor.
121 // TODO(watk): Make this explicit. 122 // TODO(watk): Make this explicit.
122 Config(VideoCodecProfile profile); 123 Config(VideoCodecProfile profile);
123 124
124 std::string AsHumanReadableString() const; 125 std::string AsHumanReadableString() const;
126 bool is_encrypted() const { return encryption_scheme.is_encrypted(); }
125 127
126 // The video codec and profile. 128 // The video codec and profile.
127 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; 129 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN;
128 130
129 // Whether the stream is encrypted. 131 // Whether the stream is encrypted, and, if so, the scheme used.
130 bool is_encrypted = false; 132 EncryptionScheme encryption_scheme;
131 133
132 // The CDM that the VDA should use to decode encrypted streams. Must be 134 // The CDM that the VDA should use to decode encrypted streams. Must be
133 // set to a valid ID if |is_encrypted|. 135 // set to a valid ID if |is_encrypted|.
134 int cdm_id = CdmContext::kInvalidCdmId; 136 int cdm_id = CdmContext::kInvalidCdmId;
135 137
136 // Whether the client supports deferred initialization. 138 // Whether the client supports deferred initialization.
137 bool is_deferred_initialization_allowed = false; 139 bool is_deferred_initialization_allowed = false;
138 140
139 // An optional graphics surface that the VDA should render to. For setting 141 // An optional graphics surface that the VDA should render to. For setting
140 // an output SurfaceView on Android. It's only valid when not equal to 142 // an output SurfaceView on Android. It's only valid when not equal to
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to 337 // std::unique_ptr<VideoDecodeAccelerator> uses "Destroy()" instead of trying to
336 // use the destructor. 338 // use the destructor.
337 template <> 339 template <>
338 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { 340 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> {
339 void operator()(media::VideoDecodeAccelerator* vda) const; 341 void operator()(media::VideoDecodeAccelerator* vda) const;
340 }; 342 };
341 343
342 } // namespace std 344 } // namespace std
343 345
344 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 346 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698