亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? renbase.h

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? H
?? 第 1 頁 / 共 2 頁
字號:
// which the rest of the renderer calls at significant moments.  These do
// the timing.

// the number of frames that the sliding averages are averaged over.
// the rule is (1024*NewObservation + (AVGPERIOD-1) * PreviousAverage)/AVGPERIOD
#define AVGPERIOD 4
#define DO_MOVING_AVG(avg,obs) (avg = (1024*obs + (AVGPERIOD-1)*avg)/AVGPERIOD)
// Spot the bug in this macro - I can't. but it doesn't work!

class CBaseVideoRenderer : public CBaseRenderer,    // Base renderer class
                           public IQualProp,        // Property page guff
                           public IQualityControl   // Allow throttling
{
protected:

    // Hungarian:
    //     tFoo is the time Foo in mSec (beware m_tStart from filter.h)
    //     trBar is the time Bar by the reference clock

    //******************************************************************
    // State variables to control synchronisation
    //******************************************************************

    // Control of sending Quality messages.  We need to know whether
    // we are in trouble (e.g. frames being dropped) and where the time
    // is being spent.

    // When we drop a frame we play the next one early.
    // The frame after that is likely to wait before drawing and counting this
    // wait as spare time is unfair, so we count it as a zero wait.
    // We therefore need to know whether we are playing frames early or not.

    int m_nNormal;                  // The number of consecutive frames
                                    // drawn at their normal time (not early)
                                    // -1 means we just dropped a frame.

#ifdef PERF
    BOOL m_bDrawLateFrames;         // Don't drop any frames (debug and I'm
                                    // not keen on people using it!)
#endif

    BOOL m_bSupplierHandlingQuality;// The response to Quality messages says
                                    // our supplier is handling things.
                                    // We will allow things to go extra late
                                    // before dropping frames.  We will play
                                    // very early after he has dropped one.

    // Control of scheduling, frame dropping etc.
    // We need to know where the time is being spent so as to tell whether
    // we should be taking action here, signalling supplier or what.
    // The variables are initialised to a mode of NOT dropping frames.
    // They will tell the truth after a few frames.
    // We typically record a start time for an event, later we get the time
    // again and subtract to get the elapsed time, and we average this over
    // a few frames.  The average is used to tell what mode we are in.

    // Although these are reference times (64 bit) they are all DIFFERENCES
    // between times which are small.  An int will go up to 214 secs before
    // overflow.  Avoiding 64 bit multiplications and divisions seems
    // worth while.



    // Audio-video throttling.  If the user has turned up audio quality
    // very high (in principle it could be any other stream, not just audio)
    // then we can receive cries for help via the graph manager.  In this case
    // we put in a wait for some time after rendering each frame.
    int m_trThrottle;

    // The time taken to render (i.e. BitBlt) frames controls which component
    // needs to degrade.  If the blt is expensive, the renderer degrades.
    // If the blt is cheap it's done anyway and the supplier degrades.
    int m_trRenderAvg;              // Time frames are taking to blt
    int m_trRenderLast;             // Time for last frame blt
    int m_tRenderStart;             // Just before we started drawing (mSec)
                                    // derived from timeGetTime.

    // When frames are dropped we will play the next frame as early as we can.
    // If it was a false alarm and the machine is fast we slide gently back to
    // normal timing.  To do this, we record the offset showing just how early
    // we really are.  This will normally be negative meaning early or zero.
    int m_trEarliness;

    // Target provides slow long-term feedback to try to reduce the
    // average sync offset to zero.  Whenever a frame is actually rendered
    // early we add a msec or two, whenever late we take off a few.
    // We add or take off 1/32 of the error time.
    // Eventually we should be hovering around zero.  For a really bad case
    // where we were (say) 300mSec off, it might take 100 odd frames to
    // settle down.  The rate of change of this is intended to be slower
    // than any other mechanism in Quartz, thereby avoiding hunting.
    int m_trTarget;

    // The proportion of time spent waiting for the right moment to blt
    // controls whether we bother to drop a frame or whether we reckon that
    // we're doing well enough that we can stand a one-frame glitch.
    int m_trWaitAvg;                // Average of last few wait times
                                    // (actually we just average how early
                                    // we were).  Negative here means LATE.

    // The average inter-frame time.
    // This is used to calculate the proportion of the time used by the
    // three operations (supplying us, waiting, rendering)
    int m_trFrameAvg;               // Average inter-frame time
    int m_trDuration;               // duration of last frame.

#ifdef PERF
    // Performance logging identifiers
    int m_idTimeStamp;              // MSR_id for frame time stamp
    int m_idEarliness;              // MSR_id for earliness fudge
    int m_idTarget;                 // MSR_id for Target fudge
    int m_idWaitReal;               // MSR_id for true wait time
    int m_idWait;                   // MSR_id for wait time recorded
    int m_idFrameAccuracy;          // MSR_id for time frame is late (int)
    int m_idRenderAvg;              // MSR_id for Render time recorded (int)
    int m_idSchLateTime;            // MSR_id for lateness at scheduler
    int m_idQualityRate;            // MSR_id for Quality rate requested
    int m_idQualityTime;            // MSR_id for Quality time requested
    int m_idDecision;               // MSR_id for decision code
    int m_idDuration;               // MSR_id for duration of a frame
    int m_idThrottle;               // MSR_id for audio-video throttling
    //int m_idDebug;                  // MSR_id for trace style debugging
    //int m_idSendQuality;          // MSR_id for timing the notifications per se
#endif // PERF
    REFERENCE_TIME m_trRememberStampForPerf;  // original time stamp of frame
                                              // with no earliness fudges etc.
#ifdef PERF
    REFERENCE_TIME m_trRememberFrameForPerf;  // time when previous frame rendered

    // debug...
    int m_idFrameAvg;
    int m_idWaitAvg;
#endif

    // PROPERTY PAGE
    // This has edit fields that show the user what's happening
    // These member variables hold these counts.

    int m_cFramesDropped;           // cumulative frames dropped IN THE RENDERER
    int m_cFramesDrawn;             // Frames since streaming started seen BY THE
                                    // RENDERER (some may be dropped upstream)

    // Next two support average sync offset and standard deviation of sync offset.
    LONGLONG m_iTotAcc;                  // Sum of accuracies in mSec
    LONGLONG m_iSumSqAcc;           // Sum of squares of (accuracies in mSec)

    // Next two allow jitter calculation.  Jitter is std deviation of frame time.
    REFERENCE_TIME m_trLastDraw;    // Time of prev frame (for inter-frame times)
    LONGLONG m_iSumSqFrameTime;     // Sum of squares of (inter-frame time in mSec)
    LONGLONG m_iSumFrameTime;            // Sum of inter-frame times in mSec

    // To get performance statistics on frame rate, jitter etc, we need
    // to record the lateness and inter-frame time.  What we actually need are the
    // data above (sum, sum of squares and number of entries for each) but the data
    // is generated just ahead of time and only later do we discover whether the
    // frame was actually drawn or not.  So we have to hang on to the data
    int m_trLate;                   // hold onto frame lateness
    int m_trFrame;                  // hold onto inter-frame time

    int m_tStreamingStart;          // if streaming then time streaming started
                                    // else time of last streaming session
                                    // used for property page statistics
#ifdef PERF
    LONGLONG m_llTimeOffset;        // timeGetTime()*10000+m_llTimeOffset==ref time
#endif

public:


    CBaseVideoRenderer(REFCLSID RenderClass, // CLSID for this renderer
                       TCHAR *pName,         // Debug ONLY description
                       LPUNKNOWN pUnk,       // Aggregated owner object
                       HRESULT *phr);        // General OLE return code

    ~CBaseVideoRenderer();

    // IQualityControl methods - Notify allows audio-video throttling

    STDMETHODIMP SetSink( IQualityControl * piqc);
    STDMETHODIMP Notify( IBaseFilter * pSelf, Quality q);

    // These provide a full video quality management implementation

    void OnRenderStart(IMediaSample *pMediaSample);
    void OnRenderEnd(IMediaSample *pMediaSample);
    void OnWaitStart();
    void OnWaitEnd();
    HRESULT OnStartStreaming();
    HRESULT OnStopStreaming();
    void ThrottleWait();

    // Handle the statistics gathering for our quality management

    void PreparePerformanceData(int trLate, int trFrame);
    virtual void RecordFrameLateness(int trLate, int trFrame);
    virtual void OnDirectRender(IMediaSample *pMediaSample);
    virtual HRESULT ResetStreamingTimes();
    BOOL ScheduleSample(IMediaSample *pMediaSample);
    HRESULT ShouldDrawSampleNow(IMediaSample *pMediaSample,
                                REFERENCE_TIME *ptrStart,
                                REFERENCE_TIME *ptrEnd);

    virtual HRESULT SendQuality(REFERENCE_TIME trLate, REFERENCE_TIME trRealStream);
    STDMETHODIMP JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName);

    //
    //  Do estimates for standard deviations for per-frame
    //  statistics
    //
    //  *piResult = (llSumSq - iTot * iTot / m_cFramesDrawn - 1) /
    //                            (m_cFramesDrawn - 2)
    //  or 0 if m_cFramesDrawn <= 3
    //
    HRESULT GetStdDev(
        int nSamples,
        int *piResult,
        LONGLONG llSumSq,
        LONGLONG iTot
    );
