2015-10-28 17:23:08 +00:00
|
|
|
// Copyright 2015 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#ifndef PACKAGER_MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|
|
|
|
#define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|
2015-10-28 17:23:08 +00:00
|
|
|
|
|
|
|
#include "packager/media/base/muxer.h"
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
namespace shaka {
|
2015-10-28 17:23:08 +00:00
|
|
|
namespace media {
|
|
|
|
namespace webm {
|
|
|
|
|
|
|
|
class Segmenter;
|
|
|
|
|
|
|
|
/// Implements WebM Muxer.
|
|
|
|
class WebMMuxer : public Muxer {
|
|
|
|
public:
|
|
|
|
/// Create a WebMMuxer object from MuxerOptions.
|
|
|
|
explicit WebMMuxer(const MuxerOptions& options);
|
|
|
|
~WebMMuxer() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Muxer implementation overrides.
|
2017-02-21 18:36:50 +00:00
|
|
|
Status InitializeMuxer() override;
|
2015-10-28 17:23:08 +00:00
|
|
|
Status Finalize() override;
|
2020-07-30 21:26:45 +00:00
|
|
|
Status AddMediaSample(size_t stream_id, const MediaSample& sample) override;
|
2017-03-03 00:10:30 +00:00
|
|
|
Status FinalizeSegment(size_t stream_id,
|
2017-09-12 17:24:24 +00:00
|
|
|
const SegmentInfo& segment_info) override;
|
2015-10-28 17:23:08 +00:00
|
|
|
|
|
|
|
void FireOnMediaStartEvent();
|
|
|
|
void FireOnMediaEndEvent();
|
|
|
|
|
2016-08-17 17:41:40 +00:00
|
|
|
std::unique_ptr<Segmenter> segmenter_;
|
2015-10-28 17:23:08 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(WebMMuxer);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace webm
|
|
|
|
} // namespace media
|
2016-05-20 21:19:33 +00:00
|
|
|
} // namespace shaka
|
2015-10-28 17:23:08 +00:00
|
|
|
|
2017-12-20 00:56:36 +00:00
|
|
|
#endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|