Chromium Code Reviews| Index: media/cast/video_sender/video_sender.h |
| diff --git a/media/cast/video_sender/video_sender.h b/media/cast/video_sender/video_sender.h |
| index 59792f7693088e94f74de3072de5810d4354efe8..59e9c67cbd42655d74e0f323fabc89c8cd3859b6 100644 |
| --- a/media/cast/video_sender/video_sender.h |
| +++ b/media/cast/video_sender/video_sender.h |
| @@ -18,6 +18,7 @@ |
| #include "media/cast/logging/logging_defines.h" |
| #include "media/cast/rtcp/rtcp.h" |
| #include "media/cast/rtp_timestamp_helper.h" |
| +#include "media/cast/transport/utility/transport_encryption_handler.h" |
| namespace media { |
| class VideoFrame; |
| @@ -44,15 +45,21 @@ class VideoSender : public RtcpSenderFeedback, |
| const VideoSenderConfig& video_config, |
| const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
| const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb, |
| - const CastInitializationCallback& cast_initialization_cb, |
| transport::CastTransportSender* const transport_sender); |
| virtual ~VideoSender(); |
| + CastInitializationStatus InitializationResult() const { |
| + return cast_initialization_status_; |
| + } |
| + |
| // The video_frame must be valid until the closure callback is called. |
| // The closure callback is called from the video encoder thread as soon as |
| // the encoder is done with the frame; it does not mean that the encoded frame |
| // has been sent out. |
| + // |
| + // Note: It is invalid to call this method if InitializationResult() returns |
| + // anything but STATUS_VIDEO_INITIALIZED. |
| void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
| const base::TimeTicks& capture_time); |
| @@ -90,9 +97,11 @@ class VideoSender : public RtcpSenderFeedback, |
| void ReceivedAck(uint32 acked_frame_id); |
| void UpdateFramesInFlight(); |
| - void SendEncodedVideoFrameMainThread( |
| - int requested_bitrate_before_encode, |
| - scoped_ptr<transport::EncodedFrame> encoded_frame); |
| + // Called by the |video_encoder_| with the next EncodeFrame to send. If |
| + // encryption is enabled, |encoded_frame->data| is encrypted before sending |
| + // using |transport_sender_|. |
| + void SendEncodedVideoFrame(int requested_bitrate_before_encode, |
| + scoped_ptr<transport::EncodedFrame> encoded_frame); |
| void InitializeTimers(); |
| @@ -122,6 +131,12 @@ class VideoSender : public RtcpSenderFeedback, |
| // risk getting stuck in a catch-up state forever. |
| CongestionControl congestion_control_; |
| + // Encrypts data in EncodedFrames before they are sent. |
| + transport::TransportEncryptionHandler encryptor_; |
|
Alpha Left Google
2014/06/03 20:01:52
Same here. It is by design to perform encryption i
miu
2014/06/03 21:55:15
Done.
|
| + |
| + // If this sender is ready for use, this is STATUS_VIDEO_INITIALIZED. |
| + CastInitializationStatus cast_initialization_status_; |
| + |
| // This is a "good enough" mapping for finding the RTP timestamp associated |
| // with a video frame. The key is the lowest 8 bits of frame id (which is |
| // what is sent via RTCP). This map is used for logging purposes. The only |