// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_MIRRORING_SERVICE_RTP_STREAM_H_ #define COMPONENTS_MIRRORING_SERVICE_RTP_STREAM_H_ #include <memory> #include <string> #include "base/component_export.h" #include "base/functional/callback.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "media/base/audio_bus.h" #include "media/cast/cast_config.h" #include "media/cast/constants.h" #include "media/video/video_encode_accelerator.h" namespace media { class VideoFrame; namespace cast { class VideoSender; class AudioSender; } // namespace cast } // namespace media namespace mirroring { class COMPONENT_EXPORT(MIRRORING_SERVICE) RtpStreamClient { … }; // Receives video frames and submits the data to media::cast::VideoSender. It // also includes a timer to request refresh frames when the source halts (e.g., // a screen capturer stops delivering frames because the screen is not being // updated). When a halt is detected, refresh frames will be requested at // intervals `refresh_interval` apart for a short period of time. This provides // the video encoder, downstream, several copies of the last frame so that it // may clear up lossy encoding artifacts. // // Note that this mostly calls through to the media::cast::VideoSender, and the // refresh frame logic could be factored out into a separate object. // TODO(issues.chromium.org/329781397): Remove unnecessary wrapper objects in // Chrome's implementation of the Cast sender. class COMPONENT_EXPORT(MIRRORING_SERVICE) VideoRtpStream final { … }; // Receives audio data and submits the data to media::cast::AudioSender. // Note that this mostly calls through to the media::cast::VideoSender, and the // refresh frame logic could be factored out into a separate object. // // NOTE: This is a do-nothing wrapper over the underlying AudioSender. // TODO(issues.chromium.org/329781397): Remove unnecessary wrapper objects in // Chrome's implementation of the Cast sender. class COMPONENT_EXPORT(MIRRORING_SERVICE) AudioRtpStream final { … }; } // namespace mirroring #endif // COMPONENTS_MIRRORING_SERVICE_RTP_STREAM_H_