[M120 Migration][MM][CAPI] Fix the logic for media using capi player.
[platform/framework/web/chromium-efl.git] / media / mojo / services / test_helpers.cc
1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/mojo/services/test_helpers.h"
6
7 namespace media {
8
9 mojom::PredictionFeatures MakeFeatures(VideoCodecProfile profile,
10                                        const gfx::Size& video_size,
11                                        double frames_per_sec,
12                                        const std::string& key_system,
13                                        bool use_hw_secure_codecs) {
14   mojom::PredictionFeatures features;
15   features.profile = profile;
16   features.video_size = video_size;
17   features.frames_per_sec = frames_per_sec;
18   features.key_system = key_system;
19   features.use_hw_secure_codecs = use_hw_secure_codecs;
20   return features;
21 }
22
23 mojom::PredictionFeaturesPtr MakeFeaturesPtr(VideoCodecProfile profile,
24                                              const gfx::Size& video_size,
25                                              double frames_per_sec,
26                                              const std::string& key_system,
27                                              bool use_hw_secure_codecs) {
28   mojom::PredictionFeaturesPtr features = mojom::PredictionFeatures::New();
29   *features = MakeFeatures(profile, video_size, frames_per_sec, key_system,
30                            use_hw_secure_codecs);
31   return features;
32 }
33
34 mojom::PredictionTargets MakeTargets(uint32_t frames_decoded,
35                                      uint32_t frames_dropped,
36                                      uint32_t frames_power_efficient) {
37   mojom::PredictionTargets targets;
38   targets.frames_decoded = frames_decoded;
39   targets.frames_dropped = frames_dropped;
40   targets.frames_power_efficient = frames_power_efficient;
41   return targets;
42 }
43
44 mojom::PredictionTargetsPtr MakeTargetsPtr(uint32_t frames_decoded,
45                                            uint32_t frames_dropped,
46                                            uint32_t frames_power_efficient) {
47   mojom::PredictionTargetsPtr targets = mojom::PredictionTargets::New();
48   *targets =
49       MakeTargets(frames_decoded, frames_dropped, frames_power_efficient);
50   return targets;
51 }
52
53 }  // namespace media