+static bool IsFmtSimilar( const video_format_t *p_fmt1, const video_format_t *p_fmt2 )
+{
+ return p_fmt1->i_width == p_fmt2->i_width &&
+ p_fmt1->i_height == p_fmt2->i_height;
+}
+
+static int GetParameters( int *pi_fmti, int *pi_fmto,
+ const video_format_t *p_fmti,
+ const video_format_t *p_fmto )
+{
+ /* Supported Input formats: YV12, I420/IYUV, YUY2, UYVY, BGR32, BGR24,
+ * BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09 */
+ const int i_fmti = GetFfmpegChroma( p_fmti->i_chroma );
+
+ /* Supported output formats: YV12, I420/IYUV, YUY2, UYVY,
+ * {BGR,RGB}{1,4,8,15,16,24,32}, Y8/Y800, YVU9/IF09 */
+ const int i_fmto = GetFfmpegChroma( p_fmto->i_chroma );
+
+ if( pi_fmti )
+ *pi_fmti = i_fmti;
+ if( pi_fmto )
+ *pi_fmto = i_fmto;
+
+ if( i_fmti < 0 || i_fmto < 0 )
+ return VLC_EGENERIC;
+
+ return VLC_SUCCESS;
+}
+