-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Shader media times access #162
base: develop
Are you sure you want to change the base?
Shader media times access #162
Conversation
#if 1 | ||
D3DSURFACE_DESC desc; | ||
m_pVideoTexture[m_nCurSurface]->GetLevelDesc(0, &desc); | ||
|
||
float fConstData[][4] = { | ||
{(float)desc.Width, (float)desc.Height, (float)(counter++), (float)diff / CLOCKS_PER_SEC}, | ||
{1.0f / desc.Width, 1.0f / desc.Height, 0, 0}, | ||
{ (float)desc.Width, (float)desc.Height, (float)(counter++), (float)diff / CLOCKS_PER_SEC }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these, use contrib/run_astyle.bat for formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do run it before pushing, but it doesn't correct it. I use AStyle 5.5.8 unicode, is this correct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That version is for Inno Setup, not astyle. Personally, I'm still in 2.05.1, no idea if there's any newer, but you shouldn't do manual corrections in style since they will be overwritten the next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sorry, it's 2.05.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue might have been already fixed in their trunk branch, but you can try reporting it to astyle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sur if it's a bug : --unpad-paren seems to be about parenthesis only, not brackets.
Yes I guess the method is intrusive, but we didn't see other way to retrieve the information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, gathering stream position information on timer is way too imprecise. And calling IMediaSeeking from rendering loop would cause deadlock, if I remember DirectShow quirks correctly. But video renderer should have segment position for each to be presented frame, and that can be used.
@on-situ-repos
Please clarify why do you need this in the first place, I think it's getting out of scope of what video renderer shaders were supposed to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look at the segment position.
It's to have effects based on the timeline (custom fadeoff / transitions / ...).
We are working on adding an external .json to set custom shader attributes (textures & others), not sure if it should be pushed too, it'll be on github anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are working on adding an external .json to set custom shader attributes (textures & others), not sure if it should be pushed too, it'll be on github anyway.
If you can wrap it into an interface that could be used by external video renderers such as madVR, then by all means yes.
You do not need the merge commits; just rebase your branch. |
Ok, I haven't used "rebase" for now, thanks for the tip. |
Ok, latest commit is better. float4 consts0 : register(c0); float4 main(float2 tex : TEXCOORD0) : COLOR |
3583d3b
to
e18876f
Compare
e18876f
to
38c98cd
Compare
src/SubPic/ISubPic.h
Outdated
@@ -183,7 +183,8 @@ public IUnknown { | |||
STDMETHOD_(bool, Paint)(bool bAll) PURE; | |||
|
|||
STDMETHOD_(void, SetTime)(REFERENCE_TIME rtNow) PURE; | |||
STDMETHOD_(void, SetSubtitleDelay)(int delayMs) PURE; | |||
STDMETHOD_(void, SetDuration)(REFERENCE_TIME rtDuration) PURE; | |||
STDMETHOD_(void, SetSubtitleDelay)(int delayMs) PURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs -> spaces
Maybe run AStyle if you haven't already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISubPic.h is excluded by astyle.ini
5966d24
to
97f9607
Compare
… to get the icons for the toolbar (play, pause, etc) buttons; else it uses built-in icons. "Toolbar.bmp" can be of bitdepth <= 24, in which case RGB(255, 0, 255) is considered transparent or of bitdepth 32, in which case the alpha channel is used for transparency / gradients; 32 bit bitmaps mustn't use any compression in order to load properly; its resolution should be 15h x h to load, each icon being h x h in size for bigger toolbar.bmp files, the player minimum width is set so that all icons remain visible. The volume slider isn't modified yet - it keeps its size. Patch by foxx1337 git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1706 10f7b99b-c216-0410-bff0-8a66a9350fd8
Add media status access from shader, add current video time and length in the const registers.