IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Delphi Discussion :

Pb depuis passage à win 8.1


Sujet :

Delphi

  1. #1
    Membre à l'essai
    Inscrit en
    Mars 2003
    Messages
    21
    Détails du profil
    Informations forums :
    Inscription : Mars 2003
    Messages : 21
    Points : 16
    Points
    16
    Par défaut Pb depuis passage à win 8.1
    Bonjour,

    j'utilise delphi 2010.
    J'ai un prog qui fonctionnait très bien sous win 7 : ce dernier me permettait d'afficher une vidéo dans un panel. On pouvait se déplacer dans le timing et voir l'affichage corrrespondant.
    Pour cela j'utilise l'unité evr.pas
    Depuis le passage à win 8.1, l'affichage ne se fait pas (le fond reste vierge).
    En revanche, la durée de la video est bien rapportée par un (FGraph as imediaposition).get_duration(posmax);

    L'initialisation se fait comme suit :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     if not Succeeded(CoCreateInstance(CLSID_FilterGraph, nil,
          CLSCTX_INPROC_SERVER, IID_IGraphBuilder, FGraph)) then
      begin
        MessageDlg('Could not create the Filtergraph', mtError, [mbOk], -1);
        exit;
      end;
      if not Succeeded(CoCreateInstance(CLSID_EnhancedVideoRenderer, nil,
          CLSCTX_INPROC, IID_IBaseFilter, FEVR)) then
      begin
        MessageDlg(
          'Could not create the Enhanced video renderer. Please check if evr.dll is installed and registered.', mtError, [mbOk], -1);
        exit;
      end;
      FGraph.AddFilter(FEVR, StringToOLESTR('EVR'));
      (FEVR as IMFGetService).GetService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl,FDisplayControl);
     
      FDisplayControl.SetVideoWindow(Panel1.Handle);
     
    FGraph.RenderFile(PWideChar(filename), nil);
    Merci pour votre aide.

  2. #2
    Expert éminent sénior
    Avatar de ShaiLeTroll
    Homme Profil pro
    Développeur C++\Delphi
    Inscrit en
    Juillet 2006
    Messages
    13 459
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Développeur C++\Delphi
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juillet 2006
    Messages : 13 459
    Points : 24 873
    Points
    24 873
    Par défaut
    tu utilises manuellement les interfaces Microsoft !
    Est-ce un extrait de evr.pas
    Est-ce celle du MFPack ?
    Ton "evr.pas" n'est-ce pas juste une série de déclaration des interfaces ?

    Pour comparer, très rapidement :

    As-tu essayé le TMediaPlayer, une encaspulation fourni par Embarcadero des fonctions vidéos de bases de Windows

    l'Active du Windows Media Player installé sur l'OS voir http://jlelong.developpez.com/articles/delphi/activex/windows-media-player/

    Evidement, il te faut les CODECS installés sur Windows, mais le 8.1 doit en avoir un tas par défaut de pré-installé !
    Aide via F1 - FAQ - Guide du développeur Delphi devant un problème - Pensez-y !
    Attention Troll Méchant !
    "Quand un homme a faim, mieux vaut lui apprendre à pêcher que de lui donner un poisson" Confucius
    Mieux vaut se taire et paraître idiot, Que l'ouvrir et de le confirmer !
    L'ignorance n'excuse pas la médiocrité !

    L'expérience, c'est le nom que chacun donne à ses erreurs. (Oscar Wilde)
    Il faut avoir le courage de se tromper et d'apprendre de ses erreurs

  3. #3
    Membre à l'essai
    Inscrit en
    Mars 2003
    Messages
    21
    Détails du profil
    Informations forums :
    Inscription : Mars 2003
    Messages : 21
    Points : 16
    Points
    16
    Par défaut
    Bonjour,

    merci pour votre réponse.
    Alors le morceau de code ci dessus est dans mon soft.
    Voici une copie du copie evr9.pas :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    *****************************************************************}
    {                                                                 }
    {            CodeGear Delphi Runtime Library                      }
    {            EVR9.pas interface unit                              }
    {                                                                 }
    {            Copyright (c) 2007 Sebastian Zierer                  }
    {            Converted 20 Feb 2007 Sebastian Zierer               }
    {            Last modified 19 Apr 2007 Sebastian Zierer           }
    {            Version 1.0                                          }
    {                                                                 }
    {*****************************************************************}
     
    {*****************************************************************}
    {                                                                 }
    { The contents of this file are subject to the Mozilla Public     }
    { License Version 1.1 (the "License"). you may not use this file  }
    { except in compliance with the License. You may obtain a copy of }
    { the License at <a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>          }
    {                                                                 }
    { Software distributed under the License is distributed on an     }
    { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or  }
    { implied. See the License for the specific language governing    }
    { rights and limitations under the License.                       }
    {                                                                 }
    {  The original files are:                                        }
    {    evr.idl                                                      }
    {                                                                 }
    { The original code is: EVR9.pas, released 20 January 2007        }
    {                                                                 }
    { The initial developer of the Pascal code is                     }
    { Sebastian Zierer.                                               }
    {                                                                 }
    { Portions created by Microsoft are                               }
    { Copyright (C) 1995-2006 Microsoft Corporation.                  }
    {                                                                 }
    { Portions created by Sebastian Zierer are                        }
    { Copyright (C) 2007 Sebastian Zierer                             }
    { All Rights Reserved.                                            }
    {                                                                 }
    { Contributor(s):                                                 }
    {                                                                 }
    { Notes:                                                          }
    {                                                                 }
    { Modification history:                                           }
    {                                                                 }
    { Known Issues:                                                   }
    {                                                                 }
    {*****************************************************************}
     
    unit EVR9;
     
    interface
     
    uses
      Windows, ActiveX, DirectShow9;
     
    {$MINENUMSIZE 4}
     
    {$IFNDEF conditionalexpressions}
      {$DEFINE norecprocs}          // Delphi 5 or less
    {$ENDIF}
     
    {$IFDEF conditionalexpressions} // Delphi 6+
      {$IF compilerversion < 18}    // Delphi 2005 or less
        {$DEFINE norecprocs}     
      {$IFEND}
    {$ENDIF}
     
     
    //=============================================================================
    // Description:
    //
    //  Service GUID used by IMFGetService::GetService to retrieve interfaces from
    //  the renderer or the presenter.
    //
    const
      SID_IMFVideoProcessor = '{6AB0000C-FECE-4d1f-A2AC-A9573530656E}';
      SID_IMFVideoMixerBitmap = '{814C7B20-0FDB-4eec-AF8F-F957C8F69EDC}';
      SID_IMFStreamSink = '{6ef2a660-47c0-4666-b13d-cbb717f2fa2c}';
      SID_IEVRFilterConfig = '{83E91E85-82C1-4EA7-801D-85DC50B75086}';
      SID_IMFVideoDisplayControl = '{A490B1E4-AB84-4D31-A1B2-181E03B1077A}';
      SID_IMFDesiredSample = '{56C294D0-753E-4260-8D61-A3D8820B1D54}';
      SID_IMFVideoPositionMapper = '{1F6A9F17-E70B-4E24-8AE4-0B2C3BA7A4AE}';
      SID_IMFVideoDeviceID = '{A38D9567-5A9C-4F3C-B293-8EB415B279BA}';
      SID_IMFVideoMixerControl = '{A5C6C53F-C202-4AA5-9695-175BA8C508A5}';
      SID_IMFGetService = '{FA993888-4383-415A-A930-DD472A8CF6F7}';
      SID_IMFVideoRenderer = '{DFDFD197-A9CA-43D8-B341-6AF3503792CD}';
      SID_IMFTrackedSample = '{245BF8E9-0755-40F7-88A5-AE0F18D55E17}';
      SID_IMFTopologyServiceLookup = '{fa993889-4383-415a-a930-dd472a8cf6f7}';
      SID_IMFTopologyServiceLookupClient = '{fa99388a-4383-415a-a930-dd472a8cf6f7}';
      SID_IEVRTrustedVideoPlugin = '{83A4CE40-7710-494b-A893-A472049AF630}';
     
    var
      IID_IMFTrackedSample: TGUID = SID_IMFTrackedSample;
      IID_IMFVideoDisplayControl: TGUID = SID_IMFVideoDisplayControl; // GetService MR_VIDEO_RENDER_SERVICE
      IID_IMFVideoPresenter: TGUID = '{29AFF080-182A-4A5D-AF3B-448F3A6346CB}';
      IID_IMFVideoPositionMapper: TGUID = SID_IMFVideoPositionMapper; // GetService MR_VIDEO_RENDER_SERVICE
      IID_IMFDesiredSample: TGUID = SID_IMFDesiredSample;
      IID_IMFVideoMixerControl: TGUID = SID_IMFVideoMixerControl;     // GetService MR_VIDEO_MIXER_SERVICE
      IID_IMFVideoRenderer: TGUID = SID_IMFVideoRenderer;
      IID_IMFVideoDeviceID: TGUID = SID_IMFVideoDeviceID;
      IID_IEVRFilterConfig: TGUID = SID_IEVRFilterConfig;
      IID_IMFTopologyServiceLookup: TGUID = SID_IMFTopologyServiceLookup;
      IID_IMFTopologyServiceLookupClient: TGUID = SID_IMFTopologyServiceLookupClient;
      IID_IEVRTrustedVideoPlugin: TGUID = SID_IEVRTrustedVideoPlugin;
     
      CLSID_EnhancedVideoRenderer: TGUID = '{FA10746C-9B63-4B6C-BC49-FC300EA5F256}';
      CLSID_MFVideoMixer9: TGUID = '{E474E05A-AB65-4f6A-827C-218B1BAAF31F}';
      CLSID_MFVideoPresenter9: TGUID = '{98455561-5136-4D28-AB08-4CEE40EA2781}';
      CLSID_EVRTearlessWindowPresenter9: TGUID = '{A0A7A57B-59B2-4919-A694-ADD0A526C373}';
     
      MR_VIDEO_RENDER_SERVICE: TGUID = '{1092A86c-AB1A-459A-A336-831FBC4D11FF}';
      MR_VIDEO_MIXER_SERVICE: TGUID =        '{073cd2fc-6cf4-40b7-8859-e89552c841f8}';
      MR_VIDEO_ACCELERATION_SERVICE: TGUID = '{efef5175-5c7d-4ce2-bbbd-34ff8bca6554}';
      MR_BUFFER_SERVICE: TGUID =             '{a562248c-9ac6-4ffc-9fba-3af8f8ad1a4d}';
     
      VIDEO_ZOOM_RECT: TGUID = '{7aaa1638-1b7f-4c93-bd89-5b9c9fb6fcf0}';
     
     
    type
      IMFVideoPositionMapper = interface(IUnknown)
        [SID_IMFVideoPositionMapper]
        function MapOutputCoordinateToInputStream(
          xOut: Single; yOut: Single; dwOutputStreamIndex: DWORD;
          dwInputStreamIndex: DWORD; out pxIn: Single; out pyIn: Single): HResult; stdcall;
      end;
     
      IMFVideoDeviceID = interface(IUnknown)
        [SID_IMFVideoDeviceID]
        function GetDeviceID(out pDeviceID: TIID): HResult; stdcall;
      end;
     
    const
      MFVideoARMode_None             = $00000000;
      MFVideoARMode_PreservePicture  = $00000001;
      MFVideoARMode_PreservePixel    = $00000002;
      MFVideoARMode_NonLinearStretch = $00000004;
      MFVideoARMode_Mask             = $00000007;
     
    //=============================================================================
    // Description:
    //
    //  The rendering preferences used by the video presenter object.
    //
    const  // MFVideoRenderPrefs
      // Do not paint color keys (default off)
      MFVideoRenderPrefs_DoNotRenderBorder           = $00000001;
      // Do not clip to monitor that has largest amount of video (default off)
      MFVideoRenderPrefs_DoNotClipToDevice           = $00000002;
      MFVideoRenderPrefs_Mask                        = $00000003;
     
    type
      PMFVideoNormalizedRect = ^TMFVideoNormalizedRect;
      TMFVideoNormalizedRect = record
        left: Single;
        top: Single;
        right: Single;
        bottom: Single;
        {$IFNDEF norecprocs}
        procedure Init(ALeft, ATop, ARight, ABottom: Single);
        {$ENDIF}
      end;
     
    type
      IMFVideoDisplayControl = interface(IUnknown)
        [SID_IMFVideoDisplayControl]
        function GetNativeVideoSize({unique} out pszVideo: TSIZE; {unique} out pszARVideo: TSIZE): HResult; stdcall;
        function GetIdealVideoSize({unique} out pszMin: TSIZE; {unique} out pszMax: TSIZE): HResult; stdcall;
        function SetVideoPosition({unique} pnrcSource: PMFVideoNormalizedRect; {unique} prcDest: PRECT): HResult; stdcall;
        function GetVideoPosition(out pnrcSource: TMFVideoNormalizedRect; out prcDest: TRECT): HResult; stdcall;
        function SetAspectRatioMode(dwAspectRatioMode: DWORD): HResult; stdcall;
        function GetAspectRatioMode(out pdwAspectRatioMode: DWORD): HResult; stdcall;
        function SetVideoWindow(hwndVideo: HWND): HResult; stdcall;
        function GetVideoWindow(out phwndVideo: HWND): HResult; stdcall;
        function RepaintVideo: HResult; stdcall;
        function GetCurrentImage(pBih: PBITMAPINFOHEADER; out lpDib; out pcbDib: DWORD; {unique} pTimeStamp: PInt64): HResult; stdcall;
        function SetBorderColor(Clr: COLORREF): HResult; stdcall;
        function GetBorderColor(out pClr: COLORREF): HResult; stdcall;
        function SetRenderingPrefs(dwRenderFlags: DWORD): HResult; stdcall; // a combination of MFVideoRenderPrefs
        function GetRenderingPrefs(out pdwRenderFlags: DWORD): HResult; stdcall;
        function SetFullscreen(fFullscreen: Boolean): HResult; stdcall;
        function GetFullscreen(out pfFullscreen: Boolean): HResult; stdcall;
      end;
     
    //=============================================================================
    // Description:
    //
    //  The different message types that can be passed to the video presenter via
    //  IMFVideoPresenter::ProcessMessage.
    //
      TMFVP_MESSAGE_TYPE = (
        // Called by the video renderer when a flush request is received on the
        // reference video stream. In response, the presenter should clear its
        // queue of samples waiting to be presented.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_FLUSH = $00000000,
        // Indicates to the presenter that the current output media type on the
        // mixer has changed. In response, the presenter may now wish to renegotiate
        // the media type of the video mixer.
        // Return Values:
        //  S_OK - successful completion
        //  MF_E_INVALIDMEDIATYPE - The presenter and mixer could not agree on
        //      a media type.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_INVALIDATEMEDIATYPE  = $00000001,
        // Indicates that a sample has been delivered to the video mixer object,
        // and there may now be a sample now available on the mixer's output. In
        // response, the presenter may want to draw frames out of the mixer's
        // output.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_PROCESSINPUTNOTIFY  = $00000002,
        // Called when streaming is about to begin. In
        // response, the presenter should allocate any resources necessary to begin
        // streaming.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_BEGINSTREAMING = $00000003,
        // Called when streaming has completed. In
        // response, the presenter should release any resources that were
        // previously allocated for streaming.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_ENDSTREAMING = $00000004,
        // Indicates that the end of this segment has been reached.
        // When the last frame has been rendered, EC_COMPLETE should be sent
        // on the IMediaEvent interface retrieved from the renderer
        // during IMFTopologyServiceLookupClient::InitServicePointers method.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_ENDOFSTREAM  = $00000005,
        // The presenter should step the number frames indicated by the lower DWORD
        // of ulParam.
        // The first n-1 frames should be skipped and only the nth frame should be
        // shown. Note that this message should only be received while in the pause
        // state or while in the started state when the rate is 0.
        // Otherwise, MF_E_INVALIDREQUEST should be returned.
        // When the nth frame has been shown EC_STEP_COMPLETE
        // should be sent on the IMediaEvent interface.
        // Additionally, if stepping is being done while the rate is set to 0
        // (a.k.a. "scrubbing"), the frame should be displayed immediately when
        // it is received, and EC_SCRUB_TIME should be sent right away after
        // sending EC_STEP_COMPLETE.
        MFVP_MESSAGE_STEP = $00000006,
        // The currently queued step operation should be cancelled. The presenter
        // should remain in the pause state following the cancellation.
        // ulParam is unused and should be set to zero.
        MFVP_MESSAGE_CANCELSTEP = $00000007);
     
    //  IMFVideoPresenter = interface(IMFClockStateSink)
    //    ['{29AFF080-182A-4a5d-AF3B-448F3A6346CB}']
    //    function ProcessMessage(eMessage: TMFVP_MESSAGE_TYPE; ulParam: ULONG_PTR);
    //    function GetCurrentMediaType(out ppMediaType: IMFVideoMediaType);
    //  end;
     
      IMFDesiredSample = interface(IUnknown)
        [SID_IMFDesiredSample]
        function GetDesiredSampleTimeAndDuration(out phnsSampleTime: Int64; out phnsSampleDuration: Int64): HResult; stdcall;
        function SetDesiredSampleTimeAndDuration(hnsSampleTime: Int64; hnsSampleDuration: Int64): HResult; stdcall;
        procedure Clear; stdcall;
      end;
     
    //  IMFTrackedSample = interface(IUnknown)
    //    [SID_IMFTrackedSample]
    //    function SetAllocator(pSampleAllocator: IMFAsyncCallback; {unique} pUnkState: IUnknown);
    //  end;
     
      IMFVideoMixerControl = interface(IUnknown)
        [SID_IMFVideoMixerControl]
        function SetStreamZOrder(dwStreamID: DWORD; dwZ: DWORD): HResult; stdcall;
        function GetStreamZOrder(dwStreamID: DWORD; out pdwZ: DWORD): HResult; stdcall;
        function SetStreamOutputRect(dwStreamID: DWORD; pnrcOutput: PMFVideoNormalizedRect): HResult; stdcall;
        function GetStreamOutputRect(dwStreamID: DWORD; out pnrcOutput: TMFVideoNormalizedRect): HResult; stdcall;
      end;
     
    //  IMFVideoRenderer = interface(IUnknown)
    //    [SID_IMFVideoRenderer]
    //    function InitializeRenderer({unique, nil} pVideoMixer: IMFTransform;
    //      {unique, nil} pVideoPresenter: IMFVideoPresenter);
    //  end;
     
    ///////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////
     
    type
      MF_SERVICE_LOOKUP_TYPE = (
        MF_SERVICE_LOOKUP_UPSTREAM,
        MF_SERVICE_LOOKUP_UPSTREAM_DIRECT,
        MF_SERVICE_LOOKUP_DOWNSTREAM,
        MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT,
        MF_SERVICE_LOOKUP_ALL, // lookup service on any components of the graph
        MF_SERVICE_LOOKUP_GLOBAL); // lookup global objects
     
      IMFTopologyServiceLookup = interface(IUnknown)
        [SID_IMFTopologyServiceLookup]
        function LookupService(_Type: MF_SERVICE_LOOKUP_TYPE; dwIndex: DWORD;
          const guidService: TIID; {in} const riid: TIID; out ppvObjects; var pnObjects: DWORD): HResult; stdcall;
      end;
     
      IMFTopologyServiceLookupClient = interface(IUnknown)
        [SID_IMFTopologyServiceLookupClient]
        function InitServicePointers(pLookup: IMFTopologyServiceLookup): HResult; stdcall;
      end;
     
      IEVRTrustedVideoPlugin = interface(IUnknown)
        [SID_IEVRTrustedVideoPlugin]
        function IsInTrustedVideoMode(out pYes: BOOL): HResult; stdcall;
        function CanConstrict (out pYes: BOOL): HResult; stdcall;
        function SetConstriction(dwKPix: DWORD): HResult; stdcall;
        function DisableImageExport(bDisable: BOOL): HResult; stdcall;
      end;
     
    type
      IEVRFilterConfig = interface(IUnknown)
        [SID_IEVRFilterConfig]
        function SetNumberOfStreams(dwMaxStreams: DWORD): HResult; stdcall;
        function GetNumberOfStreams(out pdwMaxStreams: DWORD): HResult; stdcall;
      end;
     
      IMFGetService = interface(IUnknown)
        [SID_IMFGetService]
        function GetService(const guidService: TGUID; const IID: TIID; out ppvObject): HResult; stdcall;
      end;
     
    type
      D3DPOOL = DWord;
     
      TDXVA2_Fixed32 = record
        {$IFNDEF norecprocs}
        procedure Dummy;
        class operator Implicit(Fixed32: TDXVA2_Fixed32): Double;
        class operator Implicit(ADouble: Double): TDXVA2_Fixed32;
        {$ENDIF}
        case Integer of
          0: (Fraction: Word; //USHORT;  (Unsigned SmallInt = Word)
              Value: SHORT);
          1: (ll: LongInt)
      end;
     
      TDXVA2_VideoProcessorCaps = record
        DeviceCaps: UINT;               // see DXVA2_VPDev_Xxxx
        InputPool: D3DPOOL;
        NumForwardRefSamples: UINT;
        NumBackwardRefSamples: UINT;
        Reserved: UINT;
        DeinterlaceTechnology: UINT;    // see DXVA2_DeinterlaceTech_Xxxx
        ProcAmpControlCaps: UINT;       // see DXVA2_ProcAmp_Xxxx
        VideoProcessorOperations: UINT; // see DXVA2_VideoProcess_Xxxx
        NoiseFilterTechnology: UINT;    // see DXVA2_NoiseFilterTech_Xxxx
        DetailFilterTechnology: UINT;   // see DXVA2_DetailFilterTech_Xxxx
      end;
     
      TDXVA2_ValueRange = record
        MinValue:     TDXVA2_Fixed32;
        MaxValue:     TDXVA2_Fixed32;
        DefaultValue: TDXVA2_Fixed32;
        StepSize:     TDXVA2_Fixed32;
      end;
     
      TDXVA2_ProcAmpValues = record
        Brightness: TDXVA2_Fixed32;
        Contrast:   TDXVA2_Fixed32;
        Hue:        TDXVA2_Fixed32;
        Saturation: TDXVA2_Fixed32;
      end;
     
    const
        DXVA2_ProcAmp_None                              = $0000;
        DXVA2_ProcAmp_Brightness                        = $0001;
        DXVA2_ProcAmp_Contrast                          = $0002;
        DXVA2_ProcAmp_Hue                               = $0004;
        DXVA2_ProcAmp_Saturation                        = $0008;
        DXVA2_ProcAmp_Mask                              = $000F;
     
      DXVA2_VideoProcProgressiveDevice: TGUID = '{5a54a0c9-c7ec-4bd9-8ede-f3c75dc4393b}';
      DXVA2_VideoProcBobDevice        : TGUID = '{335aa36e-7884-43a4-9c91-7f87faf3e37e}';
      DXVA2_VideoProcSoftwareDevice   : TGUID = '{4553d47f-ee7e-4e3f-9475-dbf1376c4810}';
     
     
    type
      IMFVideoProcessor = interface(IUnknown)
        [SID_IMFVideoProcessor]
        function GetAvailableVideoProcessorModes(var lpdwNumProcessingModes: UINT;
                { [size_is][size_is][out] } out ppVideoProcessingModes {Pointer to Array of GUID}): HResult; stdcall;
        function GetVideoProcessorCaps(lpVideoProcessorMode: PGUID;
          { [out] } out lpVideoProcessorCaps: TDXVA2_VideoProcessorCaps): HResult; stdcall;
        function GetVideoProcessorMode(out lpMode: TGUID): HResult; stdcall;
        function SetVideoProcessorMode(lpMode: PGUID): HResult; stdcall;
        function GetProcAmpRange(dwProperty: DWORD; out pPropRange: TDXVA2_ValueRange): HResult; stdcall;
        function GetProcAmpValues(dwFlags: DWORD; out Values: TDXVA2_ProcAmpValues): HResult; stdcall;
        function SetProcAmpValues(dwFlags: DWORD; {in} const pValues: TDXVA2_ProcAmpValues): HResult; stdcall;
        function GetFilteringRange(dwProperty: DWORD; out pPropRange: TDXVA2_ValueRange): HResult; stdcall;
        function GetFilteringValue(dwProperty: DWORD; out pValue: TDXVA2_Fixed32): HResult; stdcall;
        function SetFilteringValue(dwProperty: DWORD; const pValue: TDXVA2_Fixed32): HResult; stdcall;
        function GetBackgroundColor(out lpClrBkg: COLORREF): HResult; stdcall;
        function SetBackgroundColor(ClrBkg: COLORREF): HResult; stdcall;
      end;
     
    //  TMFVideoAlphaBitmapFlags = (
    const
        MFVideoAlphaBitmap_EntireDDS	= $1;
        MFVideoAlphaBitmap_SrcColorKey	= $2;
        MFVideoAlphaBitmap_SrcRect	= $4;
        MFVideoAlphaBitmap_DestRect	= $8;
        MFVideoAlphaBitmap_FilterMode	= $10;
        MFVideoAlphaBitmap_Alpha	= $20;
        MFVideoAlphaBitmap_BitMask	= $3f;
     
    type
      TMFVideoAlphaBitmapParams = record
        dwFlags: DWORD;
        clrSrcKey: COLORREF;
        rcSrc: TRECT;
        nrcDest: TMFVideoNormalizedRect;
        fAlpha: Single;
        dwFilterMode: DWORD;
      end;
     
      IDirect3DSurface9 = Pointer; // TODO (for now use a pointer to avoid dependencies to DirectX 9 units)
     
      TMFVideoAlphaBitmap = record
        GetBitmapFromDC: Boolean;
        case Boolean of
          True: (hdc: HDC; params: TMFVideoAlphaBitmapParams);
          False: (pDDS: IDirect3DSurface9; params2: TMFVideoAlphaBitmapParams;);
      end;
     
      IMFVideoMixerBitmap = interface(IUnknown)
        [SID_IMFVideoMixerBitmap]
        function SetAlphaBitmap(const pBmpParms: TMFVideoAlphaBitmap): HResult; stdcall;
        function ClearAlphaBitmap: HResult; stdcall;
        function UpdateAlphaBitmapParameters(const pBmpParms: TMFVideoAlphaBitmapParams): HResult; stdcall;
        function GetAlphaBitmapParameters(out pBmpParms: TMFVideoAlphaBitmapParams): HResult; stdcall;
      end;
     
    function MFVideoNormalizedRect(const ALeft, ATop, ARight, ABottom: Single): TMFVideoNormalizedRect;
     
    implementation
     
    function MFVideoNormalizedRect(const ALeft, ATop, ARight, ABottom: Single): TMFVideoNormalizedRect;
    begin
      Result.left := ALeft;
      Result.top := ATop;
      Result.right := ARight;
      Result.bottom := ABottom;
    end;
     
    { TMFVideoNormalizedRect }
     
    {$IFNDEF norecprocs}
    procedure TMFVideoNormalizedRect.Init(ALeft, ATop, ARight, ABottom: Single);
    begin
      left := ALeft;
      top := ATop;
      right := ARight;
      bottom := ABottom;
    end;
    {$ENDIF}
     
    { TDXVA2_Fixed32 }
     
    {$IFNDEF norecprocs}
    procedure TDXVA2_Fixed32.Dummy;
    begin
      // this is just to make delphi class completion happy
    end;
     
    class operator TDXVA2_Fixed32.Implicit(Fixed32: TDXVA2_Fixed32): Double;
    begin
      with Fixed32 do
        Result := Value + Fraction / $10000;
    end;
     
    class operator TDXVA2_Fixed32.Implicit(ADouble: Double): TDXVA2_Fixed32;
    begin
      Result.Fraction := Trunc(Frac(ADouble) * $10000);
      Result.Value := Trunc(ADouble);
    end;
    {$ENDIF}
     
    end.
    S'il existe un autre moyen d'afficher, je veux bien.
    La seule chose dt j'ai besoin c'est de pouvoir me déplacer dans la vidéo à la frame près.
    Il me semble que j'avais utilisé Tmediaplayer, mais j'avais abandonné, car le fichier vidéo à ouvrir provient d'avisynth, et à l'affichage il y a vait plein d'artefact.
    Alors qu'avec l'autre méthode cela marche à tous les coups.

    Merci.

  4. #4
    Membre à l'essai
    Inscrit en
    Mars 2003
    Messages
    21
    Détails du profil
    Informations forums :
    Inscription : Mars 2003
    Messages : 21
    Points : 16
    Points
    16
    Par défaut
    Problème résolu : En fait je vient de me rendre compte, qu ma vidéo s'affiche dans un panel, et je ne sais pour quelle raison, un autre panel recouvrait celui où s'affiche la vidéo !!!

    Bref, en effaçant ce panel, ma vidéo est bien lues et s'affiche correctement...

    Voilà.

    Merci pour votre aide.

    PS : j'ai voulu installer le compsant activex, mais je n'y arrive pas, quand j'essaye, delphi me dit que je n'ai pas les droits pour écrire dans le répertorie embarcadero !!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 03/01/2008, 17h24
  2. Réponses: 3
    Dernier message: 02/10/2007, 14h24
  3. Attribution des cartes réseau depuis passage a Etch
    Par himself dans le forum Debian
    Réponses: 1
    Dernier message: 12/06/2007, 10h41
  4. Problème depuis passage de IE6 à IE7
    Par hfranck dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 08/01/2007, 11h23
  5. erreur de segmentation depuis passage a OO
    Par hansaplast dans le forum C++
    Réponses: 15
    Dernier message: 27/04/2006, 12h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo