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 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 RTC_DCHECK(!parameters_.encoder_config.streams.empty()); | 2037 RTC_DCHECK(!parameters_.encoder_config.streams.empty()); |
2038 | 2038 |
2039 RTC_CHECK(parameters_.codec_settings); | 2039 RTC_CHECK(parameters_.codec_settings); |
2040 VideoCodecSettings codec_settings = *parameters_.codec_settings; | 2040 VideoCodecSettings codec_settings = *parameters_.codec_settings; |
2041 | 2041 |
2042 webrtc::VideoEncoderConfig encoder_config = | 2042 webrtc::VideoEncoderConfig encoder_config = |
2043 CreateVideoEncoderConfig(last_dimensions_, codec_settings.codec); | 2043 CreateVideoEncoderConfig(last_dimensions_, codec_settings.codec); |
2044 | 2044 |
2045 encoder_config.encoder_specific_settings = ConfigureVideoEncoderSettings( | 2045 encoder_config.encoder_specific_settings = ConfigureVideoEncoderSettings( |
2046 codec_settings.codec, parameters_.options, is_screencast); | 2046 codec_settings.codec, parameters_.options, is_screencast); |
2047 | 2047 stream_->ReconfigureVideoEncoder(encoder_config); |
2048 bool stream_reconfigured = stream_->ReconfigureVideoEncoder(encoder_config); | |
2049 | |
2050 encoder_config.encoder_specific_settings = NULL; | 2048 encoder_config.encoder_specific_settings = NULL; |
2051 | 2049 |
2052 if (!stream_reconfigured) { | |
2053 LOG(LS_WARNING) << "Failed to reconfigure video encoder for dimensions: " | |
2054 << width << "x" << height; | |
2055 return; | |
2056 } | |
2057 | |
2058 parameters_.encoder_config = encoder_config; | 2050 parameters_.encoder_config = encoder_config; |
2059 } | 2051 } |
2060 | 2052 |
2061 void WebRtcVideoChannel2::WebRtcVideoSendStream::Start() { | 2053 void WebRtcVideoChannel2::WebRtcVideoSendStream::Start() { |
2062 rtc::CritScope cs(&lock_); | 2054 rtc::CritScope cs(&lock_); |
2063 RTC_DCHECK(stream_ != NULL); | 2055 RTC_DCHECK(stream_ != NULL); |
2064 stream_->Start(); | 2056 stream_->Start(); |
2065 sending_ = true; | 2057 sending_ = true; |
2066 } | 2058 } |
2067 | 2059 |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2641 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2650 } | 2642 } |
2651 } | 2643 } |
2652 | 2644 |
2653 return video_codecs; | 2645 return video_codecs; |
2654 } | 2646 } |
2655 | 2647 |
2656 } // namespace cricket | 2648 } // namespace cricket |
2657 | 2649 |
2658 #endif // HAVE_WEBRTC_VIDEO | 2650 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |