OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/receiver/cast_receiver_impl.h" | 5 #include "media/cast/receiver/cast_receiver_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 CastReceiverImpl::CastReceiverImpl( | 28 CastReceiverImpl::CastReceiverImpl( |
29 scoped_refptr<CastEnvironment> cast_environment, | 29 scoped_refptr<CastEnvironment> cast_environment, |
30 const FrameReceiverConfig& audio_config, | 30 const FrameReceiverConfig& audio_config, |
31 const FrameReceiverConfig& video_config, | 31 const FrameReceiverConfig& video_config, |
32 CastTransportSender* const transport) | 32 CastTransportSender* const transport) |
33 : cast_environment_(cast_environment), | 33 : cast_environment_(cast_environment), |
34 audio_receiver_(cast_environment, audio_config, AUDIO_EVENT, transport), | 34 audio_receiver_(cast_environment, audio_config, AUDIO_EVENT, transport), |
35 video_receiver_(cast_environment, video_config, VIDEO_EVENT, transport), | 35 video_receiver_(cast_environment, video_config, VIDEO_EVENT, transport), |
36 ssrc_of_audio_sender_(audio_config.incoming_ssrc), | 36 ssrc_of_audio_sender_(audio_config.sender_ssrc), |
37 ssrc_of_video_sender_(video_config.incoming_ssrc), | 37 ssrc_of_video_sender_(video_config.sender_ssrc), |
38 num_audio_channels_(audio_config.channels), | 38 num_audio_channels_(audio_config.channels), |
39 audio_sampling_rate_(audio_config.rtp_timebase), | 39 audio_sampling_rate_(audio_config.rtp_timebase), |
40 audio_codec_(audio_config.codec), | 40 audio_codec_(audio_config.codec), |
41 video_codec_(video_config.codec) {} | 41 video_codec_(video_config.codec) {} |
42 | 42 |
43 CastReceiverImpl::~CastReceiverImpl() {} | 43 CastReceiverImpl::~CastReceiverImpl() {} |
44 | 44 |
45 void CastReceiverImpl::ReceivePacket(scoped_ptr<Packet> packet) { | 45 void CastReceiverImpl::ReceivePacket(scoped_ptr<Packet> packet) { |
46 const uint8_t* const data = &packet->front(); | 46 const uint8_t* const data = &packet->front(); |
47 const size_t length = packet->size(); | 47 const size_t length = packet->size(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 TRACE_EVENT_INSTANT1( | 211 TRACE_EVENT_INSTANT1( |
212 "cast_perf_test", "FrameDecoded", | 212 "cast_perf_test", "FrameDecoded", |
213 TRACE_EVENT_SCOPE_THREAD, | 213 TRACE_EVENT_SCOPE_THREAD, |
214 "rtp_timestamp", rtp_timestamp); | 214 "rtp_timestamp", rtp_timestamp); |
215 } | 215 } |
216 callback.Run(video_frame, playout_time, is_continuous); | 216 callback.Run(video_frame, playout_time, is_continuous); |
217 } | 217 } |
218 | 218 |
219 } // namespace cast | 219 } // namespace cast |
220 } // namespace media | 220 } // namespace media |
OLD | NEW |