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

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

?? transip.cpp

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//------------------------------------------------------------------------------
// File: TransIP.cpp
//
// Desc: DirectShow base classes - implements class for simple Transform-
//       In-Place filters such as audio.
//
// Copyright (c) 1992-2002 Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------------------------


// How allocators are decided.
//
// An in-place transform tries to do its work in someone else's buffers.
// It tries to persuade the filters on either side to use the same allocator
// (and for that matter the same media type).  In desperation, if the downstream
// filter refuses to supply an allocator and the upstream filter offers only
// a read-only one then it will provide an allocator.
// if the upstream filter insists on a read-only allocator then the transform
// filter will (reluctantly) copy the data before transforming it.
//
// In order to pass an allocator through it needs to remember the one it got
// from the first connection to pass it on to the second one.
//
// It is good if we can avoid insisting on a particular order of connection
// (There is a precedent for insisting on the input
// being connected first.  Insisting on the output being connected first is
// not allowed.  That would break RenderFile.)
//
// The base pin classes (CBaseOutputPin and CBaseInputPin) both have a
// m_pAllocator member which is used in places like
// CBaseOutputPin::GetDeliveryBuffer and CBaseInputPin::Inactive.
// To avoid lots of extra overriding, we should keep these happy
// by using these pointers.
//
// When each pin is connected, it will set the corresponding m_pAllocator
// and will have a single ref-count on that allocator.
//
// Refcounts are acquired by GetAllocator calls which return AddReffed
// allocators and are released in one of:
//     CBaseInputPin::Disconnect
//     CBaseOutputPin::BreakConect
// In each case m_pAllocator is set to NULL after the release, so this
// is the last chance to ever release it.  If there should ever be
// multiple refcounts associated with the same pointer, this had better
// be cleared up before that happens.  To avoid such problems, we'll
// stick with one per pointer.



