Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1072 lines
39 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. sbe.idl
  5. Abstract:
  6. This module the StreamBuffer interface definitions & CLSIDs, public
  7. --*/
  8. import "unknwn.idl" ;
  9. import "wtypes.idl" ;
  10. import "objidl.idl";
  11. import "strmif.idl" ;
  12. // ============================================================================
  13. // interfaces
  14. interface IStreamBufferSink ; // get recording objects
  15. interface IStreamBufferSource ; // associates with IStreamBufferSink
  16. interface IStreamBufferRecordControl ; // recording control
  17. interface IStreamBufferRecordingAttribute ; // StreamBuffer attribute creation
  18. interface IEnumStreamBufferRecordingAttrib ; // StreamBuffer attribute enumeration
  19. interface IStreamBufferConfigure ; // configuration interface
  20. interface IStreamBufferMediaSeeking ; // IMediaSeeking but with different GUID
  21. interface IStreamBufferPolicy ; // StreamBuffer policies
  22. interface IStreamBufferInitialize ; // allows 3rd party app to set HKEY
  23. [
  24. object,
  25. uuid(9ce50f2d-6ba7-40fb-a034-50b1a674ec78),
  26. pointer_default(unique)
  27. ]
  28. [local] interface IStreamBufferInitialize : IUnknown
  29. {
  30. /*++
  31. ------------------------------------------------------------------------
  32. SetHKEY ()
  33. Implemented on StreamBufferStreamSink and StreamBufferSource filters.
  34. Gives a hosting application the ability to specify HKEY root in
  35. registry. This method must called **early**: after the filter is
  36. instantiated, but before StreamBufferSource is locked (explicitly or
  37. implicitely) if calling the method on StreamBufferSource, or before
  38. a source is set (via IStreamBufferSource or IFileSourceFilter) if
  39. calling the method on StreamBufferStreamSource. If a call is made
  40. after either filter has been initialized internally, the call will
  41. fail with E_UNEXPECTED. The hosting application is responsible for
  42. ensuring that the HKEY passed in is writable & readable per the
  43. logged-on user privileges. The HKEY is duplicated internally,
  44. so the caller can close it after making this call.
  45. --*/
  46. HRESULT
  47. SetHKEY (
  48. [in] HKEY hkeyRoot
  49. ) ;
  50. /*++
  51. ------------------------------------------------------------------------
  52. SetSIDs ()
  53. Implemented on StreamBufferStreamSink and StreamBufferSource filters.
  54. Provides a way for the hosting application to specify security-level
  55. sharing between capture and render processes and contexts. By
  56. default security attributes are inherited from the hosting process,
  57. unless the application overrides the defaults and provides them via
  58. this method.
  59. --*/
  60. HRESULT
  61. SetSIDs (
  62. [in] DWORD cSIDs,
  63. [in, size_is (cSIDs)] PSID * ppSID
  64. ) ;
  65. } ;
  66. /*++
  67. ============================================================================
  68. ============================================================================
  69. IStreamBufferSink
  70. Stream Source interface;
  71. implemented on the StreamBufferSink filter;
  72. Only way to get a recorder object's IUnknown (object will subsequently
  73. be associated with this Sink)
  74. --*/
  75. enum {
  76. RECORDING_TYPE_CONTENT = 0, // no post-recording or overlapped
  77. RECORDING_TYPE_REFERENCE, // allows post-recording & overlapped
  78. } ;
  79. [
  80. object,
  81. uuid(afd1f242-7efd-45ee-ba4e-407a25c9a77a),
  82. pointer_default(unique)
  83. ]
  84. interface IStreamBufferSink : IUnknown
  85. {
  86. /*++
  87. ------------------------------------------------------------------------
  88. LockProfile ()
  89. 1. Locks the profile;
  90. 2. No *new* input pin connections will be accepted;
  91. 3. Existing pins that are, or have ever been, connected can be
  92. reconnected if the media type is exactly the same as the first
  93. successful connection;
  94. 4. Can be called multiple times safely with NULL parameter, but only
  95. once with non-NULL parameter; returns E_UNEXPECTED if called more
  96. than once with non-NULL param, or after the hosting filter has run;
  97. 5. Must be called before the filter that implements this interface is
  98. ever run; when it is run, it locks implicitely and this method has
  99. no effect if called with NULL parameters, or fails if called with
  100. non-NULL parameter for the reasons listed above;
  101. 6. Errors with VFW_E_UNSUPPORTED_STREAM if there are no streams in the
  102. profile;
  103. Parameter Detail
  104. ----------------
  105. pszStreamBufferFilename
  106. Is a NULL-terminated filename string. If the content written by
  107. this sink is to be shared cross-process, this parameter specifies a
  108. filename that will be opened by any reader(s) to read & render the
  109. content sent into the sink.
  110. Can be NULL (not specified)
  111. Must be a full-path filename; if no path is specified, the file is
  112. created in a "current" directory
  113. If the file already exists, the call fails
  114. Is opened with DELETE_ON_CLOSE flag, so is automatically deleted
  115. when the sink is unlocked, or when the hosting process terminates
  116. --*/
  117. HRESULT
  118. LockProfile (
  119. [in] LPCWSTR pszStreamBufferFilename
  120. ) ;
  121. /*++
  122. ------------------------------------------------------------------------
  123. CreateRecorder ()
  124. 1. Returns a *new* recorder object's IUnknown;
  125. 2. Caller can call QueryInterface() on the returned pointer to get
  126. interface pointers to configure & control the recording;
  127. 3. Returned IUnknown pointer is ref'd & must be Release()'d by the
  128. caller
  129. 4. IStreamBufferSink interface must have been locked (explicitely or
  130. implicitely) prior to call
  131. To create an ordinary recording, specify RECORDING_TYPE_CONTENT for the
  132. dwRecordType parammeter. This will record the content directly into
  133. the specified file. These recording types only accept start and stop
  134. times that occur in the future.
  135. A recording of type RECORDING_TYPE_REFERENCE generates a small file
  136. that references content saved in temporary storage. Recordings of this
  137. type can have start and stop times that occurs in the past, and can
  138. overlap other same-type recordings.
  139. Reference recording *content* will be saved in the same subdirectory as
  140. the specified reference file, but with hidden and system attributes.
  141. The naming convention of the files will append a _1.sbe, _2.sbe, etc...
  142. to the filename (minus extension) specified in the call e.g. a
  143. "seinfeld01.sbe" reference file will have saved content in hidden
  144. and system files "seinfeld01_1.sbe", "seinfeld01_2.sbe", etc...
  145. --*/
  146. HRESULT
  147. CreateRecorder (
  148. [in] LPCWSTR pszFilename,
  149. [in] DWORD dwRecordType, // RECORDING_TYPE_CONTENT or RECORDING_TYPE_REFERENCE
  150. [out] IUnknown ** pRecordingIUnknown
  151. ) ;
  152. /*++
  153. ------------------------------------------------------------------------
  154. IsProfileLocked ()
  155. 1. Returns S_OK if the profile is locked and S_FALSE if it is not.
  156. 2. Returns E_FAIL on error.
  157. --*/
  158. HRESULT
  159. IsProfileLocked (
  160. ) ;
  161. } ;
  162. /*++
  163. ============================================================================
  164. ============================================================================
  165. IStreamBufferSource ()
  166. Stream Source reader interface;
  167. Implemented on the StreamBufferSource filter;
  168. --*/
  169. [
  170. object,
  171. uuid(1c5bd776-6ced-4f44-8164-5eab0e98db12),
  172. pointer_default(unique)
  173. ]
  174. interface IStreamBufferSource : IUnknown
  175. {
  176. /*++
  177. ------------------------------------------------------------------------
  178. SetStreamSink ()
  179. 1. Sets the StreamBuffer Sink that streams from this Source;
  180. 2. IStreamBufferSink object must be in the same process as this object;
  181. 3. Interface is AddRef()'d if the call succeeds;
  182. Parameter Detail
  183. ----------------
  184. pIStreamBufferSink
  185. Sink that will stream to this Source
  186. --*/
  187. HRESULT
  188. SetStreamSink (
  189. [in] IStreamBufferSink * pIStreamBufferSink
  190. ) ;
  191. } ;
  192. /*++
  193. ============================================================================
  194. ============================================================================
  195. IStreamBufferRecordControl
  196. obtained by QIing IStreamBufferSink::CreateRecorder()-returned IUnknown *
  197. --*/
  198. [
  199. object,
  200. uuid(ba9b6c99-f3c7-4ff2-92db-cfdd4851bf31),
  201. pointer_default(unique)
  202. ]
  203. interface IStreamBufferRecordControl : IUnknown
  204. {
  205. /*++
  206. ------------------------------------------------------------------------
  207. Start ()
  208. 1. Starts a recording;
  209. 2. Will save to the filename that is specified when this interface's
  210. IUnknown is requested (IStreamBufferSink::CreateRecorder());
  211. Parameter Detail
  212. ----------------
  213. rtStart
  214. Start time relative to "now;
  215. If the recording type is a content recording, can only refer to
  216. seconds in the future; allowed seconds are [0,5]
  217. If the recording type is a reference recording, can refer to any
  218. time that still has valid content i.e. content that has not yet
  219. become stale
  220. If the recording is a reference recording and (* prtStart) is
  221. earlier than the earliest still-valid content, the call will reset
  222. it to the earliest content; the value when the recording was
  223. actually started will be [out]
  224. --*/
  225. HRESULT
  226. Start (
  227. [in,out] REFERENCE_TIME * prtStart
  228. ) ;
  229. /*++
  230. ------------------------------------------------------------------------
  231. Stop ()
  232. 1. Stops a recording;
  233. 2. Closes out the file;
  234. Parameter Detail
  235. ----------------
  236. rtStart
  237. Stop time relative to "now;
  238. If the recording type is a content recording, can only refer to
  239. seconds in the future; allowed seconds are [0,5]
  240. If the recording type is a reference recording, can refer to any
  241. time that still has valid content i.e. content that has not yet
  242. become stale; stop time cannot be <= start time
  243. --*/
  244. HRESULT
  245. Stop (
  246. [in] REFERENCE_TIME rtStop
  247. ) ;
  248. /*++
  249. ------------------------------------------------------------------------
  250. GetRecordingStatus ()
  251. 1. Retrieves the status of the recording
  252. Parameter Detail
  253. ----------------
  254. phResult
  255. The (current) status of writing or closing the recording file;
  256. Can be NULL;
  257. pbStarted
  258. If supplied, set to a non-zero value if the recording has been
  259. started
  260. Can be NULL;
  261. pbStopped
  262. If supplied, set to a non-zero value if the recording has been
  263. stopped;
  264. Can be NULL;
  265. NOTE: If the recording has never been started, it will not be flagged
  266. as stopped.
  267. --*/
  268. HRESULT
  269. GetRecordingStatus (
  270. [out] HRESULT * phResult,
  271. [out] BOOL * pbStarted,
  272. [out] BOOL * pbStopped
  273. ) ;
  274. } ;
  275. /*++
  276. ============================================================================
  277. ============================================================================
  278. IStreamBufferRecComp
  279. CoCreateInstance CLSID_StreamBufferComposeRecording and QueryInterface for
  280. this interface; this interface allows the creation of a single target
  281. content recording which consists of a number of concatenated recordings
  282. (reference or content; can mix & match if desired)
  283. --*/
  284. [
  285. object,
  286. uuid(9E259A9B-8815-42ae-B09F-221970B154FD),
  287. pointer_default(unique)
  288. ]
  289. interface IStreamBufferRecComp : IUnknown
  290. {
  291. /*++
  292. ------------------------------------------------------------------------
  293. Initialize ()
  294. 1. Initializes for a target recording
  295. Parameter Detail
  296. ----------------
  297. pszTargetFilename
  298. Sets the target filename
  299. Fails if the file already exists
  300. pszSBRecProfileRef
  301. Must be a completed, SBE-generated recording
  302. This recording's profile will be used to define the target profile
  303. Appended files must have exactly the same profile
  304. --*/
  305. HRESULT
  306. Initialize (
  307. [in] LPCWSTR pszTargetFilename,
  308. [in] LPCWSTR pszSBRecProfileRef
  309. ) ;
  310. /*++
  311. ------------------------------------------------------------------------
  312. Append ()
  313. 1. appends an entire recording
  314. 2. fails if the recording is live
  315. --*/
  316. HRESULT
  317. Append (
  318. [in] LPCWSTR pszSBRecording
  319. ) ;
  320. /*++
  321. ------------------------------------------------------------------------
  322. AppendEx ()
  323. 1. appends the specified portion of the recording; the parameters must
  324. be accurate; the call will not readjust them within the boundaries
  325. 2. the time spread must be at least 2 seconds
  326. 3. fails if the recording is live
  327. --*/
  328. HRESULT
  329. AppendEx (
  330. [in] LPCWSTR pszSBRecording,
  331. [in] REFERENCE_TIME rtStart,
  332. [in] REFERENCE_TIME rtStop
  333. ) ;
  334. /*++
  335. ------------------------------------------------------------------------
  336. GetCurrentLength ()
  337. 1. returns the current length of the recording; updates as recordings
  338. are appended;
  339. 2. can be called repeatedly during a Append() call on another
  340. thread;
  341. --*/
  342. HRESULT
  343. GetCurrentLength (
  344. [out] DWORD * pcSeconds
  345. ) ;
  346. /*++
  347. ------------------------------------------------------------------------
  348. Close ()
  349. 1. explicitely closes the recording
  350. 2. final release of interface closes the recording as well
  351. --*/
  352. HRESULT
  353. Close (
  354. ) ;
  355. /*++
  356. ------------------------------------------------------------------------
  357. Cancel ()
  358. 1. cancels an in-progress appending operation; has no effect otherwise
  359. --*/
  360. HRESULT
  361. Cancel (
  362. ) ;
  363. } ;
  364. /*++
  365. ============================================================================
  366. ============================================================================
  367. IStreamBufferRecordingAttribute
  368. obtained by calling QueryInterface on a recorder
  369. well-known attributes:
  370. NAME DESCRIPTION
  371. ------------------- ----------------------------------------------------
  372. Title String containing the content title.
  373. Author String containing the name of the content author.
  374. Description String containing a description of the content.
  375. Rating String containing a content rating.
  376. Copyright String containing a content copyright message.
  377. Duration Quadruple word value containing the playing duration
  378. of the file, in 100-nanosecond units.
  379. Bitrate Double word value containing the bit rate.
  380. Seekable Boolean value; true denoting that the content is
  381. seekable.
  382. Stridable Boolean value, true denoting that the content is
  383. stridable (fast forward and rewind are enabled).
  384. Broadcast Boolean value; true denoting that the content is not
  385. copyright-protected, and can be broadcast.
  386. Use_DRM reserved
  387. DRM_Flags reserved
  388. DRM_Level reserved
  389. Is_Protected reserved
  390. Is_Trusted reserved
  391. Signature_Name reserved
  392. HasAudio Boolean, true denoting the content includes an
  393. audio stream.
  394. HasImage Boolean, true denoting the content includes a still
  395. image stream (such as JPEG images).
  396. HasScript Boolean, true denoting the content includes a script
  397. stream.
  398. HasVideo Boolean, true denoting the content includes a video
  399. stream.
  400. CurrentBitrate Double word containing the current total bitrate,
  401. usually used for MEB (multi-bit rate) streams.
  402. OptimalBitrate Double word containing the minimum total bitrate
  403. recommended to stream the content and get
  404. maximum quality.
  405. WM/AlbumTitle String containing the album title.
  406. WM/Track Double word containing the track number.
  407. WM/PromotionURL String with a URL to an HTML page that contains
  408. information about products and events (such as
  409. concerts) that are related to this music.
  410. WM/AlbumCoverURL String with a URL to an HTML page that contains an
  411. image of the album cover and information about
  412. the album.
  413. WM/Genre String with the genre of the music.
  414. WM/Year String with the year of publication of the music.
  415. WM/GenreID
  416. WM/MCDI
  417. BannerImageType One member of the WMT_ATTR_IMAGETYPE enumeration
  418. type.
  419. BannerImageData The actual image data: a bitmap, JPEG, or GIF image.
  420. BannerImageURL If the banner image is clicked on then this URL is
  421. activated.
  422. CopyrightURL An URL to a copyright page.
  423. NSC_Name String containing the multicast station contact
  424. name (read-only).
  425. NSC_Address String containing the multicast station contact
  426. address (read-only).
  427. NSC_Phone String containing the multicast station contact
  428. phone number (read-only).
  429. NSC_Email String containing the multicast station contact
  430. email address (read-only).
  431. NSC_Description String containing the multicast station contact
  432. description (read-only).
  433. --*/
  434. cpp_quote( "////////////////////////////////////////////////////////////////" )
  435. cpp_quote( "//" )
  436. cpp_quote( "// List of pre-defined attributes " )
  437. cpp_quote( "//" )
  438. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingDuration[] =L\"Duration\";" )
  439. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBitrate[] =L\"Bitrate\";" )
  440. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSeekable[] =L\"Seekable\";" )
  441. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingStridable[] =L\"Stridable\";" )
  442. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBroadcast[] =L\"Broadcast\";" )
  443. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingProtected[] =L\"Is_Protected\";" )
  444. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrusted[] =L\"Is_Trusted\";" )
  445. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSignature_Name[] =L\"Signature_Name\";" )
  446. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasAudio[] =L\"HasAudio\";" )
  447. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasImage[] =L\"HasImage\";" )
  448. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasScript[] =L\"HasScript\";" )
  449. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasVideo[] =L\"HasVideo\";" )
  450. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCurrentBitrate[] =L\"CurrentBitrate\";" )
  451. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingOptimalBitrate[] =L\"OptimalBitrate\";" )
  452. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasAttachedImages[] =L\"HasAttachedImages\";" )
  453. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSkipBackward[] =L\"Can_Skip_Backward\";" )
  454. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingSkipForward[] =L\"Can_Skip_Forward\";" )
  455. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNumberOfFrames[] =L\"NumberOfFrames\";" )
  456. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingFileSize[] =L\"FileSize\";" )
  457. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasArbitraryDataStream[] =L\"HasArbitraryDataStream\";" )
  458. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingHasFileTransferStream[] =L\"HasFileTransferStream\";" )
  459. cpp_quote( "" )
  460. cpp_quote( "////////////////////////////////////////////////////////////////" )
  461. cpp_quote( "//" )
  462. cpp_quote( "// The content description object supports 5 basic attributes." )
  463. cpp_quote( "//" )
  464. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTitle[] =L\"Title\";" )
  465. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAuthor[] =L\"Author\";" )
  466. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingDescription[] =L\"Description\";" )
  467. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingRating[] =L\"Rating\";" )
  468. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCopyright[] =L\"Copyright\";" )
  469. cpp_quote( "" )
  470. cpp_quote( "////////////////////////////////////////////////////////////////" )
  471. cpp_quote( "//" )
  472. cpp_quote( "// These attributes are used to configure DRM using IWMDRMWriter::SetDRMAttribute." )
  473. cpp_quote( "//" )
  474. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingUse_DRM = L\"Use_DRM\";" )
  475. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingDRM_Flags = L\"DRM_Flags\";" )
  476. cpp_quote( "static const WCHAR *g_wszStreamBufferRecordingDRM_Level = L\"DRM_Level\";" )
  477. cpp_quote( "" )
  478. cpp_quote( "////////////////////////////////////////////////////////////////" )
  479. cpp_quote( "//" )
  480. cpp_quote( "// These are the additional attributes defined in the WM attribute" )
  481. cpp_quote( "// namespace that give information about the content." )
  482. cpp_quote( "//" )
  483. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumTitle[] =L\"WM/AlbumTitle\";" )
  484. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrack[] =L\"WM/Track\";" )
  485. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingPromotionURL[] =L\"WM/PromotionURL\";" )
  486. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumCoverURL[] =L\"WM/AlbumCoverURL\";" )
  487. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingGenre[] =L\"WM/Genre\";" )
  488. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingYear[] =L\"WM/Year\";" )
  489. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingGenreID[] =L\"WM/GenreID\";" )
  490. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingMCDI[] =L\"WM/MCDI\";" )
  491. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingComposer[] =L\"WM/Composer\";" )
  492. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingLyrics[] =L\"WM/Lyrics\";" )
  493. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingTrackNumber[] =L\"WM/TrackNumber\";" )
  494. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingToolName[] =L\"WM/ToolName\";" )
  495. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingToolVersion[] =L\"WM/ToolVersion\";" )
  496. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingIsVBR[] =L\"IsVBR\";" )
  497. //
  498. // WM/AlbumArtist is a potentially different value than Author
  499. //
  500. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAlbumArtist[] =L\"WM/AlbumArtist\";" )
  501. cpp_quote( "" )
  502. cpp_quote( "////////////////////////////////////////////////////////////////" )
  503. cpp_quote( "//" )
  504. cpp_quote( "// These optional attributes may be used to give information " )
  505. cpp_quote( "// about the branding of the content." )
  506. cpp_quote( "//" )
  507. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageType[] =L\"BannerImageType\";" )
  508. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageData[] =L\"BannerImageData\";" )
  509. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingBannerImageURL[] =L\"BannerImageURL\";" )
  510. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingCopyrightURL[] =L\"CopyrightURL\";" )
  511. cpp_quote( "////////////////////////////////////////////////////////////////" )
  512. cpp_quote( "//" )
  513. cpp_quote( "// Optional attributes, used to give information " )
  514. cpp_quote( "// about video stream properties." )
  515. cpp_quote( "//" )
  516. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAspectRatioX[] =L\"AspectRatioX\";" )
  517. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingAspectRatioY[] =L\"AspectRatioY\";" )
  518. cpp_quote( "////////////////////////////////////////////////////////////////" )
  519. cpp_quote( "//" )
  520. cpp_quote( "// The NSC file supports the following attributes." )
  521. cpp_quote( "//" )
  522. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCName[] =L\"NSC_Name\";" )
  523. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCAddress[] =L\"NSC_Address\";" )
  524. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCPhone[] =L\"NSC_Phone\";" )
  525. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCEmail[] =L\"NSC_Email\";" )
  526. cpp_quote( "static const WCHAR g_wszStreamBufferRecordingNSCDescription[] =L\"NSC_Description\";" )
  527. cpp_quote( "" )
  528. //
  529. // StreamBuffer Attribute datatypes;
  530. //
  531. typedef enum {
  532. STREAMBUFFER_TYPE_DWORD = 0,
  533. STREAMBUFFER_TYPE_STRING = 1,
  534. STREAMBUFFER_TYPE_BINARY = 2,
  535. STREAMBUFFER_TYPE_BOOL = 3,
  536. STREAMBUFFER_TYPE_QWORD = 4,
  537. STREAMBUFFER_TYPE_WORD = 5,
  538. STREAMBUFFER_TYPE_GUID = 6,
  539. } STREAMBUFFER_ATTR_DATATYPE ;
  540. [
  541. object,
  542. uuid(16CA4E03-FE69-4705-BD41-5B7DFC0C95F3),
  543. pointer_default(unique)
  544. ]
  545. interface IStreamBufferRecordingAttribute : IUnknown
  546. {
  547. /*++
  548. ------------------------------------------------------------------------
  549. SetAttribute ()
  550. 1. Sets an attribute on a recording object;
  551. 2. Fails if the IStreamBufferRecordControl::Start has already been successfully
  552. called;
  553. 3. If an attribute of the same name already exists, overwrites the old;
  554. --*/
  555. HRESULT
  556. SetAttribute (
  557. [in] ULONG ulReserved,
  558. [in] LPCWSTR pszAttributeName,
  559. [in] STREAMBUFFER_ATTR_DATATYPE StreamBufferAttributeType,
  560. [in] BYTE * pbAttribute,
  561. [in] WORD cbAttributeLength
  562. ) ;
  563. /*++
  564. ------------------------------------------------------------------------
  565. GetAttributeCount ()
  566. 1. Returns the count of attributes currently set;
  567. --*/
  568. HRESULT
  569. GetAttributeCount (
  570. [in] ULONG ulReserved,
  571. [out] WORD * pcAttributes
  572. ) ;
  573. /*++
  574. ------------------------------------------------------------------------
  575. GetAttributeByName ()
  576. 1. Given a name, returns the attribute data;
  577. 2. If the provided buffer is too small, returns VFW_E_BUFFER_OVERFLOW,
  578. and (* pcbLength) contains the minimum required length of the buffer
  579. 3. To learn the length of the attribute, pass in non-NULL pcbLength,
  580. and NULL pbAttribute parameter; [out] value will be the length of
  581. the attribute
  582. --*/
  583. HRESULT
  584. GetAttributeByName (
  585. [in] LPCWSTR pszAttributeName,
  586. [in] ULONG * pulReserved,
  587. [out] STREAMBUFFER_ATTR_DATATYPE * pStreamBufferAttributeType,
  588. [out] BYTE * pbAttribute,
  589. [in, out] WORD * pcbLength
  590. ) ;
  591. /*++
  592. ------------------------------------------------------------------------
  593. GetAttributeByIndex ()
  594. 1. Given an 0-based index, returns the attribute name and data
  595. 2. If either buffer is too small, returns VFW_E_BUFFER_OVERFLOW, and
  596. (* pcbLength) and (* pcchNameLength) contain the minimum required
  597. length of each buffer
  598. 3. The length returned by pcchNameLength includes the null-terminator
  599. 4. To learn the length of the name & attribute, pass in non-NULL
  600. pcchNameLength & pcbLength, and NULL pszAttributeName & pbAttribute
  601. parameters; [out] value of the non-NULL parameters will be the
  602. lengths of the name and attribute
  603. --*/
  604. HRESULT
  605. GetAttributeByIndex (
  606. [in] WORD wIndex,
  607. [in] ULONG * pulReserved,
  608. [out] WCHAR * pszAttributeName,
  609. [in, out] WORD * pcchNameLength, // includes NULL-terminator; in BYTES
  610. [out] STREAMBUFFER_ATTR_DATATYPE * pStreamBufferAttributeType,
  611. [out] BYTE * pbAttribute,
  612. [in, out] WORD * pcbLength
  613. ) ;
  614. /*++
  615. ------------------------------------------------------------------------
  616. EnumAttributes ()
  617. 1. Returns a StreamBuffer attribute enumeration object that snapshots
  618. the attributes at time-of-call
  619. --*/
  620. HRESULT
  621. EnumAttributes (
  622. [out] IEnumStreamBufferRecordingAttrib ** ppIEnumStreamBufferAttrib
  623. ) ;
  624. } ;
  625. /*++
  626. ============================================================================
  627. ============================================================================
  628. IEnumStreamBufferRecordingAttrib
  629. obtained by calling IStreamBufferRecordingAttribute::EnumAttributes, or
  630. calling clone on this interface
  631. --*/
  632. typedef struct {
  633. LPWSTR pszName ; // allocated by callee; freed by caller
  634. STREAMBUFFER_ATTR_DATATYPE StreamBufferAttributeType ;
  635. BYTE * pbAttribute ; // allocated by callee; freed by caller
  636. WORD cbLength ;
  637. } STREAMBUFFER_ATTRIBUTE ;
  638. [
  639. object,
  640. uuid (C18A9162-1E82-4142-8C73-5690FA62FE33),
  641. pointer_default(unique)
  642. ]
  643. interface IEnumStreamBufferRecordingAttrib : IUnknown
  644. {
  645. HRESULT
  646. Next (
  647. [in] ULONG cRequest,
  648. [in, out, size_is (cRequest)] STREAMBUFFER_ATTRIBUTE * pStreamBufferAttribute,
  649. [out] ULONG * pcReceived
  650. ) ;
  651. HRESULT
  652. Skip (
  653. [in] ULONG cRecords
  654. ) ;
  655. HRESULT
  656. Reset (
  657. ) ;
  658. HRESULT
  659. Clone (
  660. [out] IEnumStreamBufferRecordingAttrib ** ppIEnumStreamBufferAttrib
  661. ) ;
  662. } ;
  663. /*++
  664. ============================================================================
  665. ============================================================================
  666. IStreamBufferConfigure
  667. --*/
  668. [
  669. object,
  670. uuid(ce14dfae-4098-4af7-bbf7-d6511f835414),
  671. pointer_default(unique)
  672. ]
  673. interface IStreamBufferConfigure : IUnknown
  674. {
  675. /*++
  676. ------------------------------------------------------------------------
  677. SetStreamBufferDirectory ()
  678. 1. Sets the directory where all content is saved, ringbuffer &
  679. StreamBuffer;
  680. 2. Creates directory if necessary;
  681. 3. All TEMP files have hidden+system attributes
  682. --*/
  683. HRESULT
  684. SetDirectory (
  685. [in] LPCWSTR pszDirectoryName
  686. ) ;
  687. /*++
  688. ------------------------------------------------------------------------
  689. GetStreamBufferDirectory ()
  690. 1. Retrieves previously set backing store directory, or default
  691. location if none was specified
  692. --*/
  693. HRESULT
  694. GetDirectory (
  695. [out] LPWSTR * ppszDirectoryName
  696. ) ;
  697. /*++
  698. ------------------------------------------------------------------------
  699. SetBackingFileCount ()
  700. 1. Sets the number of backing files
  701. 2. valid values
  702. 4 <= min <= 100
  703. 6 <= max <= 102
  704. min max delta >= 2
  705. --*/
  706. HRESULT
  707. SetBackingFileCount (
  708. [in] DWORD dwMin,
  709. [in] DWORD dwMax
  710. ) ;
  711. /*++
  712. ------------------------------------------------------------------------
  713. GetBackingFileCount ()
  714. 1. Retrieves previously set backing file counts, or defaults if none
  715. have have been set
  716. --*/
  717. HRESULT
  718. GetBackingFileCount (
  719. [out] DWORD * pdwMin,
  720. [out] DWORD * pdwMax
  721. ) ;
  722. /*++
  723. ------------------------------------------------------------------------
  724. SetEachBackingFileDuration ()
  725. 1. Sets the seconds of content each backing file will hold
  726. 2. valid values:
  727. dwSeconds >= 15
  728. --*/
  729. HRESULT
  730. SetBackingFileDuration (
  731. [in] DWORD dwSeconds
  732. ) ;
  733. /*++
  734. ------------------------------------------------------------------------
  735. GetEachBackingFileDuration ()
  736. 1. Retrieves previously set backing file duration, or default of none
  737. is set
  738. --*/
  739. HRESULT
  740. GetBackingFileDuration (
  741. [out] DWORD * pdwSeconds
  742. ) ;
  743. } ;
  744. /*++
  745. ============================================================================
  746. ============================================================================
  747. IStreamBufferMediaSeeking
  748. Implemented on the StreamBufferSource filter. Used to seek and set the
  749. playback rate.
  750. --*/
  751. [
  752. object,
  753. uuid(f61f5c26-863d-4afa-b0ba-2f81dc978596),
  754. pointer_default(unique)
  755. ]
  756. interface IStreamBufferMediaSeeking : IMediaSeeking
  757. {
  758. // no additional methods have been added
  759. } ;
  760. /*++
  761. ============================================================================
  762. ============================================================================
  763. events
  764. --*/
  765. // see evcode.h comment for range
  766. // stream buffer engine (PVR) 0x0326 - 0x0350 (sbe.idl)
  767. cpp_quote ("#define STREAMBUFFER_EC_BASE 0x0326")
  768. cpp_quote ("enum {")
  769. cpp_quote (" // timehole event")
  770. cpp_quote (" // param1 = timehole stream offset ms")
  771. cpp_quote (" // param1 = timehole size ms")
  772. cpp_quote (" STREAMBUFFER_EC_TIMEHOLE = STREAMBUFFER_EC_BASE,")
  773. cpp_quote (" ")
  774. cpp_quote (" STREAMBUFFER_EC_STALE_DATA_READ,")
  775. cpp_quote (" ")
  776. cpp_quote (" STREAMBUFFER_EC_STALE_FILE_DELETED,")
  777. cpp_quote (" STREAMBUFFER_EC_CONTENT_BECOMING_STALE,")
  778. cpp_quote (" STREAMBUFFER_EC_WRITE_FAILURE,")
  779. cpp_quote (" //")
  780. cpp_quote (" // unexpected read failure")
  781. cpp_quote (" // param1 = HRESULT failure")
  782. cpp_quote (" // param2 = undefined")
  783. cpp_quote (" STREAMBUFFER_EC_READ_FAILURE,")
  784. cpp_quote (" //")
  785. cpp_quote (" // playback rate change")
  786. cpp_quote (" // param1 = old_playback_rate * 10000 e.g. 2x is 20000")
  787. cpp_quote (" // param2 = new_playback_rate * 10000")
  788. cpp_quote (" STREAMBUFFER_EC_RATE_CHANGED,")
  789. cpp_quote ("} ;")
  790. /*++
  791. ============================================================================
  792. ============================================================================
  793. trick mode
  794. We've extended the 1.0 interfaces as follows:
  795. 1. source filter presents timestamps that monotonically increase overtime
  796. 2. flushes should have no effect over queued rate segments
  797. 3. discontinuities have no effect over queued rate segments
  798. To use the interface, continue to use AM_KSPROPSETID_TSRateChange, but use
  799. dwPropId that is higher
  800. --*/
  801. cpp_quote ("typedef enum {")
  802. cpp_quote (" AM_RATE_UseRateVersion = AM_RATE_Step + 1,")
  803. cpp_quote (" AM_RATE_QueryFullFrameRate,")
  804. cpp_quote (" AM_RATE_QueryLastRateSegPTS")
  805. cpp_quote ("} AM_PROPERTY_TS_RATE_CHANGE_11 ;")
  806. // AM_RATE_QueryRate; this is the max full-frame rate; source filter can use
  807. // up to this; it can use less
  808. cpp_quote ("typedef struct {")
  809. cpp_quote (" LONG lMaxForwardFullFrame ; // rate * 10000")
  810. cpp_quote (" LONG lMaxReverseFullFrame ; // rate * 10000")
  811. cpp_quote ("} AM_QueryRate ;")
  812. /*
  813. ================================================================================
  814. AM_RATE_UseRateVersion
  815. --------------------------------------------------------------------------------
  816. Specifies the rate change version to be used.
  817. The default behavior should be per 1.0.
  818. Use a WORD value. The high-order byte specifies the minor version (revision)
  819. number; the low-order byte specifies the major version number. On a
  820. little-endian system (e.g. x86), the WORD value version for the contents of
  821. this specification is 0x0101.
  822. If the specified rate version is not supported, the call should fail with
  823. an E_NOINTERFACE error code.
  824. ================================================================================
  825. AM_RATE_QueryFullFrameRate
  826. --------------------------------------------------------------------------------
  827. Allows a source filter to query for maximum full-frame rates the timestamp
  828. scaling filter is capable of. Maximum full-frame forward and reverse rates
  829. are queried for.
  830. Use AM_QueryRate structure. Timestamp scaling filter must set
  831. lMaxReverseFullFrame struct member to negative rate.
  832. The sourcing filter can still choose to set the full-frame rate to a value
  833. smaller than the value returned by the timestamp scaling filter. For example,
  834. there may be IO issues that prevent a full-frame playback, even if the timestamp
  835. scaling filter is capable.
  836. Non-full frame playback will consist of groups of continuous samples sent to
  837. the timestamp scaling filter, separated by discontinuities. The timestamps for
  838. each group of samples will jump across the discontinuities, but still increase
  839. per the RunTimePlus timeline, when compared to RenderTime, once a steady state
  840. runstate has been achieved.
  841. Note that Rate is used this call, vs. speed.
  842. ================================================================================
  843. AM_RATE_QueryLastRateSegPTS
  844. --------------------------------------------------------------------------------
  845. Allows a source filter to query the timestamp scaling filter for the last-set
  846. rate-segment's effective PTS, regardless of rate-segment position.
  847. Note that Rate is used this call, vs. speed.
  848. ================================================================================
  849. AM_RATE_SimpleRateChange (with 1.1 semantics)
  850. --------------------------------------------------------------------------------
  851. If the rate is to be set to the most forward sample, the
  852. AM_SimpleRateChange.StartTime member is set to value -1 by the sourcing filter.
  853. This has meaning to the timestamp scaling filter to set the rate to the most
  854. forward sample, and return that sample's presentation time via the method call's
  855. [out] parameter.
  856. If the specified rate segment is incompatible, all queued samples with PTS in
  857. rate-incompatible segment can be discarded.
  858. If the current rate is incompatible i.e. samples are being dropped by the
  859. timestamp scaling filter and it is not keeping an internal queued, it should
  860. fail the querying call (AM_SimpleRateChagne.StartTime = -1) with return error
  861. VFW_E_DVD_WRONG_SPEED. The sourcing filter will then set a rate with an
  862. effective PTS.
  863. */