Sort method declarations/definitions in VideoReceiveStream.
Order as given by inheritance in class definition. No functional changes are intended with this CL. BUG=None Review-Url: https://codereview.webrtc.org/2646343005 Cr-Commit-Position: refs/heads/master@{#16272}
This commit is contained in:
parent
3373eaa577
commit
090c9405cc
@ -285,6 +285,17 @@ bool VideoReceiveStream::OnRecoveredPacket(const uint8_t* packet,
|
||||
return rtp_stream_receiver_.OnRecoveredPacket(packet, length);
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine,
|
||||
int audio_channel_id) {
|
||||
if (voice_engine && audio_channel_id != -1) {
|
||||
VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine);
|
||||
rtp_stream_sync_.ConfigureSync(audio_channel_id, voe_sync_interface);
|
||||
voe_sync_interface->Release();
|
||||
} else {
|
||||
rtp_stream_sync_.ConfigureSync(-1, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void VideoReceiveStream::Start() {
|
||||
if (decode_thread_.IsRunning())
|
||||
return;
|
||||
@ -361,21 +372,28 @@ void VideoReceiveStream::Stop() {
|
||||
transport_adapter_.Disable();
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SetSyncChannel(VoiceEngine* voice_engine,
|
||||
int audio_channel_id) {
|
||||
if (voice_engine && audio_channel_id != -1) {
|
||||
VoEVideoSync* voe_sync_interface = VoEVideoSync::GetInterface(voice_engine);
|
||||
rtp_stream_sync_.ConfigureSync(audio_channel_id, voe_sync_interface);
|
||||
voe_sync_interface->Release();
|
||||
} else {
|
||||
rtp_stream_sync_.ConfigureSync(-1, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
VideoReceiveStream::Stats VideoReceiveStream::GetStats() const {
|
||||
return stats_proxy_.GetStats();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(tommi): This method grabs a lock 6 times.
|
||||
void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) {
|
||||
// TODO(tommi): OnDecodedFrame grabs a lock, incidentally the same lock
|
||||
@ -401,13 +419,6 @@ void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) {
|
||||
stats_proxy_.OnRenderedFrame(video_frame);
|
||||
}
|
||||
|
||||
void VideoReceiveStream::OnCompleteFrame(
|
||||
std::unique_ptr<video_coding::FrameObject> frame) {
|
||||
int last_continuous_pid = frame_buffer_->InsertFrame(std::move(frame));
|
||||
if (last_continuous_pid != -1)
|
||||
rtp_stream_receiver_.FrameContinuous(last_continuous_pid);
|
||||
}
|
||||
|
||||
// TODO(asapersson): Consider moving callback from video_encoder.h or
|
||||
// creating a different callback.
|
||||
EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage(
|
||||
@ -433,6 +444,22 @@ EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage(
|
||||
return Result(Result::OK, encoded_image._timeStamp);
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SendNack(
|
||||
const std::vector<uint16_t>& sequence_numbers) {
|
||||
rtp_stream_receiver_.RequestPacketRetransmit(sequence_numbers);
|
||||
}
|
||||
|
||||
void VideoReceiveStream::RequestKeyFrame() {
|
||||
rtp_stream_receiver_.RequestKeyFrame();
|
||||
}
|
||||
|
||||
void VideoReceiveStream::OnCompleteFrame(
|
||||
std::unique_ptr<video_coding::FrameObject> frame) {
|
||||
int last_continuous_pid = frame_buffer_->InsertFrame(std::move(frame));
|
||||
if (last_continuous_pid != -1)
|
||||
rtp_stream_receiver_.FrameContinuous(last_continuous_pid);
|
||||
}
|
||||
|
||||
bool VideoReceiveStream::DecodeThreadFunction(void* ptr) {
|
||||
static_cast<VideoReceiveStream*>(ptr)->Decode();
|
||||
return true;
|
||||
@ -462,32 +489,5 @@ void VideoReceiveStream::Decode() {
|
||||
}
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SendNack(
|
||||
const std::vector<uint16_t>& sequence_numbers) {
|
||||
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();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace webrtc
|
||||
|
||||
@ -58,6 +58,8 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||
VieRemb* remb);
|
||||
~VideoReceiveStream() override;
|
||||
|
||||
const Config& config() const { return config_; }
|
||||
|
||||
void SignalNetworkState(NetworkState state);
|
||||
bool DeliverRtcp(const uint8_t* packet, size_t length);
|
||||
bool DeliverRtp(const uint8_t* packet,
|
||||
@ -66,35 +68,14 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||
|
||||
bool OnRecoveredPacket(const uint8_t* packet, size_t length);
|
||||
|
||||
// webrtc::VideoReceiveStream implementation.
|
||||
void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id);
|
||||
|
||||
// Implements webrtc::VideoReceiveStream.
|
||||
void Start() override;
|
||||
void Stop() override;
|
||||
|
||||
webrtc::VideoReceiveStream::Stats GetStats() const override;
|
||||
|
||||
// Overrides rtc::VideoSinkInterface<VideoFrame>.
|
||||
void OnFrame(const VideoFrame& video_frame) override;
|
||||
|
||||
// Implements video_coding::OnCompleteFrameCallback.
|
||||
void OnCompleteFrame(
|
||||
std::unique_ptr<video_coding::FrameObject> frame) override;
|
||||
|
||||
// Overrides EncodedImageCallback.
|
||||
EncodedImageCallback::Result OnEncodedImage(
|
||||
const EncodedImage& encoded_image,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const RTPFragmentationHeader* fragmentation) override;
|
||||
|
||||
const Config& config() const { return config_; }
|
||||
|
||||
void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id);
|
||||
|
||||
// Implements NackSender.
|
||||
void SendNack(const std::vector<uint16_t>& sequence_numbers) override;
|
||||
|
||||
// Implements KeyFrameRequestSender.
|
||||
void RequestKeyFrame() override;
|
||||
|
||||
// Takes ownership of the file, is responsible for closing it later.
|
||||
// Calling this method will close and finalize any current log.
|
||||
// Giving rtc::kInvalidPlatformFileValue disables logging.
|
||||
@ -103,6 +84,25 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||
void EnableEncodedFrameRecording(rtc::PlatformFile file,
|
||||
size_t byte_limit) override;
|
||||
|
||||
// Implements rtc::VideoSinkInterface<VideoFrame>.
|
||||
void OnFrame(const VideoFrame& video_frame) override;
|
||||
|
||||
// Implements EncodedImageCallback.
|
||||
EncodedImageCallback::Result OnEncodedImage(
|
||||
const EncodedImage& encoded_image,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const RTPFragmentationHeader* fragmentation) override;
|
||||
|
||||
// Implements NackSender.
|
||||
void SendNack(const std::vector<uint16_t>& sequence_numbers) override;
|
||||
|
||||
// Implements KeyFrameRequestSender.
|
||||
void RequestKeyFrame() override;
|
||||
|
||||
// Implements video_coding::OnCompleteFrameCallback.
|
||||
void OnCompleteFrame(
|
||||
std::unique_ptr<video_coding::FrameObject> frame) override;
|
||||
|
||||
private:
|
||||
static bool DecodeThreadFunction(void* ptr);
|
||||
void Decode();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user