| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer( | 1776 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer( |
| 1777 VideoCapturer* capturer) { | 1777 VideoCapturer* capturer) { |
| 1778 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetCapturer"); | 1778 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetCapturer"); |
| 1779 if (!DisconnectCapturer() && capturer == NULL) { | 1779 if (!DisconnectCapturer() && capturer == NULL) { |
| 1780 return false; | 1780 return false; |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 { | 1783 { |
| 1784 rtc::CritScope cs(&lock_); | 1784 rtc::CritScope cs(&lock_); |
| 1785 | 1785 |
| 1786 // Reset timestamps to realign new incoming frames to a webrtc timestamp. A |
| 1787 // new capturer may have a different timestamp delta than the previous one. |
| 1788 first_frame_timestamp_ms_ = 0; |
| 1789 |
| 1786 if (capturer == NULL) { | 1790 if (capturer == NULL) { |
| 1787 if (stream_ != NULL) { | 1791 if (stream_ != NULL) { |
| 1788 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; | 1792 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; |
| 1789 webrtc::VideoFrame black_frame; | 1793 webrtc::VideoFrame black_frame; |
| 1790 | 1794 |
| 1791 CreateBlackFrame(&black_frame, last_dimensions_.width, | 1795 CreateBlackFrame(&black_frame, last_dimensions_.width, |
| 1792 last_dimensions_.height); | 1796 last_dimensions_.height); |
| 1793 | 1797 |
| 1794 // Force this black frame not to be dropped due to timestamp order | 1798 // Force this black frame not to be dropped due to timestamp order |
| 1795 // check. As IncomingCapturedFrame will drop the frame if this frame's | 1799 // check. As IncomingCapturedFrame will drop the frame if this frame's |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2643 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2640 } | 2644 } |
| 2641 } | 2645 } |
| 2642 | 2646 |
| 2643 return video_codecs; | 2647 return video_codecs; |
| 2644 } | 2648 } |
| 2645 | 2649 |
| 2646 } // namespace cricket | 2650 } // namespace cricket |
| 2647 | 2651 |
| 2648 #endif // HAVE_WEBRTC_VIDEO | 2652 #endif // HAVE_WEBRTC_VIDEO |
| OLD | NEW |