| Index: services/media/framework/parts/lpcm_reformatter.h
|
| diff --git a/services/media/framework/parts/lpcm_reformatter.h b/services/media/framework/parts/lpcm_reformatter.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..38ae0620ba21c69cf048c686cb8bfb8de41fb6e6
|
| --- /dev/null
|
| +++ b/services/media/framework/parts/lpcm_reformatter.h
|
| @@ -0,0 +1,62 @@
|
| +// 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_PARTS_LPCM_REFORMATTER_H_
|
| +#define SERVICES_MEDIA_FRAMEWORK_PARTS_LPCM_REFORMATTER_H_
|
| +
|
| +#include "services/media/framework/allocator.h"
|
| +#include "services/media/framework/models/lpcm_transform.h"
|
| +#include "services/media/framework/packet.h"
|
| +#include "services/media/framework/stream_type.h"
|
| +
|
| +namespace mojo {
|
| +namespace media {
|
| +
|
| +class LpcmReformatter;
|
| +
|
| +typedef SharedPtr<LpcmReformatter, LpcmTransform> LpcmReformatterPtr;
|
| +
|
| +// A transform that reformats samples.
|
| +// TODO(dalesat): Some variations on this could be InPlacePacketTransforms.
|
| +class LpcmReformatter : public LpcmTransform {
|
| + public:
|
| + static LpcmReformatterPtr New(
|
| + const LpcmStreamType& in_type,
|
| + const LpcmStreamTypeSet& out_type) {
|
| + return LpcmReformatterPtr(NewImpl(in_type, out_type));
|
| + }
|
| +
|
| + private:
|
| + static LpcmReformatter* NewImpl(
|
| + const LpcmStreamType& in_type,
|
| + const LpcmStreamTypeSet& out_type);
|
| +};
|
| +
|
| +// LpcmReformatter implementation that accepts samples of type TIn and
|
| +// produces samples of type TOut.
|
| +template<typename TIn, typename TOut>
|
| +class LpcmReformatterImpl : public LpcmReformatter {
|
| + public:
|
| + LpcmReformatterImpl(
|
| + const LpcmStreamType& in_type,
|
| + const LpcmStreamTypeSet& out_type);
|
| +
|
| + ~LpcmReformatterImpl() override;
|
| +
|
| + // LpcmTransform implementation.
|
| + const LpcmStreamType& input_stream_type() const override;
|
| +
|
| + const LpcmStreamType& output_stream_type() const override;
|
| +
|
| + void TransformFrames(LpcmFrames& source, LpcmFrames& dest, bool mix) override;
|
| +
|
| + private:
|
| + LpcmStreamType in_type_;
|
| + LpcmStreamType out_type_;
|
| +};
|
| +
|
| +} // namespace media
|
| +} // namespace mojo
|
| +
|
| +#endif // SERVICES_MEDIA_FRAMEWORK_PARTS_LPCM_REFORMATTER_H_
|
|
|