[Mplayer-cvslog] CVS: main/loader/DirectShow DS_VideoDec.cpp,1.1,1.2 DS_VideoDec.h,1.1,1.2
GEREOFFY
arpi_esp at users.sourceforge.net
Tue Mar 20 22:12:39 CET 2001
Update of /cvsroot/mplayer/main/loader/DirectShow
In directory usw-pr-cvs1:/tmp/cvs-serv5386
Modified Files:
DS_VideoDec.cpp DS_VideoDec.h
Log Message:
fixed DivX Quality setting (using registry)
Index: DS_VideoDec.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_VideoDec.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DS_VideoDec.cpp 2001/03/20 01:59:42 1.1
--- DS_VideoDec.cpp 2001/03/20 21:12:37 1.2
***************
*** 29,32 ****
--- 29,35 ----
#include <sys/mman.h>
+ #include <registry.h>
+ #include <wine/winreg.h>
+
#include "guids.h"
#include "interfaces.h"
***************
*** 40,43 ****
--- 43,47 ----
#include "DS_VideoDec.h"
+
using namespace std;
extern "C" char* def_path;
***************
*** 214,220 ****
IMediaSample* sample=0;
! 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");
if(!sample)
{
--- 218,224 ----
IMediaSample* sample=0;
! //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");
if(!sample)
{
***************
*** 223,240 ****
}
char* ptr;
! printf("GetPtr...");fflush(stdout);
sample->vt->GetPointer(sample, (BYTE **)&ptr);
! printf("OK!\n");
memcpy(ptr, src, size);
! printf("memcpy OK!\n");
sample->vt->SetActualDataLength(sample, size);
! printf("SetActualDataLength OK!\n");
sample->vt->SetSyncPoint(sample, is_keyframe);
! 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);
sample->vt->Release((IUnknown*)sample);
--- 227,244 ----
}
char* ptr;
! //printf("GetPtr...");fflush(stdout);
sample->vt->GetPointer(sample, (BYTE **)&ptr);
! //printf("OK!\n");
memcpy(ptr, src, size);
! //printf("memcpy OK!\n");
sample->vt->SetActualDataLength(sample, size);
! //printf("SetActualDataLength OK!\n");
sample->vt->SetSyncPoint(sample, is_keyframe);
! //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)
! printf("Error putting data into input pin %x\n", result);
sample->vt->Release((IUnknown*)sample);
***************
*** 383,385 ****
--- 387,443 ----
}
+ 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;
+ }
Index: DS_VideoDec.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/DirectShow/DS_VideoDec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DS_VideoDec.h 2001/03/20 01:59:42 1.1
--- DS_VideoDec.h 2001/03/20 21:12:37 1.2
***************
*** 26,29 ****
--- 26,30 ----
int DS_SetValue_DivX(char* name, int value);
+ int DS_SetAttr_DivX(char* attribute, int value);
#ifdef __cplusplus
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list