1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_
6 #define MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_
8 #include "media/mojo/mojom/renderer_extensions.mojom-shared.h"
9 #include "media/renderers/win/media_foundation_rendering_mode.h"
12 struct mojo::EnumTraits<media::mojom::MediaFoundationRenderingMode,
13 media::MediaFoundationRenderingMode> {
15 static bool FromMojom(media::mojom::MediaFoundationRenderingMode data,
16 media::MediaFoundationRenderingMode* output) {
18 case media::mojom::MediaFoundationRenderingMode::DirectComposition:
19 *output = media::MediaFoundationRenderingMode::DirectComposition;
21 case media::mojom::MediaFoundationRenderingMode::FrameServer:
22 *output = media::MediaFoundationRenderingMode::FrameServer;
25 NOTREACHED_NORETURN();
28 static media::mojom::MediaFoundationRenderingMode ToMojom(
29 media::MediaFoundationRenderingMode data) {
31 case media::MediaFoundationRenderingMode::DirectComposition:
32 return media::mojom::MediaFoundationRenderingMode::DirectComposition;
33 case media::MediaFoundationRenderingMode::FrameServer:
34 return media::mojom::MediaFoundationRenderingMode::FrameServer;
37 NOTREACHED_NORETURN();
41 #endif // MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_