- add sources.
[platform/framework/web/crosswalk.git] / src / media / cast / rtp_receiver / rtp_parser / rtp_parser.h
1 // Copyright 2013 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_CAST_RTP_RECEIVER_RTP_PARSER_RTP_PARSER_H_
6 #define MEDIA_CAST_RTP_RECEIVER_RTP_PARSER_RTP_PARSER_H_
7
8 #include "media/cast/rtp_common/rtp_defines.h"
9
10 namespace media {
11 namespace cast {
12
13 class RtpData;
14
15 struct RtpParserConfig {
16   RtpParserConfig() {
17     ssrc = 0;
18     payload_type = 0;
19     audio_channels = 0;
20   }
21
22   uint32 ssrc;
23   int payload_type;
24   AudioCodec audio_codec;
25   VideoCodec video_codec;
26   int audio_channels;
27 };
28
29 class RtpParser {
30  public:
31   RtpParser(RtpData* incoming_payload_callback,
32             const RtpParserConfig parser_config);
33
34   ~RtpParser();
35
36   bool ParsePacket(const uint8* packet, size_t length,
37                    RtpCastHeader* rtp_header);
38
39  private:
40   bool ParseCommon(const uint8* packet, size_t length,
41                    RtpCastHeader* rtp_header);
42
43   bool ParseCast(const uint8* packet, size_t length,
44                  RtpCastHeader* rtp_header);
45
46   RtpData* data_callback_;
47   RtpParserConfig parser_config_;
48 };
49
50 }  // namespace cast
51 }  // namespace media
52
53 #endif  // MEDIA_CAST_RTP_RECEIVER_RTP_PARSER_RTP_PARSER_H_