xref: /trunk/main/avmedia/source/win/interface.hxx (revision 9ea84ac5)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 extern "C" const CLSID CLSID_MediaDet;
25 extern "C" const IID IID_IMediaDet;
26 struct ISampleGrabber;
27 
28 struct
29 #ifndef __MINGW32__
30 __declspec(uuid("65BD0710-24D2-4ff7-9324-ED2E5D3ABAFA")) __declspec(novtable)
31 #endif
32 IMediaDet : public IUnknown
33 {
34 public:
35     virtual  HRESULT __stdcall get_Filter(
36           IUnknown **pVal) = 0;
37     virtual  HRESULT __stdcall put_Filter(
38           IUnknown *newVal) = 0;
39     virtual  HRESULT __stdcall get_OutputStreams(
40           long *pVal) = 0;
41     virtual  HRESULT __stdcall get_CurrentStream(
42           long *pVal) = 0;
43     virtual  HRESULT __stdcall put_CurrentStream(
44          long newVal) = 0;
45     virtual  HRESULT __stdcall get_StreamType(
46           GUID *pVal) = 0;
47     virtual  HRESULT __stdcall get_StreamTypeB(
48           BSTR *pVal) = 0;
49     virtual  HRESULT __stdcall get_StreamLength(
50           double *pVal) = 0;
51     virtual  HRESULT __stdcall get_Filename(
52           BSTR *pVal) = 0;
53     virtual  HRESULT __stdcall put_Filename(
54           BSTR newVal) = 0;
55     virtual  HRESULT __stdcall GetBitmapBits(
56         double StreamTime,
57          long *pBufferSize,
58          char *pBuffer,
59         long Width,
60         long Height) = 0;
61     virtual  HRESULT __stdcall WriteBitmapBits(
62         double StreamTime,
63         long Width,
64         long Height,
65          BSTR Filename) = 0;
66     virtual  HRESULT __stdcall get_StreamMediaType(
67           AM_MEDIA_TYPE *pVal) = 0;
68     virtual  HRESULT __stdcall GetSampleGrabber(
69           ISampleGrabber **ppVal) = 0;
70     virtual  HRESULT __stdcall get_FrameRate(
71           double *pVal) = 0;
72     virtual  HRESULT __stdcall EnterBitmapGrabMode(
73         double SeekTime) = 0;
74 };
75 
76 extern "C" const IID IID_ISampleGrabberCB;
77 struct
78 #ifndef __MINGW32__
79 __declspec(uuid("0579154A-2B53-4994-B0D0-E773148EFF85")) __declspec(novtable)
80 #endif
81 ISampleGrabberCB : public IUnknown
82 {
83 public:
84     virtual HRESULT __stdcall SampleCB(
85         double SampleTime,
86         IMediaSample *pSample) = 0;
87     virtual HRESULT __stdcall BufferCB(
88         double SampleTime,
89         BYTE *pBuffer,
90         long BufferLen) = 0;
91 };
92 
93 extern "C" const IID IID_ISampleGrabber;
94 struct
95 #ifndef __MINGW32__
96 __declspec(uuid("6B652FFF-11FE-4fce-92AD-0266B5D7C78F")) __declspec(novtable)
97 #endif
98 ISampleGrabber : public IUnknown
99 {
100 public:
101     virtual HRESULT __stdcall SetOneShot(
102         BOOL OneShot) = 0;
103     virtual HRESULT __stdcall SetMediaType(
104         const AM_MEDIA_TYPE *pType) = 0;
105     virtual HRESULT __stdcall GetConnectedMediaType(
106         AM_MEDIA_TYPE *pType) = 0;
107     virtual HRESULT __stdcall SetBufferSamples(
108         BOOL BufferThem) = 0;
109     virtual HRESULT __stdcall GetCurrentBuffer(
110          long *pBufferSize,
111          long *pBuffer) = 0;
112     virtual HRESULT __stdcall GetCurrentSample(
113          IMediaSample **ppSample) = 0;
114     virtual HRESULT __stdcall SetCallback(
115         ISampleGrabberCB *pCallback,
116         long WhichMethodToCallback) = 0;
117 
118 };
119 
120