summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-20 21:12:37 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-20 21:12:37 +0000
commit0cdcee1926293663877a31fdb9654986ac8f1120 (patch)
tree917fe0b0a69f2ffd38436f3006955acbcc88fa47 /loader
parent92c8f49ad10fc6a964d01e74c0386e99c47a9086 (diff)
downloadmpv-0cdcee1926293663877a31fdb9654986ac8f1120.tar.bz2
mpv-0cdcee1926293663877a31fdb9654986ac8f1120.tar.xz
fixed DivX Quality setting (using registry)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@174 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/dshow/DS_VideoDec.c74
-rw-r--r--loader/dshow/DS_VideoDec.h1
2 files changed, 67 insertions, 8 deletions
diff --git a/loader/dshow/DS_VideoDec.c b/loader/dshow/DS_VideoDec.c
index 299f7ceae4..5831eef029 100644
--- a/loader/dshow/DS_VideoDec.c
+++ b/loader/dshow/DS_VideoDec.c
@@ -28,6 +28,9 @@
#include <sys/types.h>
#include <sys/mman.h>
+#include <registry.h>
+#include <wine/winreg.h>
+
#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 @@ extern "C" int DS_VideoDecoder_DecodeFrame(char* src, int size, int is_keyframe,
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"<<endl;
return -1;
}
char* ptr;
- printf("GetPtr...");fflush(stdout);
+ //printf("GetPtr...");fflush(stdout);
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 @@ extern "C" int DS_SetValue_DivX(char* name, int value){
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 --git a/loader/dshow/DS_VideoDec.h b/loader/dshow/DS_VideoDec.h
index c46d34155a..d3c9415c54 100644
--- a/loader/dshow/DS_VideoDec.h
+++ b/loader/dshow/DS_VideoDec.h
@@ -25,6 +25,7 @@ int DS_VideoDecoder_DecodeFrame(char* src, int size, int is_keyframe, int render
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" */