mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-26 13:01:59 -08:00
rtmp server: change value of MessageStreamID of outgoing messages
This commit is contained in:
parent
820ba067f2
commit
e255d004e3
7 changed files with 36 additions and 26 deletions
|
|
@ -910,7 +910,7 @@ func (c *Conn) WriteTracks(videoTrack *gortsplib.TrackH264, audioTrack *gortspli
|
|||
}.Marshal()
|
||||
|
||||
err = c.WriteMessage(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
|
|
@ -928,7 +928,7 @@ func (c *Conn) WriteTracks(videoTrack *gortsplib.TrackH264, audioTrack *gortspli
|
|||
}
|
||||
|
||||
err = c.WriteMessage(&message.MsgAudio{
|
||||
ChunkStreamID: 4,
|
||||
ChunkStreamID: message.MsgAudioChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
Rate: flvio.SOUND_44Khz,
|
||||
Depth: flvio.SOUND_16BIT,
|
||||
|
|
|
|||
|
|
@ -786,8 +786,8 @@ func TestReadTracks(t *testing.T) {
|
|||
PPS: pps,
|
||||
}.Marshal()
|
||||
err = mrw.Write(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
Payload: buf,
|
||||
|
|
@ -802,8 +802,8 @@ func TestReadTracks(t *testing.T) {
|
|||
}.Marshal()
|
||||
require.NoError(t, err)
|
||||
err = mrw.Write(&message.MsgAudio{
|
||||
ChunkStreamID: 4,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgAudioChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
Rate: flvio.SOUND_44Khz,
|
||||
Depth: flvio.SOUND_16BIT,
|
||||
Channels: flvio.SOUND_STEREO,
|
||||
|
|
@ -848,8 +848,8 @@ func TestReadTracks(t *testing.T) {
|
|||
PPS: pps,
|
||||
}.Marshal()
|
||||
err = mrw.Write(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
Payload: buf,
|
||||
|
|
@ -888,8 +888,8 @@ func TestReadTracks(t *testing.T) {
|
|||
PPS: pps,
|
||||
}.Marshal()
|
||||
err = mrw.Write(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
Payload: buf,
|
||||
|
|
@ -904,8 +904,8 @@ func TestReadTracks(t *testing.T) {
|
|||
}.Marshal()
|
||||
require.NoError(t, err)
|
||||
err = mrw.Write(&message.MsgAudio{
|
||||
ChunkStreamID: 4,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgAudioChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
Rate: flvio.SOUND_44Khz,
|
||||
Depth: flvio.SOUND_16BIT,
|
||||
Channels: flvio.SOUND_STEREO,
|
||||
|
|
@ -921,8 +921,8 @@ func TestReadTracks(t *testing.T) {
|
|||
PPS: pps,
|
||||
}.Marshal()
|
||||
err = mrw.Write(&message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
Payload: buf,
|
||||
|
|
@ -937,8 +937,8 @@ func TestReadTracks(t *testing.T) {
|
|||
}.Marshal()
|
||||
require.NoError(t, err)
|
||||
err = mrw.Write(&message.MsgAudio{
|
||||
ChunkStreamID: 4,
|
||||
MessageStreamID: 1,
|
||||
ChunkStreamID: message.MsgAudioChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
Rate: flvio.SOUND_44Khz,
|
||||
Depth: flvio.SOUND_16BIT,
|
||||
Channels: flvio.SOUND_STEREO,
|
||||
|
|
@ -1238,7 +1238,7 @@ func TestWriteTracks(t *testing.T) {
|
|||
msg, err = mrw.Read()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &message.MsgVideo{
|
||||
ChunkStreamID: 6,
|
||||
ChunkStreamID: message.MsgVideoChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
IsKeyFrame: true,
|
||||
H264Type: flvio.AVC_SEQHDR,
|
||||
|
|
@ -1256,7 +1256,7 @@ func TestWriteTracks(t *testing.T) {
|
|||
msg, err = mrw.Read()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, &message.MsgAudio{
|
||||
ChunkStreamID: 4,
|
||||
ChunkStreamID: message.MsgAudioChunkStreamID,
|
||||
MessageStreamID: 0x1000000,
|
||||
Rate: flvio.SOUND_44Khz,
|
||||
Depth: flvio.SOUND_16BIT,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ import (
|
|||
"github.com/aler9/rtsp-simple-server/internal/rtmp/rawmessage"
|
||||
)
|
||||
|
||||
const (
|
||||
// this is the chunk stream ID that is usually used to send MsgAudio{}
|
||||
MsgAudioChunkStreamID = 6
|
||||
)
|
||||
|
||||
// MsgAudio is an audio message.
|
||||
type MsgAudio struct {
|
||||
ChunkStreamID byte
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ import (
|
|||
"github.com/aler9/rtsp-simple-server/internal/rtmp/rawmessage"
|
||||
)
|
||||
|
||||
const (
|
||||
// this is the chunk stream ID that is usually used to send MsgVideo{}
|
||||
MsgVideoChunkStreamID = 6
|
||||
)
|
||||
|
||||
// MsgVideo is a video message.
|
||||
type MsgVideo struct {
|
||||
ChunkStreamID byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue