Leaked source code of windows server 2003
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.

75 lines
2.7 KiB

  1. //------------------------------------------------------------------------------
  2. // File: DMORt.h
  3. //
  4. // Desc: Miscellaneous runtime support for DirectShow Media Objects
  5. //
  6. // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved.
  7. //------------------------------------------------------------------------------
  8. #ifndef __DMORT_H__
  9. #define __DMORT_H__
  10. //
  11. // Mediatype helpers. MoInitMediaType() goes with MoFreeMediaType(),
  12. // MoCreateMediaType() goes with MoDeleteMediaType() - don't mix !
  13. //
  14. //
  15. // Takes a pointer to an already allocated DMO_MEDIA_TYPE structure, allocates
  16. // a format block of cbFormat bytes, and sets appropriate members of
  17. // DMO_MEDIA_TYPE to point to the newly allocated format block. Also
  18. // initializes the IUnknown pointer inside DMO_MEDIA_TYPE to NULL.
  19. //
  20. // The format block allocated by MoInitMediaType must be freed by calling
  21. // MoFreeMediaType().
  22. //
  23. STDAPI MoInitMediaType(DMO_MEDIA_TYPE *pmt, DWORD cbFormat);
  24. //
  25. // Frees the format block and releases any IUnknown, but does not free the
  26. // DMO_MEDIA_TYPE structure itself. Input parameter must point to an
  27. // DMO_MEDIA_TYPE structure previously initialized by MoInitMediaType().
  28. //
  29. STDAPI MoFreeMediaType(DMO_MEDIA_TYPE *pmt);
  30. //
  31. // Copies the DMO_MEDIA_TYPE members. Also duplicates the format block and
  32. // the IUnknown pointer. Both parameters must point to valid DMO_MEDIA_TYPE
  33. // structures. Target structure must be later freed using MoFreeMediaType().
  34. //
  35. STDAPI MoCopyMediaType(DMO_MEDIA_TYPE *pmtDest, const DMO_MEDIA_TYPE *pmtSrc);
  36. //
  37. // Allocates a new DMO_MEDIA_TYPE structure and initializes it just like
  38. // MoInitMediaType. I.e., this function allocates both the format block
  39. // and the DMO_MEDIA_TYPE structure itself. Pointer to DMO_MEDIA_TYPE is
  40. // returned as *ppmt.
  41. //
  42. // DMO_MEDIA_TYPE structures allocated by MoCreateMediaType() must be freed
  43. // by calling MoDeleteMediaType().
  44. //
  45. STDAPI MoCreateMediaType(DMO_MEDIA_TYPE **ppmt, DWORD cbFormat);
  46. //
  47. // Frees any format block, releases any IUnknown, and deletes the
  48. // DMO_MEDIA_TYPE structure itself. The input parameter must point to an
  49. // DMO_MEDIA_TYPE structure previously allocated by MoCreateMediaType().
  50. //
  51. STDAPI MoDeleteMediaType(DMO_MEDIA_TYPE *pmt);
  52. //
  53. // Allocates a new DMO_MEDIA_TYPE structure and copies pmtSrc into it like
  54. // MoCopyMediaType. I.e., this function allocates a new DMO_MEDIA_TYPE struct
  55. // as well as a new format block for the target mediatype. Trager mediatype
  56. // must later be freed using MoDeleteMediaType().
  57. //
  58. STDAPI MoDuplicateMediaType(DMO_MEDIA_TYPE **ppmtDest, const DMO_MEDIA_TYPE *pmtSrc);
  59. #endif //__DMORT_H__