// RECONNECTING and STATE CHANGES
//
// Each pin could be disconnected, connected with a read-only allocator,
// connected with an upstream read/write allocator, connected with an
// allocator from downstream or connected with its own allocator.
// Five states for each pin gives a data space of 25 states.
//
// Notation:
//
// R/W == read/write
// R-O == read-only
//
// <input pin state> <output pin state> <comments>
//
// 00 means an unconnected pin.
// <- means using a R/W allocator from the upstream filter
// <= means using a R-O allocator from an upstream filter
// || means using our own (R/W) allocator.
// -> means using a R/W allocator from a downstream filter
//    (a R-O allocator from downstream is nonsense, it can't ever work).
//
//
// That makes 25 possible states.  Some states are nonsense (two different
// allocators from the same place).  These are just an artifact of the notation.
//        <=  <-  Nonsense.
//        <-  <=  Nonsense
// Some states are illegal (the output pin never accepts a R-O allocator):
//        00  <=  !! Error !!
//        <=  <=  !! Error !!
//        ||  <=  !! Error !!
//        ->  <=  !! Error !!
// Three states appears to be inaccessible:
//        ->  ||  Inaccessible
//        ||  ->  Inaccessible
//        ||  <-  Inaccessible
// Some states only ever occur as intermediates with a pending reconnect which
// is guaranteed to finish in another state.
//        ->  00  ?? unstable goes to || 00
//        00  <-  ?? unstable goes to 00 ||
//        ->  <-  ?? unstable goes to -> ->
//        <-  ||  ?? unstable goes to <- <-
//        <-  ->  ?? unstable goes to <- <-
// And that leaves 11 possible resting states:
// 1      00  00  Nothing connected.
// 2      <-  00  Input pin connected.
// 3      <=  00  Input pin connected using R-O allocator.
// 4      ||  00  Needs several state changes to get here.
// 5      00  ||  Output pin connected using our allocator
// 6      00  ->  Downstream only connected
// 7      ||  ||  Undesirable but can be forced upon us.
// 8      <=  ||  Copy forced.  <=  -> is preferable
// 9      <=  ->  OK - forced to copy.
// 10     <-  <-  Transform in place (ideal)
// 11     ->  ->  Transform in place (ideal)
//
// The object of the exercise is to ensure that we finish up in states
// 10 or 11 whenever possible.  State 10 is only possible if the upstream
// filter has a R/W allocator (the AVI splitter notoriously
// doesn't) and state 11 is only possible if the downstream filter does
// offer an allocator.
//
// The transition table (entries marked * go via a reconnect)
//
// There are 8 possible transitions:
// A: Connect upstream to filter with R-O allocator that insists on using it.
// B: Connect upstream to filter with R-O allocator but chooses not to use it.
// C: Connect upstream to filter with R/W allocator and insists on using it.
// D: Connect upstream to filter with R/W allocator but chooses not to use it.
// E: Connect downstream to a filter that offers an allocator
// F: Connect downstream to a filter that does not offer an allocator
// G: disconnect upstream
// H: Disconnect downstream
//
//            A      B      C      D      E      F      G      H
//           ---------------------------------------------------------
// 00  00 1 | 3      3      2      2      6      5      .      .      |1  00  00
// <-  00 2 | .      .      .      .      *10/11 10     1      .      |2  <-  00
// <=  00 3 | .      .      .      .      *9/11  *7/8   1      .      |3  <=  00
// ||  00 4 | .      .      .      .      *8     *7     1      .      |4  ||  00
// 00  || 5 | 8      7      *10    7      .      .      .      1      |5  00  ||
// 00  -> 6 | 9      11     *10    11     .      .      .      1      |6  00  ->
// ||  || 7 | .      .      .      .      .      .      5      4      |7  ||  ||
// <=  || 8 | .      .      .      .      .      .      5      3      |8  <=  ||
// <=  -> 9 | .      .      .      .      .      .      6      3      |9  <=  ->
// <-  <- 10| .      .      .      .      .      .      *5/6   2      |10 <-  <-
// ->  -> 11| .      .      .      .      .      .      6      *2/3   |11 ->  ->
//           ---------------------------------------------------------
//            A      B      C      D      E      F      G      H
//
// All these states are accessible without requiring any filter to
// change its behaviour but not all transitions are accessible, for
// instance a transition from state 4 to anywhere other than
// state 8 requires that the upstream filter first offer a R-O allocator
// and then changes its mind and offer R/W.  This is NOT allowable - it
// leads to things like the output pin getting a R/W allocator from
// upstream and then the input pin being told it can only have a R-O one.
// Note that you CAN change (say) the upstream filter for a different one, but
// only as a disconnect / connect, not as a Reconnect.  (Exercise for
// the reader is to see how you get into state 4).
//
// The reconnection stuff goes as follows (some of the cases shown here as
// "no reconnect" may get one to finalise media type - an old story).
// If there is a reconnect where it says "no reconnect" here then the
// reconnection must not change the allocator choice.
//
// state 2: <- 00 transition E <- <- case C <- <- (no change)
//                                   case D -> <- and then to -> ->
//
// state 2: <- 00 transition F <- <- (no reconnect)
//
// state 3: <= 00 transition E <= -> case A <= -> (no change)
//                                   case B -> ->
//                transition F <= || case A <= || (no change)
//                                   case B || ||
//
// state 4: || 00 transition E || || case B -> || and then all cases to -> ->
//                           F || || case B || || (no change)
//
// state 5: 00 || transition A <= || (no reconnect)
//                           B || || (no reconnect)
//                           C <- || all cases     <- <-
//                           D || || (unfortunate, but upstream's choice)
//
// state 6: 00 -> transition A <= -> (no reconnect)
//                           B -> -> (no reconnect)
//                           C <- -> all cases <- <-
//                           D -> -> (no reconnect)
//
// state 10:<- <- transition G 00 <- case E 00 ->
//                                   case F 00 ||
//
// state 11:-> -> transition H -> 00 case A <= 00 (schizo)
//                                   case B <= 00
//                                   case C <- 00 (schizo)
//                                   case D <- 00
//
// The Rules:
// To sort out media types:
// The input is reconnected
//    if the input pin is connected and the output pin connects
// The output is reconnected
//    If the output pin is connected
//    and the input pin connects to a different media type
//
// To sort out allocators:
// The input is reconnected
//    if the output disconnects and the input was using a downstream allocator
// The output pin calls SetAllocator to pass on a new allocator
//    if the output is connected and
//       if the input disconnects and the output was using an upstream allocator
//       if the input acquires an allocator different from the output one
//          and that new allocator is not R-O
//
// Data is copied (i.e. call getbuffer and copy the data before transforming it)
//    if the two allocators are different.



// CHAINS of filters:
//
// We sit between two filters (call them A and Z).  We should finish up
// with the same allocator on both of our pins and that should be the
// same one that A and Z would have agreed on if we hadn't been in the
// way.  Furthermore, it should not matter how many in-place transforms
// are in the way.  Let B, C, D... be in-place transforms ("us").
// Here's how it goes:
//
// 1.
// A connects to B.  They agree on A's allocator.
//   A-a->B
//
// 2.
// B connects to C.  Same story. There is no point in a reconnect, but
// B will request an input reconnect anyway.
//   A-a->B-a->C
//
// 3.
// C connects to Z.
// C insists on using A's allocator, but compromises by requesting a reconnect.
// of C's input.
//   A-a->B-?->C-a->Z
//
// We now have pending reconnects on both A--->B and B--->C
//
// 4.
// The A--->B link is reconnected.
// A asks B for an allocator.  B sees that it has a downstream connection so
// asks its downstream input pin i.e. C's input pin for an allocator.  C sees
// that it too has a downstream connection so asks Z for an allocator.
//
// Even though Z's input pin is connected, it is being asked for an allocator.
// It could refuse, in which case the chain is done and will use A's allocator
// Alternatively, Z may supply one.  A chooses either Z's or A's own one.
// B's input pin gets NotifyAllocator called to tell it the decision and it
// propagates this downstream by calling ReceiveAllocator on its output pin
// which calls NotifyAllocator on the next input pin downstream etc.
// If the choice is Z then it goes:
//   A-z->B-a->C-a->Z
//   A-z->B-z->C-a->Z
//   A-z->B-z->C-z->Z
//
// And that's IT!!  Any further (essentially spurious) reconnects peter out
// with no change in the chain.

