| Index: webrtc/video/video_receive_stream.cc
|
| diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc
|
| index 01568cb3df5301c0cf0c021000bcab1ef2f112fb..6e9633f1b25b2e92a6a8f2f9cce1d0d6d568de18 100644
|
| --- a/webrtc/video/video_receive_stream.cc
|
| +++ b/webrtc/video/video_receive_stream.cc
|
| @@ -31,8 +31,6 @@
|
|
|
| namespace webrtc {
|
|
|
| -static const bool kEnableFrameRecording = false;
|
| -
|
| static bool UseSendSideBwe(const VideoReceiveStream::Config& config) {
|
| if (!config.rtp.transport_cc)
|
| return false;
|
| @@ -365,16 +363,12 @@ EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage(
|
| EncodedFrame(encoded_image._buffer, encoded_image._length,
|
| encoded_image._frameType));
|
| }
|
| - if (kEnableFrameRecording) {
|
| - if (!ivf_writer_.get()) {
|
| - RTC_DCHECK(codec_specific_info);
|
| - std::ostringstream oss;
|
| - oss << "receive_bitstream_ssrc_" << config_.rtp.remote_ssrc << ".ivf";
|
| - ivf_writer_ =
|
| - IvfFileWriter::Open(oss.str(), codec_specific_info->codecType);
|
| - }
|
| + {
|
| + rtc::CritScope lock(&ivf_writer_lock_);
|
| if (ivf_writer_.get()) {
|
| - bool ok = ivf_writer_->WriteFrame(encoded_image);
|
| + RTC_DCHECK(codec_specific_info);
|
| + bool ok = ivf_writer_->WriteFrame(encoded_image,
|
| + codec_specific_info->codecType);
|
| RTC_DCHECK(ok);
|
| }
|
| }
|
| @@ -397,6 +391,24 @@ void VideoReceiveStream::SendNack(
|
| rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers);
|
| }
|
|
|
| +void VideoReceiveStream::EnableEncodedFrameRecording(rtc::PlatformFile file,
|
| + size_t byte_limit) {
|
| + {
|
| + rtc::CritScope lock(&ivf_writer_lock_);
|
| + if (file == rtc::kInvalidPlatformFileValue) {
|
| + ivf_writer_.reset();
|
| + } else {
|
| + ivf_writer_ = IvfFileWriter::Wrap(rtc::File(file), byte_limit);
|
| + }
|
| + }
|
| +
|
| + if (file != rtc::kInvalidPlatformFileValue) {
|
| + // Make a keyframe appear as early as possible in the logs, to give actually
|
| + // decodable output.
|
| + RequestKeyFrame();
|
| + }
|
| +}
|
| +
|
| void VideoReceiveStream::RequestKeyFrame() {
|
| rtp_stream_receiver_.RequestKeyFrame();
|
| }
|
|
|