--- /dev/null
+#include <stdio.h>
+#include <string.h>
+#include "Form1.h"
+
+namespace TsRemux {
+
+ExecCondition::ExecCondition(void)
+{
+ input_file_text_ = NULL;
+ use_async_io_ = false;
+ bypass_audio_processing_ = false;
+ mip_to_ac3_ = false;
+ keep_con_open_ = false;
+ output_file_text_ = NULL;
+ m2ts_format_ = false;
+ ts_format_ = false;
+ bluray_format_ = false;
+}
+
+ExecCondition::~ExecCondition(void)
+{
+}
+
+TsRemux::TsRemux(int argc, char *argv[])
+{
+ argc_ = argc;
+ argv_ = argv;
+ Init();
+}
+
+TsRemux::~TsRemux(void)
+{
+}
+
+int TsRemux::Exec(void)
+{
+ for(int i=0; i<argc_; i++) {
+ printf("arg[%d]=[%s]\n", i, argv_[i]);
+ }
+ printf("");
+ printf("");
+ if(argc_ < 3){
+ printf("usage: tsremux input-file output-path [-a] [+b] [+m] [+c]\n");
+ printf(" -a: do not use async io (default on)\n");
+ printf(" +b: bypass audio alignment (default off)\n");
+ printf(" +m: trueHd to ac3 (default off)\n");
+ printf(" +c: keep console open when done (win2k)\n");
+ printf(" output extension cotrols processing:\n");
+ printf(" ts, m2ts, none for bluray directory\n");
+ return 0;
+ }
+
+ exec_condition_.input_file_text_ = argv_[1];
+ exec_condition_.use_async_io_ = false;
+ exec_condition_.bypass_audio_processing_ = false;
+ exec_condition_.mip_to_ac3_ = false;
+
+ for(int i=3; i < argc_; i++) {
+ if(!strncmp(argv_[i], "-a", 2)) {
+ exec_condition_.use_async_io_ = true;
+ } else if(!strncmp(argv_[i], "+b", 2)) {
+ exec_condition_.bypass_audio_processing_ = true;
+ } else if(!strncmp(argv_[i], "+c", 2)) {
+ exec_condition_.keep_con_open_ = true;
+ } else if(!strncmp(argv_[i], "+m", 2)) {
+ exec_condition_.mip_to_ac3_ = true;
+ } else {
+ printf("unrecognized option: %s \n", argv_[i]);
+ }
+ }
+
+ exec_condition_.output_file_text_ = argv_[2];
+ char* output_extension;
+ for(int i = strlen(exec_condition_.output_file_text_)-1; i >= 0; i--) {
+ if(!strncmp(&exec_condition_.output_file_text_[i], ".", 1)) {
+ strncpy(output_extension,
+ &exec_condition_.output_file_text_[i],
+ strlen(&exec_condition_.output_file_text_[i]));
+ }
+ }
+ if(!strncmp(output_extension, ".m2ts", 5)) {
+ exec_condition_.m2ts_format_ = true;
+ } else if(!strncmp(output_extension, ".ts", 3)) {
+ exec_condition_.ts_format_= true;
+ } else if(!strncmp(output_extension, ".", 1)) {
+ exec_condition_.bluray_format_= true;
+ } else {
+ printf("unrecognized output type\n");
+ }
+ return 0;
+}
+
+void TsRemux::Init(void)
+{
+}
+
+} //namespace
+
--- /dev/null
+#ifndef TSREMUXCPP_UTILS_H_
+#define TSREMUXCPP_UTILS_H_
+
+namespace TsRemux
+{
+ enum TsFileType
+ {
+ UNKNOWN = 0,
+ TS,
+ M2TS,
+ EVOB,
+ ELEMENTARY,
+ PES_ELEMENTARY,
+ SUP_ELEMENTARY,
+ BLU_RAY,
+ MKV
+ };
+
+ enum DtcpCci
+ {
+ CopyFree = 0,
+ NoMoreCopies,
+ CopyOnce,
+ CopyNever
+ };
+
+ enum ElementaryStreamType
+ {
+ INVALID = 0,
+ VIDEO_STREAM_MPEG1 = 0x01,
+ VIDEO_STREAM_MPEG2 = 0x02,
+ AUDIO_STREAM_MPEG1 = 0x03, // all layers including mp3
+ AUDIO_STREAM_MPEG2 = 0x04,
+ VIDEO_STREAM_H264 = 0x1b,
+ AUDIO_STREAM_LPCM = 0x80,
+ AUDIO_STREAM_AC3 = 0x81,
+ AUDIO_STREAM_DTS = 0x82,
+ AUDIO_STREAM_AC3_TRUE_HD = 0x83,
+ AUDIO_STREAM_AC3_PLUS = 0x84,
+ AUDIO_STREAM_DTS_HD = 0x85,
+ AUDIO_STREAM_DTS_HD_MASTER_AUDIO = 0x86,
+ PRESENTATION_GRAPHICS_STREAM = 0x90,
+ INTERACTIVE_GRAPHICS_STREAM = 0x91,
+ SUBTITLE_STREAM = 0x92,
+ SECONDARY_AUDIO_AC3_PLUS = 0xa1,
+ SECONDARY_AUDIO_DTS_HD = 0xa2,
+ VIDEO_STREAM_VC1 = 0xea
+ };
+
+ enum VideoFormat
+ {
+ VF_Reserved = 0,
+ i480,
+ i576,
+ p480,
+ i1080,
+ p720,
+ p1080,
+ p576
+ };
+
+ enum FrameRate
+ {
+ FR_Reserved = 0,
+ f23_976,
+ f24,
+ f25,
+ f29_97,
+ f50 = 6,
+ f59_94
+ };
+
+ enum AspectRatio
+ {
+ AR_Reserved = 0,
+ a4_3 = 2,
+ a16_9
+ };
+
+ enum AudioPresentationType
+ {
+ AP_Reserved = 0,
+ mono,
+ stereo = 3,
+ multi = 6,
+ combo = 12
+ };
+
+ enum SamplingFrequency
+ {
+ SF_Reserved = 0,
+ kHz48,
+ kHz96 = 4,
+ kHz192,
+ kHz48_192 = 12,
+ kHz48_96 = 14
+ };
+
+}
+#endif
+