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

Side by Side Diff: services/media/framework/parts/lpcm_reformatter.h

Issue 1577953002: Motown in-proc streaming framework used to implement media services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Addressed feedback including non-const ref parameters. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_MEDIA_FRAMEWORK_PARTS_LPCM_REFORMATTER_H_
6 #define SERVICES_MEDIA_FRAMEWORK_PARTS_LPCM_REFORMATTER_H_
7
8 #include "services/media/framework/allocator.h"
9 #include "services/media/framework/models/lpcm_transform.h"
10 #include "services/media/framework/packet.h"
11 #include "services/media/framework/stream_type.h"
12
13 namespace mojo {
14 namespace media {
15
16 class LpcmReformatter;
17
18 typedef SharedPtr<LpcmReformatter, LpcmTransform> LpcmReformatterPtr;
19
20 // A transform that reformats samples.
21 // TODO(dalesat): Some variations on this could be InPlacePacketTransforms.
22 class LpcmReformatter : public LpcmTransform {
23 public:
24 static LpcmReformatterPtr New(
25 const LpcmStreamType& in_type,
26 const LpcmStreamTypeSet& out_type) {
27 return LpcmReformatterPtr(NewImpl(in_type, out_type));
johngro 2016/01/26 23:47:29 What is the advantage of having an inline public n
dalesat 2016/01/28 18:49:16 Done.
28 }
29
30 private:
31 static LpcmReformatter* NewImpl(
32 const LpcmStreamType& in_type,
33 const LpcmStreamTypeSet& out_type);
34 };
35
36 // LpcmReformatter implementation that accepts samples of type TIn and
37 // produces samples of type TOut.
38 template<typename TIn, typename TOut>
39 class LpcmReformatterImpl : public LpcmReformatter {
johngro 2016/01/26 23:47:29 You can just hide this class in the .cc file. The
dalesat 2016/01/28 18:49:16 Done.
40 public:
41 LpcmReformatterImpl(
42 const LpcmStreamType& in_type,
43 const LpcmStreamTypeSet& out_type);
44
45 ~LpcmReformatterImpl() override;
46
47 // LpcmTransform implementation.
48 const LpcmStreamType& input_stream_type() const override;
49
50 const LpcmStreamType& output_stream_type() const override;
51
52 void TransformFrames(LpcmFrames* source, LpcmFrames* dest, bool mix) override;
53
54 private:
55 LpcmStreamType in_type_;
56 LpcmStreamType out_type_;
57 };
58
59 } // namespace media
60 } // namespace mojo
61
62 #endif // SERVICES_MEDIA_FRAMEWORK_PARTS_LPCM_REFORMATTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698