703 Commits

Author SHA1 Message Date
nisse
deb95f32f4 Change rtc::TimeNanos and rtc::TimeMicros return value from uint64_t to int64_t.
Also updated types close to call sites.

BUG=webrtc:6733

Review-Url: https://codereview.webrtc.org/2514553003
Cr-Commit-Position: refs/heads/master@{#15255}
2016-11-28 09:55:05 +00:00
magjed
1da1a09bf5 Android HW encoder: Set constrained baseline as the profile
The Android HW encoder is currently not setting any H264 codec parameters or profile information. No profile-level-id means Baseline Level 1, but we are actually using Contrained Baseline Level 3.1. This CL sets the correct codec parameters.

BUG=webrtc:6337

Review-Url: https://codereview.webrtc.org/2497163002
Cr-Commit-Position: refs/heads/master@{#15247}
2016-11-25 14:51:36 +00:00
hbos
c42d37646f DataChannelInterface: Remove default implementation of methods.
This can land as soon as https://codereview.chromium.org/2520033005/ has
landed.

BUG=chromium:654927

Review-Url: https://codereview.webrtc.org/2524033002
Cr-Commit-Position: refs/heads/master@{#15221}
2016-11-24 09:18:00 +00:00
honghaiz
d44d0bae85 For VPN network, use the underlying network type as its type.
This is for Android.

BUG=webrtc:6748

Review-Url: https://codereview.webrtc.org/2522073003
Cr-Commit-Position: refs/heads/master@{#15218}
2016-11-23 19:04:33 +00:00
zhihuang
4dfb8cef51 Make the default value of rtcp-mux policy to required.
Change the default value of rtcp-mux policy in RTCConfiguration.
Refactor the peerconnectioninterface and webrtcsession unit tests.

BUG=webrtc:6030

Review-Url: https://codereview.webrtc.org/2043193003
Cr-Commit-Position: refs/heads/master@{#15217}
2016-11-23 18:30:21 +00:00
hbos
42eee12614 RTCPeerConnectionStats: Removed fixed TODO comments.
I forget to remove these when fixing them.

BUG=chromium:636818
NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2522023003
Cr-Commit-Position: refs/heads/master@{#15215}
2016-11-23 15:43:32 +00:00
sakal
08be780512 Reland of Allow custom metrics implementations on Android. (patchset #1 id:1 of https://codereview.webrtc.org/2516403002/ )
Reason for revert:
Fix downstream.

Original issue's description:
> Revert of Allow custom metrics implementations on Android. (patchset #11 id:260001 of https://codereview.webrtc.org/2403463002/ )
>
> Reason for revert:
> Break downstream tests.
>
> Original issue's description:
> > Allow custom metrics implementations on Android.
> >
> > BUG=webrtc:6499
> >
> > Committed: https://crrev.com/de609b26c5fc77fd3388eae5594ee8a634edf8da
> > Cr-Commit-Position: refs/heads/master@{#15169}
>
> TBR=kjellander@webrtc.org,magjed@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6499
>
> Committed: https://crrev.com/f570a2804ed8af6f6586f4aea51e089bd55d7e42
> Cr-Commit-Position: refs/heads/master@{#15171}

TBR=kjellander@webrtc.org,magjed@webrtc.org,philipel@webrtc.org
BUG=webrtc:6499

Review-Url: https://codereview.webrtc.org/2518293002
Cr-Commit-Position: refs/heads/master@{#15214}
2016-11-23 15:12:28 +00:00
sakal
8b6462861d Add fps reduction API to SurfaceViewRenderer.
SurfaceViewRenderer forwards these calls to EglRenderer.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2517953004
Cr-Commit-Position: refs/heads/master@{#15212}
2016-11-23 14:19:33 +00:00
sakal
4fe3b8dbe7 Add framelistener functionality to SurfaceViewRenderer.
SurfaceViewRenderer forwards these calls to EglRenderer.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2524723002
Cr-Commit-Position: refs/heads/master@{#15211}
2016-11-23 14:18:25 +00:00
sakal
1c82884e31 Remove binding framebuffer from GlTextureFrameBuffer.setSize.
There shouldn't be a need to bind the framebuffer to modify the texture
size. Binding the framebuffer causes a crash on Samsung Galaxy S3 mini
for some reason.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2524003002
Cr-Commit-Position: refs/heads/master@{#15210}
2016-11-23 14:12:30 +00:00
hbos
0adb8285b1 RTCCodecStats[1] added.
RTCStatsCollector supports "payloadType", "codec" and "clockRate".
"channels", "parameters" and "implementation" need to be supported
before closing crbug.com/659117.

[1] https://w3c.github.io/webrtc-stats/#codec-dict*

BUG=chromium:659117, chromium:627816, chromium:657854
NOTRY=True

Review-Url: https://codereview.webrtc.org/2509803004
Cr-Commit-Position: refs/heads/master@{#15207}
2016-11-23 10:32:14 +00:00
magjed
10165ab8e7 Unify VideoCodecType to/from string functionality
BUG=None

Review-Url: https://codereview.webrtc.org/2509273002
Cr-Commit-Position: refs/heads/master@{#15200}
2016-11-22 18:17:04 +00:00
magjed
2d60e53ad5 H264 encoder: Include QP information in encoded images
Set the |qp_| field in EncodedImage before calling OnEncodedImage.

BUG=webrtc:6541

Review-Url: https://codereview.webrtc.org/2499003002
Cr-Commit-Position: refs/heads/master@{#15199}
2016-11-22 16:42:14 +00:00
aleloi
17338d41ac Created an AudioMixer mock in webrtc/api/test.
The mock is used in a dependent CL https://codereview.webrtc.org/2436033002.

There is also a goal to allow external mixing implementations
(subclasses of webrtc::AudioMixer) and inject them to
PeerConnectionFactory. We think that part of that is an official and
maintained mock.

Summary of changes:
    * Created a mixer mock/stub in webrtc/api/test
    * Made a target webrtc/api:mock_audio_mixer for it.

NOTRY=True
BUG=webrtc:6346

Review-Url: https://codereview.webrtc.org/2520323002
Cr-Commit-Position: refs/heads/master@{#15190}
2016-11-22 14:02:12 +00:00
hbos
820f578f2b RTCInboundRTPStreamStats's [fir/pli/nack]_count are collected for video.
Previously this was only collected for RTCOutboundRTPStreamStats video,
with no comment saying it was missing for Inbound. (nack_count should be
collected vor audio as well but this is currently not available - there
is already an existing comment about this in rtcstats_objects.h.)

BUG=chromium:657855, chromium:657854, chromium:627816

Review-Url: https://codereview.webrtc.org/2515293002
Cr-Commit-Position: refs/heads/master@{#15185}
2016-11-22 11:16:56 +00:00
sakal
b1e6d5efa6 Set surface view surface size to minimum of the layout size and frame size.
This improves the performance of SurfaceViewRenderer. This feature is added
behind a flag for now because it can be buggy on some devices.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2510413002
Cr-Commit-Position: refs/heads/master@{#15181}
2016-11-22 09:54:47 +00:00
sakal
0ce6aafc32 Move androidvideotracksource from api under api/android/jni.
This file fits there more naturally since it has dependencies to jni.

BUG=None

Review-Url: https://codereview.webrtc.org/2514383002
Cr-Commit-Position: refs/heads/master@{#15179}
2016-11-22 09:26:22 +00:00
sakal
f72331205d Add an empty libjingle_peerconnection_metrics_default_jni target.
This allows downstream dependencies can add it as a dependency.

BUG=webrtc:6499

Review-Url: https://codereview.webrtc.org/2521183002
Cr-Commit-Position: refs/heads/master@{#15178}
2016-11-22 09:25:16 +00:00
hbos
28747969cd RTCStats operator== bugfix
a == b would return true if a.member is defined even if b.member is
undefined if their values were equal. We would say that b does not have
a value in that case but its value_ member would still be initialized to
something that is being compared to. Bugfix makes sure not to do value
comparison in this case if b is undefined.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2517163002
Cr-Commit-Position: refs/heads/master@{#15172}
2016-11-21 17:17:51 +00:00
philipel
f570a2804e Revert of Allow custom metrics implementations on Android. (patchset #11 id:260001 of https://codereview.webrtc.org/2403463002/ )
Reason for revert:
Break downstream tests.

Original issue's description:
> Allow custom metrics implementations on Android.
>
> BUG=webrtc:6499
>
> Committed: https://crrev.com/de609b26c5fc77fd3388eae5594ee8a634edf8da
> Cr-Commit-Position: refs/heads/master@{#15169}

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

Review-Url: https://codereview.webrtc.org/2516403002
Cr-Commit-Position: refs/heads/master@{#15171}
2016-11-21 16:30:05 +00:00
sakal
de609b26c5 Allow custom metrics implementations on Android.
BUG=webrtc:6499

Review-Url: https://codereview.webrtc.org/2403463002
Cr-Commit-Position: refs/heads/master@{#15169}
2016-11-21 15:41:09 +00:00
magjed
e718606d00 Make magjed@ owner of webrtc/api/android/
Make magjed@ owner of whole webrtc/api/android/ and remove him as owner of subfolders.

BUG=None
NOTRY=True

Review-Url: https://codereview.webrtc.org/2516973004
Cr-Commit-Position: refs/heads/master@{#15168}
2016-11-21 14:49:08 +00:00
sakal
6280960998 Correctly pass drawn frame size when layout aspect ratio is used in EglRenderer.
Previously, layout matrix was not correctly taken into account when calculating
the drawn size of the frame.

BUG=webrtc:6470

Review-Url: https://codereview.webrtc.org/2514793002
Cr-Commit-Position: refs/heads/master@{#15163}
2016-11-21 10:24:53 +00:00
aleloi
76b3049e7c Changed the interface AudioMixer::RemoveSource to have a void return type.
In the AudioMixerImpl implementation, removing a source never fails
and the return value is always true (see audio_mixer/audio_mixer_impl.cc).

A return value of |false| signaled that removing a source failed for
some reason. We have come to the conclusion that
   * we don't know how to handle a return value of |false|
   * we can't think of why an alternative implementation would need to
     signal failure when removing a stream.

To avoid having a status code that is never read, never acted upon and
probably never set to anything but |true|, we change ::RemoveSource to
not have a return value.

NOTRY=True
BUG=webrtc:6346

Review-Url: https://codereview.webrtc.org/2506173003
Cr-Commit-Position: refs/heads/master@{#15150}
2016-11-18 10:03:08 +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
hbos
1acfbd22cc Expose RtpCodecParameters to VoiceMediaInfo stats.
Payload type -> RtpCodecParameters maps added for sender and receiver.
This is a follow-up to https://codereview.webrtc.org/2484193002/ which
did the same thing for VideoMediaInfo. This information will be used to
produce RTCCodecStats[1].

Voice[Sender/Receiver]Info is updated with current codec payload type
for every stream which can be used to look up the codec in
VoiceMediaInfo.

[1] https://w3c.github.io/webrtc-stats/#codec-dict*

BUG=chromium:659117

Review-Url: https://codereview.webrtc.org/2503383002
Cr-Commit-Position: refs/heads/master@{#15144}
2016-11-18 07:43:39 +00:00
zhihuang
81c3a03004 Added a callback function OnAddTrack to PeerConnectionObserver
Added the callback in native c++ API.
The callback function is called when a track is added and a new RtpReceiver is created.
The application can tell when tracks are added to the streams by listening to this callback.

BUG=webrtc:6112

Review-Url: https://codereview.webrtc.org/2505173002
Cr-Commit-Position: refs/heads/master@{#15142}
2016-11-17 20:06:37 +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
solenberg
ffbbcac4c6 Support multiple timestamp rates for sending DTMF.
We support multiple payload types, and one which matches the audio codec the closest, is picked (or the one with lowest clock rate, if no perfect match is found).

The exact clock rate is then ignored and DTMF packets are time stamped with the rate of the current audio codec. This is exactly the way the code has worked up to this point, but until now we have been under the impression that we were in fact sending 8k DTMF.

In other words, this is an improvement over the current situation, since we will most likely find a payload type which matches the codec clock rate.

This CL also does a little cleaning of the DTMFQueue and RTPSenderAudio classes.
BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2392883002
Cr-Commit-Position: refs/heads/master@{#15129}
2016-11-17 13:25:45 +00:00
hta
527d3474ad Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491613005/ )
Reason for revert:
More downstream issues fixed again.

Original issue's description:
> Revert of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2494683006/ )
>
> Reason for revert:
> Another downstream error.
>
> Original issue's description:
> > Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491933002/ )
> >
> > Reason for revert:
> > Relanding, now that downstream issues have been fixed.
> >
> > Original issue's description:
> > > Revert of Declare VideoCodec.codec_specific_info private (patchset #5 id:80001 of https://codereview.webrtc.org/2452963002/ )
> > >
> > > Reason for revert:
> > > Broke a google3 build
> > >
> > > Original issue's description:
> > > > Declare VideoCodec.codec_specific_info private
> > > >
> > > > This completes the privatization of the codec specific
> > > > information in VideoCodec.
> > > >
> > > > BUG=webrtc:6603
> > > >
> > > > Committed: https://crrev.com/792738640234d81c916ac4458ac72286cb2548a4
> > > > Cr-Commit-Position: refs/heads/master@{#15013}
> > >
> > > TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:6603
> > >
> > > Committed: https://crrev.com/7fe6db91d99cf6d43874651bcca56092cf869e2f
> > > Cr-Commit-Position: refs/heads/master@{#15027}
> >
> > TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:6603
> >
> > Committed: https://crrev.com/c63fb3a0d3b9b2081a6a5e6e238d8ee595dca2a2
> > Cr-Commit-Position: refs/heads/master@{#15041}
>
> TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6603
>
> Committed: https://crrev.com/281459896124685d355d37388ee2290b55015594
> Cr-Commit-Position: refs/heads/master@{#15042}

TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2508853002
Cr-Commit-Position: refs/heads/master@{#15117}
2016-11-17 07:23:15 +00:00
deadbeef
46c7389a63 Adding GetConfiguration to PeerConnection.
Just returns the configuration the PC was constructed with, or the last
one passed into SetConfiguration.

BUG=chromium:587453

Review-Url: https://codereview.webrtc.org/2504103002
Cr-Commit-Position: refs/heads/master@{#15111}
2016-11-17 03:42:09 +00:00
Henrik Kjellander
b4af3d673a Remove all references to GYP
Remove all .gyp and .gypi files.
Remove entries from OWNERS files for *.isolate, *.gyp, *.gypi
Remove unused scripts in webrtc/build.

BUG=webrtc:6323
R=henrika@webrtc.org, phoglund@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#15107}
2016-11-16 19:11:38 +00:00
Erik Språng
08127a9449 Reland #2 of Issue 2434073003: Extract bitrate allocation ...
This is yet another reland of https://codereview.webrtc.org/2434073003/
including two fixes:

1. SimulcastRateAllocator did not handle the screenshare settings properly for numSimulcastStreams = 1. Additional test case was added for that.
2. In VideoSender, when rate allocation is updated after setting a new VideoCodec config, only update the state of the EncoderParameters, but don't actually run SetRateAllocation on the encoder itself. This caused some problems upstreams.

Please review only the changes after patch set 1.

Original description:

Extract bitrate allocation of spatial/temporal layers out of codec impl.

This CL makes a number of intervowen changes:

* Add BitrateAllocation struct, that contains a codec independent view
  of how the target bitrate is distributed over spatial and temporal
  layers.

* Adds the BitrateAllocator interface, which takes a bitrate and frame
  rate and produces a BitrateAllocation.

* A default (non layered) implementation is added, and
  SimulcastRateAllocator is extended to fully handle VP8 allocation.
  This includes capturing TemporalLayer instances created by the
  encoder.

* ViEEncoder now owns both the bitrate allocator and the temporal layer
  factories for VP8. This allows allocation to happen fully outside of
  the encoder implementation.

This refactoring will make it possible for ViEEncoder to signal the
full picture of target bitrates to the RTCP module.

BUG=webrtc:6301
R=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#15105}
2016-11-16 15:41:45 +00:00
phoglund
613152af11 Add a JNI boot test to catch ARM dynamic linker regressions.
The peer connection loopback test could catch regressions too, but it's
too slow to run on downstream ARM emulators. I'm adding a test here
that just makes sure we can load the JNI and init audio/video engines
in WebRTC.

This test overlaps in functionality with the existing tests,
but we need it anyway since all existing tests are too timing-sensitive.

Removes resources from the test; they're awkward downstream and we
don't really need them anyway.

BUG=b/32820229

Review-Url: https://codereview.webrtc.org/2506603002
Cr-Commit-Position: refs/heads/master@{#15101}
2016-11-16 09:31:27 +00:00
hbos
82ebe02491 Correct stats for RTCPeerConnectionStats.dataChannels[Opened/Closed].
DataChannel.SignalOpened and unittests added.
PeerConnection.SignalDataChannelCreated added and wired up to
RTCStatsCollector.OnDataChannelCreated on RTCStatsCollector
construction.
RTCStatsCollector.OnSignalOpened/Closed added and wired up on
OnDataChannelCreated.
rtcstatscollector_unittest.cc updated, faking that channels are opened
and closed.

I did not want to use DataChannelObserver because it is used for more
than state changes and there can only be one observer (unless code is
updated). Since DataChannel already had a SignalClosed it made sense to
add a SignalOpened.

Having OnSignalBlah in RTCStatsCollector is new in this CL but will
likely be needed to correctly handle RTPMediaStreamTracks being added
and detached independently of getStats. This CL establishes this
pattern.

(An integration test will be needed for this and all the other stats to
make sure everything is wired up correctly and test outside of a
mock/fake environment, but this is not news.)

BUG=chromium:636818, chromium:627816

Review-Url: https://codereview.webrtc.org/2472113002
Cr-Commit-Position: refs/heads/master@{#15059}
2016-11-14 09:41:56 +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
magjed
13ceeeadfc Revert of H.264 packetization mode 0 (try 2) (patchset #27 id:520001 of https://codereview.webrtc.org/2337453002/ )
Reason for revert:
Broke a lot of tests in chromium.webrtc browser_tests. See e.g. https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/62228 and https://build.chromium.org/p/chromium.webrtc/builders/Win8%20Tester/builds/30102.
[ RUN      ] WebRtcVideoQualityBrowserTests/WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityH264/1
...
#
# Fatal error in e:\b\c\b\win_builder\src\third_party\webrtc\modules\rtp_rtcp\source\rtp_format_h264.cc, line 170
# last system error: 0
# Check failed: packetization_mode_ == kH264PacketizationMode1 (0 vs. 2)
#

Original issue's description:
> Implement H.264 packetization mode 0.
>
> This approach extends the H.264 specific information with
> a packetization mode enum.
>
> Status: Parameter is in code. No way to set it yet.
>
> Rebase of CL  2009213002
>
> BUG=600254
>
> Committed: https://crrev.com/3bba101f36483b8030a693dfbc93af736d1dba68
> Cr-Commit-Position: refs/heads/master@{#15032}

TBR=hbos@webrtc.org,sprang@webrtc.org,mflodman@webrtc.org,hta@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=600254
NOPRESUBMIT=true

Review-Url: https://codereview.webrtc.org/2500743002
Cr-Commit-Position: refs/heads/master@{#15050}
2016-11-12 16:54:50 +00:00
hta
2814598961 Revert of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2494683006/ )
Reason for revert:
Another downstream error.

Original issue's description:
> Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491933002/ )
>
> Reason for revert:
> Relanding, now that downstream issues have been fixed.
>
> Original issue's description:
> > Revert of Declare VideoCodec.codec_specific_info private (patchset #5 id:80001 of https://codereview.webrtc.org/2452963002/ )
> >
> > Reason for revert:
> > Broke a google3 build
> >
> > Original issue's description:
> > > Declare VideoCodec.codec_specific_info private
> > >
> > > This completes the privatization of the codec specific
> > > information in VideoCodec.
> > >
> > > BUG=webrtc:6603
> > >
> > > Committed: https://crrev.com/792738640234d81c916ac4458ac72286cb2548a4
> > > Cr-Commit-Position: refs/heads/master@{#15013}
> >
> > TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:6603
> >
> > Committed: https://crrev.com/7fe6db91d99cf6d43874651bcca56092cf869e2f
> > Cr-Commit-Position: refs/heads/master@{#15027}
>
> TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6603
>
> Committed: https://crrev.com/c63fb3a0d3b9b2081a6a5e6e238d8ee595dca2a2
> Cr-Commit-Position: refs/heads/master@{#15041}

TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2491613005
Cr-Commit-Position: refs/heads/master@{#15042}
2016-11-11 14:03:26 +00:00
hta
c63fb3a0d3 Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491933002/ )
Reason for revert:
Relanding, now that downstream issues have been fixed.

Original issue's description:
> Revert of Declare VideoCodec.codec_specific_info private (patchset #5 id:80001 of https://codereview.webrtc.org/2452963002/ )
>
> Reason for revert:
> Broke a google3 build
>
> Original issue's description:
> > Declare VideoCodec.codec_specific_info private
> >
> > This completes the privatization of the codec specific
> > information in VideoCodec.
> >
> > BUG=webrtc:6603
> >
> > Committed: https://crrev.com/792738640234d81c916ac4458ac72286cb2548a4
> > Cr-Commit-Position: refs/heads/master@{#15013}
>
> TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6603
>
> Committed: https://crrev.com/7fe6db91d99cf6d43874651bcca56092cf869e2f
> Cr-Commit-Position: refs/heads/master@{#15027}

TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2494683006
Cr-Commit-Position: refs/heads/master@{#15041}
2016-11-11 13:44:53 +00:00
magjed
b05fa2466a Optimize FindCodecById and ReferencedCodecsMatch
These functions currently copy cricket::Codec classes by value which is
expensive since they contain e.g. std::map<std::string, std::string>
containers with parameters. This CL avoids copying them altogether.

BUG=webrtc:6337

Review-Url: https://codereview.webrtc.org/2493733003
Cr-Commit-Position: refs/heads/master@{#15040}
2016-11-11 12:00:20 +00:00
nisse
acd935b540 Reland of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #1 id:1 of https://codereview.webrtc.org/2471783002/ )
Reason for revert:
Relanding after known downstream breakages have been fixed.

Original issue's description:
> Revert of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #7 id:120001 of https://codereview.webrtc.org/2383093002/ )
>
> Reason for revert:
> Breaks chrome, see https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/builds/19019/steps/compile/logs/stdio
>
> Analysis: Chrome uses cricket::VideoFrame, without explicitly including webrtc/media/base/videoframe.h, and breaks when that file is no longer included by any other webrtc headers. Will reland after updating Chrome.
>
> Original issue's description:
> > Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame.
> >
> > Replaced with webrtc::VideoFrame.
> >
> > TBR=mflodman@webrtc.org
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/45c8b8940042bd2574c39920804ade8343cefdba
> > Cr-Commit-Position: refs/heads/master@{#14885}
>
> TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@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:5682
>
> Committed: https://crrev.com/7341ab8e2505c9763d208e069bda269018357e7d
> Cr-Commit-Position: refs/heads/master@{#14886}

TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/2487633002
Cr-Commit-Position: refs/heads/master@{#15039}
2016-11-11 11:55:19 +00:00
hta
3bba101f36 Implement H.264 packetization mode 0.
This approach extends the H.264 specific information with
a packetization mode enum.

Status: Parameter is in code. No way to set it yet.

Rebase of CL  2009213002

BUG=600254

Review-Url: https://codereview.webrtc.org/2337453002
Cr-Commit-Position: refs/heads/master@{#15032}
2016-11-11 05:50:05 +00:00
hta
7fe6db91d9 Revert of Declare VideoCodec.codec_specific_info private (patchset #5 id:80001 of https://codereview.webrtc.org/2452963002/ )
Reason for revert:
Broke a google3 build

Original issue's description:
> Declare VideoCodec.codec_specific_info private
>
> This completes the privatization of the codec specific
> information in VideoCodec.
>
> BUG=webrtc:6603
>
> Committed: https://crrev.com/792738640234d81c916ac4458ac72286cb2548a4
> Cr-Commit-Position: refs/heads/master@{#15013}

TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2491933002
Cr-Commit-Position: refs/heads/master@{#15027}
2016-11-10 16:37:05 +00:00
sprang
1369c83b42 Revert of Issue 2434073003: Extract bitrate allocation ... (patchset #4 id:60001 of https://codereview.webrtc.org/2488833004/ )
Reason for revert:
Seems to be causing flakiness in perf test:
FullStackTest.ScreenshareSlidesVP8_2TL_LossyNet

Original issue's description:
> Reland of Issue 2434073003: Extract bitrate allocation ...
>
> This is a reland of https://codereview.webrtc.org/2434073003/ including
> some fixes for failing test cases.
>
> Original description:
>
> Extract bitrate allocation of spatial/temporal layers out of codec impl.
>
> This CL makes a number of intervowen changes:
>
> * Add BitrateAllocation struct, that contains a codec independent view
>   of how the target bitrate is distributed over spatial and temporal
>   layers.
>
> * Adds the BitrateAllocator interface, which takes a bitrate and frame
>   rate and produces a BitrateAllocation.
>
> * A default (non layered) implementation is added, and
>   SimulcastRateAllocator is extended to fully handle VP8 allocation.
>   This includes capturing TemporalLayer instances created by the
>   encoder.
>
> * ViEEncoder now owns both the bitrate allocator and the temporal layer
>   factories for VP8. This allows allocation to happen fully outside of
>   the encoder implementation.
>
> This refactoring will make it possible for ViEEncoder to signal the
> full picture of target bitrates to the RTCP module.
>
> BUG=webrtc:6301
>
> Committed: https://crrev.com/647bf43dcb2fd16fccf276bd94dc4400728bb405
> Cr-Commit-Position: refs/heads/master@{#15023}

TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2491393002
Cr-Commit-Position: refs/heads/master@{#15026}
2016-11-10 16:30:39 +00:00
sprang
647bf43dcb Reland of Issue 2434073003: Extract bitrate allocation ...
This is a reland of https://codereview.webrtc.org/2434073003/ including
some fixes for failing test cases.

Original description:

Extract bitrate allocation of spatial/temporal layers out of codec impl.

This CL makes a number of intervowen changes:

* Add BitrateAllocation struct, that contains a codec independent view
  of how the target bitrate is distributed over spatial and temporal
  layers.

* Adds the BitrateAllocator interface, which takes a bitrate and frame
  rate and produces a BitrateAllocation.

* A default (non layered) implementation is added, and
  SimulcastRateAllocator is extended to fully handle VP8 allocation.
  This includes capturing TemporalLayer instances created by the
  encoder.

* ViEEncoder now owns both the bitrate allocator and the temporal layer
  factories for VP8. This allows allocation to happen fully outside of
  the encoder implementation.

This refactoring will make it possible for ViEEncoder to signal the
full picture of target bitrates to the RTCP module.

BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2488833004
Cr-Commit-Position: refs/heads/master@{#15023}
2016-11-10 14:46:28 +00:00
sakal
9d1315a961 Add UMA stats for the resolution camera is started in.
BUG=webrtc:6302

Review-Url: https://codereview.webrtc.org/2476313002
Cr-Commit-Position: refs/heads/master@{#15022}
2016-11-10 14:35:24 +00:00
kwiberg
1b35d4cdf1 Don't copy loop variables when we don't have to
This was suggested by clang-tidy.

BUG=none

Review-Url: https://codereview.webrtc.org/2489693002
Cr-Commit-Position: refs/heads/master@{#15018}
2016-11-10 13:15:41 +00:00
hta
7927386402 Declare VideoCodec.codec_specific_info private
This completes the privatization of the codec specific
information in VideoCodec.

BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2452963002
Cr-Commit-Position: refs/heads/master@{#15013}
2016-11-10 11:26:45 +00:00
sprang
4bc98d4e1b Revert of Extract bitrate allocation of spatial/temporal layers out of codec impl. (patchset #17 id:320001 of https://codereview.webrtc.org/2434073003/ )
Reason for revert:
Breaks perf tests.

Original issue's description:
> Extract bitrate allocation of spatial/temporal layers out of codec impl.
>
> This CL makes a number of intervowen changes:
>
> * Add BitrateAllocation struct, that contains a codec independent view
>   of how the target bitrate is distributed over spatial and temporal
>   layers.
>
> * Adds the BitrateAllocator interface, which takes a bitrate and frame
>   rate and produces a BitrateAllocation.
>
> * A default (non layered) implementation is added, and
>   SimulcastRateAllocator is extended to fully handle VP8 allocation.
>   This includes capturing TemporalLayer instances created by the
>   encoder.
>
> * ViEEncoder now owns both the bitrate allocator and the temporal layer
>   factories for VP8. This allows allocation to happen fully outside of
>   the encoder implementation.
>
> This refactoring will make it possible for ViEEncoder to signal the
> full picture of target bitrates to the RTCP module.
>
> BUG=webrtc:6301
>
> Committed: https://crrev.com/8f46c679d24a05b3f08e02c6d91ec9637f34e24f
> Cr-Commit-Position: refs/heads/master@{#14998}

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

Review-Url: https://codereview.webrtc.org/2489843002
Cr-Commit-Position: refs/heads/master@{#15001}
2016-11-09 14:14:56 +00:00