#ifndef MEDIA_MOJO_MOJOM_MEDIA_TYPES_ENUM_MOJOM_TRAITS_H_
#define MEDIA_MOJO_MOJOM_MEDIA_TYPES_ENUM_MOJOM_TRAITS_H_
#include "base/notreached.h"
#include "build/build_config.h"
#include "media/base/cdm_factory.h"
#include "media/base/renderer_factory_selector.h"
#include "media/base/svc_scalability_mode.h"
#include "media/base/video_transformation.h"
#include "media/cdm/cdm_document_service.h"
#include "media/mojo/mojom/media_types.mojom-shared.h"
namespace mojo {
#if BUILDFLAG(IS_WIN)
template <>
struct EnumTraits<media::mojom::CdmEvent, ::media::CdmEvent> {
static media::mojom::CdmEvent ToMojom(::media::CdmEvent input) {
switch (input) {
case ::media::CdmEvent::kSignificantPlayback:
return media::mojom::CdmEvent::kSignificantPlayback;
case ::media::CdmEvent::kPlaybackError:
return media::mojom::CdmEvent::kPlaybackError;
case ::media::CdmEvent::kCdmError:
return media::mojom::CdmEvent::kCdmError;
case ::media::CdmEvent::kHardwareContextReset:
return media::mojom::CdmEvent::kHardwareContextReset;
}
NOTREACHED();
}
static bool FromMojom(media::mojom::CdmEvent input,
::media::CdmEvent* output) {
switch (input) {
case media::mojom::CdmEvent::kSignificantPlayback:
*output = ::media::CdmEvent::kSignificantPlayback;
return true;
case media::mojom::CdmEvent::kPlaybackError:
*output = ::media::CdmEvent::kPlaybackError;
return true;
case media::mojom::CdmEvent::kCdmError:
*output = ::media::CdmEvent::kCdmError;
return true;
case media::mojom::CdmEvent::kHardwareContextReset:
*output = ::media::CdmEvent::kHardwareContextReset;
return true;
}
NOTREACHED();
}
};
#endif
template <>
struct EnumTraits<media::mojom::CdmSessionClosedReason,
::media::CdmSessionClosedReason> { … };
template <>
struct EnumTraits<media::mojom::EncryptionType, ::media::EncryptionType> { … };
template <>
struct EnumTraits<media::mojom::SVCScalabilityMode, media::SVCScalabilityMode> { … };
template <>
struct EnumTraits<media::mojom::SVCInterLayerPredMode,
media::SVCInterLayerPredMode> { … };
template <>
struct EnumTraits<media::mojom::VideoRotation, ::media::VideoRotation> { … };
template <>
struct EnumTraits<media::mojom::RendererType, ::media::RendererType> { … };
template <>
struct EnumTraits<media::mojom::CreateCdmStatus, media::CreateCdmStatus> { … };
}
#endif