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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? netwrite.pas

?? 一套及時(shí)通訊的原碼
?? PAS
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
unit NetWrite;

interface
uses Windows, wmf9, SysUtils, activex, Classes;

const
  NETWRITE_ASYNC_EVENT	: PCHAR = '{6d12fe9b-d029-4d08-b2eb-92c8cab323c7}';

type

  TWMFNetWrite = class(TObject, IWMReaderCallback, IWMReaderCallbackAdvanced)
  public
    constructor Create;

    destructor  Destroy; override;
    function    Configure(dwPortNum: DWORD; const pwszFile: PWideChar; nMaxClient: cardinal): HRESULT;
    function    WritetoNet: HRESULT;
    function    Init: HRESULT;

    //Methods of IWMReaderCallback

    function OnSample(dwOutputNum: DWORD; cnsSampleTime, cnsSampleDuration: int64;
               dwFlags: DWORD; pSample: INSSBuffer; pvContext: pointer): HRESULT; stdcall;
    function OnStatus(Status: TWMTSTATUS; hr: HRESULT; dwType: TWMTATTRDATATYPE;
               pValue: PBYTE; pvContext: pointer): HRESULT; stdcall;

    //Methhods of IWMReaderCallbackAdvanced

    // Receive a sample directly from the ASF. To get this call, the user
    // must register himself to receive samples for a particular stream.
    function OnStreamSample(wStreamNum: WORD; cnsSampleTime, cnsSampleDuration: int64;
               dwFlags: DWORD; pSample: INSSBuffer; pvContext: pointer): HRESULT; stdcall;

    // In some cases, the user may want to get callbacks telling what the
    // reader thinks the current time is. This is interesting in 2 cases:
    // - If the ASF has gaps in it; say no audio for 10 seconds. This call
    //   will continue to be called, while OnSample won't be called.
    // - If the user is driving the clock, the reader needs to communicate
    //   back to the user its time, to avoid the user overrunning the reader.
    function OnTime(cnsCurrentTime: int64; pvContext: pointer): HRESULT; stdcall;

    // The user can also get callbacks when stream selection occurs.
    function OnStreamSelection(wStreamCount: Word; pStreamNumbers: PWord;
                               pSelections: PWMTSTREAMSELECTION; pvContext: Pointer): HResult; stdcall;
    // Will be called if the user got an async result from their
    // call to SetOutputProps.  The next sample you receive for
    // this output will have these properties.  The contents of the
    // media type after calling SetOutputProps and before receiving
    // an OutputPropsChanged notification are undefined.
    function OnOutputPropsChanged(dwOutputNum: DWORD; pMediaType: PWMMediaType;
               pvContext: pointer): HRESULT; stdcall;


    // If the user has registered to allocate buffers, this is where he must
    // do it.
    function AllocateForStream(wStreamNum: WORD; cbBuffer: DWORD; out ppBuffer: INSSBuffer;
               pvContext: pointer): HRESULT; stdcall;

    function AllocateForOutput(dwOutputNum, cbBuffer: DWORD; out ppBuffer: INSSBuffer;
               pvContext: pointer): HRESULT; stdcall;

    function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
    function _AddRef: Integer; stdcall;
    function _Release: Integer; stdcall;
  private
    function WriteHeader (const pwszName: PWideChar): HRESULT;
    function WriteScript: HRESULT;
  private
    m_hEvent            : THANDLE;
    m_hrAsync           : HRESULT;
    m_qwTime            : Int64;
    m_pWriterAdvanced   : IWMWriterAdvanced;
    m_pReaderAdvanced   : IWMReaderAdvanced;
    m_pReader           : IWMReader;
    m_pWriter           : IWMWriter;
    m_pNetSink          : IWMWriterNetworkSink;
    m_bEOF              : bool;
    m_pReaderHeaderInfo : IWMHeaderInfo;
    m_pWriterHeaderInfo : IWMHeaderInfo;
  public
    function CloseAll: HRESULT;
  end;

