⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsutil.pas

📁 摄像头视频捕捉程序
💻 PAS
📖 第 1 页 / 共 2 页
字号:
      EC_DVD_AUDIO_STREAM_CHANGE       : result:= 'EC_DVD_AUDIO_STREAM_CHANGE - Signals that the current audio stream number changed for the main title.';
      EC_DVD_BUTTON_AUTO_ACTIVATED     : result:= 'EC_DVD_BUTTON_AUTO_ACTIVATED - Signals that a menu button has been automatically activated per instructions on the disc.';
      EC_DVD_BUTTON_CHANGE             : result:= 'EC_DVD_BUTTON_CHANGE - Signals that either the number of available buttons changed or that the currently selected button number changed.';
      EC_DVD_CHAPTER_AUTOSTOP          : result:= 'EC_DVD_CHAPTER_AUTOSTOP - Indicates that playback stopped as the result of a call to the IDvdControl2::PlayChaptersAutoStop method.';
      EC_DVD_CHAPTER_START             : result:= 'EC_DVD_CHAPTER_START - Signals that the DVD Navigator started playback of a new chapter in the current title.';
      EC_DVD_CMD_START                 : result:= 'EC_DVD_CMD_START - Signals that a particular command has begun.';
      EC_DVD_CMD_END                   : result:= 'EC_DVD_CMD_END - Signals that a particular command has completed.';
      EC_DVD_CURRENT_HMSF_TIME         : result:= 'EC_DVD_CURRENT_HMSF_TIME - Signals the current time in DVD_HMSF_TIMECODE format at the beginning of every VOBU, which occurs every .4 to 1.0 sec.';
      EC_DVD_CURRENT_TIME              : result:= 'EC_DVD_CURRENT_TIME - Signals the beginning of every video object unit (VOBU), a video segment which is 0.4 to 1.0 seconds in length.';
      EC_DVD_DISC_EJECTED              : result:= 'EC_DVD_DISC_EJECTED - Signals that a disc has been ejected from the drive.';
      EC_DVD_DISC_INSERTED             : result:= 'EC_DVD_DISC_INSERTED - Signals that a disc has been inserted into the drive.';
      EC_DVD_DOMAIN_CHANGE             : result:= 'EC_DVD_DOMAIN_CHANGE - Indicates the DVD Navigator''s new domain.';
      EC_DVD_ERROR                     : result:= 'EC_DVD_ERROR - Signals a DVD error condition.';
      EC_DVD_KARAOKE_MODE              : result:= 'EC_DVD_KARAOKE_MODE - Indicates that the Navigator has either begun playing or finished playing karaoke data.';
      EC_DVD_NO_FP_PGC                 : result:= 'EC_DVD_NO_FP_PGC - Indicates that the DVD disc does not have a FP_PGC (First Play Program Chain).';
      EC_DVD_PARENTAL_LEVEL_CHANGE     : result:= 'EC_DVD_PARENTAL_LEVEL_CHANGE - Signals that the parental level of the authored content is about to change.';
      EC_DVD_PLAYBACK_RATE_CHANGE      : result:= 'EC_DVD_PLAYBACK_RATE_CHANGE - Indicates that a playback rate change has been initiated and the new rate is in the parameter.';
      EC_DVD_PLAYBACK_STOPPED          : result:= 'EC_DVD_PLAYBACK_STOPPED - Indicates that playback has been stopped. The DVD Navigator has completed playback of the title and did not find any other branching instruction for subsequent playback.';
      EC_DVD_PLAYPERIOD_AUTOSTOP       : result:= 'EC_DVD_PLAYPERIOD_AUTOSTOP - Indicates that the Navigator has finished playing the segment specified in a call to PlayPeriodInTitleAutoStop.';
      EC_DVD_STILL_OFF                 : result:= 'EC_DVD_STILL_OFF - Signals the end of any still.';
      EC_DVD_STILL_ON                  : result:= 'EC_DVD_STILL_ON - Signals the beginning of any still.';
      EC_DVD_SUBPICTURE_STREAM_CHANGE  : result:= 'EC_DVD_SUBPICTURE_STREAM_CHANGE - Signals that the current subpicture stream number changed for the main title.';
      EC_DVD_TITLE_CHANGE              : result:= 'EC_DVD_TITLE_CHANGE - Indicates when the current title number changes.';
      EC_DVD_VALID_UOPS_CHANGE         : result:= 'EC_DVD_VALID_UOPS_CHANGE - Signals that the available set of IDVDControl2 interface methods has changed.';
      EC_DVD_WARNING                   : result:= 'EC_DVD_WARNING - Signals a DVD warning condition.'
    else
      result := 'Unknow Graph Event!';
    end;
  end;

  function IntToBin(Value: LongInt; Digits: Integer): String;
  var
   i: Integer;
  begin
   Result:='';
   for i:=Digits downto 0 do
    if Value and (1 shl i)<>0 then
     Result:=Result + '1'
    else
     Result:=Result + '0';
  end;

   function IntToUOPS(value : longint):TUOPS;
  var temp : string;
  begin
    temp := inttobin(value,24);
  with result do
  begin
     TitlePlay                          := (copy(temp,3,1)='1'); //2
     ChapterPlay                        := (copy(temp,2,1)='1'); //1
     TimePlay                           := (copy(temp,1,1)='1'); //0
     StopForResume                      := (copy(temp,4,1)='1'); //3
     GoUp                               := (copy(temp,5,1)='1'); //4
     TimeSearch                         := (copy(temp,1,1)='1')and(copy(temp,6,1)='1'); //0,5
     ChapterSearch                      := (copy(temp,2,1)='1')and(copy(temp,6,1)='1'); //1,5
     PrevPGSearch                       := (copy(temp,7,1)='1'); //6
     TopPGSearch                        := (copy(temp,7,1)='1'); //6
     NextPGSearch                       := (copy(temp,8,1)='1'); //7
     ForwardScan                        := (copy(temp,9,1)='1'); //8
     BackwardScan                       := (copy(temp,10,1)='1'); //9
     MenuCall_Title_Menu                := (copy(temp,11,1)='1'); //10
     MenuCall_Root_Menu                 := (copy(temp,12,1)='1'); //11
     MenuCall_Sub_picture_Menu          := (copy(temp,13,1)='1'); //12
     MenuCall_Audio_Menu                := (copy(temp,14,1)='1'); //13
     MenuCall_Angle_Menu                := (copy(temp,15,1)='1'); //14
     MenuCall_Chapter_Menu              := (copy(temp,16,1)='1'); //15
     Resume                             := (copy(temp,17,1)='1'); //16
     UpperButtonSelect                  := (copy(temp,18,1)='1'); //17
     LowerButtonSelect                  := (copy(temp,18,1)='1'); //17
     LeftButtonSelect                   := (copy(temp,18,1)='1'); //17
     RightButtonSelect                  := (copy(temp,18,1)='1'); //17
     ButtonActivate                     := (copy(temp,18,1)='1'); //17
     ButtonSelectAndActivate            := (copy(temp,18,1)='1'); //17
     StillOff                           := (copy(temp,19,1)='1'); //18
     PauseOn                            := (copy(temp,20,1)='1'); //19
     PauseOff                           := (copy(temp,20,1)='1'); //19
     AudioStreamChange                  := (copy(temp,21,1)='1'); //20
     SubpictureStreamChange             := (copy(temp,22,1)='1'); //21
     AngleChange                        := (copy(temp,23,1)='1'); //22
     KaraokeAudioPresentationModeChange := (copy(temp,24,1)='1'); //23
     VideoModePreferrence               := (copy(temp,25,1)='1'); //24
  end;
  end;

  function IntToTimeCode(x : longint): TDVD_TimeCode;
  var
     tc : TDVD_TimeCode;
     str: string;
  begin
    str := IntToBin(x,31);
    tc.Hours1        := bintoint(copy(str,29,4));
    tc.Hours10       := bintoint(copy(str,25,4));
    tc.Minutes1      := bintoint(copy(str,21,4));
    tc.Minutes10     := bintoint(copy(str,17,4));
    tc.Seconds1      := bintoint(copy(str,13,4));
    tc.Seconds10     := bintoint(copy(str,9,4));
    tc.Frames1       := bintoint(copy(str,5,4));
    tc.Frames10      := bintoint(copy(str,3,2));
    tc.FrameRateCode := bintoint(copy(str,1,2));
    result := tc;
