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

Side by Side Diff: media/cast/transport/rtp_sender/rtp_sender.cc

Issue 288103002: [Cast] EncodedAudioFrame+EncodedVideoFrame+reference_time --> EncodedFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | Annotate | Revision Log
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 #include "media/cast/transport/rtp_sender/rtp_sender.h" 5 #include "media/cast/transport/rtp_sender/rtp_sender.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "media/cast/transport/cast_transport_defines.h" 9 #include "media/cast/transport/cast_transport_defines.h"
10 #include "media/cast/transport/pacing/paced_sender.h" 10 #include "media/cast/transport/pacing/paced_sender.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 config_.audio = false; 49 config_.audio = false;
50 config_.ssrc = config.rtp.config.ssrc; 50 config_.ssrc = config.rtp.config.ssrc;
51 config_.payload_type = config.rtp.config.payload_type; 51 config_.payload_type = config.rtp.config.payload_type;
52 config_.frequency = kVideoFrequency; 52 config_.frequency = kVideoFrequency;
53 config_.video_codec = config.codec; 53 config_.video_codec = config.codec;
54 packetizer_.reset(new RtpPacketizer(transport_, storage_.get(), config_)); 54 packetizer_.reset(new RtpPacketizer(transport_, storage_.get(), config_));
55 return true; 55 return true;
56 } 56 }
57 57
58 void RtpSender::IncomingEncodedVideoFrame(const EncodedVideoFrame* video_frame, 58 void RtpSender::SendFrame(const EncodedFrame& frame) {
59 const base::TimeTicks& capture_time) {
60 DCHECK(packetizer_); 59 DCHECK(packetizer_);
61 packetizer_->IncomingEncodedVideoFrame(video_frame, capture_time); 60 packetizer_->SendFrameAsPackets(frame);
62 }
63
64 void RtpSender::IncomingEncodedAudioFrame(
65 const EncodedAudioFrame* audio_frame,
66 const base::TimeTicks& recorded_time) {
67 DCHECK(packetizer_);
68 packetizer_->IncomingEncodedAudioFrame(audio_frame, recorded_time);
69 } 61 }
70 62
71 void RtpSender::ResendPackets( 63 void RtpSender::ResendPackets(
72 const MissingFramesAndPacketsMap& missing_frames_and_packets) { 64 const MissingFramesAndPacketsMap& missing_frames_and_packets) {
73 DCHECK(storage_); 65 DCHECK(storage_);
74 // Iterate over all frames in the list. 66 // Iterate over all frames in the list.
75 for (MissingFramesAndPacketsMap::const_iterator it = 67 for (MissingFramesAndPacketsMap::const_iterator it =
76 missing_frames_and_packets.begin(); 68 missing_frames_and_packets.begin();
77 it != missing_frames_and_packets.end(); 69 it != missing_frames_and_packets.end();
78 ++it) { 70 ++it) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void RtpSender::UpdateSequenceNumber(Packet* packet) { 124 void RtpSender::UpdateSequenceNumber(Packet* packet) {
133 uint16 new_sequence_number = packetizer_->NextSequenceNumber(); 125 uint16 new_sequence_number = packetizer_->NextSequenceNumber();
134 int index = 2; 126 int index = 2;
135 (*packet)[index] = (static_cast<uint8>(new_sequence_number)); 127 (*packet)[index] = (static_cast<uint8>(new_sequence_number));
136 (*packet)[index + 1] = (static_cast<uint8>(new_sequence_number >> 8)); 128 (*packet)[index + 1] = (static_cast<uint8>(new_sequence_number >> 8));
137 } 129 }
138 130
139 } // namespace transport 131 } // namespace transport
140 } // namespace cast 132 } // namespace cast
141 } // namespace media 133 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/transport/rtp_sender/rtp_sender.h ('k') | media/cast/transport/transport_audio_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698