MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / rotate_init

Function rotate_init

libhb/rotate.c:145–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143#endif
144
145static int rotate_init(hb_filter_object_t * filter, hb_filter_init_t * init)
146{
147 hb_filter_private_t * pv = NULL;
148
149 pv = calloc(1, sizeof(struct hb_filter_private_s));
150 filter->private_data = pv;
151 if (pv == NULL)
152 {
153 return 1;
154 }
155 pv->input = *init;
156
157 hb_dict_t * settings = filter->settings;
158
159 hb_rational_t par = init->geometry.par;
160 int width = init->geometry.width;
161 int height = init->geometry.height;
162 const char * trans = NULL;
163 int angle = 0, flip = 0, hflip = 0, vflip = 0;
164
165 hb_dict_extract_int(&angle, settings, "angle");
166 hb_dict_extract_bool(&flip, settings, "hflip");
167
168 const char * clock;
169 const char * cclock;
170 if (flip)
171 {
172 clock = "clock_flip";
173 cclock = "cclock_flip";
174 }
175 else
176 {
177 clock = "clock";
178 cclock = "cclock";
179 }
180
181#if HB_PROJECT_FEATURE_QSV && (defined( _WIN32 ) || defined( __MINGW32__ ))
182 if (init->hw_pix_fmt == AV_PIX_FMT_QSV)
183 {
184 qsv_rotate_init(pv, init, angle, flip);
185 return 0;
186 }
187#endif
188
189 switch (angle)
190 {
191 case 0:
192 hflip = flip;
193 break;
194 case 90:
195 trans = clock;
196 width = init->geometry.height;
197 height = init->geometry.width;
198 par.num = init->geometry.par.den;
199 par.den = init->geometry.par.num;
200 break;
201 case 180:
202 vflip = 1;

Callers

nothing calls this directly

Calls 9

hb_dict_extract_intFunction · 0.85
hb_dict_extract_boolFunction · 0.85
qsv_rotate_initFunction · 0.85
hb_value_array_initFunction · 0.85
hb_dict_initFunction · 0.85
hb_dict_setFunction · 0.85
hb_value_stringFunction · 0.85
hb_value_array_appendFunction · 0.85
hb_value_nullFunction · 0.85

Tested by

no test coverage detected