| 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/test/utility/in_process_receiver.h" | 5 #include "media/cast/test/utility/in_process_receiver.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
| 10 #include "media/cast/cast_config.h" | 10 #include "media/cast/cast_config.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 60 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 61 | 61 |
| 62 DCHECK(!transport_ && !cast_receiver_); | 62 DCHECK(!transport_ && !cast_receiver_); |
| 63 transport_.reset( | 63 transport_.reset( |
| 64 new UdpTransport(NULL, | 64 new UdpTransport(NULL, |
| 65 cast_environment_->GetTaskRunner(CastEnvironment::MAIN), | 65 cast_environment_->GetTaskRunner(CastEnvironment::MAIN), |
| 66 local_end_point_, | 66 local_end_point_, |
| 67 remote_end_point_, | 67 remote_end_point_, |
| 68 base::Bind(&InProcessReceiver::UpdateCastTransportStatus, | 68 base::Bind(&InProcessReceiver::UpdateCastTransportStatus, |
| 69 base::Unretained(this)))); | 69 base::Unretained(this)))); |
| 70 cast_receiver_.reset(CastReceiver::CreateCastReceiver( | 70 cast_receiver_ = CastReceiver::Create( |
| 71 cast_environment_, audio_config_, video_config_, transport_.get())); | 71 cast_environment_, audio_config_, video_config_, transport_.get()); |
| 72 | 72 |
| 73 // TODO(hubbe): Make the cast receiver do this automatically. | 73 // TODO(hubbe): Make the cast receiver do this automatically. |
| 74 transport_->StartReceiving(cast_receiver_->packet_receiver()); | 74 transport_->StartReceiving(cast_receiver_->packet_receiver()); |
| 75 | 75 |
| 76 PullNextAudioFrame(); | 76 PullNextAudioFrame(); |
| 77 PullNextVideoFrame(); | 77 PullNextVideoFrame(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void InProcessReceiver::GotAudioFrame(scoped_ptr<PcmAudioFrame> audio_frame, | 80 void InProcessReceiver::GotAudioFrame(scoped_ptr<PcmAudioFrame> audio_frame, |
| 81 const base::TimeTicks& playout_time) { | 81 const base::TimeTicks& playout_time) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); | 117 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // static | 120 // static |
| 121 void InProcessReceiver::WillDestroyReceiver(InProcessReceiver* receiver) { | 121 void InProcessReceiver::WillDestroyReceiver(InProcessReceiver* receiver) { |
| 122 DCHECK(receiver->cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 122 DCHECK(receiver->cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace cast | 125 } // namespace cast |
| 126 } // namespace media | 126 } // namespace media |
| OLD | NEW |