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

Unified Diff: services/media/framework_mojo/audio_track_controller.h

Issue 1692443002: Motown: Framework parts for mojo transport (producer/consumer/mediapipe) and control (audiotrack). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Sync and fix: InterfaceHandle<X> vs XPtr, changes to MediaPipe 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
Index: services/media/framework_mojo/audio_track_controller.h
diff --git a/services/media/framework_mojo/audio_track_controller.h b/services/media/framework_mojo/audio_track_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..7f9d3501b602857e5974e44ee53bf39d61b1cc85
--- /dev/null
+++ b/services/media/framework_mojo/audio_track_controller.h
@@ -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.
+
+#ifndef SERVICES_MEDIA_FRAMEWORK_MOJO_AUDIO_TRACK_CONTROLLER_H_
+#define SERVICES_MEDIA_FRAMEWORK_MOJO_AUDIO_TRACK_CONTROLLER_H_
+
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/services/media/audio/interfaces/audio_track.mojom.h"
+#include "mojo/services/media/common/interfaces/media_pipe.mojom.h"
+#include "services/media/framework/graph.h"
+#include "services/media/framework/stream_type.h"
+#include "services/media/framework_mojo/audio_track_producer.h"
+
+namespace mojo {
+namespace media {
+
+// Controls an audio track.
+class AudioTrackController {
+ public:
+ using ConstructorCallback =
+ Callback<void(std::shared_ptr<AudioTrackProducer>)>;
+ using SetRateCallback = std::function<void(TimelineTransformPtr)>;
+
+ AudioTrackController(
+ const String& url,
+ std::unique_ptr<StreamType> stream_type,
+ Graph* graph,
+ OutputRef output,
+ ApplicationImpl* app,
+ const ConstructorCallback& callback);
+
+ ~AudioTrackController();
+
+ // Sets the rate.
+ void SetRate(float rate_factor, const SetRateCallback& callback);
+
+ private:
+ AudioTrackPtr audio_track_;
+ RateControlPtr rate_control_;
+ MediaPipePtr pipe_;
+ uint32_t frames_per_second_;
+};
+
+} // namespace media
+} // namespace mojo
+
+#endif // SERVICES_MEDIA_FRAMEWORK_MOJO_AUDIO_TRACK_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698