#include <streams.h>
#include <measure.h>
#include <transip.h>


// =================================================================
// Implements the CTransInPlaceFilter class
// =================================================================

CTransInPlaceFilter::CTransInPlaceFilter
   ( TCHAR     *pName,
     LPUNKNOWN  pUnk,
     REFCLSID   clsid,
     HRESULT   *phr,
     bool       bModifiesData
   )
   : CTransformFilter(pName, pUnk, clsid),
     m_bModifiesData(bModifiesData)
{
#ifdef PERF
    RegisterPerfId();
#endif //  PERF

} // constructor

#ifdef UNICODE
CTransInPlaceFilter::CTransInPlaceFilter
   ( CHAR     *pName,
     LPUNKNOWN  pUnk,
     REFCLSID   clsid,
     HRESULT   *phr,
     bool       bModifiesData
   )
   : CTransformFilter(pName, pUnk, clsid),
     m_bModifiesData(bModifiesData)
{
#ifdef PERF
    RegisterPerfId();
#endif //  PERF

} // constructor
#endif

// return a non-addrefed CBasePin * for the user to addref if he holds onto it
// for longer than his pointer to us. We create the pins dynamically when they
// are asked for rather than in the constructor. This is because we want to
// give the derived class an oppportunity to return different pin objects

// As soon as any pin is needed we create both (this is different from the
// usual transform filter) because enumerators, allocators etc are passed
// through from one pin to another and it becomes very painful if the other
// pin isn't there.  If we fail to create either pin we ensure we fail both.

