1 // Copyright (c) 2016 The WebM project authors. All Rights Reserved. 2 // 3 // Use of this source code is governed by a BSD-style license 4 // that can be found in the LICENSE file in the root of the source 5 // tree. An additional intellectual property rights grant can be found 6 // in the file PATENTS. All contributing project authors may 7 // be found in the AUTHORS file in the root of the source tree. 8 #ifndef LIBWEBM_M2TS_VPXPES2TS_H_ 9 #define LIBWEBM_M2TS_VPXPES2TS_H_ 10 11 #include <memory> 12 #include <string> 13 14 #include "common/libwebm_util.h" 15 #include "m2ts/webm2pes.h" 16 17 namespace libwebm { 18 19 class VpxPes2Ts : public PacketReceiverInterface { 20 public: VpxPes2Ts(const std::string & input_file_name,const std::string & output_file_name)21 VpxPes2Ts(const std::string& input_file_name, 22 const std::string& output_file_name) 23 : input_file_name_(input_file_name), 24 output_file_name_(output_file_name) {} 25 virtual ~VpxPes2Ts() = default; 26 VpxPes2Ts() = delete; 27 VpxPes2Ts(const VpxPes2Ts&) = delete; 28 VpxPes2Ts(VpxPes2Ts&&) = delete; 29 30 bool ConvertToFile(); 31 32 private: 33 bool ReceivePacket(const PacketDataBuffer& packet_data) override; 34 35 const std::string input_file_name_; 36 const std::string output_file_name_; 37 38 FilePtr output_file_; 39 std::unique_ptr<Webm2Pes> pes_converter_; 40 PacketDataBuffer ts_buffer_; 41 }; 42 43 } // namespace libwebm 44 45 #endif // LIBWEBM_M2TS_VPXPES2TS_H_ 46