OSDN Git Service

add new files
authorMartini <Martini@Martini.local>
Sat, 14 Feb 2009 17:42:39 +0000 (02:42 +0900)
committerMartini <Martini@Martini.local>
Sat, 14 Feb 2009 17:42:39 +0000 (02:42 +0900)
src/BlueMux.cc [new file with mode: 0644]
src/BlueMux.h [new file with mode: 0644]
src/Form1.cc [new file with mode: 0644]
src/Form1.h [new file with mode: 0644]
src/Mkv.cc [new file with mode: 0644]
src/Mkv.h [new file with mode: 0644]
src/Program.cc [new file with mode: 0644]
src/TsToPes.cc [new file with mode: 0644]
src/TsToPes.h [new file with mode: 0644]
src/Utils.cc [new file with mode: 0644]
src/Utils.h [new file with mode: 0644]

diff --git a/src/BlueMux.cc b/src/BlueMux.cc
new file mode 100644 (file)
index 0000000..f998da8
--- /dev/null
@@ -0,0 +1,8 @@
+#include "BlueMux.h"
+
+namespace TsRemux
+{
+
+
+}
+
diff --git a/src/BlueMux.h b/src/BlueMux.h
new file mode 100644 (file)
index 0000000..8aeecb0
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef TSREMUXCPP_BLUEMUX_H_
+#define TSREMUXCPP_BLUEMUX_H_
+namespace TsRemux
+{
+
+
+}
+#endif
+
diff --git a/src/Form1.cc b/src/Form1.cc
new file mode 100644 (file)
index 0000000..6f2e37e
--- /dev/null
@@ -0,0 +1,98 @@
+#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
+
diff --git a/src/Form1.h b/src/Form1.h
new file mode 100644 (file)
index 0000000..18c4163
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef TSREMUXCPP_FORM1_H_
+#define TSREMUXCPP_FORM1_H_
+
+namespace TsRemux {
+
+class ExecCondition {
+ public:
+  ExecCondition(void);
+  ~ExecCondition(void);
+  char* input_file_text_;
+  bool use_async_io_;
+  bool bypass_audio_processing_;
+  bool mip_to_ac3_;
+  bool keep_con_open_;
+  char* output_file_text_;
+  bool m2ts_format_;
+  bool ts_format_;
+  bool bluray_format_;
+};
+
+class TsRemux {
+ public:
+  TsRemux(int argc, char *argv[]);
+  ~TsRemux(void);
+  int Exec(void);
+
+ private:
+  TsRemux(void);
+  void Init(void);
+  int argc_;
+  char **argv_;
+  ExecCondition exec_condition_;
+};
+
+}  //namespace
+
+#endif
+
diff --git a/src/Mkv.cc b/src/Mkv.cc
new file mode 100644 (file)
index 0000000..9eb0ab7
--- /dev/null
@@ -0,0 +1,8 @@
+#include "Mkv.h"
+
+namespace TsRemux
+{
+
+
+}
+
diff --git a/src/Mkv.h b/src/Mkv.h
new file mode 100644 (file)
index 0000000..24a2223
--- /dev/null
+++ b/src/Mkv.h
@@ -0,0 +1,9 @@
+#ifndef TSREMUXCPP_MKV_H_
+#define TSREMUXCPP_MKV_H_
+namespace TsRemux
+{
+
+
+}
+#endif
+
diff --git a/src/Program.cc b/src/Program.cc
new file mode 100644 (file)
index 0000000..997e2ce
--- /dev/null
@@ -0,0 +1,8 @@
+#include "Form1.h"
+
+int main( int argc, char *argv[] )
+{
+    TsRemux::TsRemux tsr( argc, argv);
+    return tsr.Exec();
+}
+
diff --git a/src/TsToPes.cc b/src/TsToPes.cc
new file mode 100644 (file)
index 0000000..b642b35
--- /dev/null
@@ -0,0 +1,8 @@
+#include "TsToPes.h"
+
+namespace TsRemux
+{
+
+
+}
+
diff --git a/src/TsToPes.h b/src/TsToPes.h
new file mode 100644 (file)
index 0000000..36ee842
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef TSREMUXCPP_TSTOPES_H_
+#define TSREMUXCPP_TSTOPES_H_
+namespace TsRemux
+{
+
+
+}
+#endif
+
diff --git a/src/Utils.cc b/src/Utils.cc
new file mode 100644 (file)
index 0000000..579dab9
--- /dev/null
@@ -0,0 +1,16 @@
+#include "Utils.h"
+
+namespace TsRemux
+{
+
+
+
+
+
+
+
+
+
+
+}
+
diff --git a/src/Utils.h b/src/Utils.h
new file mode 100644 (file)
index 0000000..afff775
--- /dev/null
@@ -0,0 +1,101 @@
+#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
+