Commit 585fc8af authored by Linshizhi's avatar Linshizhi

Remove unused code.

parent f27efcaf
Subproject commit 62049927e36cde5854de90b3a4b98ada1be4be85
Subproject commit 4ab9abdc60117616ddabc0998df2a45d1e17d21d
#include <stdio.h>
#include <iostream>
......@@ -42,27 +40,21 @@ BUILTIN(InitEncodeContext) {
}
// Convert to C/C++ type
Handle<String> path_str;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, path_str,
Object::ToString(isolate, path));
std::string outpath { Object::ToString(isolate, path)->ToCString().get() };
uint32_t width_int, height_int, bitrate_int, framerate_int;
std::string outpath { path_str->ToCString().get() };
uint32_t width_int, height_int,
bitrate_int, framerate_int;
width->ToUint32(&width_int);
height->ToUint32(&height_int);
bitrate->ToUint32(&bitrate_int);
framerate->ToUint32(&framerate_int);
if (!path->IsString()) {
// Argument check
}
enc = new LAIPIC_ENCODER::Encoder {
"", outpath, width_int, width_int, bitrate_int,
};
"", outpath, width_int, width_int, bitrate_int };
if (!enc->isReady()) {
// Fail to initialize LAIPIC_ENCODER::Encoder.
// Probaly cause of invalid arguments.
THROW_NEW_ERROR_RETURN_FAILURE(isolate,
NewEvalError(MessageTemplate::kInvalidArgument));
}
......@@ -74,11 +66,10 @@ BUILTIN(InitEncodeContext) {
BUILTIN(Encode) {
HandleScope scope(isolate);
//Handle<Object> frame = args.atOrUndefined(isolate, 1);
if (!inited) return *isolate->factory()->ToBoolean(false);
Handle<JSTypedArray> array; // = Handle<JSTypedArray>::cast(frame);
Handle<JSTypedArray> array;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, array,
JSTypedArray::Validate(isolate, args.atOrUndefined(isolate, 1), "ENCODER.encode()"));
......
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