1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef MEDIA_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_
6#define MEDIA_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_
7
8#include "base/memory/ref_counted.h"
9#include "media/mojo/interfaces/media_types.mojom.h"
10
11namespace media {
12class AudioDecoderConfig;
13class DecoderBuffer;
14}
15
16namespace mojo {
17
18template <>
19struct TypeConverter<MediaDecoderBufferPtr,
20                     scoped_refptr<media::DecoderBuffer> > {
21  static MediaDecoderBufferPtr Convert(
22      const scoped_refptr<media::DecoderBuffer>& input);
23};
24template<>
25struct TypeConverter<scoped_refptr<media::DecoderBuffer>,
26                     MediaDecoderBufferPtr> {
27  static scoped_refptr<media::DecoderBuffer> Convert(
28      const MediaDecoderBufferPtr& input);
29};
30
31template <>
32struct TypeConverter<AudioDecoderConfigPtr, media::AudioDecoderConfig> {
33  static AudioDecoderConfigPtr Convert(const media::AudioDecoderConfig& input);
34};
35template <>
36struct TypeConverter<media::AudioDecoderConfig, AudioDecoderConfigPtr> {
37  static media::AudioDecoderConfig Convert(const AudioDecoderConfigPtr& input);
38};
39
40}  // namespace mojo
41
42#endif  // MEDIA_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_
43