| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 VideoChannel::VideoChannel(rtc::Thread* thread, | 1643 VideoChannel::VideoChannel(rtc::Thread* thread, |
| 1644 VideoMediaChannel* media_channel, | 1644 VideoMediaChannel* media_channel, |
| 1645 TransportController* transport_controller, | 1645 TransportController* transport_controller, |
| 1646 const std::string& content_name, | 1646 const std::string& content_name, |
| 1647 bool rtcp) | 1647 bool rtcp) |
| 1648 : BaseChannel(thread, | 1648 : BaseChannel(thread, |
| 1649 media_channel, | 1649 media_channel, |
| 1650 transport_controller, | 1650 transport_controller, |
| 1651 content_name, | 1651 content_name, |
| 1652 rtcp), | 1652 rtcp), |
| 1653 renderer_(NULL), | |
| 1654 previous_we_(rtc::WE_CLOSE) {} | 1653 previous_we_(rtc::WE_CLOSE) {} |
| 1655 | 1654 |
| 1656 bool VideoChannel::Init() { | 1655 bool VideoChannel::Init() { |
| 1657 if (!BaseChannel::Init()) { | 1656 if (!BaseChannel::Init()) { |
| 1658 return false; | 1657 return false; |
| 1659 } | 1658 } |
| 1660 return true; | 1659 return true; |
| 1661 } | 1660 } |
| 1662 | 1661 |
| 1663 VideoChannel::~VideoChannel() { | 1662 VideoChannel::~VideoChannel() { |
| 1664 std::vector<uint32_t> screencast_ssrcs; | 1663 std::vector<uint32_t> screencast_ssrcs; |
| 1665 ScreencastMap::iterator iter; | 1664 ScreencastMap::iterator iter; |
| 1666 while (!screencast_capturers_.empty()) { | 1665 while (!screencast_capturers_.empty()) { |
| 1667 if (!RemoveScreencast(screencast_capturers_.begin()->first)) { | 1666 if (!RemoveScreencast(screencast_capturers_.begin()->first)) { |
| 1668 LOG(LS_ERROR) << "Unable to delete screencast with ssrc " | 1667 LOG(LS_ERROR) << "Unable to delete screencast with ssrc " |
| 1669 << screencast_capturers_.begin()->first; | 1668 << screencast_capturers_.begin()->first; |
| 1670 ASSERT(false); | 1669 ASSERT(false); |
| 1671 break; | 1670 break; |
| 1672 } | 1671 } |
| 1673 } | 1672 } |
| 1674 | 1673 |
| 1675 StopMediaMonitor(); | 1674 StopMediaMonitor(); |
| 1676 // this can't be done in the base class, since it calls a virtual | 1675 // this can't be done in the base class, since it calls a virtual |
| 1677 DisableMedia_w(); | 1676 DisableMedia_w(); |
| 1678 | 1677 |
| 1679 Deinit(); | 1678 Deinit(); |
| 1680 } | 1679 } |
| 1681 | 1680 |
| 1682 bool VideoChannel::SetRenderer(uint32_t ssrc, VideoRenderer* renderer) { | 1681 bool VideoChannel::SetSink(uint32_t ssrc, |
| 1683 worker_thread()->Invoke<void>(Bind( | 1682 rtc::VideoSinkInterface<VideoFrame>* sink) { |
| 1684 &VideoMediaChannel::SetRenderer, media_channel(), ssrc, renderer)); | 1683 worker_thread()->Invoke<void>( |
| 1684 Bind(&VideoMediaChannel::SetSink, media_channel(), ssrc, sink)); |
| 1685 return true; | 1685 return true; |
| 1686 } | 1686 } |
| 1687 | 1687 |
| 1688 bool VideoChannel::AddScreencast(uint32_t ssrc, VideoCapturer* capturer) { | 1688 bool VideoChannel::AddScreencast(uint32_t ssrc, VideoCapturer* capturer) { |
| 1689 return worker_thread()->Invoke<bool>(Bind( | 1689 return worker_thread()->Invoke<bool>(Bind( |
| 1690 &VideoChannel::AddScreencast_w, this, ssrc, capturer)); | 1690 &VideoChannel::AddScreencast_w, this, ssrc, capturer)); |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 bool VideoChannel::SetCapturer(uint32_t ssrc, VideoCapturer* capturer) { | 1693 bool VideoChannel::SetCapturer(uint32_t ssrc, VideoCapturer* capturer) { |
| 1694 return InvokeOnWorker(Bind(&VideoMediaChannel::SetCapturer, | 1694 return InvokeOnWorker(Bind(&VideoMediaChannel::SetCapturer, |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); | 2265 return (data_channel_type_ == DCT_RTP) && BaseChannel::ShouldSetupDtlsSrtp(); |
| 2266 } | 2266 } |
| 2267 | 2267 |
| 2268 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { | 2268 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { |
| 2269 rtc::TypedMessageData<uint32_t>* message = | 2269 rtc::TypedMessageData<uint32_t>* message = |
| 2270 new rtc::TypedMessageData<uint32_t>(sid); | 2270 new rtc::TypedMessageData<uint32_t>(sid); |
| 2271 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 2271 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); |
| 2272 } | 2272 } |
| 2273 | 2273 |
| 2274 } // namespace cricket | 2274 } // namespace cricket |
| OLD | NEW |