Commit 095f896e authored by Linshizhi's avatar Linshizhi

Use MediaCodex object instead of ENCODER.

parent aa624df5
......@@ -2786,17 +2786,22 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
InstallToStringTag(isolate_, json_object, "JSON");
}
{ // -- E N C O D E R
Handle<JSObject> encoder =
{ // -- M E D I A C O D E X
Handle<JSObject> media_codex =
factory->NewJSObject(isolate_->object_function(), AllocationType::kOld);
JSObject::AddProperty(isolate_, global, "ENCODER", encoder, DONT_ENUM);
SimpleInstallFunction(isolate_, encoder, "init",
JSObject::AddProperty(isolate_, global, "MediaCodex", media_codex, DONT_ENUM);
Handle<JSObject> mp4 =
factory->NewJSObject(isolate_->object_function(), AllocationType::kOld);
JSObject::AddProperty(isolate_, media_codex, "Mp4", mp4, DONT_ENUM);
SimpleInstallFunction(isolate_, mp4, "init",
Builtin::kInitEncodeContext, 6, true);
SimpleInstallFunction(isolate_, encoder, "encode",
SimpleInstallFunction(isolate_, mp4, "encode",
Builtin::kEncode, 1, true);
SimpleInstallFunction(isolate_, encoder, "close",
SimpleInstallFunction(isolate_, mp4, "close",
Builtin::kClose, 0, true);
InstallToStringTag(isolate_, encoder, "ENCODER");
InstallToStringTag(isolate_, media_codex, "MediaCodex");
}
{ // -- M a t h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment