1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
media / mojo / mojom / media_foundation_rendering_mode_mojom_traits.h [blame]
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_
#define MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_
#include "media/mojo/mojom/renderer_extensions.mojom-shared.h"
#include "media/renderers/win/media_foundation_rendering_mode.h"
template <>
struct mojo::EnumTraits<media::mojom::MediaFoundationRenderingMode,
media::MediaFoundationRenderingMode> {
public:
static bool FromMojom(media::mojom::MediaFoundationRenderingMode data,
media::MediaFoundationRenderingMode* output) {
switch (data) {
case media::mojom::MediaFoundationRenderingMode::DirectComposition:
*output = media::MediaFoundationRenderingMode::DirectComposition;
return true;
case media::mojom::MediaFoundationRenderingMode::FrameServer:
*output = media::MediaFoundationRenderingMode::FrameServer;
return true;
}
NOTREACHED();
}
static media::mojom::MediaFoundationRenderingMode ToMojom(
media::MediaFoundationRenderingMode data) {
switch (data) {
case media::MediaFoundationRenderingMode::DirectComposition:
return media::mojom::MediaFoundationRenderingMode::DirectComposition;
case media::MediaFoundationRenderingMode::FrameServer:
return media::mojom::MediaFoundationRenderingMode::FrameServer;
break;
}
NOTREACHED();
}
};
#endif // MEDIA_MOJO_MOJOM_MEDIA_FOUNDATION_RENDERING_MODE_MOJOM_TRAITS_H_