OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_STEREO_H_ |
| 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_STEREO_H_ |
| 12 |
| 13 #include <string> |
| 14 |
| 15 #include "common_types.h" |
| 16 #include "modules/rtp_rtcp/source/rtp_format.h" |
| 17 #include "modules/rtp_rtcp/source/rtp_format_vp9.h" |
| 18 #include "rtc_base/constructormagic.h" |
| 19 #include "typedefs.h" |
| 20 |
| 21 namespace webrtc { |
| 22 namespace RtpFormatVideoStereo { |
| 23 static const uint8_t kFirstPacketBit = 0x02; |
| 24 } // namespace RtpFormatVideoStereo |
| 25 |
| 26 class RtpPacketizerStereo : public RtpPacketizer { |
| 27 public: |
| 28 RtpPacketizerStereo(size_t max_payload_len, |
| 29 size_t last_packet_reduction_len, |
| 30 const RTPVideoTypeHeader* rtp_type_header, |
| 31 const RTPVideoStereoInfo* stereoInfo); |
| 32 |
| 33 virtual ~RtpPacketizerStereo(); |
| 34 |
| 35 // Returns total number of packets to be generated. |
| 36 size_t SetPayloadData(const uint8_t* payload_data, |
| 37 size_t payload_size, |
| 38 const RTPFragmentationHeader* fragmentation) override; |
| 39 |
| 40 // Get the next payload with generic payload header. |
| 41 // Write payload and set marker bit of the |packet|. |
| 42 // Returns true on success, false otherwise. |
| 43 bool NextPacket(RtpPacketToSend* packet) override; |
| 44 |
| 45 ProtectionType GetProtectionType(); |
| 46 |
| 47 StorageType GetStorageType(uint32_t retransmission_settings); |
| 48 |
| 49 std::string ToString() override; |
| 50 |
| 51 private: |
| 52 const size_t max_payload_len_; |
| 53 const size_t last_packet_reduction_len_; |
| 54 uint8_t header_marker_; |
| 55 std::unique_ptr<RtpPacketizer> packetizer_; |
| 56 const RTPVideoStereoInfo* stereoInfo_; |
| 57 |
| 58 RTC_DISALLOW_COPY_AND_ASSIGN(RtpPacketizerStereo); |
| 59 }; |
| 60 |
| 61 class RtpDepacketizerStereo : public RtpDepacketizer { |
| 62 public: |
| 63 virtual ~RtpDepacketizerStereo() {} |
| 64 |
| 65 bool Parse(ParsedPayload* parsed_payload, |
| 66 const uint8_t* payload_data, |
| 67 size_t payload_data_length) override; |
| 68 |
| 69 private: |
| 70 RtpDepacketizerVp9 depacketizer_; |
| 71 }; |
| 72 } // namespace webrtc |
| 73 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_STEREO_H_ |
OLD | NEW |