implementation

  constructor TWMFNetWrite.Create;
  begin
    m_pReaderHeaderInfo := nil;
    m_pWriterHeaderInfo := nil;
    m_pWriterAdvanced   := nil;
    m_pReaderAdvanced   := nil;
    m_pReader           := nil;
    m_pWriter           := nil;
    m_pNetSink          := nil;
    m_hEvent            := 0;
    m_bEOF              := false;
    m_qwTime            := 0;
    m_hrAsync           := S_OK;
  end;

  destructor TWMFNetWrite.Destroy;
  begin
    CloseAll;
    CloseHandle(m_hEvent);
    m_pWriterAdvanced := nil;
    m_pWriter := nil;
    m_pNetSink := nil;
    m_pReaderAdvanced := nil;
    m_pReader := nil;
    inherited destroy;
  end;

  function TWMFNetWrite.Configure(dwPortNum: DWORD; const pwszFile: PWideChar; nMaxClient: cardinal): HRESULT;
  var
    pProfile : IWMProfile;
    pStream  : IWMStreamConfig;
    err, cchURL, dwStreams, i, cInputs : DWORD;
    pwszURL : PWideChar;
    wStreamNumber: WORD;
  begin
    if((dwPortNum = 0) or (pwszFile = nil)) then
    begin
      result := E_INVALIDARG;
      exit;
    end;

    if ((m_pWriterAdvanced = nil) or (m_pReaderAdvanced = nil) or (m_pNetSink = nil)) then
    begin
      result := E_UNEXPECTED;
      exit;
    end;

    // Create event for handling asynchronous calls
    result   := S_OK;
    pProfile := nil;
    pStream  := nil;

    m_hrAsync := S_OK;

    m_hEvent := CreateEvent(nil, FALSE, FALSE, NETWRITE_ASYNC_EVENT);
    if (m_hEvent = 0) then
    begin
      err := GetLastError;
      writeln(format('Could not Create Event: (hr=$%x)',[err]));
      result := err;
      exit;
    end;

    // Configure the Net Sink
    result := m_pNetSink.SetNetworkProtocol(WMT_PROTOCOL_HTTP);
    if (FAILED(result)) then
    begin
      writeln('Could not Set Network protocol');
      exit;
    end;

    result := m_pNetSink.Open(dwPortNum);
    if (FAILED(result)) then
    begin
      writeln(format('Network sink failed to open port no %d',[dwPortNum]));
      exit;
    end; 

    cchURL := 0;

    result := m_pNetSink.GetHostURL(nil, cchURL);
    if(FAILED(result)) then
    begin
      writeln('Could not get the host URL from IWMWriterNEtworkSink');
      exit;
    end;
     

    getmem(pwszURL, cchURL * sizeof(WCHAR));
    if (pwszURL = nil) then
    begin
      result := E_OUTOFMEMORY; // Insufficient Memory
      exit;
    end;

    result := m_pNetSink.GetHostURL(pwszURL, cchURL);
    if (FAILED(result)) then
    begin
      writeln('Could not get the host URL from IWMWriterNEtworkSink');
      FreeMem(pwszURL);
      exit;
    end;

    writeln('Connect to '+pwszURL);
 //   Sleep(1000);

    FreeMem(pwszURL);

    // Set the max no of clients that can connect to the port
    result := m_pNetSink.SetMaximumClients(nMaxClient);
    if (FAILED(result)) then
    begin
      writeln('Could not Set maximum clients');
      exit;
    end;

    // Add the network sink to the Writer Advanced
    result := m_pWriterAdvanced.AddSink(m_pNetSink);
    if (FAILED(result)) then
    begin
      writeln('Could not Add Sink');
      exit;
    end;   

    // Open the requested file
    result := m_pReader.Open(pwszFile, self, nil);
    if (FAILED(result)) then
    begin
      writeln('Could not open file');
      exit;
    end;

    // Wait for the open to finish
    WaitForSingleObject(m_hEvent, INFINITE);
    if (FAILED(m_hrAsync)) then
    begin
      writeln(format('Open failed (hr=$%x)',[m_hrAsync]));
      result := m_hrAsync;
      exit;
    end;

    // Turn on manual stream selection, so we get all streams.
    result := m_pReaderAdvanced.SetManualStreamSelection(TRUE);
    if (FAILED(result)) then
    begin
      writeln('Failed to set manual stream selection');
      exit;
    end; // 

    // Get the profile interface, loop thru all the
    // streams and request the reader to deliver compressed samples
    result := m_pReader.QueryInterface(IID_IWMProfile, pProfile);
    if (FAILED(result)) then
    begin
      writeln('Could not Query for IWMProfile');
      exit;
    end;   


    dwStreams := 0;
    result := pProfile.GetStreamCount(dwStreams);
    if (FAILED(result)) then
    begin
      writeln(format('GetStreamCount on IWMProfile failed (hr=$%x)', [result]));
      exit;
    end; 

    for i := 0 to dwStreams - 1 do
    begin
      result := pProfile.GetStream(i, pStream);
      if (FAILED(result)) then
      begin
        writeln(format('Could not get Stream %d of %d from IWMProfile (hr=0x%08x)',[i,dwStreams,result]));
        break;
      end;
      wStreamNumber := 0;
      //Get the stream number of the current stream
      result := pStream.GetStreamNumber(wStreamNumber);
      if (FAILED(result)) then
      begin
        writeln(format('Could not get stream number from IWMStreamConfig %d of %d (hr=$%x)',
			[i, dwStreams, result]));
        break;
      end;

      pStream := nil;

      //Set the stream to be recieved in compressed mode
      result := m_pReaderAdvanced.SetReceiveStreamSamples(wStreamNumber, TRUE);
      if (FAILED(result)) then
      begin
        writeln(format('Could not SetReceivedStreamSamples for stream number %d (hr=$%x)',
                       [wStreamNumber, result]));
        break;
      end;
    end;
    pStream := nil;
    if (FAILED(result)) then exit;

    // Turn on the user clock
    result := m_pReaderAdvanced.SetUserProvidedClock(TRUE);
    if (FAILED(result)) then
    begin
      writeln(format('SetUserProvidedClock failed (hr=$%x)', [result]));
      exit;
    end; 

    // Now set the writers properties
    result := m_pWriter.SetProfile(pProfile);
    if(FAILED(result)) then
    begin
      writeln(format('Could not set profile on IWMWriter (hr=$%x)',[result]));
      exit;
    end;

    pProfile := nil;

    cInputs := 0;

    result := m_pWriter.GetInputCount(cInputs);
    if(FAILED(result)) then
    begin
      writeln(format('Could not get input count from IWMWriter (hr=$%x)',[result]));
      exit;
    end;

    for i := 0 to cInputs -1 do
      // Set the input props to NULL to indicate that we don't need a codec
      // because we are writing compressed samples to the port
       m_pWriter.SetInputProps(i, nil);

    // Write all the header attributes, which can be set, from the
    // input file to the output port.
    result := WriteHeader(g_wszWMTitle);
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMAuthor) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMDescription) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMRating) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMCopyright) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMAlbumTitle) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMTrack) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMPromotionURL) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMAlbumCoverURL) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMGenre) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMYear) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMGenreID) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMMCDI) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMBannerImageType ) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMBannerImageData ) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMBannerImageURL ) ;
    if(FAILED(result)) then exit;

    result := WriteHeader( g_wszWMCopyrightURL ) ;
    if(FAILED(result)) then exit;

    //Header has been written. Lets write the script
    result := WriteScript;
  end;

  function TWMFNetWrite.WritetoNet: HRESULT;
  begin
    if ((m_hEvent          = 0)   or
        (m_pWriterAdvanced = nil) or
        (m_pReaderAdvanced = nil) or
        (m_pNetSink        = nil)) then
    begin
      result := E_UNEXPECTED;
      exit;
    end;
    // Start Writing
    result := m_pWriter.BeginWriting;
    if (FAILED(result)) then
    begin
      writeln(format('BeginWriting on IWMWriter failed (hr=$%x)',[result]));

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99久久久国产精品潘金| 亚洲欧美日韩久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 久久综合五月天婷婷伊人| 国产精品女人毛片| 亚洲国产精品精华液网站| 国产一区二区三区综合| 91香蕉视频污| 日韩精品自拍偷拍| 亚洲码国产岛国毛片在线| 欧美a级理论片| 91浏览器打开| 首页综合国产亚洲丝袜| 国产乱一区二区| 欧美私模裸体表演在线观看| 精品国产91久久久久久久妲己| 日韩一区在线免费观看| 久久爱www久久做| 91社区在线播放| 久久综合久久综合九色| 亚洲一区中文在线| 国产成人亚洲综合色影视| 欧美在线看片a免费观看| 久久久夜色精品亚洲| 亚洲高清免费观看| 成人免费观看视频| 日韩欧美在线综合网| 专区另类欧美日韩| 国产乱国产乱300精品| 欧美日韩视频在线一区二区| 国产欧美视频一区二区三区| 性感美女久久精品| 91美女精品福利| 国产欧美日韩中文久久| 日本亚洲电影天堂| 91高清视频免费看| 国产精品白丝在线| 国产成人免费视频网站高清观看视频| 欧美三级视频在线播放| 中文字幕在线播放不卡一区| 国模一区二区三区白浆| 欧美日韩一本到| 最新中文字幕一区二区三区| 国产麻豆精品在线| 日韩一级黄色片| 性做久久久久久久久| 一本一道久久a久久精品| 久久久青草青青国产亚洲免观| 免费国产亚洲视频| 欧美日韩午夜在线| 亚洲自拍另类综合| 色婷婷狠狠综合| 综合激情网...| eeuss鲁一区二区三区| 国产精品网站导航| 国产精品一区专区| 欧美va亚洲va香蕉在线| 日韩精品国产欧美| 欧美美女一区二区在线观看| 一区二区国产视频| 欧美在线一二三| 亚洲精品成人在线| 在线看日本不卡| 亚洲综合在线免费观看| 色久综合一二码| 亚洲精品视频在线观看网站| 色94色欧美sute亚洲线路一久| 亚洲欧洲一区二区在线播放| 成人av动漫在线| 欧美激情中文不卡| 不卡一区中文字幕| 中文字幕字幕中文在线中不卡视频| 成人av在线一区二区| 国产精品激情偷乱一区二区∴| 成人激情开心网| 亚洲柠檬福利资源导航| 91蜜桃免费观看视频| 亚洲精品午夜久久久| 欧美日韩一区二区三区视频| 日韩精品免费专区| 精品国产乱码久久久久久久久| 精品午夜一区二区三区在线观看| 久久亚洲春色中文字幕久久久| 国产精品夜夜爽| 国产精品久久久一区麻豆最新章节| 99re视频这里只有精品| 一区二区三区欧美日韩| 欧美日韩一区二区三区在线看 | 日韩一级视频免费观看在线| 蜜桃免费网站一区二区三区| 精品福利av导航| 高清shemale亚洲人妖| 亚洲免费观看高清完整版在线 | 视频一区二区国产| 日韩精品在线一区| 国产黄色91视频| 亚洲色图欧美激情| 欧美日韩亚洲不卡| 国内久久精品视频| 亚洲图片激情小说| 欧美一区二区三区日韩| 国产一区在线看| 亚洲欧美日韩国产手机在线| 欧美男生操女生| 国产剧情一区在线| 亚洲另类春色国产| 日韩视频在线观看一区二区| 国产98色在线|日韩| 亚洲一二三四在线| 精品久久国产老人久久综合| 成人av网站大全| 首页国产丝袜综合| 国产欧美一区二区在线| 欧美日韩国产乱码电影| 国产传媒欧美日韩成人| 亚洲一级片在线观看| 久久久精品tv| 欧美日本在线播放| 国产成人免费视频精品含羞草妖精 | 日本成人在线一区| 欧美激情自拍偷拍| 欧美蜜桃一区二区三区| 成人性生交大合| 日韩av一区二区在线影视| 国产精品天美传媒| 欧美一区二区三区小说| 99久久久国产精品免费蜜臀| 蜜桃在线一区二区三区| 亚洲免费观看高清在线观看| 欧美成人一区二区三区片免费| 91在线丨porny丨国产| 美女视频黄久久| 亚洲精品va在线观看| 国产三级精品在线| 88在线观看91蜜桃国自产| 不卡一区二区三区四区| 久久99国产精品成人| 伊人一区二区三区| 国产欧美日韩在线| 日韩一区国产二区欧美三区| 91女神在线视频| 国产福利一区在线观看| 日本不卡高清视频| 亚洲精品中文在线观看| 国产农村妇女精品| 日韩三级电影网址| 欧美偷拍一区二区| 91年精品国产| 成人黄页毛片网站| 国产一区二区三区免费播放| 亚洲电影一级片| 亚洲三级理论片| 国产精品欧美久久久久无广告| 精品国产一区二区三区久久久蜜月| 欧美日韩二区三区| 欧美亚洲日本一区| 一本高清dvd不卡在线观看| 成人av在线观| 成人免费毛片aaaaa**| 国产精一品亚洲二区在线视频| 日本欧美大码aⅴ在线播放| 亚洲成在人线免费| 亚洲国产人成综合网站| 一区二区三区av电影 | 欧洲一区二区三区在线| 99re成人精品视频| 成人黄页毛片网站| 成人app下载| 成人高清伦理免费影院在线观看| 国产在线精品免费| 精品无人区卡一卡二卡三乱码免费卡| 日本午夜精品视频在线观看| 无码av免费一区二区三区试看| 亚洲国产成人av网| 亚洲午夜av在线| 午夜精品免费在线观看| 亚洲国产综合色| 日韩专区中文字幕一区二区| 亚洲成va人在线观看| 午夜精品久久久久久久久久久| 亚洲制服丝袜av| 丝袜美腿亚洲一区二区图片| 日韩主播视频在线| 蜜桃视频免费观看一区| 精品亚洲成a人| 国产91对白在线观看九色| 高清不卡一二三区| 99久久精品免费| 欧美性猛片aaaaaaa做受| 欧美日韩一级大片网址| 91精品国产日韩91久久久久久| 日韩欧美一区在线| 精品国产露脸精彩对白| 亚洲国产电影在线观看| 亚洲人成网站精品片在线观看| 亚洲午夜精品在线| 奇米影视一区二区三区小说| 精品一区二区综合| 国产成人av电影在线观看| av亚洲精华国产精华精华 |