Package bdsup2sub.supstream.bd
Class SupBDParser
java.lang.Object
bdsup2sub.supstream.bd.SupBDParser
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileBufferprivate static final Configurationprivate intprivate static final Loggerprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate List<SubPictureBD> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate intprivate PGSCompositionStateintprivate booleanRetrieve palette (only) update flag from PCS segmentprivate voidparse()private booleanparseODS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD, StringBuffer message) private voidparsePCS(SupBDParser.PCSSegment segment, SubPictureBD subPictureBD, StringBuffer message) parse an PCS packet which contains width/height infoprivate intparsePDS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD, StringBuffer message) private voidparseWDS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD) private SupBDParser.PCSSegmentreadPCSSegment(int offset) private voidremoveLastFrameIfInvalid(int odsCounter, int pdsCounter)
-
Field Details
-
configuration
-
logger
-
PGSSUP_FILE_MAGIC
private static final int PGSSUP_FILE_MAGIC- See Also:
-
PGSSUP_PALETTE_SEGMENT
private static final int PGSSUP_PALETTE_SEGMENT- See Also:
-
PGSSUP_PICTURE_SEGMENT
private static final int PGSSUP_PICTURE_SEGMENT- See Also:
-
PGSSUP_PRESENTATION_SEGMENT
private static final int PGSSUP_PRESENTATION_SEGMENT- See Also:
-
PGSSUP_WINDOW_SEGMENT
private static final int PGSSUP_WINDOW_SEGMENT- See Also:
-
PGSSUP_DISPLAY_SEGMENT
private static final int PGSSUP_DISPLAY_SEGMENT- See Also:
-
buffer
-
subPictures
-
forcedFrameCount
private int forcedFrameCount
-
-
Constructor Details
-
SupBDParser
- Throws:
CoreException
-
-
Method Details
-
parse
- Throws:
CoreException
-
removeLastFrameIfInvalid
private void removeLastFrameIfInvalid(int odsCounter, int pdsCounter) -
countForcedFrames
private void countForcedFrames() -
readPCSSegment
- Throws:
FileBufferExceptionCoreException
-
getCompositionNumber
- Throws:
FileBufferException
-
getCompositionState
private PGSCompositionState getCompositionState(SupBDParser.PCSSegment segment) throws FileBufferException - Throws:
FileBufferException
-
getPaletteUpdateFlag
Retrieve palette (only) update flag from PCS segment- Returns:
- true: this is only a palette update - ignore ODS
- Throws:
FileBufferException
-
parsePCS
private void parsePCS(SupBDParser.PCSSegment segment, SubPictureBD subPictureBD, StringBuffer message) throws FileBufferException parse an PCS packet which contains width/height info- Parameters:
segment- object containing info about the current segmentsubPictureBD- SubPicture object containing info about the current captionmessage-- Throws:
FileBufferException
-
parseWDS
private void parseWDS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD) throws FileBufferException - Throws:
FileBufferException
-
parseODS
private boolean parseODS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD, StringBuffer message) throws FileBufferException - Throws:
FileBufferException
-
parsePDS
private int parsePDS(SupBDParser.PCSSegment pcsSegment, SubPictureBD subPictureBD, StringBuffer message) throws FileBufferException - Throws:
FileBufferException
-
getBuffer
-
getSubPictures
-
getForcedFrameCount
public int getForcedFrameCount()
-