net.sourceforge.dvb.projectx.parser
Class CommonParsing

java.lang.Object
  |
  +--net.sourceforge.dvb.projectx.parser.CommonParsing

public class CommonParsing
extends java.lang.Object

common stuff for parsing functions


Field Summary
static int AC3_AUDIO
           
static int ACTION_DEMUX
           
static int ACTION_FILTER
           
static int ACTION_TO_M2P
           
static int ACTION_TO_PVA
           
static int ACTION_TO_TS
           
static int ACTION_TO_VDR
           
static int ACTION_UNDEFINED
           
static boolean BYTEREORDERING
           
static int CUTMODE_BYTE
           
static int CUTMODE_FRAME
           
static int CUTMODE_GOP
           
static int CUTMODE_PTS
           
static int CUTMODE_TIME
           
static int DSM_CC_STREAM_CODE
           
static int DTS_AUDIO
           
static int ECM_STREAM_CODE
           
static int EMM_STREAM_CODE
           
static int ES_AC3_A_TYPE
           
static int ES_AC3_TYPE
           
static int ES_AUDIO_PARSER
           
static int ES_cRIFF_TYPE
           
static int ES_DTS_A_TYPE
           
static int ES_DTS_TYPE
           
static int ES_MPA_TYPE
           
static int ES_MPV_TYPE
           
static int ES_RIFF_TYPE
           
static int ES_SUBPICTURE_PARSER
           
static int ES_SUP_TYPE
           
static int ES_TYPE
           
static int ES_VIDEO_PARSER
           
static int EXTENSION_START_CODE
           
static int FRAME_B_TYPE
           
static int FRAME_D_TYPE
           
static int FRAME_I_TYPE
           
static int FRAME_P_TYPE
           
static int GROUP_START_CODE
           
static int LPCM_AUDIO
           
static int MAX_BITRATE_VALUE
           
static int MPEG_AUDIO
           
static int MPEG_VIDEO
           
static int MPEG1PS_TYPE
           
static int MPEG2PS_TYPE
           
static int PACK_START_CODE
           
static int PADDING_STREAM_CODE
           
static int PES_AV_TYPE
           
static int PES_MPA_TYPE
           
static int PES_PS1_TYPE
           
static int PICTURE_START_CODE
           
static int PRIMARY_PES_PARSER
           
static int PRIVATE_STREAM_1_CODE
           
static int PRIVATE_STREAM_2_CODE
           
static int PROGRAM_STREAM_MAP_CODE
           
static int PVA_PARSER
           
static int PVA_TYPE
           
static int SECONDARY_PES_PARSER
           
static int SEQUENCE_END_CODE
           
static int SEQUENCE_HEADER_CODE
           
static int SLICE_START_CODE_MAX
           
static int SLICE_START_CODE_MIN
           
static int SUBPICTURE
           
static int SYSTEM_END_CODE
           
static int SYSTEM_START_CODE
           
static int TELETEXT
           
static int TS_PARSER
           
static int TS_TYPE
           
static int UNKNOWN
           
static int Unsupported
           
static int USER_DATA_START_CODE
           
static int WAV_AUDIO
           
 
Method Summary
static boolean alignSyncword(byte[] pes_packet, int pes_offset, int es_streamtype)
          skip leading bytes before first valid startcodes and return fixed array
static long calcVideoTime(java.lang.String logfile)
          video timelength read from ptslogfile
static boolean clearBit33ofDTS(byte[] array, int offset)
           
static boolean clearBit33ofPTS(byte[] array, int offset)
           
static long getAudioProcessingFlags()
           
static int getCutCounter()
           
static boolean getCutStatus()
           
static int getExtension2_Id(byte[] pes_packet, int pes_headerlength, int pes_payloadlength, int pesID, boolean pes_isMpeg2, long file_position)
          vdr_dvbsub determination
static int getIntValue(byte[] array, int offset, int length, boolean bytereordering)
           
static int getPES_ExtensionLengthField(byte[] array, int offset)
           
static int getPES_IdField(byte[] array, int offset)
           
static int getPES_LengthField(byte[] array, int offset)
           
