@@ -41,37 +41,119 @@ import { DEFAULT_MINIMUM_TAKE_SPAN } from '@sofie-automation/shared-lib/dist/cor
4141const mockMediaObjectsCollection = MongoMock . getInnerMockCollection < MediaObject > ( MediaObjects )
4242
4343describe ( 'lib/mediaObjects' , ( ) => {
44- test ( 'buildFormatString' , ( ) => {
45- const format1 = buildFormatString (
46- PackageInfo . FieldOrder . TFF ,
47- literal < PieceContentStreamInfo > ( {
48- width : 1920 ,
49- height : 1080 ,
50- codec_time_base : '1/25' ,
51- } )
52- )
53- expect ( format1 ) . toEqual ( '1920x1080i2500tff' )
44+ describe ( 'buildFormatString' , ( ) => {
45+ it ( 'deepscan tff, stream unknown' , ( ) => {
46+ const format1 = buildFormatString (
47+ PackageInfo . FieldOrder . TFF ,
48+ literal < PieceContentStreamInfo > ( {
49+ width : 1920 ,
50+ height : 1080 ,
51+ codec_time_base : '1/25' ,
52+ } )
53+ )
54+ expect ( format1 ) . toEqual ( '1920x1080i2500tff' )
55+ } )
5456
55- const format2 = buildFormatString (
56- PackageInfo . FieldOrder . Progressive ,
57+ it ( 'deepscan progressive, stream unknown' , ( ) => {
58+ const format2 = buildFormatString (
59+ PackageInfo . FieldOrder . Progressive ,
60+ literal < PieceContentStreamInfo > ( {
61+ width : 1280 ,
62+ height : 720 ,
63+ codec_time_base : '1001/60000' ,
64+ } )
65+ )
66+ expect ( format2 ) . toEqual ( '1280x720p5994' )
67+ } )
5768
58- literal < PieceContentStreamInfo > ( {
59- width : 1280 ,
60- height : 720 ,
61- codec_time_base : '1001/60000' ,
62- } )
63- )
64- expect ( format2 ) . toEqual ( '1280x720p5994' )
69+ it ( 'deepscan bff, stream unknown' , ( ) => {
70+ const format3 = buildFormatString (
71+ PackageInfo . FieldOrder . BFF ,
72+ literal < PieceContentStreamInfo > ( {
73+ width : 720 ,
74+ height : 576 ,
75+ codec_time_base : '1/25' ,
76+ } )
77+ )
78+ expect ( format3 ) . toEqual ( '720x576i2500bff' )
79+ } )
6580
66- const format3 = buildFormatString (
67- PackageInfo . FieldOrder . BFF ,
68- literal < PieceContentStreamInfo > ( {
69- width : 720 ,
70- height : 576 ,
71- codec_time_base : '1/25' ,
72- } )
73- )
74- expect ( format3 ) . toEqual ( '720x576i2500bff' )
81+ it ( 'deepscan tff, stream bff' , ( ) => {
82+ const format3 = buildFormatString (
83+ PackageInfo . FieldOrder . TFF ,
84+ literal < PieceContentStreamInfo > ( {
85+ width : 720 ,
86+ height : 576 ,
87+ codec_time_base : '1/25' ,
88+ field_order : PackageInfo . FieldOrder . BFF ,
89+ } )
90+ )
91+ expect ( format3 ) . toEqual ( '720x576i2500bff' )
92+ } )
93+
94+ it ( 'deepscan bff, stream tff' , ( ) => {
95+ const format3 = buildFormatString (
96+ PackageInfo . FieldOrder . BFF ,
97+ literal < PieceContentStreamInfo > ( {
98+ width : 720 ,
99+ height : 576 ,
100+ codec_time_base : '1/25' ,
101+ field_order : PackageInfo . FieldOrder . TFF ,
102+ } )
103+ )
104+ expect ( format3 ) . toEqual ( '720x576i2500tff' )
105+ } )
106+
107+ it ( 'deepscan progressive, stream tff' , ( ) => {
108+ const format3 = buildFormatString (
109+ PackageInfo . FieldOrder . Progressive ,
110+ literal < PieceContentStreamInfo > ( {
111+ width : 720 ,
112+ height : 576 ,
113+ codec_time_base : '1/25' ,
114+ field_order : PackageInfo . FieldOrder . TFF ,
115+ } )
116+ )
117+ expect ( format3 ) . toEqual ( '720x576i2500tff' )
118+ } )
119+
120+ it ( 'deepscan bff, stream progressive' , ( ) => {
121+ const format3 = buildFormatString (
122+ PackageInfo . FieldOrder . BFF ,
123+ literal < PieceContentStreamInfo > ( {
124+ width : 720 ,
125+ height : 576 ,
126+ codec_time_base : '1/25' ,
127+ field_order : PackageInfo . FieldOrder . Progressive ,
128+ } )
129+ )
130+ expect ( format3 ) . toEqual ( '720x576i2500bff' )
131+ } )
132+
133+ it ( 'deepscan unknown, stream progressive' , ( ) => {
134+ const format3 = buildFormatString (
135+ undefined ,
136+ literal < PieceContentStreamInfo > ( {
137+ width : 720 ,
138+ height : 576 ,
139+ codec_time_base : '1/25' ,
140+ field_order : PackageInfo . FieldOrder . Progressive ,
141+ } )
142+ )
143+ expect ( format3 ) . toEqual ( '720x576p2500' )
144+ } )
145+
146+ it ( 'r_frame_rate' , ( ) => {
147+ const format3 = buildFormatString (
148+ PackageInfo . FieldOrder . Progressive ,
149+ literal < PieceContentStreamInfo > ( {
150+ width : 720 ,
151+ height : 576 ,
152+ r_frame_rate : '25/1' ,
153+ } )
154+ )
155+ expect ( format3 ) . toEqual ( '720x576p2500' )
156+ } )
75157 } )
76158
77159 test ( 'acceptFormat' , ( ) => {
0 commit comments