Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1352433002: Reset frame timestamp epoch for new capturers. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@46
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « talk/media/base/fakevideocapturer.h ('k') | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « talk/media/base/fakevideocapturer.h ('k') | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698