Skip to content

Commit

Permalink
Roll Fuchsia SDK from 98ba6c8440c2 to 065fd902445d
Browse files Browse the repository at this point in the history
The AutoRoll server is located here: https://autoroll.skia.org/r/fuchsia-sdk-chromium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.

CQ_INCLUDE_TRYBOTS=luci.chromium.try:fuchsia_arm64_cast_audio;luci.chromium.try:fuchsia_x64_cast_audio
TBR=cr-fuchsia+bot@chromium.org

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I5d532182b97b6d849ac6ba9ccec45ed032da5927
Reviewed-on: https://chromium-review.googlesource.com/1255046
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Fabrice de Gans-Riberi <fdegans@chromium.org>
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595573}
  • Loading branch information
Steelskin authored and Commit Bot committed Oct 1, 2018
1 parent 2ebd4b9 commit 944a816
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 46 deletions.
2 changes: 1 addition & 1 deletion build/fuchsia/linux.sdk.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
98ba6c8440c2afb334433de9bb901a0f97efe1e1
065fd902445d69829dddf465c524700b375de112
2 changes: 1 addition & 1 deletion build/fuchsia/mac.sdk.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bd8834505d919018dd7ffdc5fa42eb04616ca9f5
4dfe28e996ad104738f8abdb1f27680b369dba9a
32 changes: 16 additions & 16 deletions chromecast/media/cma/backend/fuchsia/mixer_output_stream_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ constexpr base::TimeDelta kTargetWritePeriod =
// MixerOutputStreamFuchsia::Write().
constexpr int kMaxOutputBufferSizeFrames = 4096;

// Current AudioOut implementation allows only one buffer with id=0.
// Current AudioRenderer implementation allows only one buffer with id=0.
// TODO(sergeyu): Replace with an incrementing buffer id once AddPayloadBuffer()
// and RemovePayloadBuffer() are implemented properly in AudioOut.
// and RemovePayloadBuffer() are implemented properly in AudioRenderer.
const uint32_t kBufferId = 0;

// static
Expand All @@ -42,34 +42,34 @@ MixerOutputStreamFuchsia::MixerOutputStreamFuchsia() = default;
MixerOutputStreamFuchsia::~MixerOutputStreamFuchsia() = default;

