本文整理汇总了Golang中github.com/acolwell/mse-tools/webm.IdToName函数的典型用法代码示例。如果您正苦于以下问题:Golang IdToName函数的具体用法?Golang IdToName怎么用?Golang IdToName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IdToName函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: OnListStart
func (c *DemuxerClient) OnListStart(offset int64, id int) bool {
//log.Printf("OnListStart(%d, %s)\n", offset, webm.IdToName(id))
if !c.readEBMLHeader {
log.Printf("Unexpected element %s before EBMLHeader\n", webm.IdToName(id))
return false
}
if id == webm.IdSegment {
c.segmentOffset = offset
c.writer.WriteListStart(webm.IdSegment)
c.outputSegmentOffset = c.writer.Offset()
c.writer.WriteVoid(SEEK_HEAD_RESERVE_SIZE)
return true
}
if id == webm.IdCluster {
c.clusterTimecode = -1
if c.outputClusterOffset == -1 {
c.outputClusterOffset = c.writer.Offset()
}
return true
}
log.Printf("OnListStart() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:28,代码来源:mse_webm_remuxer.go
示例2: OnString
func (c *DemuxerClient) OnString(id int, value string) bool {
if !c.readEBMLHeader {
log.Printf("Unexpected element %s before EBMLHeader\n", webm.IdToName(id))
return false
}
log.Printf("OnString() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:9,代码来源:mse_webm_remuxer.go
示例3: OnUint
func (c *TestClient) OnUint(id int, value uint64) bool {
if id != webm.IdSeekID {
fmt.Printf("%s<%s type=\"uint\" value=\"%d\"/>\n", c.indent(), webm.IdToName(id), value)
} else {
fmt.Printf("%s<%s type=\"uint\" id_name=\"%s\" value=\"%d\"/>\n", c.indent(), webm.IdToName(id), webm.IdToName(int(value)), value)
}
if id == webm.IdTimecode {
c.clusterTimecode = value
}
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:11,代码来源:webm_dump.go
示例4: OnUint
func (c *DemuxerClient) OnUint(id int, value uint64) bool {
if !c.readEBMLHeader {
log.Printf("Unexpected element %s before EBMLHeader\n", webm.IdToName(id))
return false
}
if id == webm.IdTimecode {
c.clusterTimecode = int64(value)
//log.Printf("Input Cluster timecode %d\n", c.clusterTimecode)
return true
}
log.Printf("OnUint() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:15,代码来源:mse_webm_remuxer.go
示例5: OnBinary
func (c *TestClient) OnBinary(id int, value []byte) bool {
if id != webm.IdSimpleBlock {
fmt.Printf("%s<%s type=\"binary\" size=\"%d\"/>\n", c.indent(), webm.IdToName(id), len(value))
} else {
blockInfo := webm.ParseSimpleBlock(value)
presentationTimecode := int64(c.clusterTimecode) + int64(blockInfo.Timecode)
if blockInfo != nil {
fmt.Printf("%s<%s type=\"binary\" size=\"%d\" trackNum=\"%d\" timecode=\"%d\" presentationTimecode=\"%d\" flags=\"%x\"/>\n",
c.indent(), webm.IdToName(id), len(value), blockInfo.Id, blockInfo.Timecode, presentationTimecode, blockInfo.Flags)
} else {
fmt.Printf("%s<%s type=\"binary\" size=\"%d\" invalid=\"true\"/>\n", c.indent(), webm.IdToName(id), len(value))
}
}
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:15,代码来源:webm_dump.go
示例6: OnInt
func (c *BlockGroupClient) OnInt(id int, value int64) bool {
if id == webm.IdDiscardPadding || id == webm.IdReferenceBlock {
c.writer.Write(id, value)
return true
}
log.Printf("OnInt() : Unexpected element %s %d\n", webm.IdToName(id), value)
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:8,代码来源:mse_webm_remuxer.go
示例7: OnUint
func (c *BlockGroupClient) OnUint(id int, value uint64) bool {
if id == webm.IdBlockDuration {
c.writer.Write(id, value)
return true
}
log.Printf("OnUint() : Unexpected element %s %u\n", webm.IdToName(id), value)
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:8,代码来源:mse_webm_remuxer.go
示例8: OnBinary
func (c *BlockGroupClient) OnBinary(id int, value []byte) bool {
if id == webm.IdBlock {
blockInfo := webm.ParseSimpleBlock(value)
c.id = blockInfo.Id
c.rawTimecode = int64(blockInfo.Timecode)
c.flags = blockInfo.Flags & 0x0f
c.blockData = value[blockInfo.HeaderSize:]
c.parsedBlock = true
return true
} else if id == webm.IdBlockAdditions {
c.writer.Write(id, value)
return true
}
log.Printf("OnBinary() : Unexpected element %s size %d\n", webm.IdToName(id), len(value))
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:16,代码来源:mse_webm_remuxer.go
示例9: OnListEnd
func (c *DemuxerClient) OnListEnd(offset int64, id int) bool {
//log.Printf("OnListEnd(%d, %s)\n", offset, webm.IdToName(id))
if id == webm.IdSegment {
if c.outputClusterTimecode != -1 {
c.writeRemainingBlocks()
c.writer.WriteListEnd(webm.IdCluster)
}
if c.writer.CanSeek() {
c.writeCues()
}
// Rewrite seek head.
oldOffset := c.writer.Offset()
if c.writer.SetOffset(c.outputSegmentOffset) {
c.writeSeekHead()
if c.writer.Offset() < c.outputInfoOffset {
c.writer.WriteVoid(int(c.outputInfoOffset - c.writer.Offset()))
}
c.writer.SetOffset(oldOffset)
}
c.writer.WriteListEnd(webm.IdSegment)
return true
}
if id == webm.IdCluster {
return true
}
log.Printf("OnListEnd() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:36,代码来源:mse_webm_remuxer.go
示例10: OnInt
func (c *DemuxerClient) OnInt(id int, value int64) bool {
log.Printf("OnInt() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:4,代码来源:mse_webm_remuxer.go
示例11: OnInt
func (c *TestClient) OnInt(id int, value int64) bool {
fmt.Printf("%<%s type=\"int\" value=\"%d\"/>\n", c.indent(), webm.IdToName(id), value)
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:4,代码来源:webm_dump.go
示例12: OnListEnd
func (c *TestClient) OnListEnd(offset int64, id int) bool {
c.depth--
fmt.Printf("%s</%s>\n", c.indent(), webm.IdToName(id))
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:5,代码来源:webm_dump.go
示例13: OnListStart
func (c *TestClient) OnListStart(offset int64, id int) bool {
fmt.Printf("%s<%s type=\"list\" offset=\"%d\">\n", c.indent(), webm.IdToName(id), offset)
c.depth++
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:5,代码来源:webm_dump.go
示例14: OnFloat
func (c *TestClient) OnFloat(id int, value float64) bool {
fmt.Printf("%s<%s type=\"float\" value=\"%f\"/>\n", c.indent(), webm.IdToName(id), value)
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:4,代码来源:webm_dump.go
示例15: OnBinary
func (c *DemuxerClient) OnBinary(id int, value []byte) bool {
if id == ebml.IdHeader {
if c.readEBMLHeader {
log.Printf("Already read an EBMLHeader\n")
return false
}
if !c.ParseEBMLHeader(value) {
return false
}
c.readEBMLHeader = true
webm.WriteHeader(c.writer)
//c.writer.Write(id, value)
return true
}
if !c.readEBMLHeader {
log.Printf("Unexpected element %s before EBMLHeader\n", webm.IdToName(id))
return false
}
if id == ebml.IdVoid {
return true
}
if id == webm.IdSeekHead {
return true
}
if id == webm.IdInfo {
if !c.ParseInfo(value) {
return false
}
c.outputInfoOffset = c.writer.Offset()
c.writer.Write(id, value)
return true
}
if id == webm.IdTracks {
if !c.ParseTracks(value) {
return false
}
c.outputTracksOffset = c.writer.Offset()
// Filter out deprecated values.
filteredValue := webm.Filter(value, []int{webm.IdFrameRate})
c.writer.Write(id, filteredValue)
return true
}
if id == webm.IdSimpleBlock {
return c.ParseSimpleBlock(value)
}
switch id {
case webm.IdCues,
webm.IdPrevSize,
webm.IdPosition:
return true
}
log.Printf("OnBinary() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:65,代码来源:mse_webm_remuxer.go
示例16: OnString
func (c *BlockGroupClient) OnString(id int, value string) bool {
log.Printf("OnString() : Unexpected element %s %s\n", webm.IdToName(id), value)
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:4,代码来源:mse_webm_remuxer.go
示例17: OnFloat
func (c *BlockGroupClient) OnFloat(id int, value float64) bool {
log.Printf("OnFloat() : Unexpected element %s %f\n", webm.IdToName(id), value)
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:4,代码来源:mse_webm_remuxer.go
示例18: OnString
func (c *TestClient) OnString(id int, value string) bool {
fmt.Printf("%s<%s type=\"string\" value=\"%s\"/>\n", c.indent(), webm.IdToName(id), value)
return true
}
开发者ID:MCProHosting,项目名称:mse-tools,代码行数:4,代码来源:webm_dump.go
示例19: OnListEnd
func (c *BlockGroupClient) OnListEnd(offset int64, id int) bool {
//log.Printf("OnListEnd(%d, %s)\n", offset, webm.IdToName(id))
log.Printf("OnListEnd() : Unexpected element %s\n", webm.IdToName(id))
return false
}
开发者ID:acolwell,项目名称:mse-tools,代码行数:5,代码来源:mse_webm_remuxer.go
注:本文中的github.com/acolwell/mse-tools/webm.IdToName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论