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); }
bool CSGravity::initialize(ID3D11Device* device, Particle* particles, int maxParticles){ ID3DBlob* csBuffer; if(!D3D11Init::CompileD3DShader(_csFilePath, "CS_Main", "cs_5_0", &csBuffer)){ MessageBox(NULL, "Could not compile compute shader!", "Error", 0); if(csBuffer){ csBuffer->Release(); } return false; } HRESULT result = device->CreateComputeShader(csBuffer->GetBufferPointer(), csBuffer->GetBufferSize(), 0, &_computeShader); if(FAILED(result)){ MessageBox(NULL, "Could not create compute shader!", "Error", 0); return false; } calculateThreadGroups(maxParticles); return createInputBuffer(device, particles, maxParticles) && createConstantBuffers(device, maxParticles); }