bool MixerOutputStreamFuchsia::Start(int requested_sample_rate, int channels) {
DCHECK(!audio_out_);
DCHECK(!audio_renderer_);
DCHECK(reference_time_.is_null());

sample_rate_ = requested_sample_rate;
channels_ = channels;
target_packet_size_ = ::media::AudioTimestampHelper::TimeToFrames(
kTargetWritePeriod, sample_rate_);

// Connect |audio_out_|.
// Connect |audio_renderer_|.
fuchsia::media::AudioPtr audio_server =
base::fuchsia::ComponentContext::GetDefault()
->ConnectToService<fuchsia::media::Audio>();
audio_server->CreateAudioOut(audio_out_.NewRequest());
audio_out_.set_error_handler(
audio_server->CreateAudioRenderer(audio_renderer_.NewRequest());
audio_renderer_.set_error_handler(
fit::bind_member(this, &MixerOutputStreamFuchsia::OnRendererError));

// Configure the renderer.
fuchsia::media::AudioStreamType format;
format.sample_format = fuchsia::media::AudioSampleFormat::FLOAT;
format.channels = channels_;
format.frames_per_second = sample_rate_;
audio_out_->SetPcmStreamType(std::move(format));
audio_renderer_->SetPcmStreamType(std::move(format));

// Use number of samples to specify media position.
audio_out_->SetPtsUnits(sample_rate_, 1);
audio_renderer_->SetPtsUnits(sample_rate_, 1);

audio_out_->EnableMinLeadTimeEvents(true);
audio_out_.events().OnMinLeadTimeChanged =
audio_renderer_->EnableMinLeadTimeEvents(true);
audio_renderer_.events().OnMinLeadTimeChanged =
fit::bind_member(this, &MixerOutputStreamFuchsia::OnMinLeadTimeChanged);

return true;
Expand Down Expand Up @@ -98,7 +98,7 @@ int MixerOutputStreamFuchsia::OptimalWriteFramesCount() {
bool MixerOutputStreamFuchsia::Write(const float* data,
int data_size,
bool* out_playback_interrupted) {
if (!audio_out_)
if (!audio_renderer_)
return false;

DCHECK_EQ(data_size % channels_, 0);
Expand Down Expand Up @@ -136,7 +136,7 @@ bool MixerOutputStreamFuchsia::Write(const float* data,
packet.payload_offset = payload_buffer_pos_;
packet.payload_size = packet_size;
packet.flags = 0;
audio_out_->SendPacketNoReply(std::move(packet));
audio_renderer_->SendPacketNoReply(std::move(packet));

// Update stream position.
int frames = data_size / channels_;
Expand All @@ -145,8 +145,8 @@ bool MixerOutputStreamFuchsia::Write(const float* data,

if (reference_time_.is_null()) {
reference_time_ = now + min_lead_time_;
audio_out_->PlayNoReply(reference_time_.ToZxTime(),
stream_position_samples_ - frames);
audio_renderer_->PlayNoReply(reference_time_.ToZxTime(),
stream_position_samples_ - frames);
} else {
// Block the thread to limit amount of buffered data. Currently
// MixerOutputStreamAlsa uses blocking Write() and StreamMixer relies on
Expand All @@ -168,7 +168,7 @@ bool MixerOutputStreamFuchsia::Write(const float* data,

void MixerOutputStreamFuchsia::Stop() {
reference_time_ = base::TimeTicks();
audio_out_.Unbind();
audio_renderer_.Unbind();
}

size_t MixerOutputStreamFuchsia::GetMinBufferSize() {
Expand All @@ -190,7 +190,7 @@ bool MixerOutputStreamFuchsia::InitializePayloadBuffer() {
}

payload_buffer_pos_ = 0;
audio_out_->AddPayloadBuffer(
audio_renderer_->AddPayloadBuffer(
kBufferId, zx::vmo(payload_buffer_.handle().Duplicate().GetHandle()));

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MixerOutputStreamFuchsia : public MixerOutputStream {

base::TimeTicks GetCurrentStreamTime();

// Event handlers for |audio_out_|.
// Event handlers for |audio_renderer_|.
void OnRendererError();
void OnMinLeadTimeChanged(int64_t min_lead_time);

Expand All @@ -48,7 +48,7 @@ class MixerOutputStreamFuchsia : public MixerOutputStream {
int target_packet_size_ = 0;

// Audio renderer connection.
fuchsia::media::AudioOutPtr audio_out_;
fuchsia::media::AudioRendererPtr audio_renderer_;

base::SharedMemory payload_buffer_;
size_t payload_buffer_pos_ = 0;
Expand Down
42 changes: 21 additions & 21 deletions media/audio/fuchsia/audio_output_stream_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace media {

// Current AudioOut implementation allows only one buffer with id=0.
// Current AudioRenderer implementation allows only one buffer with id=0.
// TODO(sergeyu): Replace with an incrementing buffer id once AddPayloadBuffer()
// and RemovePayloadBuffer() are implemented properly in AudioOut.
// and RemovePayloadBuffer() are implemented properly in AudioRenderer.
const uint32_t kBufferId = 0;

AudioOutputStreamFuchsia::AudioOutputStreamFuchsia(
Expand All @@ -27,36 +27,36 @@ AudioOutputStreamFuchsia::AudioOutputStreamFuchsia(

AudioOutputStreamFuchsia::~AudioOutputStreamFuchsia() {
// Close() must be called first.
DCHECK(!audio_out_);
DCHECK(!audio_renderer_);
}

bool AudioOutputStreamFuchsia::Open() {
DCHECK(!audio_out_);
DCHECK(!audio_renderer_);

// Connect |audio_out_| to the audio service.
// Connect |audio_renderer_| to the audio service.
fuchsia::media::AudioPtr audio_server =
base::fuchsia::ComponentContext::GetDefault()
->ConnectToService<fuchsia::media::Audio>();
audio_server->CreateAudioOut(audio_out_.NewRequest());
audio_out_.set_error_handler(
audio_server->CreateAudioRenderer(audio_renderer_.NewRequest());
audio_renderer_.set_error_handler(
fit::bind_member(this, &AudioOutputStreamFuchsia::OnRendererError));

// Inform the |audio_out_| of the format required by the caller.
// Inform the |audio_renderer_| of the format required by the caller.
fuchsia::media::AudioStreamType format;
format.sample_format = fuchsia::media::AudioSampleFormat::FLOAT;
format.channels = parameters_.channels();
format.frames_per_second = parameters_.sample_rate();
audio_out_->SetPcmStreamType(std::move(format));
audio_renderer_->SetPcmStreamType(std::move(format));

// Use number of samples to specify media position.
audio_out_->SetPtsUnits(parameters_.sample_rate(), 1);
audio_renderer_->SetPtsUnits(parameters_.sample_rate(), 1);

// Setup OnMinLeadTimeChanged event listener. This event is used to get
// |min_lead_time_|, which indicates how far ahead audio samples need to be
// sent to the renderer.
audio_out_.events().OnMinLeadTimeChanged =
audio_renderer_.events().OnMinLeadTimeChanged =
fit::bind_member(this, &AudioOutputStreamFuchsia::OnMinLeadTimeChanged);
audio_out_->EnableMinLeadTimeEvents(true);
audio_renderer_->EnableMinLeadTimeEvents(true);

// The renderer may fail initialization asynchronously, which is handled in
// OnRendererError().
Expand All @@ -75,8 +75,8 @@ void AudioOutputStreamFuchsia::Start(AudioSourceCallback* callback) {
void AudioOutputStreamFuchsia::Stop() {
callback_ = nullptr;
reference_time_ = base::TimeTicks();
audio_out_->PauseNoReply();
audio_out_->DiscardAllPacketsNoReply();
audio_renderer_->PauseNoReply();
audio_renderer_->DiscardAllPacketsNoReply();
timer_.Stop();
}

Expand All @@ -91,7 +91,7 @@ void AudioOutputStreamFuchsia::GetVolume(double* volume) {

void AudioOutputStreamFuchsia::Close() {
Stop();
audio_out_.Unbind();
audio_renderer_.Unbind();

// Signal to the manager that we're closed and can be removed. This should be
// the last call in the function as it deletes |this|.
Expand Down Expand Up @@ -125,7 +125,7 @@ bool AudioOutputStreamFuchsia::InitializePayloadBuffer() {
}

payload_buffer_pos_ = 0;
audio_out_->AddPayloadBuffer(
audio_renderer_->AddPayloadBuffer(
kBufferId, zx::vmo(payload_buffer_.handle().Duplicate().GetHandle()));

return true;
Expand All @@ -146,7 +146,7 @@ void AudioOutputStreamFuchsia::OnMinLeadTimeChanged(int64_t min_lead_time) {
}

void AudioOutputStreamFuchsia::OnRendererError() {
LOG(WARNING) << "AudioOut has failed.";
LOG(WARNING) << "AudioRenderer has failed.";
ReportError();
}

Expand All @@ -158,7 +158,7 @@ void AudioOutputStreamFuchsia::ReportError() {
}

void AudioOutputStreamFuchsia::PumpSamples() {
DCHECK(audio_out_);
DCHECK(audio_renderer_);

// Allocate payload buffer if necessary.
if (!payload_buffer_.mapped_size() && !InitializePayloadBuffer()) {
Expand Down Expand Up @@ -187,8 +187,8 @@ void AudioOutputStreamFuchsia::PumpSamples() {
if (reference_time_.is_null()) {
stream_position_samples_ = 0;
reference_time_ = now + min_lead_time_;
audio_out_->PlayNoReply(reference_time_.ToZxTime(),
stream_position_samples_);
audio_renderer_->PlayNoReply(reference_time_.ToZxTime(),
stream_position_samples_);
}

// Request more samples from |callback_|.
Expand All @@ -212,7 +212,7 @@ void AudioOutputStreamFuchsia::PumpSamples() {
packet.payload_offset = payload_buffer_pos_;
packet.payload_size = packet_size;
packet.flags = 0;
audio_out_->SendPacketNoReply(std::move(packet));
audio_renderer_->SendPacketNoReply(std::move(packet));

stream_position_samples_ += frames_filled;
payload_buffer_pos_ =
Expand Down
2 changes: 1 addition & 1 deletion media/audio/fuchsia/audio_output_stream_fuchsia.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AudioOutputStreamFuchsia : public AudioOutputStream {
AudioManagerFuchsia* manager_;
AudioParameters parameters_;

fuchsia::media::AudioOutPtr audio_out_;
fuchsia::media::AudioRendererPtr audio_renderer_;

// |audio_bus_| is used only in PumpSamples(). It is kept here to avoid
// reallocating the memory every time.
Expand Down
9 changes: 7 additions & 2 deletions net/base/network_change_notifier_fuchsia_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ class FakeNetstack : public fuchsia::netstack::Netstack {
void GetStats(uint32_t nicid, GetStatsCallback callback) override {}
void GetAggregateStats(GetAggregateStatsCallback callback) override {}
void SetInterfaceStatus(uint32_t nicid, bool enabled) override {}
void SetRouteTable(
::fidl::VectorPtr<fuchsia::netstack::RouteTableEntry> rt) override {}
void SetInterfaceAddress(uint32_t nicid,
fuchsia::netstack::NetAddress addr,
uint8_t prefixLen,
Expand All @@ -167,6 +165,13 @@ class FakeNetstack : public fuchsia::netstack::Netstack {
void GetFilterStatus(GetFilterStatusCallback callback) override {}
void SetNameServers(
::fidl::VectorPtr<::fuchsia::netstack::NetAddress> servers) override {}
void AddEthernetDevice(
::fidl::StringPtr topological_path,
::fidl::InterfaceHandle<::zircon::ethernet::Device> device) override {}
void StartRouteTableTransaction(
::fidl::InterfaceRequest<::fuchsia::netstack::RouteTableTransaction>
routeTableTransaction,
StartRouteTableTransactionCallback callback) override {}

::fidl::VectorPtr<fuchsia::netstack::NetInterface> interfaces_ =
fidl::VectorPtr<fuchsia::netstack::NetInterface>::New(0);
Expand Down
17 changes: 15 additions & 2 deletions third_party/fuchsia-sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ fuchsia_sdk_fidl_pkg("media") {

sources = [
"audio.fidl",
"audio_capturer.fidl",
"audio_device_enumerator.fidl",
"audio_in.fidl",
"audio_out.fidl",
"audio_renderer.fidl",
"gain_control.fidl",
"stream.fidl",
"stream_type.fidl",
Expand All @@ -255,6 +255,19 @@ fuchsia_sdk_fidl_pkg("netstack") {
"net_address.fidl",
"netstack.fidl",
]

deps = [
":ethernet",
]
}

fuchsia_sdk_fidl_pkg("ethernet") {
namespace = "zircon"
namespace_path = "zircon"

sources = [
"ethernet.fidl",
]
}

fuchsia_sdk_fidl_pkg("oldhttp") {
Expand Down

0 comments on commit 944a816

Please sign in to comment.