namespace AVC {
namespace Decode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
+VAStatus EntrypointNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+}
+
+// H264*NotSupported functions report properly if profile is not supported or
+// only entrypoint is not supported
+VAStatus H264NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_ENCODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264MVCNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_MVC_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
VAStatus HasDecodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_DECODING(i965) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if (HAS_H264_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264NotSupported();
}
-VAStatus HasMVCDecodeSupport(const VAProfile& profile)
+VAStatus HasMVCDecodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
EXPECT_PTR(env);
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_MVC_DECODING_PROFILE(i965, profile) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if (HAS_H264_MVC_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264MVCNotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
- {VAProfileH264Baseline, VAEntrypointVLD,
- []{return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;}},
+ { VAProfileH264Baseline, VAEntrypointVLD, &ProfileNotSupported },
- {VAProfileH264ConstrainedBaseline, VAEntrypointVLD, &HasDecodeSupport},
- {VAProfileH264Main, VAEntrypointVLD, &HasDecodeSupport},
- {VAProfileH264High, VAEntrypointVLD, &HasDecodeSupport},
+ { VAProfileH264ConstrainedBaseline, VAEntrypointVLD, &HasDecodeSupport },
+ { VAProfileH264Main, VAEntrypointVLD, &HasDecodeSupport },
+ { VAProfileH264High, VAEntrypointVLD, &HasDecodeSupport },
- {VAProfileH264MultiviewHigh, VAEntrypointVLD,
- std::bind(&HasMVCDecodeSupport, VAProfileH264MultiviewHigh)},
- {VAProfileH264StereoHigh, VAEntrypointVLD,
- std::bind(&HasMVCDecodeSupport, VAProfileH264StereoHigh)},
+ { VAProfileH264MultiviewHigh, VAEntrypointVLD,
+ &HasMVCDecodeSupport },
+ { VAProfileH264StereoHigh, VAEntrypointVLD,
+ &HasMVCDecodeSupport },
};
INSTANTIATE_TEST_CASE_P(
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
+//H264*NotSupported functions report properly if profile is not supported or
+//only entrypoint is not supported
+VAStatus H264NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_DECODING(i965)
+ && !HAS_LP_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264LPNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_DECODING(i965)
+ && !HAS_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
+VAStatus H264MVCNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_MVC_DECODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_H264_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264NotSupported();
}
VAStatus HasLPEncodeSupport()
if (IS_SKL(i965->intel.device_info))
return VA_STATUS_SUCCESS;
- return HAS_LP_H264_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_LP_H264_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264LPNotSupported();
}
VAStatus HasMVCEncodeSupport()
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_H264_MVC_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_H264_MVC_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264MVCNotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
{VAProfileH264ConstrainedBaseline, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264ConstrainedBaseline, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264Main, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264Main, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264Main, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264Main, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264High, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264High, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
- {VAProfileH264High, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264High, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264MultiviewHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
- {VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &EntrypointNotSupported},
- {VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
+ {VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
{VAProfileH264StereoHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
- {VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &EntrypointNotSupported},
- {VAProfileH264StereoHigh, VAEntrypointEncPicture, &EntrypointNotSupported},
+ {VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
+ {VAProfileH264StereoHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
};
INSTANTIATE_TEST_CASE_P(
namespace JPEG {
namespace Decode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
+VAStatus EntrypointNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+}
+
+VAStatus NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_JPEG_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
VAStatus HasDecodeSupport()
{
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_JPEG_DECODING(i965) ? VA_STATUS_SUCCESS :
- VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+ if(HAS_JPEG_DECODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return NotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
namespace JPEG {
namespace Encode {
+VAStatus ProfileNotSupported()
+{
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+}
+
VAStatus EntrypointNotSupported()
{
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
}
+VAStatus NotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_JPEG_DECODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
VAStatus HasEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
struct i965_driver_data *i965(*env);
EXPECT_PTR(i965);
- return HAS_JPEG_ENCODING(i965) ? VA_STATUS_SUCCESS :
- EntrypointNotSupported();
+ if (HAS_JPEG_ENCODING(i965))
+ return VA_STATUS_SUCCESS;
+
+ return NotSupported();
}
static const std::vector<ConfigTestInput> inputs = {
{VAProfileJPEGBaseline, VAEntrypointEncPicture, &HasEncodeSupport},
- {VAProfileJPEGBaseline, VAEntrypointEncSlice, &EntrypointNotSupported},
- {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &EntrypointNotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSlice, &NotSupported},
+ {VAProfileJPEGBaseline, VAEntrypointEncSliceLP, &NotSupported},
};
INSTANTIATE_TEST_CASE_P(