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
|
|
|
|
|
|
|
|
#ifndef MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|
|
|
|
#define MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|
|
|
|
|
|
|
|
#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;
|
2017-03-03 00:10:30 +00:00
|
|
|
Status AddSample(size_t stream_id,
|
|
|
|
std::shared_ptr<MediaSample> sample) override;
|
|
|
|
Status FinalizeSegment(size_t stream_id,
|
2017-02-24 01:17:47 +00:00
|
|
|
std::shared_ptr<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
|
|
|
|
|
|
|
#endif // MEDIA_FORMATS_WEBM_WEBM_MUXER_H_
|