Skip to content

Commit

Permalink
net,core: add fields for signatures in B<>O messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jailuthra committed Sep 21, 2021
1 parent fce8a40 commit 9c4cc8b
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 143 deletions.
3 changes: 2 additions & 1 deletion core/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ type TranscodeData struct {
// TranscodedSegmentData contains encoded data for a profile
type TranscodedSegmentData struct {
Data []byte
Pixels int64 // Encoded pixels
PHash []byte // Perceptual hash data (maybe nil)
Pixels int64 // Encoded pixels
}

type SegChanData struct {
Expand Down
42 changes: 22 additions & 20 deletions core/streamdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ func (s *StreamParameters) StreamID() string {
}

type SegTranscodingMetadata struct {
ManifestID ManifestID
Fname string
Seq int64
Hash ethcommon.Hash
Profiles []ffmpeg.VideoProfile
OS *net.OSInfo
Duration time.Duration
Caps *Capabilities
AuthToken *net.AuthToken
DetectorEnabled bool
DetectorProfiles []ffmpeg.DetectorProfile
ManifestID ManifestID
Fname string
Seq int64
Hash ethcommon.Hash
Profiles []ffmpeg.VideoProfile
OS *net.OSInfo
Duration time.Duration
Caps *Capabilities
AuthToken *net.AuthToken
DetectorEnabled bool
DetectorProfiles []ffmpeg.DetectorProfile
CalcPerceptualHash bool
}

func (md *SegTranscodingMetadata) Flatten() []byte {
Expand Down Expand Up @@ -109,15 +110,16 @@ func NetSegData(md *SegTranscodingMetadata) (*net.SegData, error) {
}
// Generate serialized segment info
segData := &net.SegData{
ManifestId: []byte(md.ManifestID),
Seq: md.Seq,
Hash: md.Hash.Bytes(),
Storage: storage,
Duration: int32(md.Duration / time.Millisecond),
Capabilities: md.Caps.ToNetCapabilities(),
AuthToken: md.AuthToken,
DetectorEnabled: md.DetectorEnabled,
DetectorProfiles: detectorProfiles,
ManifestId: []byte(md.ManifestID),
Seq: md.Seq,
Hash: md.Hash.Bytes(),
Storage: storage,
Duration: int32(md.Duration / time.Millisecond),
Capabilities: md.Caps.ToNetCapabilities(),
AuthToken: md.AuthToken,
DetectorEnabled: md.DetectorEnabled,
DetectorProfiles: detectorProfiles,
CalcPerceptualHash: md.CalcPerceptualHash,
// Triggers failure on Os that don't know how to use FullProfiles/2/3
Profiles: []byte("invalid"),
}
Expand Down
Loading

0 comments on commit 9c4cc8b

Please sign in to comment.