Resolved conflict.

This commit is contained in:
Alan Noble 2017-12-04 15:59:41 +10:30
commit 726d360a31
3 changed files with 29 additions and 3 deletions

25
Readme.md Normal file
View File

@ -0,0 +1,25 @@
# Readme
av is a collection of tools and packages written in Go for audio-video processing.
# Description
* revid: a tool for re-muxing and re-directing video streams.
* RingBuffer: a package that implements a ring buffer with concurrency control.
# License
Copyright (C) 2017 the Australian Ocean Lab (AusOcean).
It is free software: you can redistribute it and/or modify them
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
or more details.
You should have received a copy of the GNU General Public License
along with revid in gpl.txt. If not, see [GNU licenses](http://www.gnu.org/licenses/).

View File

@ -377,7 +377,7 @@ func sendClipToRTP(clip []byte, _ string, conn net.Conn) error {
len(clip)/size, size+rtpHeaderSize, len(clip))
pkt := make([]byte, rtpHeaderSize+rtpPackets*mp2tPacketSize)
for offset := 0; offset < len(clip); offset += size {
RTPEncapsulate(clip[offset:offset+size], pkt)
rtpEncapsulate(clip[offset:offset+size], pkt)
_, err := conn.Write(pkt)
if err != nil {
return fmt.Errorf("RTP write error %s. Is your player listening?", err)
@ -565,9 +565,9 @@ func mp2tGetPCR(pkt []byte) (uint64, uint32, bool) {
return pcrBase, pcrExt, true
}
// RTPEncapsulate encapsulates MPEG-TS packets within an RTP header,
// rtpEncapsulate encapsulates MPEG-TS packets within an RTP header,
// setting the payload type accordingly (to 33) and incrementing the RTP sequence number.
func RTPEncapsulate(mp2tPacket []byte, pkt []byte) {
func rtpEncapsulate(mp2tPacket []byte, pkt []byte) {
// RTP packet encapsulates the MP2T
// first 12 bytes is the header
// byte 0: version=2, padding=0, extension=0, cc=0

View File

@ -37,6 +37,7 @@ import (
RingBuffer aims to provide functionality of a RingBuffer data structure.
It may be used in concurrent routines.
*/
type RingBuffer interface {
Get() ([]byte, error)
DoneWriting(size int) error