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.

88 lines
2.5 KiB

  1. //==========================================================================;
  2. //
  3. // Copyright (c) Microsoft Corporation 1995-1999.
  4. //
  5. //--------------------------------------------------------------------------;
  6. //
  7. // segment.cpp : implementation of various graph segment extension classes
  8. //
  9. #include "stdafx.h"
  10. #ifndef TUNING_MODEL_ONLY
  11. #include <bdamedia.h>
  12. #include "devices.h"
  13. #include "seg.h"
  14. #include "closedcaptioning.h"
  15. #include "MSViddataservices.h"
  16. DEFINE_EXTERN_OBJECT_ENTRY(CLSID_MSVidClosedCaptioning, CClosedCaptioning)
  17. DEFINE_EXTERN_OBJECT_ENTRY(CLSID_MSVidDataServices, CDataServices)
  18. // VWSegment
  19. #if 0
  20. // note: the compiler is generating but never calling the code to construct these initializers so the pointers
  21. // are staying null. we work around this by providing a function which dynamically allocating them on the heap
  22. // and calling it in our dllmain.
  23. std_arity1pmf<IMSVidGraphSegment, IEnumFilters **, HRESULT> * VWGraphSegment::Fetch = &std_arity1_member(&IMSVidGraphSegment::EnumFilters);
  24. // reset and next use same types as DSGraphContainer so same template expansion already initialized
  25. #else
  26. std_arity1pmf<IMSVidGraphSegment, IEnumFilters **, HRESULT> * VWGraphSegment::Fetch = NULL;
  27. // reset and next use same types as DSGraphContainer so same template expansion already initialized
  28. #endif
  29. namespace MSVideoControl {
  30. // work around compiler bug as per above description
  31. void CtorStaticVWSegmentFwdSeqPMFs(void) {
  32. // DSGraphContainer
  33. VWGraphSegment::Fetch = new std_arity1pmf<IMSVidGraphSegment, IEnumFilters **, HRESULT>(&IMSVidGraphSegment::EnumFilters);
  34. }
  35. // work around compiler bug as per above description
  36. void DtorStaticVWSegmentFwdSeqPMFs(void) {
  37. // DSGraphContainer
  38. delete VWGraphSegment::Fetch;
  39. }
  40. VWSegmentContainer VWGraphSegment::Container(void) {
  41. VWSegmentContainer g;
  42. HRESULT hr = (*this)->get_Container(&g);
  43. ASSERT(SUCCEEDED(hr));
  44. return g;
  45. }
  46. MSVidSegmentType VWGraphSegment::Type(void) {
  47. MSVidSegmentType t;
  48. HRESULT hr = (*this)->get_Type(&t);
  49. ASSERT(SUCCEEDED(hr));
  50. return t;
  51. }
  52. DSGraph VWGraphSegment::Graph(void) {
  53. DSGraph g;
  54. HRESULT hr = (Container())->get_Graph(&g);
  55. ASSERT(SUCCEEDED(hr));
  56. return g;
  57. }
  58. GUID2 VWGraphSegment::Category(void) {
  59. GUID2 g;
  60. HRESULT hr = (*this)->get_Category(&g);
  61. ASSERT(SUCCEEDED(hr));
  62. return g;
  63. }
  64. GUID2 VWGraphSegment::ClassID(void) {
  65. GUID2 g;
  66. HRESULT hr = (*this)->GetClassID(&g);
  67. ASSERT(SUCCEEDED(hr));
  68. return g;
  69. }
  70. }; // namespace
  71. #endif //TUNING_MODEL_ONLY
  72. // end of file - segment.cpp