Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to branch-head/58 and add ARM support. #61

Closed
wants to merge 12 commits into from
Closed
  •  
  •  
  •  
31 changes: 18 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEPOT_TOOLS_DIR="$THIRD_PARTY_DIR/depot_tools"
OS=$(go env GOOS)
ARCH=$(go env GOARCH)
CONFIG="Release"
COMMIT="f33698296719f956497d2dbff81b5080864a8804" # branch-heads/52
COMMIT="c279861207c5b15fc51069e96595782350e0ac12" # branch-heads/58

INCLUDE_DIR="$PROJECT_DIR/include"
LIB_DIR="$PROJECT_DIR/lib"
Expand Down Expand Up @@ -57,6 +57,13 @@ else
popd
fi

if [ "$ARCH" = "arm" ]; then
echo "Manually fetching arm sysroot"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was doing this manually necessary? gclient sync seems to do,

________ running '/usr/bin/python src/build/linux/sysroot_scripts/install-sysroot.py --running-as-hook' in '/Sandbox/go-webrtc/third_party/webrtc'
Wheezy arm sysroot image already up to date: /Sandbox/go-webrtc/third_party/webrtc/src/build/linux/debian_wheezy_arm-sysroot
Precise amd64 sysroot image already up to date: /Sandbox/go-webrtc/third_party/webrtc/src/build/linux/ubuntu_precise_amd64-sysroot

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gah, sorry, nevermind. I see you're cross-compiling.

pushd $WEBRTC_SRC || exit 1
./build/linux/sysroot_scripts/install-sysroot.py --arch=arm || exit 1
popd
fi

echo "Checking out latest tested / compatible version of webrtc ..."
pushd $WEBRTC_SRC
git checkout $COMMIT
Expand All @@ -67,19 +74,15 @@ pushd $WEBRTC_SRC || exit 1
rm -rf out/$CONFIG
popd

echo "Applying webrtc patches ..."
pushd $WEBRTC_SRC || exit 1
for PATCH in build_at_webrtc_branch_heads_52.patch; do
git apply --check ${PROJECT_DIR}/webrtc_patches/${PATCH} || exit 1
git am < ${PROJECT_DIR}/webrtc_patches/${PATCH} || exit 1
done
popd

echo "Building webrtc ..."
pushd $WEBRTC_SRC
export GYP_DEFINES="include_tests=0 include_examples=0"
python webrtc/build/gyp_webrtc webrtc/api/api.gyp || exit 1
ninja -C out/$CONFIG || exit 1
if [ "$ARCH" = "arm" ]; then
gn gen out/$CONFIG --args='target_os="linux" target_cpu="arm" is_debug=false' || exit 1
else
gn gen out/$CONFIG --args='is_debug=false' || exit 1
fi
ninja -C out/$CONFIG webrtc webrtc/test webrtc/pc:pc_test_utils || exit 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ninja -C out/$CONFIG webrtc field_trial metrics_default fake_audio_device is sufficient.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/fake_audio_device/pc_test_utils/

popd

echo "Copying headers ..."
Expand All @@ -92,15 +95,17 @@ do
done
popd
pushd $PROJECT_DIR || exit 1
git clean -fdx "$INCLUDE_DIR"
git clean -fd "$INCLUDE_DIR"
popd

echo "Concatenating libraries ..."
pushd $WEBRTC_SRC/out/$CONFIG
if [ "$OS" = "darwin" ]; then
ls *.a > filelist
find . -name '*.o' > filelist
libtool -static -o libwebrtc-magic.a -filelist filelist
strip -S -x -o libwebrtc-magic.a libwebrtc-magic.a
elif [ "$ARCH" = "arm" ]; then
arm-linux-gnueabihf-ar crs libwebrtc-magic.a $(find . -name '*.o' -not -name '*.main.o')
else
ar crs libwebrtc-magic.a $(find . -name '*.o' -not -name '*.main.o')
fi
Expand Down
18 changes: 17 additions & 1 deletion datachannel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,24 @@ class FakeDataChannel : public DataChannelInterface {
return state_;
};

