OLD | NEW |
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 "media/base/bitstream_buffer.h" | 13 #include "media/base/bitstream_buffer.h" |
| 14 #include "media/base/surface_manager.h" |
14 #include "media/base/video_decoder_config.h" | 15 #include "media/base/video_decoder_config.h" |
15 #include "media/video/picture.h" | 16 #include "media/video/picture.h" |
16 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
17 | 18 |
18 typedef unsigned int GLenum; | 19 typedef unsigned int GLenum; |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 | 22 |
22 // Video decoder interface. | 23 // Video decoder interface. |
23 // This interface is extended by the various components that ultimately | 24 // This interface is extended by the various components that ultimately |
(...skipping 24 matching lines...) Expand all Loading... |
48 // Normally, the VDA is required to be able to provide all PictureBuffers | 49 // Normally, the VDA is required to be able to provide all PictureBuffers |
49 // to the client via PictureReady(), even if the client does not return | 50 // to the client via PictureReady(), even if the client does not return |
50 // any of them via ReusePictureBuffer(). The client is only required to | 51 // any of them via ReusePictureBuffer(). The client is only required to |
51 // return PictureBuffers when it holds all of them, if it wants to get | 52 // return PictureBuffers when it holds all of them, if it wants to get |
52 // more decoded output. See VideoDecoder::CanReadWithoutStalling for | 53 // more decoded output. See VideoDecoder::CanReadWithoutStalling for |
53 // more context. | 54 // more context. |
54 // If this flag is set, then the VDA does not make this guarantee. The | 55 // If this flag is set, then the VDA does not make this guarantee. The |
55 // client must return PictureBuffers to be sure that new frames will be | 56 // client must return PictureBuffers to be sure that new frames will be |
56 // provided via PictureReady. | 57 // provided via PictureReady. |
57 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE = 1 << 0, | 58 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE = 1 << 0, |
| 59 |
| 60 // Whether the VDA supports being configured with an output surface for |
| 61 // it to render frames to. For example, SurfaceViews on Android. |
| 62 SUPPORTS_EXTERNAL_OUTPUT_SURFACE = 1 << 1, |
58 }; | 63 }; |
59 | 64 |
60 SupportedProfiles supported_profiles; | 65 SupportedProfiles supported_profiles; |
61 uint32_t flags; | 66 uint32_t flags; |
62 }; | 67 }; |
63 | 68 |
64 // Enumeration of potential errors generated by the API. | 69 // Enumeration of potential errors generated by the API. |
65 // Note: Keep these in sync with PP_VideoDecodeError_Dev. Also do not | 70 // Note: Keep these in sync with PP_VideoDecodeError_Dev. Also do not |
66 // rearrange, reuse or remove values as they are used for gathering UMA | 71 // rearrange, reuse or remove values as they are used for gathering UMA |
67 // statistics. | 72 // statistics. |
68 enum Error { | 73 enum Error { |
69 // An operation was attempted during an incompatible decoder state. | 74 // An operation was attempted during an incompatible decoder state. |
70 ILLEGAL_STATE = 1, | 75 ILLEGAL_STATE = 1, |
71 // Invalid argument was passed to an API method. | 76 // Invalid argument was passed to an API method. |
72 INVALID_ARGUMENT, | 77 INVALID_ARGUMENT, |
73 // Encoded input is unreadable. | 78 // Encoded input is unreadable. |
74 UNREADABLE_INPUT, | 79 UNREADABLE_INPUT, |
75 // A failure occurred at the browser layer or one of its dependencies. | 80 // A failure occurred at the browser layer or one of its dependencies. |
76 // Examples of such failures include GPU hardware failures, GPU driver | 81 // Examples of such failures include GPU hardware failures, GPU driver |
77 // failures, GPU library failures, browser programming errors, and so on. | 82 // failures, GPU library failures, browser programming errors, and so on. |
78 PLATFORM_FAILURE, | 83 PLATFORM_FAILURE, |
79 // Largest used enum. This should be adjusted when new errors are added. | 84 // Largest used enum. This should be adjusted when new errors are added. |
80 LARGEST_ERROR_ENUM, | 85 LARGEST_ERROR_ENUM, |
81 }; | 86 }; |
82 | 87 |
83 // Config structure contains parameters required for the VDA initialization. | 88 // Config structure contains parameters required for the VDA initialization. |
84 struct MEDIA_EXPORT Config { | 89 struct MEDIA_EXPORT Config { |
85 enum { kNoSurfaceID = -1 }; | 90 enum { kNoSurfaceID = SurfaceManager::kNoSurfaceID }; |
86 | 91 |
87 Config() = default; | 92 Config() = default; |
88 Config(VideoCodecProfile profile); | 93 Config(VideoCodecProfile profile); |
89 Config(const VideoDecoderConfig& video_decoder_config); | 94 Config(const VideoDecoderConfig& video_decoder_config); |
90 | 95 |
91 std::string AsHumanReadableString() const; | 96 std::string AsHumanReadableString() const; |
92 | 97 |
93 // |profile| combines the information about the codec and its profile. | 98 // |profile| combines the information about the codec and its profile. |
94 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; | 99 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
95 | 100 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // Specialize std::default_delete so that scoped_ptr<VideoDecodeAccelerator> | 250 // Specialize std::default_delete so that scoped_ptr<VideoDecodeAccelerator> |
246 // uses "Destroy()" instead of trying to use the destructor. | 251 // uses "Destroy()" instead of trying to use the destructor. |
247 template <> | 252 template <> |
248 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { | 253 struct MEDIA_EXPORT default_delete<media::VideoDecodeAccelerator> { |
249 void operator()(media::VideoDecodeAccelerator* vda) const; | 254 void operator()(media::VideoDecodeAccelerator* vda) const; |
250 }; | 255 }; |
251 | 256 |
252 } // namespace std | 257 } // namespace std |
253 | 258 |
254 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 259 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |