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 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 } | 1736 } |
1737 | 1737 |
1738 bool VideoChannel::SetVideoSend(uint32 ssrc, | 1738 bool VideoChannel::SetVideoSend(uint32 ssrc, |
1739 bool mute, | 1739 bool mute, |
1740 const VideoOptions* options) { | 1740 const VideoOptions* options) { |
1741 return InvokeOnWorker(Bind(&VideoMediaChannel::SetVideoSend, media_channel(), | 1741 return InvokeOnWorker(Bind(&VideoMediaChannel::SetVideoSend, media_channel(), |
1742 ssrc, mute, options)); | 1742 ssrc, mute, options)); |
1743 } | 1743 } |
1744 | 1744 |
1745 void VideoChannel::ChangeState() { | 1745 void VideoChannel::ChangeState() { |
1746 // Render incoming data if we're the active call, and we have the local | |
1747 // content. We receive data on the default channel and multiplexed streams. | |
1748 bool recv = IsReadyToReceive(); | |
1749 if (!media_channel()->SetRender(recv)) { | |
1750 LOG(LS_ERROR) << "Failed to SetRender on video channel"; | |
1751 // TODO(gangji): Report error back to server. | |
1752 } | |
1753 | |
1754 // Send outgoing data if we're the active call, we have the remote content, | 1746 // Send outgoing data if we're the active call, we have the remote content, |
1755 // and we have had some form of connectivity. | 1747 // and we have had some form of connectivity. |
1756 bool send = IsReadyToSend(); | 1748 bool send = IsReadyToSend(); |
1757 if (!media_channel()->SetSend(send)) { | 1749 if (!media_channel()->SetSend(send)) { |
1758 LOG(LS_ERROR) << "Failed to SetSend on video channel"; | 1750 LOG(LS_ERROR) << "Failed to SetSend on video channel"; |
1759 // TODO(gangji): Report error back to server. | 1751 // TODO(gangji): Report error back to server. |
1760 } | 1752 } |
1761 | 1753 |
1762 LOG(LS_INFO) << "Changing video state, recv=" << recv << " send=" << send; | 1754 LOG(LS_INFO) << "Changing video state, send=" << send; |
1763 } | 1755 } |
1764 | 1756 |
1765 bool VideoChannel::GetStats(VideoMediaInfo* stats) { | 1757 bool VideoChannel::GetStats(VideoMediaInfo* stats) { |
1766 return InvokeOnWorker( | 1758 return InvokeOnWorker( |
1767 Bind(&VideoMediaChannel::GetStats, media_channel(), stats)); | 1759 Bind(&VideoMediaChannel::GetStats, media_channel(), stats)); |
1768 } | 1760 } |
1769 | 1761 |
1770 void VideoChannel::StartMediaMonitor(int cms) { | 1762 void VideoChannel::StartMediaMonitor(int cms) { |
1771 media_monitor_.reset(new VideoMediaMonitor(media_channel(), worker_thread(), | 1763 media_monitor_.reset(new VideoMediaMonitor(media_channel(), worker_thread(), |
1772 rtc::Thread::Current())); | 1764 rtc::Thread::Current())); |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 return (data_channel_type_ == DCT_RTP); | 2403 return (data_channel_type_ == DCT_RTP); |
2412 } | 2404 } |
2413 | 2405 |
2414 void DataChannel::OnStreamClosedRemotely(uint32 sid) { | 2406 void DataChannel::OnStreamClosedRemotely(uint32 sid) { |
2415 rtc::TypedMessageData<uint32>* message = | 2407 rtc::TypedMessageData<uint32>* message = |
2416 new rtc::TypedMessageData<uint32>(sid); | 2408 new rtc::TypedMessageData<uint32>(sid); |
2417 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 2409 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); |
2418 } | 2410 } |
2419 | 2411 |
2420 } // namespace cricket | 2412 } // namespace cricket |
OLD | NEW |