static long getPTSfromBytes(byte[] array, int offset)
          returns pts value from pes_extension
static long getPTSfromBytes(byte[] array, int offset, boolean trim)
          returns pts value from pes_extension
static boolean getPvaPidExtraction()
           
static int getPvaPidToExtract()
           
static long getValue(byte[] array, int offset, int length, boolean bytereordering)
          returns value
static double getVideoFramerate()
           
static boolean isInfoScan()
           
static boolean isProcessCancelled()
           
static boolean isProcessPausing()
           
static void logAlias(JobProcessing job_processing, java.lang.String _vptslog, java.lang.String _datalog)
          create PTS alias
static boolean makecut(JobProcessing job_processing, long comparePoint, java.util.List ctemp)
          make cut
static boolean makecut(JobProcessing job_processing, java.lang.String cuts_filename, long startPTS, long comparePoint, java.util.List newcut, int lastframes, java.util.List ctemp, int gopnumber, java.util.List cell)
          make cut
static int nextBits(byte[] buffer, int BitPos, int N)
           
static java.lang.String parseCutValue(long value)
          parse cut long value
static long parseCutValue(java.lang.String value, boolean demux)
          parse cut field value
static long readPTS(byte[] array, int offset, int length, boolean bytereordering, boolean trim)
          returns pts value from pes_extension
static void resetSplitMode(JobProcessing job_processing, java.lang.String vptslog)
          split reset
static void setAudioProcessingFlags(long val)
           
static void setCutCounter(int val)
           
static void setCutStatus(boolean b)
           
static void setInfoScan(boolean b)
           
static void setPES_IdField(byte[] array, int offset, int value)
           
static void setPES_LengthField(byte[] array, int offset, int value)
           
static void setPES_PTSField(byte[] array, int offset, long value)
           
static void setPES_SubIdField(byte[] array, int offset, int pes_headerlength, int pes_extensionlength, int value)
           
static void setProcessCancelled(boolean b)
           
static void setProcessPausing(boolean b)
           
static void setPvaPidExtraction(boolean b)
           
static void setPvaPidToExtract(int val)
           
static void setValue(byte[] array, int offset, int length, boolean bytereordering, long value)
           
static void setVideoFramerate(double val)
           
static void setVideoHeader(JobProcessing job_processing, java.lang.String videofile, java.lang.String logfile, int[] clv, int[] MPGVideotype)
          set 1. videoheader
static int validateStartcode(byte[] pes_packet, int offset)
          check startcode return int of skip'able data (negative)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTEREORDERING

public static final boolean BYTEREORDERING

SECONDARY_PES_PARSER

public static final int SECONDARY_PES_PARSER

PRIMARY_PES_PARSER

public static final int PRIMARY_PES_PARSER

TS_PARSER

public static final int TS_PARSER

PVA_PARSER

public static final int PVA_PARSER

ES_VIDEO_PARSER

public static final int ES_VIDEO_PARSER

ES_AUDIO_PARSER

public static final int ES_AUDIO_PARSER

ES_SUBPICTURE_PARSER

public static final int ES_SUBPICTURE_PARSER

Unsupported

public static final int Unsupported

PES_AV_TYPE

public static final int PES_AV_TYPE

MPEG1PS_TYPE

public static final int MPEG1PS_TYPE

MPEG2PS_TYPE

public static final int MPEG2PS_TYPE

PVA_TYPE

public static final int PVA_TYPE

TS_TYPE

public static final int TS_TYPE

PES_MPA_TYPE

public static final int PES_MPA_TYPE

PES_PS1_TYPE

public static final int PES_PS1_TYPE

ES_MPV_TYPE

public static final int ES_MPV_TYPE

ES_MPA_TYPE

public static final int ES_MPA_TYPE

ES_AC3_TYPE

public static final int ES_AC3_TYPE

ES_AC3_A_TYPE

public static final int ES_AC3_A_TYPE

ES_DTS_TYPE

public static final int ES_DTS_TYPE

ES_DTS_A_TYPE

public static final int ES_DTS_A_TYPE

ES_RIFF_TYPE

public static final int ES_RIFF_TYPE

ES_cRIFF_TYPE

public static final int ES_cRIFF_TYPE