CBasePin *
CTransInPlaceFilter::GetPin(int n)
{
    HRESULT hr = S_OK;

    // Create an input pin if not already done

    if (m_pInput == NULL) {

        m_pInput = new CTransInPlaceInputPin( NAME("TransInPlace input pin")
                                            , this        // Owner filter
                                            , &hr         // Result code
                                            , L"Input"    // Pin name
                                            );

        // Constructor for CTransInPlaceInputPin can't fail
        ASSERT(SUCCEEDED(hr));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草伊人久久| 国产精品久久久久一区二区三区共| 成人免费毛片片v| 国产麻豆精品theporn| 美国十次了思思久久精品导航| 亚洲亚洲人成综合网络| 亚洲国产精品v| 1区2区3区国产精品| 欧美国产日韩精品免费观看| 久久久蜜臀国产一区二区| 欧美不卡一区二区三区| 精品少妇一区二区三区| 久久嫩草精品久久久久| 欧美肥妇free| 欧美一级国产精品| 欧美成人午夜电影| 久久免费偷拍视频| 日本一区二区视频在线观看| 国产女同性恋一区二区| 国产精品欧美综合在线| 亚洲美女视频在线观看| 亚洲福利视频三区| 久久国产视频网| 国产精品一区二区男女羞羞无遮挡| 国产老妇另类xxxxx| aaa欧美色吧激情视频| 欧美专区日韩专区| 日韩免费在线观看| 国产精品入口麻豆九色| 亚洲欧美aⅴ...| 日本伊人精品一区二区三区观看方式| 蜜桃传媒麻豆第一区在线观看| 精品在线一区二区三区| 成人av免费在线观看| 欧洲视频一区二区| 精品国内二区三区| 亚洲欧美日韩一区二区三区在线观看| 一区二区激情视频| 国产一区二区调教| 一本到高清视频免费精品| 欧美三片在线视频观看| 久久精品免费在线观看| 亚洲一区二区三区美女| 国产精品影视网| 欧美体内she精视频| 久久精品一区二区三区不卡牛牛 | 日韩成人精品在线| 黄色小说综合网站| 日本韩国精品在线| 精品91自产拍在线观看一区| 国产精品久久久久久久第一福利 | 成人的网站免费观看| 欧美日韩精品高清| 国产精品麻豆视频| 精品在线免费视频| 欧美羞羞免费网站| 国产精品乱人伦中文| 日本免费在线视频不卡一不卡二| 99久久久免费精品国产一区二区 | 成人网在线免费视频| 欧美日韩国产a| 亚洲欧美一区二区三区国产精品| 久久福利资源站| 欧美精品乱码久久久久久按摩| ...av二区三区久久精品| 久久国产夜色精品鲁鲁99| 欧美色爱综合网| 一区二区三区成人| 97超碰欧美中文字幕| 国产亚洲一本大道中文在线| 蜜臀久久99精品久久久久久9| 在线观看一区二区视频| 国产精品国产三级国产普通话三级| 久久99精品一区二区三区| 欧美久久久久久久久久 | 欧美午夜不卡在线观看免费| 国产精品福利一区二区三区| 国产精选一区二区三区| 精品电影一区二区三区 | 中文字幕亚洲一区二区av在线| 九一久久久久久| 日韩女优制服丝袜电影| 日日骚欧美日韩| 欧美久久久一区| 日韩精品国产精品| 日韩一区二区三区三四区视频在线观看| 樱桃视频在线观看一区| 欧美性色黄大片| 亚洲五码中文字幕| 欧美精品黑人性xxxx| 男女性色大片免费观看一区二区| 91精品欧美久久久久久动漫| 日韩影院精彩在线| 精品国产一区二区三区久久影院 | 欧洲人成人精品| 亚洲一二三级电影| 日韩一区二区三区视频| 国产精品白丝av| 国产精品久久福利| 色婷婷一区二区三区四区| 午夜成人在线视频| 欧美成人一区二区三区在线观看| 国产美女视频91| 综合久久久久久| 精品视频色一区| 麻豆精品视频在线观看| 国产欧美精品一区二区色综合 | 欧美中文字幕一区二区三区| 亚洲国产一区二区视频| 日韩精品资源二区在线| 成人av在线一区二区三区| 一区二区三区四区中文字幕| 91精品国产综合久久精品麻豆| 激情小说欧美图片| 亚洲午夜羞羞片| 久久亚洲私人国产精品va媚药| 不卡av电影在线播放| 日韩电影在线一区| 国产偷国产偷亚洲高清人白洁| 欧美亚洲一区三区| 国产美女精品一区二区三区| 亚洲免费在线观看视频| 2023国产精品| 欧洲一区二区三区在线| 国产福利精品导航| 日日夜夜精品免费视频| 综合色中文字幕| www国产精品av| 欧美视频第二页| av电影天堂一区二区在线 | 亚洲精品在线免费观看视频| 色综合久久中文综合久久97| 国模无码大尺度一区二区三区| 亚洲精品视频在线观看网站| 久久久精品黄色| 日韩西西人体444www| 色偷偷久久一区二区三区| 国产高清一区日本| 青娱乐精品视频在线| 亚洲宅男天堂在线观看无病毒| 久久精品亚洲麻豆av一区二区| 在线播放国产精品二区一二区四区| 国产成人精品午夜视频免费| 久久99久久久久| 日韩精品国产精品| 亚洲va欧美va人人爽午夜| 亚洲视频狠狠干| 国产精品看片你懂得| 久久亚洲一级片| 久久久不卡网国产精品一区| 精品成人一区二区| 日韩欧美三级在线| 日韩一级高清毛片| 日韩午夜av电影| 日韩一级欧美一级| 日韩欧美成人激情| 精品久久五月天| 久久综合色婷婷| 国产亚洲精品超碰| 国产精品你懂的| 亚洲日本青草视频在线怡红院| 国产精品第四页| 亚洲精品亚洲人成人网| 亚洲一区在线视频| 亚洲超碰精品一区二区| 日韩成人一级片| 精品在线播放免费| 国产成人免费在线视频| 成人午夜精品在线| 色婷婷综合在线| 欧美电影影音先锋| 精品处破学生在线二十三| 国产网红主播福利一区二区| 国产视频视频一区| 色妞www精品视频| 亚洲永久精品国产| 一区二区三区欧美视频| 国产日韩视频一区二区三区| 国产精品拍天天在线| 自拍偷拍国产亚洲| 亚洲二区在线观看| 久久国产综合精品| 成人高清免费在线播放| 欧美性感一类影片在线播放| 欧美精品 日韩| 国产丝袜在线精品| 亚洲品质自拍视频| 麻豆成人av在线| 成人av免费在线观看| 在线视频综合导航| 日韩精品一区二区三区swag| 国产精品入口麻豆九色| 午夜久久福利影院| 国产成人综合在线观看| 欧美在线看片a免费观看| 欧美大片在线观看一区二区| 日韩一区在线免费观看| 免费看日韩a级影片| proumb性欧美在线观看| 777xxx欧美|