summaryrefslogtreecommitdiffstats
path: root/media/mojo/services/media_type_converters.h
blob: 7b92854758c67d77b9ff9a8c6af4d0b19b908e95 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright 2014 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_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_
#define MEDIA_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "media/mojo/interfaces/content_decryption_module.mojom.h"
#include "media/mojo/interfaces/media_types.mojom.h"

namespace media {
class AudioDecoderConfig;
class DecoderBuffer;
class DecryptConfig;
class VideoDecoderConfig;
struct CdmConfig;
struct CdmKeyInformation;
struct SubsampleEntry;
}

namespace mojo {

template <>
struct TypeConverter<SubsampleEntryPtr, media::SubsampleEntry> {
  static SubsampleEntryPtr Convert(const media::SubsampleEntry& input);
};
template <>
struct TypeConverter<media::SubsampleEntry, SubsampleEntryPtr> {
  static media::SubsampleEntry Convert(const SubsampleEntryPtr& input);
};

template <>
struct TypeConverter<DecryptConfigPtr, media::DecryptConfig> {
  static DecryptConfigPtr Convert(const media::DecryptConfig& input);
};
template <>
struct TypeConverter<scoped_ptr<media::DecryptConfig>, DecryptConfigPtr> {
  static scoped_ptr<media::DecryptConfig> Convert(
      const DecryptConfigPtr& input);
};

template <>
struct TypeConverter<MediaDecoderBufferPtr,
                     scoped_refptr<media::DecoderBuffer>> {
  static MediaDecoderBufferPtr Convert(
      const scoped_refptr<media::DecoderBuffer>& input);
};
template<>
struct TypeConverter<scoped_refptr<media::DecoderBuffer>,
                     MediaDecoderBufferPtr> {
  static scoped_refptr<media::DecoderBuffer> Convert(
      const MediaDecoderBufferPtr& input);
};

template <>
struct TypeConverter<AudioDecoderConfigPtr, media::AudioDecoderConfig> {
  static AudioDecoderConfigPtr Convert(const media::AudioDecoderConfig& input);
};
template <>
struct TypeConverter<media::AudioDecoderConfig, AudioDecoderConfigPtr> {
  static media::AudioDecoderConfig Convert(const AudioDecoderConfigPtr& input);
};

template <>
struct TypeConverter<VideoDecoderConfigPtr, media::VideoDecoderConfig> {
  static VideoDecoderConfigPtr Convert(const media::VideoDecoderConfig& input);
};
template <>
struct TypeConverter<media::VideoDecoderConfig, VideoDecoderConfigPtr> {
  static media::VideoDecoderConfig Convert(const VideoDecoderConfigPtr& input);
};

template <>
struct TypeConverter<CdmKeyInformationPtr, media::CdmKeyInformation> {
  static CdmKeyInformationPtr Convert(const media::CdmKeyInformation& input);
};
template <>
struct TypeConverter<scoped_ptr<media::CdmKeyInformation>,
                     CdmKeyInformationPtr> {
  static scoped_ptr<media::CdmKeyInformation> Convert(
      const CdmKeyInformationPtr& input);
};

template <>
struct TypeConverter<CdmConfigPtr, media::CdmConfig> {
  static CdmConfigPtr Convert(const media::CdmConfig& input);
};
template <>
struct TypeConverter<media::CdmConfig, CdmConfigPtr> {
  static media::CdmConfig Convert(const CdmConfigPtr& input);
};

}  // namespace mojo

#endif  // MEDIA_MOJO_SERVICES_MEDIA_TYPE_CONVERTERS_H_