ES_SUP_TYPE

public static final int ES_SUP_TYPE

ES_TYPE

public static final int ES_TYPE

UNKNOWN

public static final int UNKNOWN

AC3_AUDIO

public static final int AC3_AUDIO

TELETEXT

public static final int TELETEXT

MPEG_AUDIO

public static final int MPEG_AUDIO

MPEG_VIDEO

public static final int MPEG_VIDEO

LPCM_AUDIO

public static final int LPCM_AUDIO

SUBPICTURE

public static final int SUBPICTURE

DTS_AUDIO

public static final int DTS_AUDIO

WAV_AUDIO

public static final int WAV_AUDIO

ACTION_UNDEFINED

public static final int ACTION_UNDEFINED

ACTION_DEMUX

public static final int ACTION_DEMUX

ACTION_TO_VDR

public static final int ACTION_TO_VDR

ACTION_TO_M2P

public static final int ACTION_TO_M2P

ACTION_TO_PVA

public static final int ACTION_TO_PVA

ACTION_TO_TS

public static final int ACTION_TO_TS

ACTION_FILTER

public static final int ACTION_FILTER

CUTMODE_BYTE

public static final int CUTMODE_BYTE

CUTMODE_GOP

public static final int CUTMODE_GOP

CUTMODE_FRAME

public static final int CUTMODE_FRAME

CUTMODE_PTS

public static final int CUTMODE_PTS

CUTMODE_TIME

public static final int CUTMODE_TIME

PICTURE_START_CODE

public static final int PICTURE_START_CODE

SLICE_START_CODE_MIN

public static final int SLICE_START_CODE_MIN

SLICE_START_CODE_MAX

public static final int SLICE_START_CODE_MAX

USER_DATA_START_CODE

public static final int USER_DATA_START_CODE

SEQUENCE_HEADER_CODE

public static final int SEQUENCE_HEADER_CODE

EXTENSION_START_CODE

public static final int EXTENSION_START_CODE

SEQUENCE_END_CODE

public static final int SEQUENCE_END_CODE

GROUP_START_CODE

public static final int GROUP_START_CODE

SYSTEM_END_CODE

public static final int SYSTEM_END_CODE

PACK_START_CODE

public static final int PACK_START_CODE

SYSTEM_START_CODE

public static final int SYSTEM_START_CODE

PROGRAM_STREAM_MAP_CODE

public static final int PROGRAM_STREAM_MAP_CODE

PRIVATE_STREAM_1_CODE

public static final int PRIVATE_STREAM_1_CODE

PADDING_STREAM_CODE

public static final int PADDING_STREAM_CODE

PRIVATE_STREAM_2_CODE

public static final int PRIVATE_STREAM_2_CODE

ECM_STREAM_CODE

public static final int ECM_STREAM_CODE

EMM_STREAM_CODE

public static final int EMM_STREAM_CODE

DSM_CC_STREAM_CODE

public static final int DSM_CC_STREAM_CODE

FRAME_I_TYPE

public static final int FRAME_I_TYPE

FRAME_P_TYPE

public static final int FRAME_P_TYPE

FRAME_B_TYPE

public static final int FRAME_B_TYPE

FRAME_D_TYPE

public static final int FRAME_D_TYPE

MAX_BITRATE_VALUE

public static final int MAX_BITRATE_VALUE
Method Detail

isInfoScan

public static boolean isInfoScan()

setInfoScan

public static void setInfoScan(boolean b)

isProcessCancelled

public static boolean isProcessCancelled()

setProcessCancelled

public static void setProcessCancelled(boolean b)

isProcessPausing

public static boolean isProcessPausing()

setProcessPausing

public static void setProcessPausing(boolean b)

getAudioProcessingFlags

public static long getAudioProcessingFlags()

setAudioProcessingFlags

public static void setAudioProcessingFlags(long val)

getVideoFramerate

public static double getVideoFramerate()

setVideoFramerate

public static void setVideoFramerate(double val)

getCutCounter

public static int getCutCounter()

setCutCounter

public static void setCutCounter(int val)

getCutStatus

public static boolean getCutStatus()

setCutStatus

