parser.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /* A Bison parser, made by GNU Bison 3.5.1. */
  2. /* Bison interface for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
  4. Inc.
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. /* As a special exception, you may create a larger work that contains
  16. part or all of the Bison parser skeleton and distribute that work
  17. under terms of your choice, so long as that work isn't itself a
  18. parser generator using the skeleton or a modified version thereof
  19. as a parser skeleton. Alternatively, if you modify or redistribute
  20. the parser skeleton itself, you may (at your option) remove this
  21. special exception, which will cause the skeleton and the resulting
  22. Bison output files to be licensed under the GNU General Public
  23. License without this special exception.
  24. This special exception was added by the Free Software Foundation in
  25. version 2.2 of Bison. */
  26. /* Undocumented macros, especially those whose name start with YY_,
  27. are private implementation details. Do not rely on them. */
  28. #ifndef YY_WDS_GEN_PARSER_H_INCLUDED
  29. # define YY_WDS_GEN_PARSER_H_INCLUDED
  30. /* Debug traces. */
  31. #ifndef YYDEBUG
  32. # define YYDEBUG 0
  33. #endif
  34. #if YYDEBUG
  35. extern int wds_debug;
  36. #endif
  37. /* "%code requires" blocks. */
  38. /*
  39. * This file is part of Wireless Display Software for Linux OS
  40. *
  41. * Copyright (C) 2015 Intel Corporation.
  42. *
  43. * This library is free software; you can redistribute it and/or
  44. * modify it under the terms of the GNU Lesser General Public
  45. * License as published by the Free Software Foundation; either
  46. * version 2.1 of the License, or (at your option) any later version.
  47. *
  48. * This library is distributed in the hope that it will be useful,
  49. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  50. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  51. * Lesser General Public License for more details.
  52. *
  53. * You should have received a copy of the GNU Lesser General Public
  54. * License along with this library; if not, write to the Free Software
  55. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  56. * 02110-1301 USA
  57. */
  58. #include <map>
  59. #include <memory>
  60. #include "libwds/rtsp/audiocodecs.h"
  61. #include "libwds/rtsp/contentprotection.h"
  62. #include "libwds/rtsp/triggermethod.h"
  63. #include "libwds/rtsp/route.h"
  64. #include "libwds/rtsp/uibcsetting.h"
  65. #include "libwds/rtsp/uibccapability.h"
  66. #define YYLEX_PARAM scanner
  67. namespace wds {
  68. struct AudioCodec;
  69. namespace rtsp {
  70. class Driver;
  71. class Scanner;
  72. class Message;
  73. class Header;
  74. class TransportHeader;
  75. class Property;
  76. class PropertyErrors;
  77. class Payload;
  78. class VideoFormats;
  79. struct H264Codec;
  80. struct H264Codec3d;
  81. }
  82. }
  83. /* Token type. */
  84. #ifndef YYTOKENTYPE
  85. # define YYTOKENTYPE
  86. enum yytokentype
  87. {
  88. END = 0,
  89. WFD_SP = 258,
  90. WFD_NUM = 259,
  91. WFD_OPTIONS = 260,
  92. WFD_SET_PARAMETER = 261,
  93. WFD_GET_PARAMETER = 262,
  94. WFD_SETUP = 263,
  95. WFD_PLAY = 264,
  96. WFD_TEARDOWN = 265,
  97. WFD_PAUSE = 266,
  98. WFD_END = 267,
  99. WFD_RESPONSE = 268,
  100. WFD_RESPONSE_CODE = 269,
  101. WFD_STRING = 270,
  102. WFD_GENERIC_PROPERTY = 271,
  103. WFD_HEADER = 272,
  104. WFD_CSEQ = 273,
  105. WFD_RESPONSE_METHODS = 274,
  106. WFD_TAG = 275,
  107. WFD_SUPPORT_CHECK = 276,
  108. WFD_REQUEST_URI = 277,
  109. WFD_CONTENT_TYPE = 278,
  110. WFD_MIME = 279,
  111. WFD_CONTENT_LENGTH = 280,
  112. WFD_AUDIO_CODECS = 281,
  113. WFD_VIDEO_FORMATS = 282,
  114. WFD_3D_FORMATS = 283,
  115. WFD_CONTENT_PROTECTION = 284,
  116. WFD_DISPLAY_EDID = 285,
  117. WFD_COUPLED_SINK = 286,
  118. WFD_TRIGGER_METHOD = 287,
  119. WFD_PRESENTATION_URL = 288,
  120. WFD_CLIENT_RTP_PORTS = 289,
  121. WFD_ROUTE = 290,
  122. WFD_I2C = 291,
  123. WFD_AV_FORMAT_CHANGE_TIMING = 292,
  124. WFD_PREFERRED_DISPLAY_MODE = 293,
  125. WFD_UIBC_CAPABILITY = 294,
  126. WFD_UIBC_SETTING = 295,
  127. WFD_STANDBY_RESUME_CAPABILITY = 296,
  128. WFD_STANDBY_IN_REQUEST = 297,
  129. WFD_STANDBY_IN_RESPONSE = 298,
  130. WFD_CONNECTOR_TYPE = 299,
  131. WFD_IDR_REQUEST = 300,
  132. WFD_AUDIO_CODECS_ERROR = 301,
  133. WFD_VIDEO_FORMATS_ERROR = 302,
  134. WFD_3D_FORMATS_ERROR = 303,
  135. WFD_CONTENT_PROTECTION_ERROR = 304,
  136. WFD_DISPLAY_EDID_ERROR = 305,
  137. WFD_COUPLED_SINK_ERROR = 306,
  138. WFD_TRIGGER_METHOD_ERROR = 307,
  139. WFD_PRESENTATION_URL_ERROR = 308,
  140. WFD_CLIENT_RTP_PORTS_ERROR = 309,
  141. WFD_ROUTE_ERROR = 310,
  142. WFD_I2C_ERROR = 311,
  143. WFD_AV_FORMAT_CHANGE_TIMING_ERROR = 312,
  144. WFD_PREFERRED_DISPLAY_MODE_ERROR = 313,
  145. WFD_UIBC_CAPABILITY_ERROR = 314,
  146. WFD_UIBC_SETTING_ERROR = 315,
  147. WFD_STANDBY_RESUME_CAPABILITY_ERROR = 316,
  148. WFD_STANDBY_ERROR = 317,
  149. WFD_CONNECTOR_TYPE_ERROR = 318,
  150. WFD_IDR_REQUEST_ERROR = 319,
  151. WFD_GENERIC_PROPERTY_ERROR = 320,
  152. WFD_NONE = 321,
  153. WFD_AUDIO_CODEC_LPCM = 322,
  154. WFD_AUDIO_CODEC_AAC = 323,
  155. WFD_AUDIO_CODEC_AC3 = 324,
  156. WFD_HDCP_SPEC_2_0 = 325,
  157. WFD_HDCP_SPEC_2_1 = 326,
  158. WFD_IP_PORT = 327,
  159. WFD_PRESENTATION_URL_0 = 328,
  160. WFD_PRESENTATION_URL_1 = 329,
  161. WFD_STREAM_PROFILE = 330,
  162. WFD_MODE_PLAY = 331,
  163. WFD_ROUTE_PRIMARY = 332,
  164. WFD_ROUTE_SECONDARY = 333,
  165. WFD_INPUT_CATEGORY_LIST = 334,
  166. WFD_INPUT_CATEGORY_GENERIC = 335,
  167. WFD_INPUT_CATEGORY_HIDC = 336,
  168. WFD_GENERIC_CAP_LIST = 337,
  169. WFD_INPUT_TYPE_KEYBOARD = 338,
  170. WFD_INPUT_TYPE_MOUSE = 339,
  171. WFD_INPUT_TYPE_SINGLE_TOUCH = 340,
  172. WFD_INPUT_TYPE_MULTI_TOUCH = 341,
  173. WFD_INPUT_TYPE_JOYSTICK = 342,
  174. WFD_INPUT_TYPE_CAMERA = 343,
  175. WFD_INPUT_TYPE_GESTURE = 344,
  176. WFD_INPUT_TYPE_REMOTE_CONTROL = 345,
  177. WFD_HIDC_CAP_LIST = 346,
  178. WFD_INPUT_PATH_INFRARED = 347,
  179. WFD_INPUT_PATH_USB = 348,
  180. WFD_INPUT_PATH_BT = 349,
  181. WFD_INPUT_PATH_WIFI = 350,
  182. WFD_INPUT_PATH_ZIGBEE = 351,
  183. WFD_INPUT_PATH_NOSP = 352,
  184. WFD_UIBC_SETTING_ENABLE = 353,
  185. WFD_UIBC_SETTING_DISABLE = 354,
  186. WFD_SUPPORTED = 355,
  187. WFD_SESSION = 356,
  188. WFD_SESSION_ID = 357,
  189. WFD_TIMEOUT = 358,
  190. WFD_TRANSPORT = 359,
  191. WFD_SERVER_PORT = 360
  192. };
  193. #endif
  194. /* Value type. */
  195. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  196. union YYSTYPE
  197. {
  198. std::string* sval;
  199. unsigned long long int nval;
  200. bool bool_val;
  201. std::vector<std::string>* vsval;
  202. wds::rtsp::Message* message;
  203. wds::rtsp::Header* header;
  204. wds::rtsp::Payload* mpayload;
  205. wds::AudioFormats audio_format;
  206. wds::rtsp::Property* property;
  207. std::vector<unsigned short>* error_list;
  208. wds::rtsp::PropertyErrors* property_errors;
  209. std::map<wds::rtsp::PropertyType, std::shared_ptr<wds::rtsp::PropertyErrors>>* property_error_map;
  210. std::vector<wds::rtsp::H264Codec>* codecs;
  211. wds::rtsp::H264Codec* codec;
  212. std::vector<wds::rtsp::H264Codec3d>* codecs_3d;
  213. wds::rtsp::H264Codec3d* codec_3d;
  214. wds::rtsp::ContentProtection::HDCPSpec hdcp_spec;
  215. wds::rtsp::TriggerMethod::Method trigger_method;
  216. wds::rtsp::Route::Destination route_destination;
  217. bool uibc_setting;
  218. std::vector<wds::rtsp::UIBCCapability::InputCategory>* input_category_list;
  219. std::vector<wds::rtsp::UIBCCapability::InputType>* generic_cap_list;
  220. std::vector<wds::rtsp::UIBCCapability::DetailedCapability>* hidc_cap_list;
  221. wds::rtsp::UIBCCapability::InputCategory input_category_list_value;
  222. wds::rtsp::UIBCCapability::InputType generic_cap_list_value;
  223. wds::rtsp::UIBCCapability::DetailedCapability* hidc_cap_list_value;
  224. wds::rtsp::UIBCCapability::InputPath input_path;
  225. wds::rtsp::Method method;
  226. std::vector<wds::rtsp::Method>* methods;
  227. wds::rtsp::PropertyType parameter;
  228. std::vector<wds::rtsp::PropertyType>* parameters;
  229. std::vector<wds::AudioCodec>* audio_codecs;
  230. wds::AudioCodec* audio_codec;
  231. std::pair<std::string, unsigned int>* session_info;
  232. wds::rtsp::TransportHeader* transport;
  233. };
  234. typedef union YYSTYPE YYSTYPE;
  235. # define YYSTYPE_IS_TRIVIAL 1
  236. # define YYSTYPE_IS_DECLARED 1
  237. #endif
  238. int wds_parse (void* scanner, std::unique_ptr<wds::rtsp::Message>& message);
  239. #endif /* !YY_WDS_GEN_PARSER_H_INCLUDED */