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

Unified Diff: webrtc/video/video_receive_stream.cc

Issue 2646343005: Sort method declarations/definitions in VideoReceiveStream. (Closed)
Patch Set: Rebase. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_receive_stream.cc
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc
index 174d35256493ce4d166c6e20c59c0ab40eae629c..8956bc4e0cec2ab7076fe8338560643f57f3fb05 100644
--- a/webrtc/video/video_receive_stream.cc
+++ b/webrtc/video/video_receive_stream.cc
@@ -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;
@@ -362,21 +373,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
@@ -402,13 +420,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(
@@ -434,6 +445,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;
@@ -463,32 +490,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
« no previous file with comments | « webrtc/video/video_receive_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698