| 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/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 void InProcessReceiver::StartOnMainThread() { | 75 void InProcessReceiver::StartOnMainThread() { |
| 76 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 76 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 77 | 77 |
| 78 DCHECK(!transport_ && !cast_receiver_); | 78 DCHECK(!transport_ && !cast_receiver_); |
| 79 transport_.reset( | 79 transport_.reset( |
| 80 new UdpTransport(NULL, | 80 new UdpTransport(NULL, |
| 81 cast_environment_->GetTaskRunner(CastEnvironment::MAIN), | 81 cast_environment_->GetTaskRunner(CastEnvironment::MAIN), |
| 82 local_end_point_, | 82 local_end_point_, |
| 83 remote_end_point_, | 83 remote_end_point_, |
| 84 65536, |
| 84 base::Bind(&InProcessReceiver::UpdateCastTransportStatus, | 85 base::Bind(&InProcessReceiver::UpdateCastTransportStatus, |
| 85 base::Unretained(this)))); | 86 base::Unretained(this)))); |
| 86 cast_receiver_ = CastReceiver::Create( | 87 cast_receiver_ = CastReceiver::Create( |
| 87 cast_environment_, audio_config_, video_config_, transport_.get()); | 88 cast_environment_, audio_config_, video_config_, transport_.get()); |
| 88 | 89 |
| 89 // TODO(hubbe): Make the cast receiver do this automatically. | 90 // TODO(hubbe): Make the cast receiver do this automatically. |
| 90 transport_->StartReceiving(cast_receiver_->packet_receiver()); | 91 transport_->StartReceiving(cast_receiver_->packet_receiver()); |
| 91 | 92 |
| 92 PullNextAudioFrame(); | 93 PullNextAudioFrame(); |
| 93 PullNextVideoFrame(); | 94 PullNextVideoFrame(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 120 } | 121 } |
| 121 | 122 |
| 122 void InProcessReceiver::PullNextVideoFrame() { | 123 void InProcessReceiver::PullNextVideoFrame() { |
| 123 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 124 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 124 cast_receiver_->RequestDecodedVideoFrame(base::Bind( | 125 cast_receiver_->RequestDecodedVideoFrame(base::Bind( |
| 125 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); | 126 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); |
| 126 } | 127 } |
| 127 | 128 |
| 128 } // namespace cast | 129 } // namespace cast |
| 129 } // namespace media | 130 } // namespace media |
| OLD | NEW |