Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Implement Holmer@ comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_ 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_
11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_ 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_
12 12
13 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
13 #include "webrtc/modules/rtp_rtcp/source/rtp_packet.h" 14 #include "webrtc/modules/rtp_rtcp/source/rtp_packet.h"
14 15
15 namespace webrtc { 16 namespace webrtc {
16 // Class to hold rtp packet with metadata for sender side. 17 // Class to hold rtp packet with metadata for sender side.
17 class RtpPacketToSend : public rtp::Packet { 18 class RtpPacketToSend : public rtp::Packet {
18 public: 19 public:
19 explicit RtpPacketToSend(const ExtensionManager* extensions) 20 explicit RtpPacketToSend(const ExtensionManager* extensions)
20 : Packet(extensions) {} 21 : Packet(extensions) {}
21 RtpPacketToSend(const RtpPacketToSend& packet) = default; 22 RtpPacketToSend(const RtpPacketToSend& packet) = default;
22 RtpPacketToSend(const ExtensionManager* extensions, size_t capacity) 23 RtpPacketToSend(const ExtensionManager* extensions, size_t capacity)
23 : Packet(extensions, capacity) {} 24 : Packet(extensions, capacity) {}
24 25
25 RtpPacketToSend& operator=(const RtpPacketToSend& packet) = default; 26 RtpPacketToSend& operator=(const RtpPacketToSend& packet) = default;
27
26 // Time in local time base as close as it can to frame capture time. 28 // Time in local time base as close as it can to frame capture time.
27 int64_t capture_time_ms() const { return capture_time_ms_; } 29 int64_t capture_time_ms() const { return capture_time_ms_; }
30
28 void set_capture_time_ms(int64_t time) { capture_time_ms_ = time; } 31 void set_capture_time_ms(int64_t time) { capture_time_ms_ = time; }
29 32
33 void set_packetization_finish_time_ms(int64_t time) {
34 SetExtension<VideoTimingExtension>(
35 VideoTiming::GetDeltaCappedMs(capture_time_ms_, time),
36 VideoTiming::kPacketizationFinishDeltaIdx);
37 }
38
39 void set_pacer_exit_time_ms(int64_t time) {
40 SetExtension<VideoTimingExtension>(
41 VideoTiming::GetDeltaCappedMs(capture_time_ms_, time),
42 VideoTiming::kPacerExitDeltaIdx);
43 }
44
45 void set_network_time_ms(int64_t time) {
46 SetExtension<VideoTimingExtension>(
47 VideoTiming::GetDeltaCappedMs(capture_time_ms_, time),
48 VideoTiming::kNetworkTimestampDeltaIdx);
49 }
50
51 void set_network2_time_ms(int64_t time) {
52 SetExtension<VideoTimingExtension>(
53 VideoTiming::GetDeltaCappedMs(capture_time_ms_, time),
54 VideoTiming::kNetwork2TimestampDeltaIdx);
55 }
56
30 private: 57 private:
31 int64_t capture_time_ms_ = 0; 58 int64_t capture_time_ms_ = 0;
32 }; 59 };
33 60
34 } // namespace webrtc 61 } // namespace webrtc
35 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_ 62 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_TO_SEND_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698