public:

    // IQualProp property page support

    STDMETHODIMP get_FramesDroppedInRenderer(int *cFramesDropped);
    STDMETHODIMP get_FramesDrawn(int *pcFramesDrawn);
    STDMETHODIMP get_AvgFrameRate(int *piAvgFrameRate);
    STDMETHODIMP get_Jitter(int *piJitter);
    STDMETHODIMP get_AvgSyncOffset(int *piAvg);
    STDMETHODIMP get_DevSyncOffset(int *piDev);

    // Implement an IUnknown interface and expose IQualProp

    DECLARE_IUNKNOWN
    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid,VOID **ppv);
};

#endif // __RENBASE__

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美国产77777| 日韩高清国产一区在线| 欧美性猛交xxxxxxxx| 亚洲电影欧美电影有声小说| 久久亚洲捆绑美女| 国产一区二区免费视频| 中文字幕一区二区三| 欧美色图12p| 韩国成人在线视频| 亚洲精品伦理在线| 国产亚洲综合在线| 欧美性色综合网| 国产一区二区三区蝌蚪| 国产一区二区不卡| 欧美日韩在线一区二区| 国产精品美女视频| 色婷婷亚洲综合| 综合色中文字幕| 国产成人综合亚洲91猫咪| 欧美欧美欧美欧美首页| 亚洲国产中文字幕在线视频综合| 国产麻豆视频一区二区| 日本91福利区| 欧美刺激午夜性久久久久久久| 一区二区三区在线播放| 国产精品成人一区二区艾草| 久久久精品国产免大香伊| 91精品国产美女浴室洗澡无遮挡| 亚洲一区二区三区四区的| 国产亚洲一区二区三区四区| 欧美一区二区三区在线电影 | 欧洲精品一区二区| 91在线精品一区二区三区| 成人h动漫精品一区二区| 欧美午夜精品久久久久久孕妇 | 欧美日韩国产123区| 三级在线观看一区二区 | 亚洲欧美日韩国产综合| 色综合咪咪久久| 日本在线观看不卡视频| 天堂av在线一区| 国产精品综合在线视频| 福利一区二区在线| 91国内精品野花午夜精品| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美videossexotv100| 国产成人夜色高潮福利影视| 一区二区三区不卡视频在线观看| 欧美一区二区三区啪啪| 亚洲精品在线一区二区| 中文字幕在线观看一区| 日韩黄色片在线观看| 成人免费看的视频| 精品国产伦一区二区三区免费| 99精品视频中文字幕| 欧美日韩国产美女| 亚洲国产aⅴ天堂久久| 国产精品美女久久久久久久久| 欧美精品一二三| 国产精品国产三级国产aⅴ中文| 欧美一区二区网站| 亚洲美女免费在线| 成人免费毛片aaaaa**| www激情久久| 国产成人亚洲综合a∨婷婷| 久久99国产精品成人| 欧美日韩精品专区| 日韩精品免费视频人成| 99久久精品99国产精品 | 国产欧美精品日韩区二区麻豆天美| 911国产精品| 亚洲成精国产精品女| 五月天激情小说综合| 欧美午夜电影在线播放| 亚洲免费在线电影| 欧美日韩高清影院| 2022国产精品视频| 国产一区久久久| 18欧美乱大交hd1984| 色婷婷综合久色| 丝瓜av网站精品一区二区| 91精品中文字幕一区二区三区| 日韩亚洲欧美一区| 国产一区二区精品久久99| 久久久天堂av| 欧美网站大全在线观看| 日韩女优毛片在线| 亚洲国产精品激情在线观看| 不卡欧美aaaaa| 久久99国内精品| 亚洲女同一区二区| 丰满亚洲少妇av| 欧美一区二区三区视频在线 | 久久综合久久99| 色综合久久综合| 国产成人综合在线| 免费亚洲电影在线| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲成a人片在线观看中文| 精品久久久久久无| 91麻豆精品久久久久蜜臀| 91免费在线看| 国产91丝袜在线播放九色| 亚洲午夜久久久久久久久电影院| 不卡一区在线观看| 国产精品久久久久久户外露出| 男男视频亚洲欧美| 91麻豆精品国产91久久久更新时间| 亚洲激情校园春色| 亚洲欧美日韩久久| 欧美亚洲一区二区三区四区| www.日韩在线| 床上的激情91.| 99视频热这里只有精品免费| 国产美女精品一区二区三区| 久久国产精品99久久人人澡| 精品日韩99亚洲| 精品国产乱码久久| 亚洲欧洲国产日韩| 日韩一区日韩二区| 亚洲第一在线综合网站| 午夜精品一区二区三区免费视频| 7777女厕盗摄久久久| 国产一区二区三区四| 成人午夜免费电影| 欧美在线视频日韩| 欧美一二三四在线| 一区二区三区四区精品在线视频| 欧美喷潮久久久xxxxx| 日韩一级完整毛片| 中文字幕一区三区| 捆绑紧缚一区二区三区视频| 不卡av免费在线观看| 日韩一区二区在线看片| 成人欧美一区二区三区1314 | 色一区在线观看| 日韩欧美国产综合| 偷拍与自拍一区| 亚洲伦在线观看| 精品国产乱码久久久久久影片| 欧美午夜一区二区三区| 精品动漫一区二区三区在线观看| 91欧美激情一区二区三区成人| 国精品**一区二区三区在线蜜桃| 亚洲一区二区欧美日韩| www.在线成人| 欧美国产日本视频| 国产一区二区视频在线播放| 日韩午夜av电影| 奇米一区二区三区| 欧美日韩综合不卡| 亚洲一区二区三区四区五区中文 | 欧美三级电影精品| 亚洲国产精品麻豆| 欧美日韩亚洲综合一区| 亚洲一区成人在线| 欧美在线观看视频在线| 欧美精品色综合| 日韩一卡二卡三卡国产欧美| 亚洲国产日韩a在线播放性色| 亚洲国产日韩av| 日韩一区二区三区观看| 经典三级一区二区| 成人av免费网站| 亚洲国产中文字幕在线视频综合| 亚洲国产一区视频| 久久午夜老司机| 日本韩国欧美国产| 蜜臀av一级做a爰片久久| 日韩免费成人网| av电影在线观看完整版一区二区| 日本高清免费不卡视频| 欧美日韩国产乱码电影| 久久久噜噜噜久久人人看| 国产成人免费视频| 天天爽夜夜爽夜夜爽精品视频| 国产成人鲁色资源国产91色综| 欧美人与性动xxxx| 不卡一卡二卡三乱码免费网站| 欧美日本免费一区二区三区| 国产经典欧美精品| 日本sm残虐另类| 一区二区三区成人在线视频| 国产精品一卡二卡| 免费看欧美女人艹b| 亚洲精品菠萝久久久久久久| 久久精品视频一区| 精品日本一线二线三线不卡| 91精品办公室少妇高潮对白| 成人不卡免费av| 国产精品激情偷乱一区二区∴| 国产成人精品免费网站| 国产精品理论片在线观看| 欧美大片在线观看一区二区| 欧美午夜精品理论片a级按摩| 亚洲影视在线观看| 亚洲国产你懂的| 天堂精品中文字幕在线| 日韩va亚洲va欧美va久久| 日韩欧美在线不卡|