end;

  function BinToInt(Value: String): LongInt;
  var
     i,Digits: Integer;
     p : array[0..3]of integer;
  begin
     Result:=0;
     p[0]:=1;p[1]:=2;p[2]:=4;p[3]:=8;
     Digits:=Length(Value);
     for i := 1 to digits do
       begin
         if copy(value,i,1) = '1' then result := result+p[digits-i];
       end;
  end;

  function TimeCodeToFrames(value : TDVD_TimeCode): longint;
  var
    frate : integer;
  begin
    case value.FrameRateCode of
      1 : frate := 25;
      3 : frate := 30;
    else
      frate := 0;
    end;
    result := ( (value.Hours1+value.Hours10*10)*3600 +(value.Minutes1+value.Minutes10*10)*60 +value.Seconds1+value.Seconds10*10)*frate+value.Frames1+value.Frames10*10;
  end;

  function ShowFilterPropertyPage(Filter: IBaseFilter): HRESULT;
  var
    SpecifyPropertyPages : ISpecifyPropertyPages;
    CAGUID  :TCAGUID;
    FilterInfo: TFilterInfo;
  begin
    result := S_FALSE;
    if Filter = nil then exit;
    result := Filter.QueryInterface(IID_ISpecifyPropertyPages, SpecifyPropertyPages);
    if result <> S_OK then exit;
    result := SpecifyPropertyPages.GetPages(CAGUID);
    if result <> S_OK then exit;
    result := Filter.QueryFilterInfo(FilterInfo);
    if result <> S_OK then exit;
    result := OleCreatePropertyFrame(0, 0, 0, FilterInfo.achName, 1, @Filter, CAGUID.cElems, CAGUID.pElems, 0, 0, nil );
  end;

  function AddGraphToRot(Graph: IFilterGraph; out dwRegister: Longint): HRESULT;
  var Moniker: IMoniker;
      ROT    : IRunningObjectTable;
      wsz    : string[255];
  begin
    result := GetRunningObjectTable(0, ROT);
    if (result <> S_OK) then exit;
    wsz := format('FilterGraph %p pid %x',[pointer(graph),GetCurrentProcessId()]);
    result  := CreateItemMoniker('!', StringToOleStr(wsz), Moniker);
    if (result <> S_OK) then exit;
    result  := ROT.Register(0, Graph, Moniker, dwRegister);
  end;

  function RemoveGraphFromRot(dwRegister: longint): HRESULT;
  var ROT: IRunningObjectTable;
  begin
    result := GetRunningObjectTable(0, ROT);
    if (result <> S_OK) then exit;
    result := ROT.Revoke(dwRegister);
  end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -