Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: services/media/framework/stages/input.cc

Issue 1678433002: Motown: Remove LPCM optimizations, fix prepare, add flush, add ActiveMultistreamSink model/stage (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/media/framework/stages/input.h ('k') | services/media/framework/stages/lpcm_stage_input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework/stages/input.cc
diff --git a/services/media/framework/stages/input.cc b/services/media/framework/stages/input.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b8d466ac1e3b89167154f6e56b28904f7e79f5ee
--- /dev/null
+++ b/services/media/framework/stages/input.cc
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/media/framework/engine.h"
+#include "services/media/framework/stages/input.h"
+#include "services/media/framework/stages/stage.h"
+
+namespace mojo {
+namespace media {
+
+Input::Input() : prepared_(false) {}
+
+Input::~Input() {}
+
+void Input::Connect(const OutputRef& output) {
+ DCHECK(output.valid());
+ DCHECK(!mate_);
+ mate_ = output;
+}
+
+Output& Input::actual_mate() const {
+ DCHECK(mate_.valid());
+ return mate_.actual();
+}
+
+void Input::SetDemand(Demand demand, Engine* engine) const {
+ DCHECK(engine);
+ DCHECK(connected());
+
+ if (actual_mate().UpdateDemandFromInput(demand)) {
+ engine->PushToDemandBacklog(mate().stage_);
+ }
+}
+
+bool Input::SupplyPacketFromOutput(PacketPtr packet) {
+ DCHECK(packet);
+ DCHECK(!packet_from_upstream_);
+ packet_from_upstream_ = std::move(packet);
+ return true;
+}
+
+void Input::Flush() {
+ packet_from_upstream_.reset(nullptr);
+}
+
+} // namespace media
+} // namespace mojo
« no previous file with comments | « services/media/framework/stages/input.h ('k') | services/media/framework/stages/lpcm_stage_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698