2
* Copyright 2012, The Android Open Source Project
3
* Copyright (C) 2016 Canonical, Ltd.
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
18
#ifndef MCS_STREAMING_MPEGTSPACKETIZER_H_
19
#define MCS_STREAMING_MPEGTSPACKETIZER_H_
24
#include "mcs/streaming/packetizer.h"
29
class MPEGTSPacketizer : public Packetizer {
31
static Packetizer::Ptr Create();
35
TrackId AddTrack(const TrackFormat &format) override;
37
void SubmitCSD(TrackId track_index, const video::Buffer::Ptr &buffer) override;
39
bool Packetize(TrackId track_index, const video::Buffer::Ptr &access_unit,
40
video::Buffer::Ptr *packets, int flags = 0) override;
47
uint32_t CalcCrc32(const uint8_t *start, size_t size) const;
53
unsigned int pat_continuity_counter_;
54
unsigned int pmt_continuity_counter_;
55
uint32_t crc_table_[256];
56
std::vector<std::shared_ptr<Track>> tracks_;
57
std::vector<video::Buffer::Ptr> program_info_descriptors_;
60
} // namespace streaming