virtual uint32_t messages_sent() const {
return 1234;
};

virtual uint64_t bytes_sent() const {
return 1234;
};

virtual uint32_t messages_received() const {
return 1234;
};

virtual uint64_t bytes_received() const {
return 1234;
};

virtual uint64_t buffered_amount() const {
return 0;
return 1234;
};

// Sends data to self.
Expand Down
1 change: 1 addition & 0 deletions datachannel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _DATACHANNEL_H_

#include <_cgo_export.h> // Allow calling certain Go functions.
#include <assert.h>

#include "webrtc/api/peerconnectioninterface.h"
#include "webrtc/api/datachannelinterface.h"
Expand Down
2 changes: 1 addition & 1 deletion datachannel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestDataStateEnums(t *testing.T) {
So(c.MaxRetransmits(), ShouldEqual, 0)
So(c.Negotiated(), ShouldBeFalse)
So(c.ID(), ShouldEqual, 12345)
So(c.BufferedAmount(), ShouldEqual, 0)
So(c.BufferedAmount(), ShouldEqual, 1234)

// There's not a good way to create a DataChannel without first having an
// available PeerConnection object with a valid session, but that's part of
Expand Down
91 changes: 0 additions & 91 deletions include/webrtc/api/androidvideocapturer.h

This file was deleted.

80 changes: 80 additions & 0 deletions include/webrtc/api/audio/audio_mixer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright (c) 2011 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.
*/

#ifndef WEBRTC_API_AUDIO_AUDIO_MIXER_H_
#define WEBRTC_API_AUDIO_AUDIO_MIXER_H_

#include <memory>

#include "webrtc/base/refcount.h"
#include "webrtc/modules/include/module_common_types.h"

namespace webrtc {

// WORK IN PROGRESS
// This class is under development and is not yet intended for for use outside
// of WebRtc/Libjingle.
class AudioMixer : public rtc::RefCountInterface {
public:
// A callback class that all mixer participants must inherit from/implement.
class Source {
public:
enum class AudioFrameInfo {
kNormal, // The samples in audio_frame are valid and should be used.
kMuted, // The samples in audio_frame should not be used, but
// should be implicitly interpreted as zero. Other
// fields in audio_frame may be read and should
// contain meaningful values.
kError, // The audio_frame will not be used.
};

// Overwrites |audio_frame|. The data_ field is overwritten with
// 10 ms of new audio (either 1 or 2 interleaved channels) at
// |sample_rate_hz|. All fields in |audio_frame| must be updated.
virtual AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz,
AudioFrame* audio_frame) = 0;

// A way for a mixer implementation to distinguish participants.
virtual int Ssrc() const = 0;

// A way for this source to say that GetAudioFrameWithInfo called
// with this sample rate or higher will not cause quality loss.
virtual int PreferredSampleRate() const = 0;

virtual ~Source() {}
};

// Returns true if adding was successful. A source is never added
// twice. Addition and removal can happen on different threads.
virtual bool AddSource(Source* audio_source) = 0;

// Removal is never attempted if a source has not been successfully
// added to the mixer.
virtual void RemoveSource(Source* audio_source) = 0;

// Performs mixing by asking registered audio sources for audio. The
// mixed result is placed in the provided AudioFrame. This method
// will only be called from a single thread. The channels argument
// specifies the number of channels of the mix result. The mixer
// should mix at a rate that doesn't cause quality loss of the
// sources' audio. The mixing rate is one of the rates listed in
// AudioProcessing::NativeRate. All fields in
// |audio_frame_for_mixing| must be updated.
virtual void Mix(size_t number_of_channels,
AudioFrame* audio_frame_for_mixing) = 0;

protected:
// Since the mixer is reference counted, the destructor may be
// called from any thread.
~AudioMixer() override {}
};
} // namespace webrtc

#endif // WEBRTC_API_AUDIO_AUDIO_MIXER_H_
Loading