1 __name__
="oggStream - class of stream in OGG files"
2 __author__
="Maxim Litvinov (aka DarakuTenshi) otaky<at>ukr.net"
12 Class for processing stream in OGG file.
14 #==============================================================================
15 def __init__(self
, streamSerial
, streamType
, streamSource
):
17 @brief Constructor of oggStream class
18 @param[IN] streamSerial - serial number of stream in OGG file
19 @param[IN] streamType - one char type id of stream (output from ogginfo tool)
21 self
.serial
=streamSerial
22 self
.source
=streamSource
25 if(streamType
=="v"): self
.strType
="video"; self
.intType
=OGG_STREAM_VIDEO
26 if(streamType
=="a"): self
.strType
="audio"; self
.intType
=OGG_STREAM_AUDIO
27 if(streamType
=="t"): self
.strType
="text"; self
.intType
=OGG_STREAM_TEXT
31 #==============================================================================
37 #==============================================================================
40 Return integer value of type of stream
43 #==============================================================================
46 Return string value of type of stream
49 #==============================================================================
52 Return serial number of stream
55 #==============================================================================
56 def getAttr(self
, attrIndex
):
58 @brief return attribute of stream.
60 This function return list of attribute name and attribute value,
62 @param[IN] attrIndex - index of requested attribute.
63 @return list where 0 element is attribute name, and 1st - value.
66 RET
.append(self
.attrNames
[attrIndex
])
67 RET
.append(self
.attrValues
[attrIndex
])
69 #==============================================================================
70 def addAttr(self
, attrName
, attrValue
):
72 @brief add attribute to stream
74 @param[IN] attrName - name of attribute
75 @param[IN] attrValue - value of attribute
77 self
.attrNames
.append(attrName
)
78 self
.attrValues
.append(attrValue
)
80 #==============================================================================
81 def getAttrNumber(self
):
83 Get number of attributes.
84 @return Attributes number.
86 return len(self
.attrNames
)
87 #==============================================================================