Lines Matching defs:env

24 napi_value VideoNapi::Constructor(napi_env env)
38 return NapiDataUtils::DefineClass(env, "Video", properties, count, VideoNapi::New);
41 napi_value VideoNapi::New(napi_env env, napi_callback_info info)
45 ctxt->GetCbInfoSync(env, info);
46 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
49 ASSERT_ERR(ctxt->env, video != nullptr, Status::E_ERROR, "no memory for video!");
51 ASSERT_CALL(env, napi_wrap(env, ctxt->self, video, Destructor, nullptr, nullptr), video);
55 void VideoNapi::NewInstance(napi_env env, std::shared_ptr<UnifiedRecord> in, napi_value &out)
58 ASSERT_CALL_VOID(env, napi_new_instance(env, Constructor(env), 0, nullptr, &out));
60 ASSERT_ERR_VOID(env, video != nullptr, Status::E_ERROR, "no memory for video!");
62 ASSERT_CALL_DELETE(env, napi_wrap(env, out, video, Destructor, nullptr, nullptr), video);
65 void VideoNapi::Destructor(napi_env env, void *data, void *hint)
73 VideoNapi *VideoNapi::GetVideo(napi_env env, napi_callback_info info, std::shared_ptr<ContextBase> ctxt)
76 ctxt->GetCbInfoSync(env, info);
77 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
81 napi_value VideoNapi::GetVideoUri(napi_env env, napi_callback_info info)
85 auto video = GetVideo(env, info, ctxt);
87 ctxt->env, (video != nullptr && video->value_ != nullptr), Status::E_ERROR, "invalid object!");
88 ctxt->status = NapiDataUtils::SetValue(env, video->value_->GetUri(), ctxt->output);
89 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, "set video uri failed!");
93 napi_value VideoNapi::SetVideoUri(napi_env env, napi_callback_info info)
98 auto input = [env, ctxt, &uri](size_t argc, napi_value *argv) {
101 ctxt->status = NapiDataUtils::GetValue(env, argv[0], uri);
105 ctxt->GetCbInfoSync(env, info, input);
106 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
109 ctxt->env, (video != nullptr && video->value_ != nullptr), Status::E_ERROR, "invalid object!");