/[tivodecode]/tivocom/trunk/CTivoDecode.h
ViewVC logotype

Contents of /tivocom/trunk/CTivoDecode.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 254 - (show annotations) (download)
Sun Sep 9 23:26:20 2007 UTC (15 years, 9 months ago) by jeremyd2019
File MIME type: text/plain
File size: 2202 byte(s)
rework interfaces (bumped typelib version to 1.1).  Add support for decoding the MPEG stream.  Added support to read and write from streams (implementing IStream) and make the versions which take filenames use a stream implementation that wraps file access.  Make OpenTivoFile take the MAK as a parameter.  It has a default value of "" (empty string), which means try to get the MAK from the registry, so either omit that param (for those languages which permit that) or specify it as empty string to use the MAK from the registry.  Added progress reporting of MPEG stream decoding via a connection point.  Progress is updated every 100 frames, and percent complete is provided if the tivo file stream supports Seek and Stat functions

1 // CTivoDecode.h : Declaration of the CTivoDecode
2
3 #pragma once
4 #include "resource.h" // main symbols
5
6 #include "tivocom.h"
7 #include "DTivoDecodeEvents_CP.h"
8
9
10 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
11 #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
12 #endif
13
14
15
16 // CTivoDecode
17
18 class ATL_NO_VTABLE CTivoDecode :
19 public CComObjectRootEx<CComSingleThreadModel>,
20 public CComCoClass<CTivoDecode, &CLSID_TivoDecode>,
21 public IConnectionPointContainerImpl<CTivoDecode>,
22 public CProxy_DTivoDecodeEvents<CTivoDecode>,
23 public ISupportErrorInfoImpl<&IID_ITivoDecode>,
24 public IProvideClassInfo2Impl<&CLSID_TivoDecode, &DIID_DTivoDecodeEvents, &LIBID_tivocomLib, /*wMajor =*/ 1, /*wMinor =*/ 1>,
25 public IDispatchImpl<ITivoDecode, &IID_ITivoDecode, &LIBID_tivocomLib, /*wMajor =*/ 1, /*wMinor =*/ 1>
26 {
27 public:
28 CTivoDecode()
29 {
30 }
31
32 DECLARE_REGISTRY_RESOURCEID(IDR_TIVODECODE)
33
34 DECLARE_NOT_AGGREGATABLE(CTivoDecode)
35
36 BEGIN_COM_MAP(CTivoDecode)
37 COM_INTERFACE_ENTRY(ITivoDecode)
38 COM_INTERFACE_ENTRY(IProvideClassInfo)
39 COM_INTERFACE_ENTRY(IProvideClassInfo2)
40 COM_INTERFACE_ENTRY(ISupportErrorInfo)
41 COM_INTERFACE_ENTRY(IDispatch)
42 COM_INTERFACE_ENTRY(IConnectionPointContainer)
43 END_COM_MAP()
44
45 BEGIN_CONNECTION_POINT_MAP(CTivoDecode)
46 CONNECTION_POINT_ENTRY(__uuidof(DTivoDecodeEvents))
47 END_CONNECTION_POINT_MAP()
48
49
50 DECLARE_PROTECT_FINAL_CONSTRUCT()
51
52 HRESULT FinalConstruct()
53 {
54 return S_OK;
55 }
56
57 void FinalRelease()
58 {
59 }
60
61 public:
62
63 STDMETHOD(get_mak)(BSTR* pVal);
64 STDMETHOD(put_mak)(BSTR newVal);
65 STDMETHOD(OpenTivoFile)(BSTR bstrFileName, BSTR bstrMAK, ITivoFile** pTivoFile);
66 STDMETHOD(OpenTivoStream)(IStream* pStm, BSTR bstrMAK, ITivoFile** pTivoFile);
67 };
68
69 OBJECT_ENTRY_AUTO(__uuidof(TivoDecode), CTivoDecode)

cvs@jdrake.com
ViewVC Help
Powered by ViewVC 1.1.13