• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
2 //
3 // Use of this source code is governed by a BSD-style license
4 // that can be found in the LICENSE file in the root of the source
5 // tree. An additional intellectual property rights grant can be found
6 // in the file PATENTS.  All contributing project authors may
7 // be found in the AUTHORS file in the root of the source tree.
8 #ifndef SRC_PROJECTION_PARSER_H_
9 #define SRC_PROJECTION_PARSER_H_
10 
11 #include "src/byte_parser.h"
12 #include "src/float_parser.h"
13 #include "src/int_parser.h"
14 #include "src/master_value_parser.h"
15 #include "webm/dom_types.h"
16 #include "webm/id.h"
17 
18 namespace webm {
19 
20 // Spec reference:
21 // https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md#projection-master-element
22 class ProjectionParser : public MasterValueParser<Projection> {
23  public:
ProjectionParser()24   ProjectionParser()
25       : MasterValueParser(
26             MakeChild<IntParser<ProjectionType>>(Id::kProjectionType,
27                                                  &Projection::type),
28             MakeChild<BinaryParser>(Id::kProjectionPrivate,
29                                     &Projection::projection_private),
30             MakeChild<FloatParser>(Id::kProjectionPoseYaw,
31                                    &Projection::pose_yaw),
32             MakeChild<FloatParser>(Id::kProjectionPosePitch,
33                                    &Projection::pose_pitch),
34             MakeChild<FloatParser>(Id::kProjectionPoseRoll,
35                                    &Projection::pose_roll)) {}
36 };
37 
38 }  // namespace webm
39 
40 #endif  // SRC_PROJECTION_PARSER_H_
41