Index: gpu/ipc/common/gpu_info_struct_traits.h |
diff --git a/gpu/ipc/common/gpu_info_struct_traits.h b/gpu/ipc/common/gpu_info_struct_traits.h |
index ca142166271e96b88dd5ecef0f556047bb4bc5b6..637bc527ce66a76a272731f85bb1cb27e42bbe81 100644 |
--- a/gpu/ipc/common/gpu_info_struct_traits.h |
+++ b/gpu/ipc/common/gpu_info_struct_traits.h |
@@ -7,6 +7,7 @@ |
#include "gpu/config/gpu_info.h" |
#include "gpu/ipc/common/gpu_info.mojom.h" |
+#include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
namespace mojo { |
@@ -47,5 +48,83 @@ struct EnumTraits<gpu::mojom::CollectInfoResult, gpu::CollectInfoResult> { |
gpu::CollectInfoResult* out); |
}; |
+template <> |
+struct EnumTraits<gpu::mojom::VideoCodecProfile, gpu::VideoCodecProfile> { |
+ static gpu::mojom::VideoCodecProfile ToMojom( |
+ gpu::VideoCodecProfile video_codec_profile); |
+ static bool FromMojom(gpu::mojom::VideoCodecProfile input, |
+ gpu::VideoCodecProfile* out); |
+}; |
+ |
+template <> |
+struct StructTraits<gpu::mojom::VideoDecodeAcceleratorSupportedProfile, |
+ gpu::VideoDecodeAcceleratorSupportedProfile> { |
+ static bool Read( |
+ gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView data, |
+ gpu::VideoDecodeAcceleratorSupportedProfile* out); |
+ |
+ static const gpu::VideoCodecProfile& profile( |
Fady Samuel
2016/07/15 18:08:38
Just return by value. This is a small type.
Alex Z.
2016/07/18 12:50:05
Done.
|
+ const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
+ return input.profile; |
+ } |
+ |
+ static const gfx::Size& max_resolution( |
+ const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
+ return input.max_resolution; |
+ } |
+ |
+ static const gfx::Size& min_resolution( |
+ const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
+ return input.min_resolution; |
+ } |
+ |
+ static bool encrypted_only( |
+ const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
+ return input.encrypted_only; |
+ } |
+}; |
+ |
+template <> |
+struct StructTraits<gpu::mojom::VideoDecodeAcceleratorCapabilities, |
+ gpu::VideoDecodeAcceleratorCapabilities> { |
+ static bool Read(gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView data, |
+ gpu::VideoDecodeAcceleratorCapabilities* out) { |
+ out->flags = data.flags(); |
+ return true; |
+ } |
+ |
+ static uint32_t flags(const gpu::VideoDecodeAcceleratorCapabilities& input) { |
+ return input.flags; |
+ } |
+}; |
+ |
+template <> |
+struct StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile, |
+ gpu::VideoEncodeAcceleratorSupportedProfile> { |
+ static bool Read( |
+ gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data, |
+ gpu::VideoEncodeAcceleratorSupportedProfile* out); |
+ |
+ static const gpu::VideoCodecProfile& profile( |
Fady Samuel
2016/07/15 18:08:38
pass by value.
Alex Z.
2016/07/18 12:50:05
Done.
|
+ const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
+ return input.profile; |
+ } |
+ |
+ static const gfx::Size& max_resolution( |
+ const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
+ return input.max_resolution; |
+ } |
+ |
+ static uint32_t max_framerate_numerator( |
+ const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
+ return input.max_framerate_numerator; |
+ } |
+ |
+ static uint32_t max_framerate_denominator( |
+ const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
+ return input.max_framerate_denominator; |
+ } |
+}; |
+ |
} // namespace mojo |
#endif // CC_IPC_GPU_STRUCT_TRAITS_H_ |