mirror of https://bitbucket.org/ausocean/av.git
Resolved conflict.
This commit is contained in:
commit
726d360a31
|
@ -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/).
|
|
@ -377,7 +377,7 @@ func sendClipToRTP(clip []byte, _ string, conn net.Conn) error {
|
||||||
len(clip)/size, size+rtpHeaderSize, len(clip))
|
len(clip)/size, size+rtpHeaderSize, len(clip))
|
||||||
pkt := make([]byte, rtpHeaderSize+rtpPackets*mp2tPacketSize)
|
pkt := make([]byte, rtpHeaderSize+rtpPackets*mp2tPacketSize)
|
||||||
for offset := 0; offset < len(clip); offset += size {
|
for offset := 0; offset < len(clip); offset += size {
|
||||||
RTPEncapsulate(clip[offset:offset+size], pkt)
|
rtpEncapsulate(clip[offset:offset+size], pkt)
|
||||||
_, err := conn.Write(pkt)
|
_, err := conn.Write(pkt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("RTP write error %s. Is your player listening?", err)
|
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
|
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.
|
// 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
|
// RTP packet encapsulates the MP2T
|
||||||
// first 12 bytes is the header
|
// first 12 bytes is the header
|
||||||
// byte 0: version=2, padding=0, extension=0, cc=0
|
// byte 0: version=2, padding=0, extension=0, cc=0
|
||||||
|
|
|
@ -37,6 +37,7 @@ import (
|
||||||
RingBuffer aims to provide functionality of a RingBuffer data structure.
|
RingBuffer aims to provide functionality of a RingBuffer data structure.
|
||||||
It may be used in concurrent routines.
|
It may be used in concurrent routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type RingBuffer interface {
|
type RingBuffer interface {
|
||||||
Get() ([]byte, error)
|
Get() ([]byte, error)
|
||||||
DoneWriting(size int) error
|
DoneWriting(size int) error
|
||||||
|
|
Loading…
Reference in New Issue