Use std::unique_ptr in VideoProcessor.

Add RTC_CHECKs for failures in VideoProcessor::Init.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2684223002
Cr-Commit-Position: refs/heads/master@{#16526}
This commit is contained in:
asapersson
2017-02-10 00:16:07 -08:00
committed by Commit bot
parent c29988cb9a
commit 654d54c073
2 changed files with 43 additions and 68 deletions

View File

@ -190,20 +190,20 @@ class VideoProcessorImpl : public VideoProcessor {
// Return the number of spatial resizes.
int NumberSpatialResizes() override;
webrtc::VideoEncoder* encoder_;
webrtc::VideoDecoder* decoder_;
webrtc::VideoEncoder* const encoder_;
webrtc::VideoDecoder* const decoder_;
std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_;
FrameReader* frame_reader_;
FrameWriter* frame_writer_;
PacketManipulator* packet_manipulator_;
FrameReader* const frame_reader_;
FrameWriter* const frame_writer_;
PacketManipulator* const packet_manipulator_;
const TestConfig& config_;
Stats* stats_;
EncodedImageCallback* encode_callback_;
DecodedImageCallback* decode_callback_;
std::unique_ptr<EncodedImageCallback> encode_callback_;
std::unique_ptr<DecodedImageCallback> decode_callback_;
// Keep track of the last successful frame, since we need to write that
// when decoding fails:
uint8_t* last_successful_frame_buffer_;
std::unique_ptr<uint8_t[]> last_successful_frame_buffer_;
// To keep track of if we have excluded the first key frame from packet loss:
bool first_key_frame_has_been_excluded_;
// To tell the decoder previous frame have been dropped due to packet loss:
@ -235,7 +235,7 @@ class VideoProcessorImpl : public VideoProcessor {
const webrtc::RTPFragmentationHeader* fragmentation) override;
private:
VideoProcessorImpl* video_processor_;
VideoProcessorImpl* const video_processor_;
};
// Callback class required to implement according to the VideoDecoder API.
@ -257,7 +257,7 @@ class VideoProcessorImpl : public VideoProcessor {
}
private:
VideoProcessorImpl* video_processor_;
VideoProcessorImpl* const video_processor_;
};
};