116 Commits

Author SHA1 Message Date
kthelgason
2bc6864278 Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.

Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: 83399caec5
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: 35fc2aa82f

TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 15:02:22 +00:00
deadbeef
e702b30fec Adding C++ versions of currently spec'd "RtpParameters" structs.
These structs will be used for ORTC objects (and their WebRTC
equivalents).

This CL also introduces some minor changes to the existing implemented
structs:

- max_bitrate_bps uses rtc::Optional instead of "-1 means unset"
- "mime_type" turned into "name"/"kind" (which can be used to form the
  MIME type string, if needed).
- clock_rate and channels changed to rtc::Optional, since they will
  need to be for RtpSender.send().
- Renamed "channels" to "num_channels" (the ORTC name, which I prefer).

BUG=webrtc:7013, webrtc:7112

Review-Url: https://codereview.webrtc.org/2651883010
Cr-Commit-Position: refs/heads/master@{#16437}
2017-02-04 20:09:01 +00:00
brandtr
9d58d94585 Fix and improve FlexFEC configuration for RTP/RTCP.
Fix: Order of assignments is now correct, after being incorrect
due to an incorrect merge between
https://codereview.webrtc.org/2617373002/ and
https://codereview.webrtc.org/2589713003.

Improvement: Set parameters in more places, allowing for
correct reconfiguration. Add TODOs to point of minor issues
with current configuration.

TESTED=By locally patching an application using this code.
BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2660403004
Cr-Commit-Position: refs/heads/master@{#16431}
2017-02-03 12:43:41 +00:00
minyue
35fc2aa82f Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
Reason for revert:
due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)

Original issue's description:
> Drop frames until specified bitrate is achieved.
>
> This CL fixes a regression introduced with the new quality scaler
> where the video would no longer start in a scaled mode. This CL adds
> code that compares incoming captured frames to the target bitrate,
> and if they are found to be too large, they are dropped and sinkWants
> set to a lower resolution. The number of dropped frames should be low
> (0-4 in most cases) and should not introduce a noticeable delay, or
> at least should be preferrable to having the first 2-4 seconds of video
> have very low quality.
>
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2630333002
> Cr-Commit-Position: refs/heads/master@{#16391}
> Committed: 83399caec5

TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2666303002
Cr-Commit-Position: refs/heads/master@{#16395}
2017-02-01 11:14:00 +00:00
kthelgason
83399caec5 Drop frames until specified bitrate is achieved.
This CL fixes a regression introduced with the new quality scaler
where the video would no longer start in a scaled mode. This CL adds
code that compares incoming captured frames to the target bitrate,
and if they are found to be too large, they are dropped and sinkWants
set to a lower resolution. The number of dropped frames should be low
(0-4 in most cases) and should not introduce a noticeable delay, or
at least should be preferrable to having the first 2-4 seconds of video
have very low quality.

BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2630333002
Cr-Commit-Position: refs/heads/master@{#16391}
2017-02-01 09:31:52 +00:00
brandtr
1474212895 Reland of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #1 id:1 of https://codereview.webrtc.org/2649323010/ )
Reason for revert:
Downstream project relied on changed struct.

Transition made possible by https://codereview.webrtc.org/2655243006/.

Original issue's description:
> Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
>
> Reason for revert:
> Breaks internal downstream project.
>
> Original issue's description:
> > Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
> >
> > Prior to this CL, received RTX (associated) payload types were only configured
> > when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> > SSRC was set up.
> >
> > After this CL, the RTX (associated) payload types are set in
> > WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> > them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> > that is the code path that sets other SSRCs.
> >
> > As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> > We remove the possibility for each video payload type to have an associated
> > specific RTX SSRC. Although the config previously allowed for this, all payload
> > types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> > did not support multiple SSRCs. This change to the config struct should thus not
> > have any functional impact. The change does however affect the RtcEventLog, since
> > that is used for storing the VideoReceiveStream::Configs. For simplicity,
> > this CL does not change the event log proto definitions, instead duplicating
> > the serialized RTX SSRCs such that they fit in the existing proto definition.
> >
> > BUG=webrtc:7011
> >
> > Review-Url: https://codereview.webrtc.org/2646073004
> > Cr-Commit-Position: refs/heads/master@{#16302}
> > Committed: fe2bef39cd
>
> TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2649323010
> Cr-Commit-Position: refs/heads/master@{#16307}
> Committed: e4974953ce

TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org,kjellander@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
# NOTREECHECKS=true
# NOTRY=true
BUG=webrtc:7011

Review-Url: https://codereview.webrtc.org/2654163006
Cr-Commit-Position: refs/heads/master@{#16322}
2017-01-27 12:53:07 +00:00
kjellander
e4974953ce Revert of Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters. (patchset #7 id:160001 of https://codereview.webrtc.org/2646073004/ )
Reason for revert:
Breaks internal downstream project.

Original issue's description:
> Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
>
> Prior to this CL, received RTX (associated) payload types were only configured
> when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
> SSRC was set up.
>
> After this CL, the RTX (associated) payload types are set in
> WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
> them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
> that is the code path that sets other SSRCs.
>
> As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
> We remove the possibility for each video payload type to have an associated
> specific RTX SSRC. Although the config previously allowed for this, all payload
> types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
> did not support multiple SSRCs. This change to the config struct should thus not
> have any functional impact. The change does however affect the RtcEventLog, since
> that is used for storing the VideoReceiveStream::Configs. For simplicity,
> this CL does not change the event log proto definitions, instead duplicating
> the serialized RTX SSRCs such that they fit in the existing proto definition.
>
> BUG=webrtc:7011
>
> Review-Url: https://codereview.webrtc.org/2646073004
> Cr-Commit-Position: refs/heads/master@{#16302}
> Committed: fe2bef39cd

TBR=stefan@webrtc.org,magjed@webrtc.org,terelius@webrtc.org,brandtr@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7011

Review-Url: https://codereview.webrtc.org/2649323010
Cr-Commit-Position: refs/heads/master@{#16307}
2017-01-26 21:22:37 +00:00
brandtr
fe2bef39cd Make RTX pt/apt reconfigurable by calling WebRtcVideoChannel2::SetRecvParameters.
Prior to this CL, received RTX (associated) payload types were only configured
when WebRtcVideoChannel2::AddRecvStream was called. In the same method, the RTX
SSRC was set up.

After this CL, the RTX (associated) payload types are set in
WebRtcVideoChannel2::SetRecvParameters, which is the appropriate place to set
them. The RTX SSRC is still set in WebRtcVideoChannel2::AddRecvStream, since
that is the code path that sets other SSRCs.

As part of this fix, the VideoReceiveStream::Config::Rtp struct is changed.
We remove the possibility for each video payload type to have an associated
specific RTX SSRC. Although the config previously allowed for this, all payload
types always had the same RTX SSRC set, and the underlying RtpPayloadRegistry
did not support multiple SSRCs. This change to the config struct should thus not
have any functional impact. The change does however affect the RtcEventLog, since
that is used for storing the VideoReceiveStream::Configs. For simplicity,
this CL does not change the event log proto definitions, instead duplicating
the serialized RTX SSRCs such that they fit in the existing proto definition.

BUG=webrtc:7011

Review-Url: https://codereview.webrtc.org/2646073004
Cr-Commit-Position: refs/heads/master@{#16302}
2017-01-26 16:03:58 +00:00
sprang
429600d7d0 Reland of Add experimental simulcast screen content mode
The original CL was reverted because of a bug discovered by the
chromium bots. Description of that CL:

> Review-Url: https://codereview.webrtc.org/2636443002
> Cr-Commit-Position: refs/heads/master@{#16135}
> Committed: a28e971e3b

The first patch set of this CL is the same as r16135.
Subsequence patch sets are the fixes applied.
Some new test cases have been added, which reveal a few more bugs that
have also been fixed.

BUG=webrtc:4172

Review-Url: https://codereview.webrtc.org/2641133002
Cr-Commit-Position: refs/heads/master@{#16299}
2017-01-26 14:12:26 +00:00
hbos
50cfe1fda7 RTCMediaStreamTrackStats.framesDropped collected by RTCStatsCollector.
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-framesdropped
Implemented as frames_received - frames_rendered.

Part of this CL is adding frames_rendered to VideoReceiveStream::Stats
and updating it at ReceiveStatisticsProxy::OnRenderedFrame.

BUG=webrtc:6757, chromium:659137, chromium:627816
NOTRY=True

Review-Url: https://codereview.webrtc.org/2607933002
Cr-Commit-Position: refs/heads/master@{#16213}
2017-01-23 15:21:55 +00:00
brandtr
9c3d4c4d88 Stop leaking FlexfecReceiveStream objects after call shutdown.
BUG=webrtc:7017

Review-Url: https://codereview.webrtc.org/2645703003
Cr-Commit-Position: refs/heads/master@{#16212}
2017-01-23 14:59:13 +00:00
hbos
42f6d2fb6c RTCMediaStreamTrackStats.framesReceived collected by RTCStatsCollector.
VideoReceiverInfo::frames_received added based on
VideoReceiveStream::Stats::frame_counts (.key_frames + .delta_frames).

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2607913002
Cr-Commit-Position: refs/heads/master@{#16185}
2017-01-20 11:56:50 +00:00
sprang
44303ea0ff Revert of Add experimental simulcast screen content mode (patchset #5 id:80001 of https://codereview.webrtc.org/2636443002/ )
Reason for revert:
Breaks chromium.

Original issue's description:
> Add experimental simulcast screen content mode
>
> BUG=webrtc:4172
>
> Review-Url: https://codereview.webrtc.org/2636443002
> Cr-Commit-Position: refs/heads/master@{#16135}
> Committed: a28e971e3b

TBR=perkj@webrtc.org,asapersson@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/2643763002
Cr-Commit-Position: refs/heads/master@{#16145}
2017-01-18 13:19:13 +00:00
sprang
a28e971e3b Add experimental simulcast screen content mode
BUG=webrtc:4172

Review-Url: https://codereview.webrtc.org/2636443002
Cr-Commit-Position: refs/heads/master@{#16135}
2017-01-18 08:36:31 +00:00
brandtr
3d200bd6ac Remove FlexfecConfig and replace with specific struct in VideoSendStream.
The existence of FlexfecConfig is due to a naive design. Now when it
is not used on the receiving side (see https://codereview.webrtc.org/2542413002),
it is time to remove it from the sending side as well.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2621573002
Cr-Commit-Position: refs/heads/master@{#16097}
2017-01-16 14:59:19 +00:00
brandtr
36e7d70410 Explicitly only add transport-cc RTCP feedback param to default FlexFEC codec.
Earlier, the FlexFEC codec would receive the same default RTCP feedback
params as the media codecs. Since most of these are not used, there is
no point negotiating them.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2623513002
Cr-Commit-Position: refs/heads/master@{#16057}
2017-01-13 15:15:54 +00:00
perkj
d533aec3b8 Remove WebRtcVideoSendStream2::VideoSink inheritance. Remove sending black frame on source removal.
BUG=webrtc:6371,webrtc:6983

Review-Url: https://codereview.webrtc.org/2469993003
Cr-Commit-Position: refs/heads/master@{#16048}
2017-01-13 13:57:25 +00:00
nisse
af916899cc Move VideoFrame and related declarations to webrtc/api/video.
Moves webrtc/common_video/rotation.h and parts of
webrtc/common_video/include/video_frame_buffer.h and
webrtc/video_frame.h, and adds to a new GN target api:video_frame_api.

BUG=webrtc:5880

Review-Url: https://codereview.webrtc.org/2517173004
Cr-Commit-Position: refs/heads/master@{#15993}
2017-01-10 15:44:26 +00:00
deadbeef
fb2aceded6 Add video send SSRC to RtpParameters, and don't allow changing SSRC.
With this, RtpSender and RtpReceiver will always return an SSRC if one
is available. Also, attempts to change the SSRC with SetParameters will
fail, rather than silently doing nothing.

BUG=webrtc:6888

Review-Url: https://codereview.webrtc.org/2567333004
Cr-Commit-Position: refs/heads/master@{#15939}
2017-01-07 07:05:37 +00:00
brandtr
1cfbd6003b Generalize FlexfecReceiveStream::Config.
- Adding information about RTCP and RTP header extensions.
- Renaming flexfec_payload_type -> payload_type and
  flexfec_ssrc -> remote_ssrc.

BUG=webrtc:5654
R=stefan@webrtc.org, philipel@webrtc.org

Review-Url: https://codereview.webrtc.org/2542413002
Cr-Commit-Position: refs/heads/master@{#15477}
2016-12-08 12:18:05 +00:00
brandtr
ffc61181d8 Don't cache video codec list in VideoEngine2.
A WebRtcVideoEngine2 object seems to be reused between PeerConnections,
which means that the field trial added in
https://codereview.webrtc.org/2511703002/ may not activate/deactivate
as intended between calls. This CL removes the caching of video codecs,
which gets rid of this problem.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2521393004
Cr-Commit-Position: refs/heads/master@{#15265}
2016-11-28 14:02:28 +00:00
magjed
5dfac56813 Keep all codec parameters in VideoReceiveStream::Decoder
It will be necessary to keep the H264 profile information in
VideoReceiveStream::Decoder. I think it will be easier now and for the
future to just store all of the codec parameters unmodified in
VideoReceiveStream::Decoder instead of extracting a subset of them to an
ad hoc class.

BUG=webrtc:6743,webrtc:5948

Review-Url: https://codereview.webrtc.org/2523773003
Cr-Commit-Position: refs/heads/master@{#15239}
2016-11-25 11:56:41 +00:00
Sergey Ulanov
e2b1501101 Start probes only after network is connected.
Previously ProbeController was starting probing as soon as SetBitrates()
is called. As result these probes would often timeout while connection
is being established. Now ProbeController receives notifications about
network route changes. This allows to start probing only when transport
is connected. This also makes it possible to restart probing whenever
transport route changes (will be done in a separate change).

BUG=webrtc:6332
R=honghaiz@webrtc.org, philipel@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2458863002 .

Committed: https://crrev.com/5c99c76255ee7bface3c742c25fb5617748ac86e
Cr-Original-Commit-Position: refs/heads/master@{#15094}
Cr-Commit-Position: refs/heads/master@{#15204}
2016-11-23 00:08:37 +00:00
brandtr
468da7c074 Wire up FlexFEC in VideoEngine2.
This CL interfaces the SDP information (payload types and
SSRCs) about FlexFEC with the corresponding configs at the
Call layer. It also adds a field trial, which when active
will expose FlexFEC in the default codec list, thus showing
up in the default SDP.

BUG=webrtc:5654
R=magjed@webrtc.org, stefan@webrtc.org
CC=perkj@webrtc.org

Review-Url: https://codereview.webrtc.org/2511703002
Cr-Commit-Position: refs/heads/master@{#15184}
2016-11-22 10:16:56 +00:00
magjed
509e4fe8e6 Reland of Stop using hardcoded payload types for video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2513633002/ )
Reason for revert:
The WebRtcBrowserTest.NegotiateUnsupportedVideoCodec test has been fixed in Chromium with the following change:
   function removeVideoCodec(offerSdp) {
-    offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n',
-                                'a=rtpmap:100 XVP8/90000\r\n');
+    offerSdp = offerSdp.replace(/a=rtpmap:(\d+)\ VP8\/90000\r\n/,
+                                'a=rtpmap:$1 XVP8/90000\r\n');
     return offerSdp;
   }

Original issue's description:
> Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
>
> Reason for revert:
> Breaks chromium.fyi test:
> WebRtcBrowserTest.NegotiateUnsupportedVideoCodec
>
> Original issue's description:
> > Stop using hardcoded payload types for video codecs
> >
> > This CL stops using hardcoded payload types for different video codecs
> > and will dynamically assign them payload types incrementally from 96 to
> > 127 instead.
> >
> > This CL:
> >  * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
> >    webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
> >    internally supported software codecs instead. The purpose is to
> >    streamline the payload type assignment in webrtcvideoengine2.cc which
> >    will now have two encoder factories of the same
> >    WebRtcVideoEncoderFactory type; one internal and one external.
> >  * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
> >    instead.
> >  * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
> >    moves the create function to the internal encoder factory instead.
> >  * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
> >    interface without any static functions.
> >  * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
> >    the internal and external codecs and assigns them payload types
> >    incrementally from 96 to 127.
> >  * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
> >    what payload types will be used.
> >
> > BUG=webrtc:6677,webrtc:6705
> > R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
> >
> > Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> > Cr-Commit-Position: refs/heads/master@{#15135}
>
> TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6677,webrtc:6705
>
> Committed: https://crrev.com/eacbaea920797ff751ca83050d140821f5055591
> Cr-Commit-Position: refs/heads/master@{#15140}

TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705

Review-Url: https://codereview.webrtc.org/2511933002
Cr-Commit-Position: refs/heads/master@{#15148}
2016-11-18 09:34:14 +00:00
magjed
eacbaea920 Revert of Stop using hardcoded payload types for video codecs (patchset #6 id:210001 of https://codereview.webrtc.org/2493133002/ )
Reason for revert:
Breaks chromium.fyi test:
WebRtcBrowserTest.NegotiateUnsupportedVideoCodec

Original issue's description:
> Stop using hardcoded payload types for video codecs
>
> This CL stops using hardcoded payload types for different video codecs
> and will dynamically assign them payload types incrementally from 96 to
> 127 instead.
>
> This CL:
>  * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
>    webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
>    internally supported software codecs instead. The purpose is to
>    streamline the payload type assignment in webrtcvideoengine2.cc which
>    will now have two encoder factories of the same
>    WebRtcVideoEncoderFactory type; one internal and one external.
>  * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
>    instead.
>  * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
>    moves the create function to the internal encoder factory instead.
>  * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
>    interface without any static functions.
>  * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
>    the internal and external codecs and assigns them payload types
>    incrementally from 96 to 127.
>  * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
>    what payload types will be used.
>
> BUG=webrtc:6677,webrtc:6705
> R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org
>
> Committed: https://crrev.com/42043b95872b51321f508bf255d804ce3dff366b
> Cr-Commit-Position: refs/heads/master@{#15135}

TBR=hta@webrtc.org,stefan@webrtc.org,ossu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6677,webrtc:6705

Review-Url: https://codereview.webrtc.org/2513633002
Cr-Commit-Position: refs/heads/master@{#15140}
2016-11-17 16:52:06 +00:00
Magnus Jedvert
42043b9587 Stop using hardcoded payload types for video codecs
This CL stops using hardcoded payload types for different video codecs
and will dynamically assign them payload types incrementally from 96 to
127 instead.

This CL:
 * Replaces 'std::vector<VideoCodec> DefaultVideoCodecList()' in
   webrtcvideoengine2.cc with an explicit WebRtcVideoEncoderFactory for
   internally supported software codecs instead. The purpose is to
   streamline the payload type assignment in webrtcvideoengine2.cc which
   will now have two encoder factories of the same
   WebRtcVideoEncoderFactory type; one internal and one external.
 * Removes webrtc::VideoEncoder::EncoderType and use cricket::VideoCodec
   instead.
 * Removes 'static VideoEncoder* Create(EncoderType codec_type)' and
   moves the create function to the internal encoder factory instead.
 * Removes video_encoder.cc. webrtc::VideoEncoder is now just an
   interface without any static functions.
 * The function GetSupportedCodecs in webrtcvideoengine2.cc unifies
   the internal and external codecs and assigns them payload types
   incrementally from 96 to 127.
 * Updates webrtcvideoengine2_unittest.cc and removes assumptions about
   what payload types will be used.

BUG=webrtc:6677,webrtc:6705
R=hta@webrtc.org, ossu@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2493133002 .

Cr-Commit-Position: refs/heads/master@{#15135}
2016-11-17 15:08:47 +00:00
magjed
725e484e33 Use different RTX payload types for different H264 profiles
This CL is a quick fix to unblock H264 High Profile. This CL is supposed
to be superseded by a proper fix of
https://bugs.chromium.org/p/webrtc/issues/detail?id=6705 like
https://codereview.webrtc.org/2493133002/.

BUG=webrtc:6677

Review-Url: https://codereview.webrtc.org/2497773003
Cr-Commit-Position: refs/heads/master@{#15099}
2016-11-16 08:48:21 +00:00
honghaiz
906c5dc6b7 Revert of Start probes only after network is connected. (patchset #9 id:240001 of https://codereview.webrtc.org/2458863002/ )
Reason for revert:
It broke downstream test.

Original issue's description:
> Start probes only after network is connected.
>
> Previously ProbeController was starting probing as soon as SetBitrates()
> is called. As result these probes would often timeout while connection
> is being established. Now ProbeController receives notifications about
> network route changes. This allows to start probing only when transport
> is connected. This also makes it possible to restart probing whenever
> transport route changes (will be done in a separate change).
>
> BUG=webrtc:6332
>
> Committed: https://crrev.com/5c99c76255ee7bface3c742c25fb5617748ac86e
> Cr-Commit-Position: refs/heads/master@{#15094}

TBR=philipel@webrtc.org,stefan@webrtc.org,sergeyu@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6332

Review-Url: https://codereview.webrtc.org/2504783002
Cr-Commit-Position: refs/heads/master@{#15098}
2016-11-15 22:39:09 +00:00
sergeyu
5c99c76255 Start probes only after network is connected.
Previously ProbeController was starting probing as soon as SetBitrates()
is called. As result these probes would often timeout while connection
is being established. Now ProbeController receives notifications about
network route changes. This allows to start probing only when transport
is connected. This also makes it possible to restart probing whenever
transport route changes (will be done in a separate change).

BUG=webrtc:6332

Review-Url: https://codereview.webrtc.org/2458863002
Cr-Commit-Position: refs/heads/master@{#15094}
2016-11-15 20:25:37 +00:00
magjed
f823ededce Negotiate H264 profiles in SDP
This CL will start to distinguish H264 profiles during SDP negotiation.
We currently don't look at the H264 profile at all and assume they are
all Constrained Baseline Level 3.1. This CL will start to check profiles
for equality when matching, and will generate the correct answer H264
level.

Each local supported H264 profile needs to be listed explicitly in the
list of local supported codecs, even if they are redundant. For example,
Baseline profile should be listed explicitly even though another profile
that is a superset of Baseline is also listed. The reason for this is to
simplify the code and avoid profile intersection during matching. So
VideoCodec::Matches will check for profile equality, and not check if
one codec is a subset of the other. This also leads to the nice property
that VideoCodec::Matches is symmetric, i.e. iif a.Matches(b) then
b.Matches(a).

BUG=webrtc:6337
TBR=tkchin@webrtc.org

Review-Url: https://codereview.webrtc.org/2483173002
Cr-Commit-Position: refs/heads/master@{#15051}
2016-11-12 17:53:08 +00:00
brandtr
e6f98c7a37 Remove RED/RTX workaround from sender/receiver and VideoEngine2.
In older Chrome versions, the associated payload type in the RTX header
of retransmitted packets was always set to be the original media payload type,
regardless of the actual payload type of the packet. This meant that packets
encapsulated with RED headers had incorrect payload type information in the
RTX header. Due to an assumption in the receiver, this incorrect payload type
information would effectively be undone, leading to a working system.

Albeit working, this behaviour was undesired, and thus removed. In the interim,
several workarounds were introduced to not destroy interop between old and
new Chrome versions:
  (1) https://codereview.webrtc.org/1649493004
      - If no payload type mapping existed for RED over RTX, the payload type
        of the underlying media would be used.
      - If RED had been negotiated, received RTX packets would always be
        assumed to contain RED.
  (2) https://codereview.webrtc.org/1964473002
      - If RED was removed from the remote description answer, it would be
        disabled in the local receiver as well.
  (3) https://codereview.webrtc.org/2033763002
      - If RED was negotiated in the SDP, it would always be used, regardless
        if ULPFEC was negotiated and used, or not.

Since the Chrome versions that exhibited the original bug now are very old,
this CL removes the workarounds from (1) and (2). In particular, after this
change, we will have the following behaviour:
  - We assume that a payload type mapping for RED over RTX always is set.
    If this is not the case, the RTX packet is not sent.
  - The associated payload type of received RTX packets will always be obeyed.
  - The (non)-existence of RED in the remote description does not affect the
    local receiver.
The workaround in (3) still needs to exist, in order to interop with receivers
that did not have the workarounds in (1) and (2) removed. The change in (3)
can be removed in a couple of Chrome versions.

TESTED=Using AppRTC between patched Chrome (connected to ethernet) and standard Chrome M54 (connected to lossy internal Google WiFi), with and without FEC turned off using AppRTC flag. Also using "Munge SDP" sample on patched Chrome over loopback interface, with 100ms delay and 5% packet loss simulated using tc.
BUG=webrtc:6650

Review-Url: https://codereview.webrtc.org/2469093003
Cr-Commit-Position: refs/heads/master@{#15038}
2016-11-11 11:28:38 +00:00
perkj
803d97f159 Let ViEEncoder express resolution requests as Sinkwants.
This removes the VideoSendStream::LoadObserver interface and the implementation in WebrtcVideoSendStream and replace it with VideoSinkWants through the VideoSourceInterface.

To do that that, some stats for CPU adaptation is moved into VideoSendStream. Also handling of the CVO rtp header extension is moved to VideoSendStreamImpl.

BUG=webrtc:5687
TBR=mflodman@webrtc.org

Review-Url: https://codereview.webrtc.org/2304363002
Cr-Commit-Position: refs/heads/master@{#14877}
2016-11-01 18:45:54 +00:00
sakal
87da404883 Implement qpSum stat for video send ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2430603003
Cr-Commit-Position: refs/heads/master@{#14851}
2016-10-31 13:53:51 +00:00
Per
21d45d2ab6 Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known.
This is the second reland.  Patchset 1 contains the reverted cl.
Patchset 2 revert the change to initialize the encoder with resolution 1*1pixels if an internal source is used.
This is to to fix the problem reported in https://codereview.webrtc.org/2457203002/ https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Tester/builds/35251 remoting.
Fix has been verified to work in Chrome.
This reverts commit 05a55b500d83e4212d4e54f0fecf13097e782ffa.

BUG=webrtc:6371 b/32285861
TBR=pbos@webrtc.org, skvlad@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2458363002 .

Cr-Commit-Position: refs/heads/master@{#14833}
2016-10-30 20:38:56 +00:00
emircan
05a55b500d Revert of Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known. (patchset #2 id:20001 of https://codereview.webrtc.org/2455963004/ )
Reason for revert:
It breaks webrtc.fyi bots, see
https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Tester/builds/35251.

Original issue's description:
> Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known.
>
> Patchset 1 contain the originally reviewed cl in https://codereview.webrtc.org/2455063002/
> TBR=stefan@webrtc.org, pbos@webrtc.org, skvlad@webrtc.org
>
> BUG=webrtc:6371 b/32285861
>
> Committed: https://crrev.com/5f1b05129e4770c98429164761779d99a410e7c8
> Cr-Commit-Position: refs/heads/master@{#14823}

TBR=pbos@webrtc.org,skvlad@webrtc.org,stefan@webrtc.org,perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6371 b/32285861

Review-Url: https://codereview.webrtc.org/2457203002
Cr-Commit-Position: refs/heads/master@{#14829}
2016-10-28 21:06:36 +00:00
magjed
1e45cc6ee0 Replace WebRtcVideoEncoderFactory::VideoCodec with cricket::VideoCodec
This CL introduces two new functions to the WebRtcVideoEncoderFactory
interface based on cricket::VideoFormat instead of
WebRtcVideoEncoderFactory::VideoCodec. The functions are:
WebRtcVideoEncoderFactory::CreateVideoEncoder() and
WebRtcVideoEncoderFactory::supported_codecs(). In order to make a smooth
transition to the new interface, the old functions are kept, and default
implementations are provided for both the old and new functions so that
external clients can switch from the old to the new functions in peace.
The default implementations will just convert between
cricket::VideoFormat and WebRtcVideoEncoderFactory::VideoCodec. Once all
external clients have updated their code, the plan is to remove the old
functions and all default implementations to make
WebRtcVideoEncoderFactory a pure interface again.

BUG=webrtc:6402,webrtc:6337

Review-Url: https://codereview.webrtc.org/2449993003
Cr-Commit-Position: refs/heads/master@{#14826}
2016-10-28 14:43:52 +00:00
perkj
5f1b05129e Reland Change ViEEncoder to not reconfigure the encoder until the video resolution is known.
Patchset 1 contain the originally reviewed cl in https://codereview.webrtc.org/2455063002/
TBR=stefan@webrtc.org, pbos@webrtc.org, skvlad@webrtc.org

BUG=webrtc:6371 b/32285861

Review-Url: https://codereview.webrtc.org/2455963004
Cr-Commit-Position: refs/heads/master@{#14823}
2016-10-28 13:58:43 +00:00
perkj
5da65f241c Revert of Change ViEEncoder to not reconfigure the encoder until the video resolution is known. (patchset #4 id:60001 of https://codereview.webrtc.org/2455063002/ )
Reason for revert:
Seems to break WebRTC perf tests.

Original issue's description:
> Change ViEEncoder to not reconfigure the encoder until the video resolution is known.
>
> BUG=b/32285861
>
> Committed: https://crrev.com/461c29e436b5bd7ed019e83024e24dc8e86ec9b9
> Cr-Commit-Position: refs/heads/master@{#14813}

TBR=skvlad@webrtc.org,pbos@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=b/32285861

Review-Url: https://codereview.webrtc.org/2457083002
Cr-Commit-Position: refs/heads/master@{#14815}
2016-10-28 11:48:53 +00:00
perkj
461c29e436 Change ViEEncoder to not reconfigure the encoder until the video resolution is known.
BUG=b/32285861

Review-Url: https://codereview.webrtc.org/2455063002
Cr-Commit-Position: refs/heads/master@{#14813}
2016-10-28 10:13:58 +00:00
sakal
e5ba44eab1 Implement framesDecoded stat in video receive ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2423823003
Cr-Commit-Position: refs/heads/master@{#14789}
2016-10-26 14:09:29 +00:00
sakal
43536c3d6a Implement framesEncoded stat in video send ssrc stats.
Implemented as defined by this pull request: https://github.com/w3c/webrtc-stats/pull/70

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2421193003
Cr-Commit-Position: refs/heads/master@{#14734}
2016-10-24 09:09:39 +00:00
perkj
267527459b Remove cricket::VideoCodec with, height and framerate properties
Since WebRtcVideoSendStream have reconfigures the send codec to match the incoming captured frames widht and height they have not been used.
Framerate has just been set when parsing sdp to 60fps and not changed elsewhere.

This cl require some upstream projects to change first.

BUG=webrtc:5332

Review-Url: https://codereview.webrtc.org/2408153002
Cr-Commit-Position: refs/heads/master@{#14733}
2016-10-24 08:21:24 +00:00
Per
061ea0df03 Remove VideoCodec resolution validation.
This is needed to be able to land https://codereview.webrtc.org/2408153002/  "Remove cricket::VideoCodec with, height and framerate properties" without breaking upstream projects.

BUG=webrtc:5332
TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2437453003 .

Cr-Commit-Position: refs/heads/master@{#14681}
2016-10-19 11:58:09 +00:00
nisse
e5ddf52b97 Delete unused file webrtcvideochannelfactory.h.
BUG=None

Review-Url: https://codereview.webrtc.org/2416453002
Cr-Commit-Position: refs/heads/master@{#14641}
2016-10-15 18:29:59 +00:00
skvlad
11a9cbfa50 Refactoring: move ownership of RtcEventLog from Call to PeerConnection
This CL is a pure refactoring which should not result in any functinal
changes. It moves ownership of the RtcEventLog from webrtc::Call to the
webrtc::PeerConnection object.

This is done so that we can add RtcEventLog support for ICE events -
which will require the TransportController to have a pointer to the
RtcEventLog. PeerConnection is the closest common owner of both Call and
TransportController (through WebRtcSession).

BUG=webrtc:6393

Review-Url: https://codereview.webrtc.org/2353033005
Cr-Commit-Position: refs/heads/master@{#14578}
2016-10-07 18:53:15 +00:00
brandtr
b5f2c3fbe9 Rename FecConfig to UlpfecConfig in config.h.
Also rename some related minor methods. No functional changes
are intended/expected.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2391963002
Cr-Commit-Position: refs/heads/master@{#14513}
2016-10-05 06:28:43 +00:00
perkj
fa10b557d9 Releand of Let ViEEncoder handle resolution changes.
The original landed cl is in patchset 1.
The following patchset fix VideoQualityTest as well as fix the case where max_bitrate is set in the SendParams. A unit test is added for that as well.

Original cl description:
Let ViEEncoder handle resolution changes.

This cl move codec reconfiguration due to video frame size changes from WebRtcVideoSendStream to ViEEncoder.

With this change, many variables in WebRtcVideoSendStream no longer need to be locked.

BUG=webrtc:5687, webrtc:6371, webrtc:5332

Review-Url: https://codereview.webrtc.org/2386573002
Cr-Commit-Position: refs/heads/master@{#14467}
2016-10-03 06:45:33 +00:00
perkj
3b703ede8b Revert of Let ViEEncoder handle resolution changes. (patchset #17 id:340001 of https://codereview.webrtc.org/2351633002/ )
Reason for revert:
Fails on a content_browsertest (and also webrtc_perf?)

https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Tester/builds/34336

https://build.chromium.org/p/client.webrtc/builders/Linux64%20Release%20%5Blarge%20tests%5D/builds/9091/steps/webrtc_perf_tests/logs/stdio
[  FAILED  ] FullStackTest.ParisQcifWithoutPacketLoss (59436 ms)

Original issue's description:
> Let ViEEncoder handle resolution changes.
>
> This cl move codec reconfiguration due to video frame size changes from WebRtcVideoSendStream to ViEEncoder.
>
> With this change, many variables in WebRtcVideoSendStream no longer need to be locked.
>
> BUG=webrtc:5687, webrtc:6371, webrtc:5332
>
> Committed: https://crrev.com/26105b41b4f97642ee30cb067dc786c2737709ad
> Cr-Commit-Position: refs/heads/master@{#14445}

TBR=sprang@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5687, webrtc:6371, webrtc:5332

Review-Url: https://codereview.webrtc.org/2383493005
Cr-Commit-Position: refs/heads/master@{#14447}
2016-09-30 06:25:46 +00:00
perkj
26105b41b4 Let ViEEncoder handle resolution changes.
This cl move codec reconfiguration due to video frame size changes from WebRtcVideoSendStream to ViEEncoder.

With this change, many variables in WebRtcVideoSendStream no longer need to be locked.

BUG=webrtc:5687, webrtc:6371, webrtc:5332

Review-Url: https://codereview.webrtc.org/2351633002
Cr-Commit-Position: refs/heads/master@{#14445}
2016-09-30 05:39:15 +00:00