2013-09-24 01:35:40 +00:00
|
|
|
// Copyright (c) 2012 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.
|
|
|
|
|
2014-04-10 21:42:38 +00:00
|
|
|
#ifndef MEDIA_FORMATS_MP4_CENC_H_
|
|
|
|
#define MEDIA_FORMATS_MP4_CENC_H_
|
2013-09-24 01:35:40 +00:00
|
|
|
|
2014-09-30 23:52:58 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2013-09-24 01:35:40 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2014-10-01 22:10:21 +00:00
|
|
|
#include "packager/media/base/decrypt_config.h"
|
2013-09-24 01:35:40 +00:00
|
|
|
|
2014-09-19 20:41:13 +00:00
|
|
|
namespace edash_packager {
|
2013-09-24 01:35:40 +00:00
|
|
|
namespace media {
|
|
|
|
|
|
|
|
class BufferReader;
|
2013-11-27 02:23:30 +00:00
|
|
|
class BufferWriter;
|
2013-09-24 01:35:40 +00:00
|
|
|
|
2013-11-27 02:23:30 +00:00
|
|
|
namespace mp4 {
|
2013-09-24 01:35:40 +00:00
|
|
|
|
2013-11-27 02:23:30 +00:00
|
|
|
class FrameCENCInfo {
|
|
|
|
public:
|
2013-09-24 01:35:40 +00:00
|
|
|
FrameCENCInfo();
|
2014-09-30 21:52:21 +00:00
|
|
|
explicit FrameCENCInfo(const std::vector<uint8_t>& iv);
|
2013-09-24 01:35:40 +00:00
|
|
|
~FrameCENCInfo();
|
2013-11-27 02:23:30 +00:00
|
|
|
|
2014-09-30 21:52:21 +00:00
|
|
|
bool Parse(uint8_t iv_size, BufferReader* reader);
|
2013-11-27 02:23:30 +00:00
|
|
|
void Write(BufferWriter* writer) const;
|
|
|
|
size_t ComputeSize() const;
|
2013-09-24 01:35:40 +00:00
|
|
|
size_t GetTotalSizeOfSubsamples() const;
|
|
|
|
|
2013-11-27 02:23:30 +00:00
|
|
|
void AddSubsample(const SubsampleEntry& subsample) {
|
|
|
|
subsamples_.push_back(subsample);
|
|
|
|
}
|
|
|
|
|
2014-09-30 21:52:21 +00:00
|
|
|
const std::vector<uint8_t>& iv() const { return iv_; }
|
2013-11-27 02:23:30 +00:00
|
|
|
const std::vector<SubsampleEntry>& subsamples() const { return subsamples_; }
|
|
|
|
|
|
|
|
private:
|
2014-09-30 21:52:21 +00:00
|
|
|
std::vector<uint8_t> iv_;
|
2013-11-27 02:23:30 +00:00
|
|
|
std::vector<SubsampleEntry> subsamples_;
|
|
|
|
|
|
|
|
// Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler
|
|
|
|
// generated copy constructor and assignment operator.
|
|
|
|
};
|
2013-09-24 01:35:40 +00:00
|
|
|
|
|
|
|
} // namespace mp4
|
|
|
|
} // namespace media
|
2014-09-19 20:41:13 +00:00
|
|
|
} // namespace edash_packager
|
2013-09-24 01:35:40 +00:00
|
|
|
|
2014-04-10 21:42:38 +00:00
|
|
|
#endif // MEDIA_FORMATS_MP4_CENC_H_
|