mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-07 09:11:28 +08:00
Add MJPEG support to HomeKit client
This commit is contained in:
@@ -95,6 +95,17 @@ func (c *Client) GetMedias() []*core.Media {
|
|||||||
c.SDP = fmt.Sprintf("%+v\n%+v", c.videoConfig, c.audioConfig)
|
c.SDP = fmt.Sprintf("%+v\n%+v", c.videoConfig, c.audioConfig)
|
||||||
|
|
||||||
c.Medias = []*core.Media{
|
c.Medias = []*core.Media{
|
||||||
|
{
|
||||||
|
Kind: core.KindVideo,
|
||||||
|
Direction: core.DirectionRecvonly,
|
||||||
|
Codecs: []*core.Codec{
|
||||||
|
{
|
||||||
|
Name: core.CodecJPEG,
|
||||||
|
ClockRate: 90000,
|
||||||
|
PayloadType: core.PayloadTypeRAW,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
videoToMedia(c.videoConfig.Codecs),
|
videoToMedia(c.videoConfig.Codecs),
|
||||||
audioToMedia(c.audioConfig.Codecs),
|
audioToMedia(c.audioConfig.Codecs),
|
||||||
}
|
}
|
||||||
@@ -164,8 +175,12 @@ func (c *Client) Start() error {
|
|||||||
func (c *Client) Stop() error {
|
func (c *Client) Stop() error {
|
||||||
_ = c.SuperProducer.Close()
|
_ = c.SuperProducer.Close()
|
||||||
|
|
||||||
c.srtp.DelSession(c.videoSession)
|
if c.videoSession != nil {
|
||||||
c.srtp.DelSession(c.audioSession)
|
c.srtp.DelSession(c.videoSession)
|
||||||
|
}
|
||||||
|
if c.audioSession != nil {
|
||||||
|
c.srtp.DelSession(c.audioSession)
|
||||||
|
}
|
||||||
|
|
||||||
return c.hap.Close()
|
return c.hap.Close()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user