feat: initial media structs
This commit is contained in:
parent
22e72da15c
commit
a499dcf544
|
@ -0,0 +1,59 @@
|
|||
package metadata
|
||||
|
||||
import "git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
||||
|
||||
type MediaFormat struct {
|
||||
Subtype string
|
||||
Role string
|
||||
Ext string
|
||||
Cid *encoding.CID
|
||||
Height int
|
||||
Width int
|
||||
Languages []string
|
||||
Asr int
|
||||
Fps int
|
||||
Bitrate int
|
||||
AudioChannels int
|
||||
Vcodec string
|
||||
Acodec string
|
||||
Container string
|
||||
DynamicRange string
|
||||
Charset string
|
||||
Value []byte
|
||||
Duration int
|
||||
Rows int
|
||||
Columns int
|
||||
Index int
|
||||
InitRange string
|
||||
IndexRange string
|
||||
Caption string
|
||||
}
|
||||
|
||||
func NewMediaFormat(subtype string, role, ext, vcodec, acodec, container, dynamicRange, charset, initRange, indexRange, caption string, cid *encoding.CID, height, width, asr, fps, bitrate, audioChannels, duration, rows, columns, index int, languages []string, value []byte) *MediaFormat {
|
||||
return &MediaFormat{
|
||||
Subtype: subtype,
|
||||
Role: role,
|
||||
Ext: ext,
|
||||
Cid: cid,
|
||||
Height: height,
|
||||
Width: width,
|
||||
Languages: languages,
|
||||
Asr: asr,
|
||||
Fps: fps,
|
||||
Bitrate: bitrate,
|
||||
AudioChannels: audioChannels,
|
||||
Vcodec: vcodec,
|
||||
Acodec: acodec,
|
||||
Container: container,
|
||||
DynamicRange: dynamicRange,
|
||||
Charset: charset,
|
||||
Value: value,
|
||||
Duration: duration,
|
||||
Rows: rows,
|
||||
Columns: columns,
|
||||
Index: index,
|
||||
InitRange: initRange,
|
||||
IndexRange: indexRange,
|
||||
Caption: caption,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package metadata
|
||||
|
||||
import "git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
||||
|
||||
type MediaMetadataLinks struct {
|
||||
Count int
|
||||
Head []*encoding.CID
|
||||
Collapsed []*encoding.CID
|
||||
Tail []*encoding.CID
|
||||
}
|
||||
|
||||
func NewMediaMetadataLinks(head []*encoding.CID) *MediaMetadataLinks {
|
||||
return &MediaMetadataLinks{
|
||||
Count: len(head),
|
||||
Head: head,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package metadata
|
||||
|
||||
type MediaMetadata struct {
|
||||
Metadata
|
||||
Name string
|
||||
MediaTypes map[string][]MediaFormat
|
||||
Parents []MetadataParentLink
|
||||
Details MediaMetadataDetails
|
||||
Links *MediaMetadataLinks
|
||||
ExtraMetadata ExtraMetadata
|
||||
}
|
||||
|
||||
func NewMediaMetadata(name string, details MediaMetadataDetails, parents []MetadataParentLink, mediaTypes map[string][]MediaFormat, links *MediaMetadataLinks, extraMetadata ExtraMetadata) *MediaMetadata {
|
||||
return &MediaMetadata{
|
||||
Name: name,
|
||||
Details: details,
|
||||
Parents: parents,
|
||||
MediaTypes: mediaTypes,
|
||||
Links: links,
|
||||
ExtraMetadata: extraMetadata,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package metadata
|
||||
|
||||
type MediaMetadataDetails struct {
|
||||
Data map[int]interface{}
|
||||
}
|
||||
|
||||
func NewMediaMetadataDetails(data map[int]interface{}) *MediaMetadataDetails {
|
||||
return &MediaMetadataDetails{Data: data}
|
||||
}
|
Loading…
Reference in New Issue