| 1 | package ffprobescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/" |
| 5 | "errorsscip-go gomod github.com/golang/go/src go1.13 errors/" |
| 6 | ) |
| 7 | |
| 8 | var ( |
| 9 | ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. = errorsscip-go gomod github.com/golang/go/src go1.13 errors/.Newscip-go gomod github.com/golang/go/src go1.13 errors/New().("side data not found") |
| 10 | ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. = errorsscip-go gomod github.com/golang/go/src go1.13 errors/.Newscip-go gomod github.com/golang/go/src go1.13 errors/New().("unexpected data type") |
| 11 | ) |
| 12 | |
| 13 | // All names and structures of side data types got from |
| 14 | // https://github.com/FFmpeg/FFmpeg/blob/4ab1184fae88bd47b9d195ac8224853c6f4e94cf/libavcodec/avpacket.c#L268 |
| 15 | // https://github.com/FFmpeg/FFmpeg/blob/master/fftools/ffprobe.c#L2291 |
| 16 | const ( |
| 17 | SideDataTypeUnknownscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeUnknown. = "unknown" |
| 18 | SideDataTypeDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeDisplayMatrix. = "Display Matrix" |
| 19 | SideDataTypeStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeStereo3D. = "Stereo 3D" |
| 20 | SideDataTypeSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSphericalMapping. = "Spherical Mapping" |
| 21 | SideDataTypeSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSkipSamples. = "Skip Samples" |
| 22 | SideDataTypeMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeMasteringDisplayMetadata. = "Mastering display metadata" |
| 23 | SideDataTypeContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeContentLightLevel. = "Content light level metadata" |
| 24 | ) |
| 25 | |
| 26 | type SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataBase# struct { |
| 27 | Typescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataBase#Type. string `json:"side_data_type"` |
| 28 | } |
| 29 | |
| 30 | // SideDataDisplayMatrix represents the display matrix side data. |
| 31 | type SideDataDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix# struct { |
| 32 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#SideDataBase. |
| 33 | Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#Data. string `json:"displaymatrix"` |
| 34 | Rotationscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#Rotation. int `json:"rotation"` |
| 35 | } |
| 36 | |
| 37 | // SideDataStereo3D represents the stereo 3D side data. |
| 38 | type SideDataStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D# struct { |
| 39 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#SideDataBase. |
| 40 | Typescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#Type. string `json:"type"` |
| 41 | Invertedscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#Inverted. bool `json:"inverted"` |
| 42 | } |
| 43 | |
| 44 | // SideDataSphericalMapping represents the spherical mapping side data. |
| 45 | type SideDataSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping# struct { |
| 46 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#SideDataBase. |
| 47 | Projectionscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#Projection. string `json:"projection"` |
| 48 | Paddingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#Padding. int `json:"padding,omitempty"` |
| 49 | BoundLeftscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#BoundLeft. int `json:"bound_left,omitempty"` |
| 50 | BoundTopscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#BoundTop. int `json:"bound_top,omitempty"` |
| 51 | BoundRightscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#BoundRight. int `json:"bound_right,omitempty"` |
| 52 | BoundBottomscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#BoundBottom. int `json:"bound_bottom,omitempty"` |
| 53 | Yawscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#Yaw. int `json:"yaw,omitempty"` |
| 54 | Pitchscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#Pitch. int `json:"pitch,omitempty"` |
| 55 | Rollscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#Roll. int `json:"roll,omitempty"` |
| 56 | } |
| 57 | |
| 58 | // SideDataSkipSamples represents the skip samples side data. |
| 59 | type SideDataSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples# struct { |
| 60 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#SideDataBase. |
| 61 | SkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#SkipSamples. int `json:"skip_samples"` |
| 62 | DiscardPaddingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#DiscardPadding. int `json:"discard_padding"` |
| 63 | SkipReasonscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#SkipReason. int `json:"skip_reason"` |
| 64 | DiscardReasonscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#DiscardReason. int `json:"discard_reason"` |
| 65 | } |
| 66 | |
| 67 | // SideDataMasteringDisplayMetadata represents the mastering display metadata side data. |
| 68 | type SideDataMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata# struct { |
| 69 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#SideDataBase. |
| 70 | RedXscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#RedX. int `json:"red_x,omitempty"` |
| 71 | RedYscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#RedY. int `json:"red_y,omitempty"` |
| 72 | GreenXscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#GreenX. int `json:"green_x,omitempty"` |
| 73 | GreenYscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#GreenY. int `json:"green_y,omitempty"` |
| 74 | BlueXscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#BlueX. int `json:"blue_x,omitempty"` |
| 75 | BlueYscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#BlueY. int `json:"blue_y,omitempty"` |
| 76 | WhitePointXscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#WhitePointX. int `json:"white_point_x,omitempty"` |
| 77 | WhitePointYscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#WhitePointY. int `json:"white_point_y,omitempty"` |
| 78 | MinLuminancescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#MinLuminance. int `json:"min_luminance,omitempty"` |
| 79 | MaxLuminancescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#MaxLuminance. int `json:"max_luminance,omitempty"` |
| 80 | } |
| 81 | |
| 82 | // SideDataContentLightLevel represents the content light level side data. |
| 83 | type SideDataContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel# struct { |
| 84 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#SideDataBase. |
| 85 | MaxContentscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#MaxContent. int `json:"max_content,omitempty"` |
| 86 | MaxAveragescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#MaxAverage. int `json:"max_average,omitempty"` |
| 87 | } |
| 88 | |
| 89 | // SideDataUnknown represents an unknown side data. |
| 90 | type SideDataUnknownscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataUnknown# Tagsscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/Tags# |
| 91 | |
| 92 | // SideData represents a side data packet. |
| 93 | type SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData# struct { |
| 94 | SideDataBasescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#SideDataBase. |
| 95 | Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. interface{} `json:"-"` |
| 96 | } |
| 97 | |
| 98 | func (sd *SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#) UnmarshalJSONscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#UnmarshalJSON().(b []byte) error { |
| 99 | type Alias SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData# |
| 100 | aux := &struct { |
| 101 | *Alias |
| 102 | }{ |
| 103 | Alias: (*Alias)(sd), |
| 104 | } |
| 105 | |
| 106 | if err := jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/Unmarshal().(b, aux); err != nil { |
| 107 | return err |
| 108 | } |
| 109 | |
| 110 | switch sd.Typescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataBase#Type. { |
| 111 | case SideDataTypeDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeDisplayMatrix.: |
| 112 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = &SideDataDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#{} |
| 113 | case SideDataTypeStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeStereo3D.: |
| 114 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#) |
| 115 | case SideDataTypeSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSphericalMapping.: |
| 116 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#) |
| 117 | case SideDataTypeSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSkipSamples.: |
| 118 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#) |
| 119 | case SideDataTypeMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeMasteringDisplayMetadata.: |
| 120 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#) |
| 121 | case SideDataTypeContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeContentLightLevel.: |
| 122 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#) |
| 123 | default: |
| 124 | sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data. = new(SideDataUnknownscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataUnknown#) |
| 125 | } |
| 126 | |
| 127 | return jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/Unmarshal().(b, sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data.) |
| 128 | } |
| 129 | |
| 130 | func (sd *SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#) MarshalJSONscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#MarshalJSON().() ([]byte, error) { |
| 131 | return jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/Marshal().(sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data.) |
| 132 | } |
| 133 | |
| 134 | // SideDataList represents a list of side data packets. |
| 135 | type SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList# []SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData# |
| 136 | |
| 137 | // UnmarshalJSON for SideDataList |
| 138 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) UnmarshalJSONscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#UnmarshalJSON().(b []byte) error { |
| 139 | var raw []jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.RawMessagescip-go gomod github.com/golang/go/src go1.13 `encoding/json`/RawMessage# |
| 140 | if err := jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/Unmarshal().(b, &raw); err != nil { |
| 141 | return err |
| 142 | } |
| 143 | |
| 144 | for _, r := range raw { |
| 145 | var sd SideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData# |
| 146 | if err := jsonscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.13 `encoding/json`/Unmarshal().(r, &sd); err != nil { |
| 147 | return err |
| 148 | } |
| 149 | *s = append(*s, sd) |
| 150 | } |
| 151 | |
| 152 | return nil |
| 153 | } |
| 154 | |
| 155 | // FindUnknownSideData searches for SideData of type SideDataUnknown in the SideDataList. |
| 156 | // If such SideData is found, it is returned, otherwise, an error is returned |
| 157 | // indicating that the SideData of type SideDataUnknown was not found or the found |
| 158 | // SideData was of an unexpected type. |
| 159 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) FindUnknownSideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#FindUnknownSideData().(sideDataType string) (*SideDataUnknownscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataUnknown#, error) { |
| 160 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(sideDataType) |
| 161 | if !found { |
| 162 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 163 | } |
| 164 | |
| 165 | unknownSideData, ok := data.(*SideDataUnknownscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataUnknown#) |
| 166 | if !ok { |
| 167 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 168 | } |
| 169 | |
| 170 | return unknownSideData, nil |
| 171 | } |
| 172 | |
| 173 | // FindSideData searches for SideData by its type in the SideDataList. |
| 174 | // If SideData of the specified type is found, it is returned, otherwise, |
| 175 | // an error is returned indicating that the SideData of the specified type was not found. |
| 176 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) FindSideDatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#FindSideData().(sideDataType string) (interface{}, error) { |
| 177 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(sideDataType) |
| 178 | if !found { |
| 179 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 180 | } |
| 181 | |
| 182 | return data, nil |
| 183 | } |
| 184 | |
| 185 | // GetDisplayMatrix retrieves the DisplayMatrix from the SideData. If the DisplayMatrix is not found or |
| 186 | // the SideData is of the wrong type, an error is returned. |
| 187 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetDisplayMatrix().() (*SideDataDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#, error) { |
| 188 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeDisplayMatrix.) |
| 189 | if !found { |
| 190 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 191 | } |
| 192 | displayMatrix, ok := data.(*SideDataDisplayMatrixscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataDisplayMatrix#) |
| 193 | if !ok { |
| 194 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 195 | } |
| 196 | return displayMatrix, nil |
| 197 | } |
| 198 | |
| 199 | // GetStereo3D retrieves the Stereo3D data from the SideData. If the Stereo3D data is not found or |
| 200 | // the SideData is of the wrong type, an error is returned. |
| 201 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetStereo3D().() (*SideDataStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#, error) { |
| 202 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeStereo3D.) |
| 203 | if !found { |
| 204 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 205 | } |
| 206 | stereo3D, ok := data.(*SideDataStereo3Dscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataStereo3D#) |
| 207 | if !ok { |
| 208 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 209 | } |
| 210 | return stereo3D, nil |
| 211 | } |
| 212 | |
| 213 | // GetSphericalMapping retrieves the SphericalMapping data from the SideData. If the SphericalMapping data is not found or |
| 214 | // the SideData is of the wrong type, an error is returned. |
| 215 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetSphericalMapping().() (*SideDataSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#, error) { |
| 216 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSphericalMapping.) |
| 217 | if !found { |
| 218 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 219 | } |
| 220 | sphericalMapping, ok := data.(*SideDataSphericalMappingscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSphericalMapping#) |
| 221 | if !ok { |
| 222 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 223 | } |
| 224 | return sphericalMapping, nil |
| 225 | } |
| 226 | |
| 227 | // GetSkipSamples retrieves the SkipSamples data from the SideData. If the SkipSamples data is not found or |
| 228 | // the SideData is of the wrong type, an error is returned. |
| 229 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetSkipSamples().() (*SideDataSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#, error) { |
| 230 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeSkipSamples.) |
| 231 | if !found { |
| 232 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 233 | } |
| 234 | skipSamples, ok := data.(*SideDataSkipSamplesscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataSkipSamples#) |
| 235 | if !ok { |
| 236 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 237 | } |
| 238 | return skipSamples, nil |
| 239 | } |
| 240 | |
| 241 | // GetMasteringDisplayMetadata retrieves the MasteringDisplayMetadata from the SideData. If the MasteringDisplayMetadata is not found or |
| 242 | // the SideData is of the wrong type, an error is returned. |
| 243 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetMasteringDisplayMetadata().() (*SideDataMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#, error) { |
| 244 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeMasteringDisplayMetadata.) |
| 245 | if !found { |
| 246 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 247 | } |
| 248 | masteringDisplayMetadata, ok := data.(*SideDataMasteringDisplayMetadatascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataMasteringDisplayMetadata#) |
| 249 | if !ok { |
| 250 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 251 | } |
| 252 | return masteringDisplayMetadata, nil |
| 253 | } |
| 254 | |
| 255 | // GetContentLightLevel retrieves the ContentLightLevel from the SideData. If the ContentLightLevel is not found or |
| 256 | // the SideData is of the wrong type, an error is returned. |
| 257 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) GetContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#GetContentLightLevel().() (*SideDataContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#, error) { |
| 258 | data, found := s.findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(SideDataTypeContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataTypeContentLightLevel.) |
| 259 | if !found { |
| 260 | return nil, ErrSideDataNotFoundscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataNotFound. |
| 261 | } |
| 262 | contentLightLevel, ok := data.(*SideDataContentLightLevelscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataContentLightLevel#) |
| 263 | if !ok { |
| 264 | return nil, ErrSideDataUnexpectedTypescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/ErrSideDataUnexpectedType. |
| 265 | } |
| 266 | return contentLightLevel, nil |
| 267 | } |
| 268 | |
| 269 | func (s *SideDataListscip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#) findSideDataByNamescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataList#findSideDataByName().(sideDataType string) (interface{}, bool) { |
| 270 | for _, sd := range *s { |
| 271 | if sd.Typescip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideDataBase#Type. == sideDataType { |
| 272 | return sd.Datascip-go gomod gopkg.in/vansante/go-ffprobe.v2 . `gopkg.in/vansante/go-ffprobe.v2`/SideData#Data., true |
| 273 | } |
| 274 | } |
| 275 | return nil, false |
| 276 | } |