public static void setCutStatus(boolean b)

getPvaPidExtraction

public static boolean getPvaPidExtraction()

setPvaPidExtraction

public static void setPvaPidExtraction(boolean b)

getPvaPidToExtract

public static int getPvaPidToExtract()

setPvaPidToExtract

public static void setPvaPidToExtract(int val)

getPTSfromBytes

public static long getPTSfromBytes(byte[] array,
                                   int offset)
returns pts value from pes_extension
Returns:
- pts

getPTSfromBytes

public static long getPTSfromBytes(byte[] array,
                                   int offset,
                                   boolean trim)
returns pts value from pes_extension
Returns:
- pts

readPTS

public static long readPTS(byte[] array,
                           int offset,
                           int length,
                           boolean bytereordering,
                           boolean trim)
returns pts value from pes_extension
Returns:
- pts

setValue

public static void setValue(byte[] array,
                            int offset,
                            int length,
                            boolean bytereordering,
                            long value)

getValue

public static long getValue(byte[] array,
                            int offset,
                            int length,
                            boolean bytereordering)
returns value
Returns:
-

getIntValue

public static int getIntValue(byte[] array,
                              int offset,
                              int length,
                              boolean bytereordering)

setPES_PTSField

public static void setPES_PTSField(byte[] array,
                                   int offset,
                                   long value)

setPES_LengthField

public static void setPES_LengthField(byte[] array,
                                      int offset,
                                      int value)

setPES_IdField

public static void setPES_IdField(byte[] array,
                                  int offset,
                                  int value)

setPES_SubIdField

public static void setPES_SubIdField(byte[] array,
                                     int offset,
                                     int pes_headerlength,
                                     int pes_extensionlength,
                                     int value)

getPES_LengthField

public static int getPES_LengthField(byte[] array,
                                     int offset)

getPES_IdField

public static int getPES_IdField(byte[] array,
                                 int offset)

getPES_ExtensionLengthField

public static int getPES_ExtensionLengthField(byte[] array,
                                              int offset)

clearBit33ofPTS

public static boolean clearBit33ofPTS(byte[] array,
                                      int offset)

clearBit33ofDTS

public static boolean clearBit33ofDTS(byte[] array,
                                      int offset)

nextBits

public static int nextBits(byte[] buffer,
                           int BitPos,
                           int N)

validateStartcode

public static int validateStartcode(byte[] pes_packet,
                                    int offset)
check startcode return int of skip'able data (negative)

alignSyncword

public static boolean alignSyncword(byte[] pes_packet,
                                    int pes_offset,
                                    int es_streamtype)
skip leading bytes before first valid startcodes and return fixed array

logAlias

public static void logAlias(JobProcessing job_processing,
                            java.lang.String _vptslog,
                            java.lang.String _datalog)
create PTS alias

resetSplitMode

public static void resetSplitMode(JobProcessing job_processing,
                                  java.lang.String vptslog)
split reset

parseCutValue

public static java.lang.String parseCutValue(long value)
parse cut long value

parseCutValue

public static long parseCutValue(java.lang.String value,
                                 boolean demux)
parse cut field value

calcVideoTime

public static long calcVideoTime(java.lang.String logfile)
video timelength read from ptslogfile

makecut

public static boolean makecut(JobProcessing job_processing,
                              long comparePoint,
                              java.util.List ctemp)
make cut

makecut

public static boolean makecut(JobProcessing job_processing,
                              java.lang.String cuts_filename,
                              long startPTS,
                              long comparePoint,
                              java.util.List newcut,
                              int lastframes,
                              java.util.List ctemp,
                              int gopnumber,
                              java.util.List cell)
make cut

setVideoHeader

public static void setVideoHeader(JobProcessing job_processing,
                                  java.lang.String videofile,
                                  java.lang.String logfile,
                                  int[] clv,
                                  int[] MPGVideotype)
set 1. videoheader

getExtension2_Id

public static int getExtension2_Id(byte[] pes_packet,
                                   int pes_headerlength,
                                   int pes_payloadlength,
                                   int pesID,
                                   boolean pes_isMpeg2,
                                   long file_position)
vdr_dvbsub determination