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

Side by Side Diff: media/cast/video_receiver/video_receiver.h

Issue 62843002: Cast: Added support for AES-CTR crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 7 years, 1 month 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 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ 5 #ifndef MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_
6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ 6 #define MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/threading/non_thread_safe.h" 13 #include "base/threading/non_thread_safe.h"
14 #include "base/time/tick_clock.h" 14 #include "base/time/tick_clock.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "crypto/encryptor.h"
16 #include "media/cast/cast_config.h" 17 #include "media/cast/cast_config.h"
17 #include "media/cast/cast_environment.h" 18 #include "media/cast/cast_environment.h"
18 #include "media/cast/cast_receiver.h" 19 #include "media/cast/cast_receiver.h"
19 #include "media/cast/rtcp/rtcp.h" 20 #include "media/cast/rtcp/rtcp.h"
20 #include "media/cast/rtp_common/rtp_defines.h" 21 #include "media/cast/rtp_common/rtp_defines.h"
21 #include "media/cast/rtp_receiver/rtp_receiver.h" 22 #include "media/cast/rtp_receiver/rtp_receiver.h"
22 23
23 namespace media { 24 namespace media {
24 namespace cast { 25 namespace cast {
25 26
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 friend class LocalRtpVideoData; 68 friend class LocalRtpVideoData;
68 friend class LocalRtpVideoFeedback; 69 friend class LocalRtpVideoFeedback;
69 70
70 void CastFeedback(const RtcpCastMessage& cast_message); 71 void CastFeedback(const RtcpCastMessage& cast_message);
71 void RequestKeyFrame(); 72 void RequestKeyFrame();
72 73
73 void DecodeVideoFrame(const VideoFrameDecodedCallback& callback, 74 void DecodeVideoFrame(const VideoFrameDecodedCallback& callback,
74 scoped_ptr<EncodedVideoFrame> encoded_frame, 75 scoped_ptr<EncodedVideoFrame> encoded_frame,
75 const base::TimeTicks& render_time); 76 const base::TimeTicks& render_time);
76 77
78 bool DecryptVideoFrame(const EncodedVideoFrame* encrypted_video_frame,
79 EncodedVideoFrame* encoded_frame);
80
77 bool PullEncodedVideoFrame(uint32 rtp_timestamp, 81 bool PullEncodedVideoFrame(uint32 rtp_timestamp,
78 bool next_frame, 82 bool next_frame,
79 scoped_ptr<EncodedVideoFrame>* encoded_frame, 83 scoped_ptr<EncodedVideoFrame>* encoded_frame,
80 base::TimeTicks* render_time); 84 base::TimeTicks* render_time);
81 85
82 void PlayoutTimeout(); 86 void PlayoutTimeout();
83 87
84 // Returns Render time based on current time and the rtp timestamp. 88 // Returns Render time based on current time and the rtp timestamp.
85 base::TimeTicks GetRenderTime(base::TimeTicks now, uint32 rtp_timestamp); 89 base::TimeTicks GetRenderTime(base::TimeTicks now, uint32 rtp_timestamp);
86 90
(...skipping 15 matching lines...) Expand all
102 const VideoCodec codec_; 106 const VideoCodec codec_;
103 const uint32 incoming_ssrc_; 107 const uint32 incoming_ssrc_;
104 base::TimeDelta target_delay_delta_; 108 base::TimeDelta target_delay_delta_;
105 base::TimeDelta frame_delay_; 109 base::TimeDelta frame_delay_;
106 scoped_ptr<LocalRtpVideoData> incoming_payload_callback_; 110 scoped_ptr<LocalRtpVideoData> incoming_payload_callback_;
107 scoped_ptr<LocalRtpVideoFeedback> incoming_payload_feedback_; 111 scoped_ptr<LocalRtpVideoFeedback> incoming_payload_feedback_;
108 RtpReceiver rtp_receiver_; 112 RtpReceiver rtp_receiver_;
109 scoped_ptr<Rtcp> rtcp_; 113 scoped_ptr<Rtcp> rtcp_;
110 scoped_ptr<RtpReceiverStatistics> rtp_video_receiver_statistics_; 114 scoped_ptr<RtpReceiverStatistics> rtp_video_receiver_statistics_;
111 base::TimeTicks time_last_sent_cast_message_; 115 base::TimeTicks time_last_sent_cast_message_;
112 // Sender-receiver offset estimation. 116 base::TimeDelta time_offset_; // Sender-receiver offset estimation.
113 base::TimeDelta time_offset_; 117 scoped_ptr<crypto::Encryptor> encryptor_;
114 118 std::string iv_mask_;
115 std::list<VideoFrameEncodedCallback> queued_encoded_callbacks_; 119 std::list<VideoFrameEncodedCallback> queued_encoded_callbacks_;
116
117 base::WeakPtrFactory<VideoReceiver> weak_factory_; 120 base::WeakPtrFactory<VideoReceiver> weak_factory_;
118 121
119 DISALLOW_COPY_AND_ASSIGN(VideoReceiver); 122 DISALLOW_COPY_AND_ASSIGN(VideoReceiver);
120 }; 123 };
121 124
122 } // namespace cast 125 } // namespace cast
123 } // namespace media 126 } // namespace media
124 127
125 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_ 128 #endif // MEDIA_CAST_VIDEO_RECEIVER_VIDEO_RECEIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698