Value x264Encode_AST(argList *a) { struct x264EncodeParams *params = malloc(sizeof(struct x264EncodeParams)); checkArgs(a, 2, typeClip, typeStr); MkvsynthOutput *output = MANDCLIP(0); params->filename = strdup(MANDSTR(1)); params->x264params = strdup(OPTSTR("params", "")); params->input = createInputBuffer(output); if(isMetaDataValid(params->input->metaData) != 1) MkvsynthError("invalid colorspace!"); mkvsynthQueue((void *)params, x264Encode); RETURNNULL(); }
Value writeRawFile_AST(argList *a) { struct writeRawFileParams *params = malloc(sizeof(struct writeRawFileParams)); checkArgs(a, 2, typeClip, typeStr); MkvsynthOutput *output = MANDCLIP(0); char *filename = MANDSTR(1); //////////////////// // Error Checking // //////////////////// params->file = fopen(filename, "w"); if(params->file == NULL) MkvsynthError("Could not open the output file!"); params->input = createInputBuffer(output); mkvsynthQueue((void *)params, writeRawFile); RETURNNULL(); }
void writeRawFile_AST(ASTnode *p, ASTnode *args) { struct writeRawFileParams *params = malloc(sizeof(struct writeRawFileParams)); checkArgs("writeRawFile", args, 2, typeClip, typeStr); MkvsynthOutput *output = MANDCLIP(); char *filename = MANDSTR(); //////////////////// // Error Checking // //////////////////// params->file = fopen(filename, "w"); if(params->file == NULL) { printf("Could not open the output file!\n"); exit(0); } params->input = createInputBuffer(output); mkvsynthQueue((void *)params, writeRawFile); }