# HG changeset patch # User arpi_esp # Date 985122757 0 # Node ID fb67a2aa61fe738cb4d3df79a0ac8378b32666ef # Parent 82a9977f7e04a39d25ca4822e0f8dda5672ae66b fixed DivX Quality setting (using registry) diff -r 82a9977f7e04 -r fb67a2aa61fe loader/dshow/DS_VideoDec.c --- a/loader/dshow/DS_VideoDec.c Tue Mar 20 21:11:45 2001 +0000 +++ b/loader/dshow/DS_VideoDec.c Tue Mar 20 21:12:37 2001 +0000 @@ -28,6 +28,9 @@ #include #include +#include +#include + #include "guids.h" #include "interfaces.h" #include "DS_Filter.h" @@ -39,6 +42,7 @@ #include "DS_VideoDec.h" + using namespace std; extern "C" char* def_path; @@ -213,29 +217,29 @@ m_bh.biSizeImage=size; IMediaSample* sample=0; - printf("GetBuffer... (m_pAll=%X) ",dsf->m_pAll);fflush(stdout); + //printf("GetBuffer... (m_pAll=%X) ",dsf->m_pAll);fflush(stdout); dsf->m_pAll->vt->GetBuffer(dsf->m_pAll, &sample, 0, 0, 0); - printf("OK!\n"); + //printf("OK!\n"); if(!sample) { Debug cerr<<"ERROR: null sample"<vt->GetPointer(sample, (BYTE **)&ptr); - printf("OK!\n"); + //printf("OK!\n"); memcpy(ptr, src, size); - printf("memcpy OK!\n"); + //printf("memcpy OK!\n"); sample->vt->SetActualDataLength(sample, size); - printf("SetActualDataLength OK!\n"); + //printf("SetActualDataLength OK!\n"); sample->vt->SetSyncPoint(sample, is_keyframe); - printf("SetSyncPoint OK!\n"); + //printf("SetSyncPoint OK!\n"); sample->vt->SetPreroll(sample, !render); // sample->vt->SetMediaType(sample, &m_sOurType); int result=dsf->m_pImp->vt->Receive(dsf->m_pImp, sample); if(result) - Debug printf("Error putting data into input pin %x\n", result); + printf("Error putting data into input pin %x\n", result); sample->vt->Release((IUnknown*)sample); @@ -382,4 +386,58 @@ return -200; } +extern "C" int DS_SetAttr_DivX(char* attribute, int value){ + int result, status, newkey, count; + if(strcmp(attribute, "Quality")==0){ + char* keyname="SOFTWARE\\Microsoft\\Scrunch"; + result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); + if(result!=0) + { + printf("VideoDecoder::SetExtAttr: registry failure\n"); + return -1; + } + result=RegSetValueExA(newkey, "Current Post Process Mode", 0, REG_DWORD, &value, 4); + if(result!=0) + { + printf("VideoDecoder::SetExtAttr: error writing value\n"); + return -1; + } + value=-1; + result=RegSetValueExA(newkey, "Force Post Process Mode", 0, REG_DWORD, &value, 4); + if(result!=0) + { + printf("VideoDecoder::SetExtAttr: error writing value\n"); + return -1; + } + RegCloseKey(newkey); + return 0; + } + if( + (strcmp(attribute, "Saturation")==0) || + (strcmp(attribute, "Hue")==0) || + (strcmp(attribute, "Contrast")==0) || + (strcmp(attribute, "Brightness")==0) + ) + { + char* keyname="SOFTWARE\\Microsoft\\Scrunch\\Video"; + result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); + if(result!=0) + { + printf("VideoDecoder::SetExtAttr: registry failure\n"); + return -1; + } + result=RegSetValueExA(newkey, attribute, 0, REG_DWORD, &value, 4); + if(result!=0) + { + printf("VideoDecoder::SetExtAttr: error writing value\n"); + return -1; + } + RegCloseKey(newkey); + return 0; + } + + printf("Unknown attribute!\n"); + return -200; +} + diff -r 82a9977f7e04 -r fb67a2aa61fe loader/dshow/DS_VideoDec.h --- a/loader/dshow/DS_VideoDec.h Tue Mar 20 21:11:45 2001 +0000 +++ b/loader/dshow/DS_VideoDec.h Tue Mar 20 21:12:37 2001 +0000 @@ -25,6 +25,7 @@ int DS_VideoDecoder_SetDestFmt(int bits, int csp); int DS_SetValue_DivX(char* name, int value); +int DS_SetAttr_DivX(char* attribute, int value); #ifdef __cplusplus } /* extern "C" */