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 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer( | 1874 bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer( |
1875 VideoCapturer* capturer) { | 1875 VideoCapturer* capturer) { |
1876 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetCapturer"); | 1876 TRACE_EVENT0("webrtc", "WebRtcVideoSendStream::SetCapturer"); |
1877 if (!DisconnectCapturer() && capturer == NULL) { | 1877 if (!DisconnectCapturer() && capturer == NULL) { |
1878 return false; | 1878 return false; |
1879 } | 1879 } |
1880 | 1880 |
1881 { | 1881 { |
1882 rtc::CritScope cs(&lock_); | 1882 rtc::CritScope cs(&lock_); |
1883 | 1883 |
| 1884 // Reset timestamps to realign new incoming frames to a webrtc timestamp. A |
| 1885 // new capturer may have a different timestamp delta than the previous one. |
| 1886 first_frame_timestamp_ms_ = 0; |
| 1887 |
1884 if (capturer == NULL) { | 1888 if (capturer == NULL) { |
1885 if (stream_ != NULL) { | 1889 if (stream_ != NULL) { |
1886 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; | 1890 LOG(LS_VERBOSE) << "Disabling capturer, sending black frame."; |
1887 webrtc::VideoFrame black_frame; | 1891 webrtc::VideoFrame black_frame; |
1888 | 1892 |
1889 CreateBlackFrame(&black_frame, last_dimensions_.width, | 1893 CreateBlackFrame(&black_frame, last_dimensions_.width, |
1890 last_dimensions_.height); | 1894 last_dimensions_.height); |
1891 | 1895 |
1892 // Force this black frame not to be dropped due to timestamp order | 1896 // Force this black frame not to be dropped due to timestamp order |
1893 // check. As IncomingCapturedFrame will drop the frame if this frame's | 1897 // check. As IncomingCapturedFrame will drop the frame if this frame's |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2788 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2792 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2789 } | 2793 } |
2790 } | 2794 } |
2791 | 2795 |
2792 return video_codecs; | 2796 return video_codecs; |
2793 } | 2797 } |
2794 | 2798 |
2795 } // namespace cricket | 2799 } // namespace cricket |
2796 | 2800 |
2797 #endif // HAVE_WEBRTC_VIDEO | 2801 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |