Lines Matching refs:res

115     AMF_RESULT         res;
140 res = version_fun(&ctx->version);
141 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "%s failed with error %d\n", AMF_QUERY_VERSION_FUNCTION_NAME, res);
142 res = init_fun(AMF_FULL_VERSION, &ctx->factory);
143 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "%s failed with error %d\n", AMF_INIT_FUNCTION_NAME, res);
144 res = ctx->factory->pVtbl->GetTrace(ctx->factory, &ctx->trace);
145 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "GetTrace() failed with error %d\n", res);
146 res = ctx->factory->pVtbl->GetDebug(ctx->factory, &ctx->debug);
147 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "GetDebug() failed with error %d\n", res);
155 AMF_RESULT res;
157 res = ctx->context->pVtbl->InitDX11(ctx->context, hwctx->device, AMF_DX11_1);
158 if (res != AMF_OK) {
159 if (res == AMF_NOT_SUPPORTED)
162 av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise on the given D3D11 device: %d.\n", res);
177 AMF_RESULT res;
200 res = ctx->context->pVtbl->InitDX9(ctx->context, device);
204 if (res != AMF_OK) {
205 if (res == AMF_NOT_SUPPORTED)
208 av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise on given D3D9 device: %d.\n", res);
220 AMF_RESULT res;
240 res = ctx->factory->pVtbl->CreateContext(ctx->factory, &ctx->context);
241 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext() failed with error %d\n", res);
310 res = ctx->context->pVtbl->InitDX11(ctx->context, NULL, AMF_DX11_1);
311 if (res == AMF_OK) {
314 res = ctx->context->pVtbl->InitDX9(ctx->context, NULL);
315 if (res == AMF_OK) {
319 res = ctx->context->pVtbl->QueryInterface(ctx->context, &guid, (void**)&context1);
320 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext1() failed with error %d\n", res);
322 res = context1->pVtbl->InitVulkan(context1, NULL);
324 if (res != AMF_OK) {
325 if (res == AMF_NOT_SUPPORTED)
328 av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise on the given Vulkan device: %d.\n", res);
342 AMF_RESULT res;
366 res = ctx->factory->pVtbl->CreateComponent(ctx->factory, ctx->context, codec_id, &ctx->encoder);
367 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_ENCODER_NOT_FOUND, "CreateComponent(%ls) failed with error %d\n", codec_id, res);
510 AMF_RESULT res;
512 res = AMFVariantInit(&var);
513 if (res == AMF_OK) {
516 res = val->pVtbl->QueryInterface(val, &guid_AMFInterface, (void**)&amf_interface);
518 if (res == AMF_OK) {
519 res = AMFVariantAssignInterface(&var, amf_interface);
522 if (res == AMF_OK) {
523 res = object->pVtbl->SetProperty(object, name, var);
527 return res;
532 AMF_RESULT res;
534 res = AMFVariantInit(&var);
535 if (res == AMF_OK) {
536 res = object->pVtbl->GetProperty(object, name, &var);
537 if (res == AMF_OK) {
541 res = amf_interface->pVtbl->QueryInterface(amf_interface, &guid_AMFBuffer, (void**)val);
543 res = AMF_INVALID_DATA_TYPE;
548 return res;
555 AMF_RESULT res;
557 res = context->pVtbl->AllocBuffer(context, AMF_MEMORY_HOST, sizeof(frame_ref), &frame_ref_storage_buffer);
558 if (res == AMF_OK) {
582 AMF_RESULT res;
603 res = ctx->encoder->pVtbl->Drain(ctx->encoder);
604 if (res == AMF_INPUT_FULL) {
607 if (res == AMF_OK) {
610 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "Drain() failed with error %d\n", res);
631 res = ctx->context->pVtbl->CreateSurfaceFromDX11Native(ctx->context, texture, &surface, NULL); // wrap to AMF surface
632 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR(ENOMEM), "CreateSurfaceFromDX11Native() failed with error %d\n", res);
643 res = ctx->context->pVtbl->CreateSurfaceFromDX9Native(ctx->context, texture, &surface, NULL); // wrap to AMF surface
644 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR(ENOMEM), "CreateSurfaceFromDX9Native() failed with error %d\n", res);
652 res = ctx->context->pVtbl->AllocSurface(ctx->context, AMF_MEMORY_HOST, ctx->format, avctx->width, avctx->height, &surface);
653 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR(ENOMEM), "AllocSurface() failed with error %d\n", res);
668 res = amf_set_property_buffer(surface, L"av_frame_ref", frame_ref_storage_buffer);
669 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "SetProperty failed for \"av_frame_ref\" with error %d\n", res);
675 AMF_ASSIGN_PROPERTY_INT64(res, surface, PTS_PROP, frame->pts);
679 AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_INSERT_AUD, !!ctx->aud);
682 AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_AUD, !!ctx->aud);
689 res = ctx->encoder->pVtbl->SubmitInput(ctx->encoder, (AMFData*)surface);
690 if (res == AMF_INPUT_FULL) { // handle full queue
696 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "SubmitInput() failed with error %d\n", res);
721 res = amf_get_property_buffer(data, L"av_frame_ref", &frame_ref_storage_buffer);
722 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "GetProperty failed for \"av_frame_ref\" with error %d\n", res);
732 res = ctx->encoder->pVtbl->SubmitInput(ctx->encoder, (AMFData*)ctx->delayed_surface);
733 if (res != AMF_INPUT_FULL) {
738 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "Repeated SubmitInput() failed with error %d\n", res);
747 res = ctx->encoder->pVtbl->Drain(ctx->encoder);
748 if (res != AMF_INPUT_FULL) {
751 AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "Repeated Drain() failed with error %d\n", res);