diff options
29 files changed, 71 insertions, 6 deletions
diff --git a/src/apps/mplayerc/FGManagerBDA.cpp b/src/apps/mplayerc/FGManagerBDA.cpp index 3c5bbfde4..c1e66d728 100644 --- a/src/apps/mplayerc/FGManagerBDA.cpp +++ b/src/apps/mplayerc/FGManagerBDA.cpp @@ -53,8 +53,8 @@ static const MPEG2VIDEOINFO sMpv_fmt = 0, // AvgTimePerFrame
0, // dwInterlaceFlags
0, // dwCopyProtectFlags
- 16, // dwPictAspectRatioX
- 9, // dwPictAspectRatioY
+ 0, // dwPictAspectRatioX
+ 0, // dwPictAspectRatioY
{0}, // dwControlFlag & dwReserved1
0, // dwReserved2
{
diff --git a/src/apps/mplayerc/mpcresources/mplayerc.br.rc b/src/apps/mplayerc/mpcresources/mplayerc.br.rc Binary files differindex 9ccb7fc7d..bf35e7836 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.br.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.br.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.by.rc b/src/apps/mplayerc/mpcresources/mplayerc.by.rc Binary files differindex 59faa174d..989102e94 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.by.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.by.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.ca.rc b/src/apps/mplayerc/mpcresources/mplayerc.ca.rc Binary files differindex 97385576d..bfbc357f4 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.ca.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.ca.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.cz.rc b/src/apps/mplayerc/mpcresources/mplayerc.cz.rc Binary files differindex 963a21808..c513e3db1 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.cz.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.cz.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.de.rc b/src/apps/mplayerc/mpcresources/mplayerc.de.rc Binary files differindex 32b129994..1d11fd1d7 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.de.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.de.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.es.rc b/src/apps/mplayerc/mpcresources/mplayerc.es.rc Binary files differindex 2084060f0..dc2dbdcc2 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.es.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.es.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.fr.rc b/src/apps/mplayerc/mpcresources/mplayerc.fr.rc Binary files differindex 880aa272c..5c9ac0cb5 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.fr.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.fr.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.hu.rc b/src/apps/mplayerc/mpcresources/mplayerc.hu.rc Binary files differindex 98b1f596d..3b64e59e3 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.hu.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.hu.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.it.rc b/src/apps/mplayerc/mpcresources/mplayerc.it.rc Binary files differindex f7be26a66..b0528263e 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.it.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.it.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.ja.rc b/src/apps/mplayerc/mpcresources/mplayerc.ja.rc Binary files differindex 68cff7942..e31aae596 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.ja.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.ja.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.kr.rc b/src/apps/mplayerc/mpcresources/mplayerc.kr.rc Binary files differindex 6417d9a26..657ae4991 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.kr.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.kr.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.nl.rc b/src/apps/mplayerc/mpcresources/mplayerc.nl.rc Binary files differindex 99fd49b3a..c3e45145c 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.nl.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.nl.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.pl.rc b/src/apps/mplayerc/mpcresources/mplayerc.pl.rc Binary files differindex 6e4967f3e..539a9297e 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.pl.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.pl.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.ru.rc b/src/apps/mplayerc/mpcresources/mplayerc.ru.rc Binary files differindex 4a0137d7a..f6584d9c5 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.ru.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.ru.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.sc.rc b/src/apps/mplayerc/mpcresources/mplayerc.sc.rc Binary files differindex 8dde5ff28..d6195b4a4 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.sc.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.sc.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.sk.rc b/src/apps/mplayerc/mpcresources/mplayerc.sk.rc Binary files differindex ae36fbf63..cef100dd7 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.sk.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.sk.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.sv.rc b/src/apps/mplayerc/mpcresources/mplayerc.sv.rc Binary files differindex dbd5c413a..4e143403c 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.sv.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.sv.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.tc.rc b/src/apps/mplayerc/mpcresources/mplayerc.tc.rc Binary files differindex 17b3c2569..8db192c28 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.tc.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.tc.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.tr.rc b/src/apps/mplayerc/mpcresources/mplayerc.tr.rc Binary files differindex fae62e656..97ba39de5 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.tr.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.tr.rc diff --git a/src/apps/mplayerc/mpcresources/mplayerc.ua.rc b/src/apps/mplayerc/mpcresources/mplayerc.ua.rc Binary files differindex e831d59df..c6c6ed2fd 100644 --- a/src/apps/mplayerc/mpcresources/mplayerc.ua.rc +++ b/src/apps/mplayerc/mpcresources/mplayerc.ua.rc diff --git a/src/apps/mplayerc/mplayerc.rc b/src/apps/mplayerc/mplayerc.rc Binary files differindex 36a209db6..6816ab6bf 100644 --- a/src/apps/mplayerc/mplayerc.rc +++ b/src/apps/mplayerc/mplayerc.rc diff --git a/src/apps/mplayerc/resource.h b/src/apps/mplayerc/resource.h Binary files differindex 880255c88..698a84888 100644 --- a/src/apps/mplayerc/resource.h +++ b/src/apps/mplayerc/resource.h diff --git a/src/filters/transform/Mpeg2DecFilter/IMpeg2DecFilter.h b/src/filters/transform/Mpeg2DecFilter/IMpeg2DecFilter.h index 0f0718a0d..a36174c94 100644 --- a/src/filters/transform/Mpeg2DecFilter/IMpeg2DecFilter.h +++ b/src/filters/transform/Mpeg2DecFilter/IMpeg2DecFilter.h @@ -51,5 +51,8 @@ IMpeg2DecFilter : public IUnknown STDMETHOD(EnableInterlaced(bool fEnable)) = 0;
STDMETHOD_(bool, IsInterlacedEnabled()) = 0;
+
+ STDMETHOD(EnableReadARFromStream(bool fEnable)) = 0;
+ STDMETHOD_(bool, IsReadARFromStreamEnabled()) = 0;
};
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp index 296674a12..336655725 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp @@ -224,6 +224,7 @@ CMpeg2DecFilter::CMpeg2DecFilter(LPUNKNOWN lpunk, HRESULT* phr) EnableForcedSubtitles(true);
EnablePlanarYUV(true);
EnableInterlaced(false);
+ EnableReadARFromStream(true);
CRegKey key;
if(ERROR_SUCCESS == key.Open(HKEY_CURRENT_USER, _T("Software\\Gabest\\Filters\\MPEG Video Decoder"), KEY_READ))
@@ -237,10 +238,13 @@ CMpeg2DecFilter::CMpeg2DecFilter(LPUNKNOWN lpunk, HRESULT* phr) if(ERROR_SUCCESS == key.QueryDWORDValue(_T("ForcedSubtitles"), dw)) EnableForcedSubtitles(!!dw);
if(ERROR_SUCCESS == key.QueryDWORDValue(_T("PlanarYUV"), dw)) EnablePlanarYUV(!!dw);
if(ERROR_SUCCESS == key.QueryDWORDValue(_T("Interlaced"), dw)) EnableInterlaced(!!dw);
+ if(ERROR_SUCCESS == key.QueryDWORDValue(_T("ReadARFromStream"), dw)) EnableReadARFromStream(!!dw);
}
m_rate.Rate = 10000;
m_rate.StartTime = 0;
+
+ m_par.SetSize(1,1);
}
CMpeg2DecFilter::~CMpeg2DecFilter()
@@ -256,6 +260,7 @@ CMpeg2DecFilter::~CMpeg2DecFilter() key.SetDWORDValue(_T("ForcedSubtitles"), m_fForcedSubs);
key.SetDWORDValue(_T("PlanarYUV"), m_fPlanarYUV);
key.SetDWORDValue(_T("Interlaced"), m_fInterlaced);
+ key.SetDWORDValue(_T("ReadARFromStream"), m_bReadARFromStream);
}
delete m_pSubpicInput;
@@ -532,6 +537,7 @@ HRESULT CMpeg2DecFilter::Transform(IMediaSample* pIn) //
SetDeinterlaceMethod();
+ UpdateAspectRatio();
hr = DeliverFast();
if(hr != S_OK)
@@ -556,6 +562,32 @@ bool CMpeg2DecFilter::IsVideoInterlaced() return IsInterlacedEnabled();
}
+inline int LNKO(int a, int b)
+{
+ if(a == 0 || b == 0)
+ return(1);
+ while(a != b)
+ {
+ if(a < b) b -= a;
+ else if(a > b) a -= b;
+ }
+ return(a);
+}
+
+void CMpeg2DecFilter::UpdateAspectRatio()
+{
+ if(m_bReadARFromStream && (m_par.cx != m_dec->m_info.m_sequence->pixel_width || m_par.cy != m_dec->m_info.m_sequence->pixel_height))
+ {
+ m_par.cx = m_dec->m_info.m_sequence->pixel_width;
+ m_par.cy = m_dec->m_info.m_sequence->pixel_height;
+ CSize dar(m_dec->m_info.m_sequence->picture_width * m_par.cx,
+ m_dec->m_info.m_sequence->picture_height * m_par.cy);
+ int lnko = LNKO(dar.cx, dar.cy);
+ if(lnko > 1) dar.cx /= lnko, dar.cy /= lnko;
+ SetAspect(dar);
+ }
+}
+
HRESULT CMpeg2DecFilter::DeliverFast()
{
HRESULT hr;
@@ -1193,6 +1225,19 @@ STDMETHODIMP_(bool) CMpeg2DecFilter::IsInterlacedEnabled() return m_fInterlaced;
}
+STDMETHODIMP CMpeg2DecFilter::EnableReadARFromStream(bool fEnable)
+{
+ CAutoLock cAutoLock(&m_csProps);
+ m_bReadARFromStream = fEnable;
+ return S_OK;
+}
+
+STDMETHODIMP_(bool) CMpeg2DecFilter::IsReadARFromStreamEnabled()
+{
+ CAutoLock cAutoLock(&m_csProps);
+ return m_bReadARFromStream;
+}
+
//
// CMpeg2DecInputPin
//
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h index f92c6e481..829ec6fa3 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h @@ -46,6 +46,7 @@ CMpeg2DecFilter REFERENCE_TIME m_AvgTimePerFrame;
bool m_fWaitForKeyFrame;
bool m_fInitializedBuffer;
+ CSize m_par;
struct framebuf
{
@@ -94,6 +95,7 @@ protected: void InputTypeChanged();
HRESULT Transform(IMediaSample* pIn);
bool IsVideoInterlaced();
+ void UpdateAspectRatio();
public:
CMpeg2DecFilter(LPUNKNOWN lpunk, HRESULT* phr);
@@ -132,6 +134,7 @@ protected: bool m_fForcedSubs;
bool m_fPlanarYUV;
bool m_fInterlaced;
+ bool m_bReadARFromStream;
static void CalcBrCont(BYTE* YTbl, float bright, float cont);
static void CalcHueSat(BYTE* UTbl, BYTE* VTbl, float hue, float sat);
@@ -168,6 +171,9 @@ public: STDMETHODIMP EnableInterlaced(bool fEnable);
STDMETHODIMP_(bool) IsInterlacedEnabled();
+
+ STDMETHODIMP EnableReadARFromStream(bool fEnable);
+ STDMETHODIMP_(bool) IsReadARFromStreamEnabled();
};
class CMpeg2DecInputPin : public CDeCSSInputPin
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.cpp index cb148a846..c8de3e7ea 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.cpp +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.cpp @@ -63,6 +63,7 @@ bool CMpeg2DecSettingsWnd::OnConnect(const CInterfaceList<IUnknown, &IID_IUnknow m_forcedsubs = m_pM2DF->IsForcedSubtitlesEnabled();
m_planaryuv = m_pM2DF->IsPlanarYUVEnabled();
m_interlaced = m_pM2DF->IsInterlacedEnabled();
+ m_readARFromStream = m_pM2DF->IsReadARFromStreamEnabled();
return true;
}
@@ -90,6 +91,10 @@ bool CMpeg2DecSettingsWnd::OnActivate() m_forcedsubs_check.SetCheck(m_forcedsubs ? BST_CHECKED : BST_UNCHECKED);
p.y += m_fontheight + 5;
+ m_readARFromStream_check.Create(ResStr(IDS_MPEG2DECSETTINGSWND_3), dwStyle|BS_AUTOCHECKBOX, CRect(p, CSize(300, m_fontheight)), this, IDC_PP_CHECK4);
+ m_readARFromStream_check.SetCheck(m_readARFromStream ? BST_CHECKED : BST_UNCHECKED);
+ p.y += m_fontheight + 5;
+
p.y += 10;
m_ditype_static.Create(ResStr(IDS_MPEG2_DEINTERLACING), dwStyle, CRect(p, CSize(70, m_fontheight)), this);
@@ -160,6 +165,7 @@ void CMpeg2DecSettingsWnd::OnDeactivate() m_planaryuv = !!IsDlgButtonChecked(m_planaryuv_check.GetDlgCtrlID());
m_interlaced = !!IsDlgButtonChecked(m_interlaced_check.GetDlgCtrlID());
m_forcedsubs = !!IsDlgButtonChecked(m_forcedsubs_check.GetDlgCtrlID());
+ m_readARFromStream = !!IsDlgButtonChecked(m_readARFromStream_check.GetDlgCtrlID());
}
bool CMpeg2DecSettingsWnd::OnApply()
@@ -176,6 +182,7 @@ bool CMpeg2DecSettingsWnd::OnApply() m_pM2DF->EnableForcedSubtitles(m_forcedsubs);
m_pM2DF->EnablePlanarYUV(m_planaryuv);
m_pM2DF->EnableInterlaced(m_interlaced);
+ m_pM2DF->EnableReadARFromStream(m_readARFromStream);
}
return true;
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.h b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.h index cea28794c..a358fdb8a 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.h +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecSettingsWnd.h @@ -35,6 +35,7 @@ CMpeg2DecSettingsWnd : public CInternalPropertyPageWnd bool m_planaryuv;
bool m_interlaced;
bool m_forcedsubs;
+ bool m_readARFromStream;
enum
{
@@ -46,6 +47,7 @@ CMpeg2DecSettingsWnd : public CInternalPropertyPageWnd IDC_PP_CHECK1,
IDC_PP_CHECK2,
IDC_PP_CHECK3,
+ IDC_PP_CHECK4,
IDC_PP_BUTTON1,
IDC_PP_BUTTON2,
};
@@ -60,6 +62,7 @@ CMpeg2DecSettingsWnd : public CInternalPropertyPageWnd CButton m_planaryuv_check;
CButton m_interlaced_check;
CButton m_forcedsubs_check;
+ CButton m_readARFromStream_check;
CStatic m_note_static;
void UpdateProcampValues();
diff --git a/src/filters/transform/Mpeg2DecFilter/resource.h b/src/filters/transform/Mpeg2DecFilter/resource.h index 5050ae86a..a8354b8b7 100644 --- a/src/filters/transform/Mpeg2DecFilter/resource.h +++ b/src/filters/transform/Mpeg2DecFilter/resource.h @@ -9,10 +9,11 @@ #define IDS_MPEG2_BRIGHTNESS 33148
#define IDS_MPEG2_RESET 33149
#define IDS_MPEG2DECSETTINGSWND_7 33150
-#define IDS_MPEG2_CONTRAST 33157
-#define IDS_MPEG2_HUE 33158
-#define IDS_MPEG2_SATURATION 33159
-#define IDS_MPEG2DECSETTINGSWND_8 33160
+#define IDS_MPEG2_CONTRAST 33157
+#define IDS_MPEG2_HUE 33158
+#define IDS_MPEG2_SATURATION 33159
+#define IDS_MPEG2DECSETTINGSWND_8 33160
+#define IDS_MPEG2DECSETTINGSWND_3 41108
// Next default values for new objects
//
|