// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_BASE_MEDIA_SERIALIZERS_BASE_H_ #define MEDIA_BASE_MEDIA_SERIALIZERS_BASE_H_ #include #include "base/values.h" #include "media/base/media_export.h" namespace media { namespace internal { // Serializer specializer struct. // All the types that base::Value's constructor can take should be passed // by non-const values. (int, bool, std::string, char*, etc). template struct MediaSerializer { static inline base::Value Serialize(T value) { return base::Value(value); } }; } // namespace internal template base::Value MediaSerialize(const T& t) { return internal::MediaSerializer::Serialize(t); } } // namespace media #endif // MEDIA_BASE_MEDIA_SERIALIZERS_BASE_H_