2013-04-18 12:02:52 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-12-18 09:46:22 +00:00
|
|
|
#ifndef WEBRTC_VIDEO_SEND_STREAM_H_
|
|
|
|
|
#define WEBRTC_VIDEO_SEND_STREAM_H_
|
2013-04-18 12:02:52 +00:00
|
|
|
|
2014-01-07 09:54:34 +00:00
|
|
|
#include <map>
|
2013-04-18 12:02:52 +00:00
|
|
|
#include <string>
|
2016-09-28 06:19:48 -07:00
|
|
|
#include <utility>
|
2016-09-01 01:17:40 -07:00
|
|
|
#include <vector>
|
2016-09-29 11:48:50 +02:00
|
|
|
#include <utility>
|
2013-04-18 12:02:52 +00:00
|
|
|
|
2016-11-28 07:02:13 -08:00
|
|
|
#include "webrtc/api/call/transport.h"
|
2016-09-28 06:19:48 -07:00
|
|
|
#include "webrtc/base/platform_file.h"
|
2013-04-18 12:02:52 +00:00
|
|
|
#include "webrtc/common_types.h"
|
2016-04-18 21:12:48 -07:00
|
|
|
#include "webrtc/common_video/include/frame_callback.h"
|
2013-10-28 16:32:01 +00:00
|
|
|
#include "webrtc/config.h"
|
2016-04-18 05:15:22 -07:00
|
|
|
#include "webrtc/media/base/videosinkinterface.h"
|
2016-09-16 07:53:41 -07:00
|
|
|
#include "webrtc/media/base/videosourceinterface.h"
|
2013-04-18 12:02:52 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
class VideoEncoder;
|
|
|
|
|
|
2016-05-01 20:18:34 -07:00
|
|
|
class VideoSendStream {
|
2013-04-18 12:02:52 +00:00
|
|
|
public:
|
2015-02-25 10:42:16 +00:00
|
|
|
struct StreamStats {
|
2016-08-11 08:41:18 -07:00
|
|
|
std::string ToString() const;
|
|
|
|
|
|
2015-02-25 10:42:16 +00:00
|
|
|
FrameCounts frame_counts;
|
2016-08-11 08:41:18 -07:00
|
|
|
bool is_rtx = false;
|
2016-11-25 03:52:46 -08:00
|
|
|
bool is_flexfec = false;
|
2015-02-25 10:42:16 +00:00
|
|
|
int width = 0;
|
|
|
|
|
int height = 0;
|
|
|
|
|
// TODO(holmer): Move bitrate_bps out to the webrtc::Call layer.
|
|
|
|
|
int total_bitrate_bps = 0;
|
|
|
|
|
int retransmit_bitrate_bps = 0;
|
|
|
|
|
int avg_delay_ms = 0;
|
|
|
|
|
int max_delay_ms = 0;
|
|
|
|
|
StreamDataCounters rtp_stats;
|
|
|
|
|
RtcpPacketTypeCounter rtcp_packet_type_counts;
|
|
|
|
|
RtcpStatistics rtcp_stats;
|
|
|
|
|
};
|
|
|
|
|
|
2013-06-05 11:33:21 +00:00
|
|
|
struct Stats {
|
2016-08-11 08:41:18 -07:00
|
|
|
std::string ToString(int64_t time_ms) const;
|
2015-12-18 16:01:11 +01:00
|
|
|
std::string encoder_implementation_name = "unknown";
|
2015-06-11 12:38:38 +02:00
|
|
|
int input_frame_rate = 0;
|
|
|
|
|
int encode_frame_rate = 0;
|
|
|
|
|
int avg_encode_time_ms = 0;
|
|
|
|
|
int encode_usage_percent = 0;
|
2016-10-24 01:46:43 -07:00
|
|
|
uint32_t frames_encoded = 0;
|
2016-10-31 06:53:47 -07:00
|
|
|
rtc::Optional<uint64_t> qp_sum;
|
2016-09-29 11:48:50 +02:00
|
|
|
// Bitrate the encoder is currently configured to use due to bandwidth
|
|
|
|
|
// limitations.
|
2015-06-11 12:38:38 +02:00
|
|
|
int target_media_bitrate_bps = 0;
|
2016-09-29 11:48:50 +02:00
|
|
|
// Bitrate the encoder is actually producing.
|
2015-06-11 12:38:38 +02:00
|
|
|
int media_bitrate_bps = 0;
|
2016-09-29 11:48:50 +02:00
|
|
|
// Media bitrate this VideoSendStream is configured to prefer if there are
|
|
|
|
|
// no bandwidth limitations.
|
|
|
|
|
int preferred_media_bitrate_bps = 0;
|
2015-06-11 12:38:38 +02:00
|
|
|
bool suspended = false;
|
2015-12-14 02:08:12 -08:00
|
|
|
bool bw_limited_resolution = false;
|
2016-11-01 11:45:46 -07:00
|
|
|
bool cpu_limited_resolution = false;
|
|
|
|
|
// Total number of times resolution as been requested to be changed due to
|
|
|
|
|
// CPU adaptation.
|
|
|
|
|
int number_of_cpu_adapt_changes = 0;
|
2015-02-25 10:42:16 +00:00
|
|
|
std::map<uint32_t, StreamStats> substreams;
|
2013-06-05 11:33:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Config {
|
2016-09-01 01:17:40 -07:00
|
|
|
public:
|
2015-08-28 04:07:10 -07:00
|
|
|
Config() = delete;
|
2016-09-01 01:17:40 -07:00
|
|
|
Config(Config&&) = default;
|
2015-09-28 09:59:31 -07:00
|
|
|
explicit Config(Transport* send_transport)
|
2015-08-28 04:07:10 -07:00
|
|
|
: send_transport(send_transport) {}
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
Config& operator=(Config&&) = default;
|
|
|
|
|
Config& operator=(const Config&) = delete;
|
|
|
|
|
|
|
|
|
|
// Mostly used by tests. Avoid creating copies if you can.
|
|
|
|
|
Config Copy() const { return Config(*this); }
|
|
|
|
|
|
2014-05-15 09:35:06 +00:00
|
|
|
std::string ToString() const;
|
|
|
|
|
|
2014-03-19 08:43:57 +00:00
|
|
|
struct EncoderSettings {
|
2016-09-01 01:17:40 -07:00
|
|
|
EncoderSettings() = default;
|
|
|
|
|
EncoderSettings(std::string payload_name,
|
|
|
|
|
int payload_type,
|
|
|
|
|
VideoEncoder* encoder)
|
|
|
|
|
: payload_name(std::move(payload_name)),
|
|
|
|
|
payload_type(payload_type),
|
|
|
|
|
encoder(encoder) {}
|
2014-05-15 09:35:06 +00:00
|
|
|
std::string ToString() const;
|
|
|
|
|
|
2014-03-19 08:43:57 +00:00
|
|
|
std::string payload_name;
|
2015-06-11 12:38:38 +02:00
|
|
|
int payload_type = -1;
|
2014-03-19 08:43:57 +00:00
|
|
|
|
2015-09-03 18:24:44 -07:00
|
|
|
// TODO(sophiechang): Delete this field when no one is using internal
|
|
|
|
|
// sources anymore.
|
|
|
|
|
bool internal_source = false;
|
|
|
|
|
|
2016-02-05 11:13:28 +01:00
|
|
|
// Allow 100% encoder utilization. Used for HW encoders where CPU isn't
|
|
|
|
|
// expected to be the limiting factor, but a chip could be running at
|
|
|
|
|
// 30fps (for example) exactly.
|
|
|
|
|
bool full_overuse_time = false;
|
|
|
|
|
|
2014-03-19 08:43:57 +00:00
|
|
|
// Uninitialized VideoEncoder instance to be used for encoding. Will be
|
|
|
|
|
// initialized from inside the VideoSendStream.
|
2015-06-11 12:38:38 +02:00
|
|
|
VideoEncoder* encoder = nullptr;
|
2014-03-19 08:43:57 +00:00
|
|
|
} encoder_settings;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
2013-10-16 13:29:14 +00:00
|
|
|
static const size_t kDefaultMaxPacketSize = 1500 - 40; // TCP over IPv4.
|
2013-06-05 11:33:21 +00:00
|
|
|
struct Rtp {
|
2014-05-15 09:35:06 +00:00
|
|
|
std::string ToString() const;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
|
|
|
|
std::vector<uint32_t> ssrcs;
|
|
|
|
|
|
2015-12-09 12:37:51 -08:00
|
|
|
// See RtcpMode for description.
|
|
|
|
|
RtcpMode rtcp_mode = RtcpMode::kCompound;
|
|
|
|
|
|
2013-06-05 11:33:21 +00:00
|
|
|
// Max RTP packet size delivered to send transport from VideoEngine.
|
2015-06-11 12:38:38 +02:00
|
|
|
size_t max_packet_size = kDefaultMaxPacketSize;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
|
|
|
|
// RTP header extensions to use for this send stream.
|
|
|
|
|
std::vector<RtpExtension> extensions;
|
|
|
|
|
|
|
|
|
|
// See NackConfig for description.
|
|
|
|
|
NackConfig nack;
|
|
|
|
|
|
2016-10-04 23:28:39 -07:00
|
|
|
// See UlpfecConfig for description.
|
|
|
|
|
UlpfecConfig ulpfec;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
2017-01-16 06:59:19 -08:00
|
|
|
struct Flexfec {
|
|
|
|
|
// Payload type of FlexFEC. Set to -1 to disable sending FlexFEC.
|
|
|
|
|
int payload_type = -1;
|
|
|
|
|
|
|
|
|
|
// SSRC of FlexFEC stream.
|
|
|
|
|
uint32_t ssrc = 0;
|
|
|
|
|
|
|
|
|
|
// Vector containing a single element, corresponding to the SSRC of the
|
|
|
|
|
// media stream being protected by this FlexFEC stream.
|
|
|
|
|
// The vector MUST have size 1.
|
|
|
|
|
//
|
|
|
|
|
// TODO(brandtr): Update comment above when we support
|
|
|
|
|
// multistream protection.
|
|
|
|
|
std::vector<uint32_t> protected_media_ssrcs;
|
|
|
|
|
} flexfec;
|
2016-11-15 05:25:41 -08:00
|
|
|
|
2014-01-24 09:30:53 +00:00
|
|
|
// Settings for RTP retransmission payload format, see RFC 4588 for
|
|
|
|
|
// details.
|
|
|
|
|
struct Rtx {
|
2014-05-15 09:35:06 +00:00
|
|
|
std::string ToString() const;
|
2014-01-24 09:30:53 +00:00
|
|
|
// SSRCs to use for the RTX streams.
|
|
|
|
|
std::vector<uint32_t> ssrcs;
|
|
|
|
|
|
|
|
|
|
// Payload type to use for the RTX stream.
|
2015-06-11 12:38:38 +02:00
|
|
|
int payload_type = -1;
|
2014-01-24 09:30:53 +00:00
|
|
|
} rtx;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
|
|
|
|
// RTCP CNAME, see RFC 3550.
|
|
|
|
|
std::string c_name;
|
|
|
|
|
} rtp;
|
|
|
|
|
|
2015-08-28 04:07:10 -07:00
|
|
|
// Transport for outgoing packets.
|
2015-09-28 09:59:31 -07:00
|
|
|
Transport* send_transport = nullptr;
|
2015-08-28 04:07:10 -07:00
|
|
|
|
2013-06-05 11:33:21 +00:00
|
|
|
// Called for each I420 frame before encoding the frame. Can be used for
|
2015-06-11 12:38:38 +02:00
|
|
|
// effects, snapshots etc. 'nullptr' disables the callback.
|
2016-04-18 05:15:22 -07:00
|
|
|
rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback = nullptr;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
2015-06-11 12:38:38 +02:00
|
|
|
// Called for each encoded frame, e.g. used for file storage. 'nullptr'
|
2016-02-05 11:13:28 +01:00
|
|
|
// disables the callback. Also measures timing and passes the time
|
|
|
|
|
// spent on encoding. This timing will not fire if encoding takes longer
|
|
|
|
|
// than the measuring window, since the sample data will have been dropped.
|
2015-06-11 12:38:38 +02:00
|
|
|
EncodedFrameObserver* post_encode_callback = nullptr;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
|
|
|
|
// Expected delay needed by the renderer, i.e. the frame will be delivered
|
|
|
|
|
// this many milliseconds, if possible, earlier than expected render time.
|
2014-05-15 09:35:06 +00:00
|
|
|
// Only valid if |local_renderer| is set.
|
2015-06-11 12:38:38 +02:00
|
|
|
int render_delay_ms = 0;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
|
|
|
|
// Target delay in milliseconds. A positive value indicates this stream is
|
|
|
|
|
// used for streaming instead of a real-time call.
|
2015-06-11 12:38:38 +02:00
|
|
|
int target_delay_ms = 0;
|
2013-06-05 11:33:21 +00:00
|
|
|
|
2013-11-18 12:18:43 +00:00
|
|
|
// True if the stream should be suspended when the available bitrate fall
|
|
|
|
|
// below the minimum configured bitrate. If this variable is false, the
|
|
|
|
|
// stream may send at a rate higher than the estimated available bitrate.
|
2015-06-11 12:38:38 +02:00
|
|
|
bool suspend_below_min_bitrate = false;
|
2016-09-01 01:17:40 -07:00
|
|
|
|
2016-11-28 13:11:13 -08:00
|
|
|
// Enables periodic bandwidth probing in application-limited region.
|
|
|
|
|
bool periodic_alr_bandwidth_probing = false;
|
|
|
|
|
|
2016-09-01 01:17:40 -07:00
|
|
|
private:
|
|
|
|
|
// Access to the copy constructor is private to force use of the Copy()
|
|
|
|
|
// method for those exceptional cases where we do use it.
|
|
|
|
|
Config(const Config&) = default;
|
2013-06-05 11:33:21 +00:00
|
|
|
};
|
|
|
|
|
|
2016-05-01 20:18:34 -07:00
|
|
|
// Starts stream activity.
|
|
|
|
|
// When a stream is active, it can receive, process and deliver packets.
|
|
|
|
|
virtual void Start() = 0;
|
|
|
|
|
// Stops stream activity.
|
|
|
|
|
// When a stream is stopped, it can't receive, process or deliver packets.
|
|
|
|
|
virtual void Stop() = 0;
|
|
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
// Based on the spec in
|
|
|
|
|
// https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference.
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// These options are enforced on a best-effort basis. For instance, all of
|
|
|
|
|
// these options may suffer some frame drops in order to avoid queuing.
|
|
|
|
|
// TODO(sprang): Look into possibility of more strictly enforcing the
|
|
|
|
|
// maintain-framerate option.
|
2016-11-01 11:45:46 -07:00
|
|
|
enum class DegradationPreference {
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// Don't take any actions based on over-utilization signals.
|
|
|
|
|
kDegradationDisabled,
|
|
|
|
|
// On over-use, request lost resolution, possibly causing down-scaling.
|
2016-11-01 11:45:46 -07:00
|
|
|
kMaintainResolution,
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
// On over-use, request lower frame rate, possible causing frame drops.
|
|
|
|
|
kMaintainFramerate,
|
|
|
|
|
// Try to strike a "pleasing" balance between frame rate or resolution.
|
2016-11-01 11:45:46 -07:00
|
|
|
kBalanced,
|
|
|
|
|
};
|
Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2783183003/ )
Reason for revert:
Seem to be a flaky test rather than an issue with this cl. Creating reland, will add code to reduce flakiness to that test.
Original issue's description:
> Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #8 id:410001 of https://codereview.webrtc.org/2781433002/ )
>
> Reason for revert:
> This has resulted in failure of CallPerfTest.ReceivesCpuOveruseAndUnderuse test on the Win7 build bot https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1780
>
> Original issue's description:
> > Reland of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #1 id:1 of https://codereview.webrtc.org/2764133002/ )
> >
> > Reason for revert:
> > Found issue with test case, will add fix to reland cl.
> >
> > Original issue's description:
> > > Revert of Add framerate to VideoSinkWants and ability to signal on overuse (patchset #14 id:250001 of https://codereview.webrtc.org/2716643002/ )
> > >
> > > Reason for revert:
> > > Breaks perf tests:
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Win7/builds/1679
> > > https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20%28L%20Nexus5%29/builds/2325
> > >
> > > Original issue's description:
> > > > Add framerate to VideoSinkWants and ability to signal on overuse
> > > >
> > > > In ViEEncoder, try to reduce framerate instead of resolution if the
> > > > current degradation preference is maintain-resolution rather than
> > > > balanced.
> > > >
> > > > BUG=webrtc:4172
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2716643002
> > > > Cr-Commit-Position: refs/heads/master@{#17327}
> > > > Committed: https://chromium.googlesource.com/external/webrtc/+/72acf2526177bb4dbb5103cd6e165eb4361a5ae6
> > >
> > > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:4172
> > >
> > > Review-Url: https://codereview.webrtc.org/2764133002
> > > Cr-Commit-Position: refs/heads/master@{#17331}
> > > Committed: https://chromium.googlesource.com/external/webrtc/+/8b45b11144c968b4173215c76f78c710c9a2ed0b
> >
> > TBR=nisse@webrtc.org,magjed@webrtc.org,kthelgason@webrtc.org,ilnik@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:4172
> >
> > Review-Url: https://codereview.webrtc.org/2781433002
> > Cr-Commit-Position: refs/heads/master@{#17474}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/3ea3c77e93121b1ab9d5e46641e6764f2cca0d51
>
> TBR=ilnik@webrtc.org,stefan@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2783183003
> Cr-Commit-Position: refs/heads/master@{#17477}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f9ed235c9b7248694edcb46feb1f29ce7456ab59
R=ilnik@webrtc.org,stefan@webrtc.org
BUG=webrtc:4172
Review-Url: https://codereview.webrtc.org/2789823002
Cr-Commit-Position: refs/heads/master@{#17498}
2017-04-02 23:53:04 -07:00
|
|
|
|
2016-09-16 07:53:41 -07:00
|
|
|
virtual void SetSource(
|
2016-11-01 11:45:46 -07:00
|
|
|
rtc::VideoSourceInterface<webrtc::VideoFrame>* source,
|
|
|
|
|
const DegradationPreference& degradation_preference) = 0;
|
2013-04-18 12:02:52 +00:00
|
|
|
|
2014-03-19 08:43:57 +00:00
|
|
|
// Set which streams to send. Must have at least as many SSRCs as configured
|
|
|
|
|
// in the config. Encoder settings are passed on to the encoder instance along
|
|
|
|
|
// with the VideoStream settings.
|
2016-09-01 01:17:40 -07:00
|
|
|
virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0;
|
2013-04-18 12:02:52 +00:00
|
|
|
|
2014-12-01 15:23:21 +00:00
|
|
|
virtual Stats GetStats() = 0;
|
2016-05-01 20:18:34 -07:00
|
|
|
|
2016-09-28 06:19:48 -07:00
|
|
|
// Takes ownership of each file, is responsible for closing them later.
|
|
|
|
|
// Calling this method will close and finalize any current logs.
|
|
|
|
|
// Some codecs produce multiple streams (VP8 only at present), each of these
|
|
|
|
|
// streams will log to a separate file. kMaxSimulcastStreams in common_types.h
|
|
|
|
|
// gives the max number of such streams. If there is no file for a stream, or
|
|
|
|
|
// the file is rtc::kInvalidPlatformFileValue, frames from that stream will
|
|
|
|
|
// not be logged.
|
|
|
|
|
// If a frame to be written would make the log too large the write fails and
|
|
|
|
|
// the log is closed and finalized. A |byte_limit| of 0 means no limit.
|
|
|
|
|
virtual void EnableEncodedFrameRecording(
|
|
|
|
|
const std::vector<rtc::PlatformFile>& files,
|
|
|
|
|
size_t byte_limit) = 0;
|
|
|
|
|
inline void DisableEncodedFrameRecording() {
|
|
|
|
|
EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0);
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 20:18:34 -07:00
|
|
|
protected:
|
|
|
|
|
virtual ~VideoSendStream() {}
|
2013-04-18 12:02:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2013-12-18 09:46:22 +00:00
|
|
|
#endif // WEBRTC_VIDEO_SEND_STREAM_H_
|