| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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_COMMON_PIPELINE_STATISTICS_STRUCT_TRAITS_H_ | |
| 6 #define MEDIA_MOJO_COMMON_PIPELINE_STATISTICS_STRUCT_TRAITS_H_ | |
| 7 | |
| 8 #include "media/base/pipeline_status.h" | |
| 9 #include "media/mojo/interfaces/media_types.mojom.h" | |
| 10 | |
| 11 namespace mojo { | |
| 12 | |
| 13 template <> | |
| 14 struct StructTraits<media::mojom::PipelineStatisticsDataView, | |
| 15 media::PipelineStatistics> { | |
| 16 static uint64_t audio_bytes_decoded(const media::PipelineStatistics& input) { | |
| 17 return input.audio_bytes_decoded; | |
| 18 } | |
| 19 static uint64_t video_bytes_decoded(const media::PipelineStatistics& input) { | |
| 20 return input.video_bytes_decoded; | |
| 21 } | |
| 22 static uint32_t video_frames_decoded(const media::PipelineStatistics& input) { | |
| 23 return input.video_frames_decoded; | |
| 24 } | |
| 25 static uint32_t video_frames_dropped(const media::PipelineStatistics& input) { | |
| 26 return input.video_frames_dropped; | |
| 27 } | |
| 28 static int64_t audio_memory_usage(const media::PipelineStatistics& input) { | |
| 29 return input.audio_memory_usage; | |
| 30 } | |
| 31 static int64_t video_memory_usage(const media::PipelineStatistics& input) { | |
| 32 return input.video_memory_usage; | |
| 33 } | |
| 34 | |
| 35 static bool Read(media::mojom::PipelineStatisticsDataView data, | |
| 36 media::PipelineStatistics* output) { | |
| 37 output->audio_bytes_decoded = data.audio_bytes_decoded(); | |
| 38 output->video_bytes_decoded = data.video_bytes_decoded(); | |
| 39 output->video_frames_decoded = data.video_frames_decoded(); | |
| 40 output->video_frames_dropped = data.video_frames_dropped(); | |
| 41 output->audio_memory_usage = data.audio_memory_usage(); | |
| 42 output->video_memory_usage = data.video_memory_usage(); | |
| 43 return true; | |
| 44 } | |
| 45 }; | |
| 46 | |
| 47 } // namespace mojo | |
| 48 | |
| 49 #endif // MEDIA_MOJO_COMMON_PIPELINE_STATISTICS_STRUCT_TRAITS_H_ | |
| OLD | NEW |